From a255c93707c1325ab30ea467c92a3c08c51fc1eb Mon Sep 17 00:00:00 2001 From: David Carlton Date: Mon, 23 Dec 2002 19:39:59 +0000 Subject: 2002-12-23 David Carlton * Merge from mainline; tag is carlton_dictionary-20021223-merge. --- gdb/ChangeLog | 1833 ++++++++++++++++++++++++++ gdb/MAINTAINERS | 9 +- gdb/Makefile.in | 160 ++- gdb/NEWS | 8 + gdb/abug-rom.c | 6 +- gdb/acconfig.h | 3 + gdb/acinclude.m4 | 126 -- gdb/aclocal.m4 | 126 -- gdb/ada-lang.c | 16 +- gdb/ada-tasks.c | 6 +- gdb/alpha-linux-tdep.c | 2 +- gdb/alpha-nat.c | 1 + gdb/alpha-osf1-tdep.c | 3 +- gdb/alpha-tdep.c | 37 +- gdb/alphafbsd-tdep.c | 2 +- gdb/alphanbsd-tdep.c | 2 +- gdb/arc-tdep.c | 738 ----------- gdb/arch-utils.c | 22 +- gdb/arch-utils.h | 8 +- gdb/arm-linux-tdep.c | 3 +- gdb/arm-tdep.c | 284 ++-- gdb/armnbsd-tdep.c | 12 +- gdb/avr-tdep.c | 24 +- gdb/ax-gdb.c | 2 +- gdb/blockframe.c | 118 +- gdb/breakpoint.c | 111 +- gdb/breakpoint.h | 15 +- gdb/buildsym.c | 60 +- gdb/buildsym.h | 8 +- gdb/c-typeprint.c | 2 +- gdb/ch-exp.c | 2233 -------------------------------- gdb/ch-lang.c | 663 ---------- gdb/ch-lang.h | 41 - gdb/ch-typeprint.c | 340 ----- gdb/ch-valprint.c | 605 --------- gdb/cli/cli-cmds.c | 5 +- gdb/cli/cli-dump.c | 1 + gdb/cli/cli-setshow.c | 1 + gdb/coffread.c | 70 +- gdb/complaints.h | 20 +- gdb/completer.c | 46 +- gdb/completer.h | 10 +- gdb/config.in | 12 + gdb/config/alpha/alpha-linux.mh | 4 + gdb/config/arc/arc.mt | 3 - gdb/config/arc/tm-arc.h | 336 ----- gdb/config/d30v/d30v.mt | 5 - gdb/config/d30v/tm-d30v.h | 323 ----- gdb/config/fr30/fr30.mt | 5 - gdb/config/fr30/tm-fr30.h | 233 ---- gdb/config/h8500/tm-h8500.h | 5 + gdb/config/i386/i386aix.mh | 9 - gdb/config/i386/i386aix.mt | 7 - gdb/config/i386/i386m3.mh | 6 - gdb/config/i386/i386m3.mt | 3 - gdb/config/i386/i386mach.mh | 9 - gdb/config/i386/i386os9k.mt | 3 - gdb/config/i386/nm-i386aix.h | 43 - gdb/config/i386/nm-i386mach.h | 30 - gdb/config/i386/nm-m3.h | 23 - gdb/config/i386/tm-cygwin.h | 6 +- gdb/config/i386/tm-i386aix.h | 48 - gdb/config/i386/tm-i386m3.h | 56 - gdb/config/i386/tm-i386mk.h | 38 - gdb/config/i386/x86-64linux.mt | 1 + gdb/config/i386/xm-i386aix.h | 29 - gdb/config/i386/xm-i386m3.h | 33 - gdb/config/i386/xm-i386mach.h | 28 - gdb/config/i386/xm-i386mk.h | 26 - gdb/config/i960/mon960.mt | 5 - gdb/config/i960/nindy960.mt | 3 - gdb/config/i960/tm-i960.h | 345 ----- gdb/config/i960/tm-mon960.h | 69 - gdb/config/i960/tm-nindy960.h | 106 -- gdb/config/i960/tm-vx960.h | 52 - gdb/config/i960/vxworks960.mt | 6 - gdb/config/m32r/tm-m32r.h | 8 +- gdb/config/m68k/apollo68b.mh | 5 - gdb/config/m68k/apollo68b.mt | 3 - gdb/config/m68k/apollo68v.mh | 10 - gdb/config/m68k/hp300bsd.mh | 6 - gdb/config/m68k/hp300bsd.mt | 3 - gdb/config/m68k/hp300hpux.mh | 8 - gdb/config/m68k/hp300hpux.mt | 8 - gdb/config/m68k/linux.mt | 2 +- gdb/config/m68k/tm-linux.h | 15 +- gdb/config/m68k/tm-m68k.h | 9 - gdb/config/m88k/delta88.mh | 6 - gdb/config/m88k/delta88.mt | 3 - gdb/config/m88k/delta88v4.mh | 8 - gdb/config/m88k/delta88v4.mt | 3 - gdb/config/m88k/m88k.mh | 4 - gdb/config/m88k/m88k.mt | 3 - gdb/config/m88k/nm-delta88v4.h | 23 - gdb/config/m88k/nm-m88k.h | 25 - gdb/config/m88k/tm-delta88.h | 28 - gdb/config/m88k/tm-delta88v4.h | 32 - gdb/config/m88k/tm-m88k.h | 587 --------- gdb/config/m88k/xm-delta88.h | 44 - gdb/config/m88k/xm-dgux.h | 55 - gdb/config/mips/tm-irix3.h | 5 - gdb/config/mips/tm-irix6.h | 5 - gdb/config/mips/tm-linux.h | 19 - gdb/config/mips/tm-mips.h | 14 - gdb/config/mn10200/tm-mn10200.h | 12 +- gdb/config/nm-linux.h | 5 +- gdb/config/pa/hppa64.mt | 2 +- gdb/config/pa/hppahpux.mt | 2 +- gdb/config/pa/nm-hppab.h | 16 +- gdb/config/pa/nm-hppah.h | 30 +- gdb/config/pa/nm-hppao.h | 16 +- gdb/config/pa/tm-hppa.h | 8 +- gdb/config/pa/tm-hppah.h | 5 +- gdb/config/powerpc/aix432.mh | 6 +- gdb/config/rs6000/tm-rs6000.h | 13 +- gdb/config/sparc/tm-sp64.h | 4 + gdb/config/sparc/tm-sparc.h | 13 +- gdb/config/z8k/tm-z8k.h | 10 +- gdb/configure | 999 +++++++------- gdb/configure.in | 60 +- gdb/corelow.c | 12 +- gdb/cpu32bug-rom.c | 6 +- gdb/cris-tdep.c | 55 +- gdb/cxux-nat.c | 537 -------- gdb/d10v-tdep.c | 33 +- gdb/d30v-tdep.c | 1365 ------------------- gdb/dbug-rom.c | 6 +- gdb/dbxread.c | 105 +- gdb/defs.h | 10 +- gdb/doc/ChangeLog | 39 + gdb/doc/Makefile.in | 24 +- gdb/doc/agentexpr.texi | 4 +- gdb/doc/annotate.texi | 6 +- gdb/doc/fdl.texi | 6 +- gdb/doc/gdbint.texinfo | 19 +- gdb/doublest.c | 8 +- gdb/dst.h | 1671 ------------------------ gdb/dstread.c | 1598 ----------------------- gdb/dummy-frame.c | 60 +- gdb/dummy-frame.h | 37 + gdb/dve3900-rom.c | 20 +- gdb/dwarf2cfi.c | 14 +- gdb/dwarf2cfi.h | 2 +- gdb/dwarf2read.c | 363 +++--- gdb/dwarfread.c | 215 ++- gdb/elfread.c | 30 +- gdb/eval.c | 2 +- gdb/exec.c | 16 +- gdb/expprint.c | 56 + gdb/expression.h | 14 +- gdb/f-valprint.c | 18 +- gdb/findvar.c | 8 +- gdb/fork-child.c | 125 -- gdb/fr30-tdep.c | 601 --------- gdb/frame.c | 493 ++++++- gdb/frame.h | 368 +++++- gdb/frv-tdep.c | 12 +- gdb/gdbarch.c | 620 ++++++--- gdb/gdbarch.h | 161 ++- gdb/gdbarch.sh | 90 +- gdb/gdbserver/ChangeLog | 14 + gdb/gdbserver/linux-arm-low.c | 4 +- gdb/gdbserver/linux-low.c | 2 - gdb/gdbserver/linux-s390-low.c | 3 +- gdb/gdbthread.h | 9 +- gdb/gdbtypes.c | 37 +- gdb/gdbtypes.h | 2 +- gdb/h8300-tdep.c | 29 +- gdb/h8500-tdep.c | 21 +- gdb/hppa-tdep.c | 69 +- gdb/hppah-nat.c | 395 +++++- gdb/hpread.c | 92 +- gdb/i386-interix-tdep.c | 28 +- gdb/i386-linux-tdep.c | 2 +- gdb/i386-sol2-tdep.c | 2 +- gdb/i386-tdep.c | 49 +- gdb/i386aix-nat.c | 377 ------ gdb/i386bsd-tdep.c | 4 +- gdb/i386gnu-tdep.c | 2 +- gdb/i386ly-tdep.c | 4 +- gdb/i386m3-nat.c | 426 ------ gdb/i386mach-nat.c | 172 --- gdb/i386nbsd-tdep.c | 4 +- gdb/i386obsd-tdep.c | 2 +- gdb/i960-tdep.c | 1056 --------------- gdb/ia64-linux-nat.c | 1 + gdb/ia64-tdep.c | 34 +- gdb/infcmd.c | 96 +- gdb/inferior.h | 87 +- gdb/inflow.c | 6 +- gdb/infrun.c | 703 +++------- gdb/inftarg.c | 246 +--- gdb/infttrace.c | 52 +- gdb/lin-lwp.c | 38 +- gdb/linux-proc.c | 49 + gdb/m32r-tdep.c | 22 +- gdb/m68hc11-tdep.c | 51 +- gdb/m68k-tdep.c | 183 ++- gdb/m68klinux-nat.c | 117 +- gdb/m88k-nat.c | 290 ----- gdb/m88k-tdep.c | 661 ---------- gdb/macroscope.c | 4 +- gdb/macrotab.c | 40 +- gdb/maint.c | 2 +- gdb/mcore-tdep.c | 25 +- gdb/mdebugread.c | 235 ++-- gdb/mi/ChangeLog | 19 + gdb/mi/gdbmi.texinfo | 62 +- gdb/mi/mi-cmd-stack.c | 2 +- gdb/mi/mi-cmds.c | 8 +- gdb/mi/mi-cmds.h | 4 + gdb/mi/mi-main.c | 9 +- gdb/mips-irix-tdep.c | 2 +- gdb/mips-linux-tdep.c | 19 +- gdb/mips-tdep.c | 117 +- gdb/mipsnbsd-tdep.c | 2 +- gdb/mn10200-tdep.c | 4 +- gdb/mn10300-tdep.c | 13 +- gdb/ns32k-tdep.c | 37 +- gdb/ns32knbsd-tdep.c | 2 +- gdb/objc-exp.y | 28 +- gdb/objc-lang.c | 50 +- gdb/objc-lang.h | 28 +- gdb/ocd.c | 4 +- gdb/os9kread.c | 1621 ----------------------- gdb/osabi.c | 44 +- gdb/osabi.h | 10 +- gdb/p-exp.y | 52 +- gdb/pa64solib.c | 18 +- gdb/parse.c | 16 +- gdb/parser-defs.h | 8 + gdb/ppc-linux-nat.c | 1 + gdb/ppc-linux-tdep.c | 27 +- gdb/ppcnbsd-tdep.c | 2 +- gdb/printcmd.c | 24 - gdb/regcache.h | 14 +- gdb/remote-bug.c | 1027 --------------- gdb/remote-e7000.c | 4 +- gdb/remote-est.c | 6 +- gdb/remote-mips.c | 18 +- gdb/remote-nindy.c | 762 ----------- gdb/remote-nrom.c | 351 ----- gdb/remote-os9k.c | 1234 ------------------ gdb/remote-rdp.c | 4 +- gdb/remote-vx.c | 5 +- gdb/remote-vx960.c | 160 --- gdb/rom68k-rom.c | 6 +- gdb/rs6000-tdep.c | 131 +- gdb/s390-tdep.c | 34 +- gdb/sh-tdep.c | 50 +- gdb/shnbsd-tdep.c | 3 +- gdb/solib-svr4.c | 21 +- gdb/solib.c | 1 + gdb/somsolib.c | 2 +- gdb/source.c | 35 +- gdb/sparc-nat.c | 37 +- gdb/sparc-tdep.c | 63 +- gdb/sparcnbsd-tdep.c | 4 +- gdb/stabsread.c | 255 ++-- gdb/stabsread.h | 3 - gdb/stack.c | 266 ++-- gdb/std-regs.c | 9 +- gdb/symfile.c | 101 +- gdb/symmisc.c | 1 + gdb/symtab.h | 10 +- gdb/target.c | 222 +--- gdb/target.h | 163 +-- gdb/testsuite/ChangeLog | 129 ++ gdb/testsuite/gdb.base/attach.exp | 31 - gdb/testsuite/gdb.base/foll-vfork.exp | 11 +- gdb/testsuite/gdb.base/maint.exp | 25 +- gdb/testsuite/gdb.base/selftest.exp | 16 +- gdb/testsuite/gdb.base/step-test.exp | 8 +- gdb/testsuite/gdb.c++/annota2.exp | 3 +- gdb/testsuite/gdb.c++/m-data.cc | 16 +- gdb/testsuite/gdb.c++/m-data.exp | 14 +- gdb/testsuite/gdb.c++/try_catch.cc | 81 +- gdb/testsuite/gdb.c++/try_catch.exp | 34 +- gdb/testsuite/gdb.chill/ChangeLog | 350 ----- gdb/testsuite/gdb.chill/Makefile.in | 26 - gdb/testsuite/gdb.chill/builtins.ch | 83 -- gdb/testsuite/gdb.chill/builtins.exp | 441 ------- gdb/testsuite/gdb.chill/callch.ch | 50 - gdb/testsuite/gdb.chill/callch.exp | 69 - gdb/testsuite/gdb.chill/chexp.exp | 450 ------- gdb/testsuite/gdb.chill/chillvars.ch | 204 --- gdb/testsuite/gdb.chill/chillvars.exp | 316 ----- gdb/testsuite/gdb.chill/configure | 899 ------------- gdb/testsuite/gdb.chill/configure.in | 11 - gdb/testsuite/gdb.chill/enum.ch | 9 - gdb/testsuite/gdb.chill/enum.exp | 85 -- gdb/testsuite/gdb.chill/func1.ch | 9 - gdb/testsuite/gdb.chill/gch1041.ch | 17 - gdb/testsuite/gdb.chill/gch1041.exp | 76 -- gdb/testsuite/gdb.chill/gch1272.ch | 21 - gdb/testsuite/gdb.chill/gch1272.exp | 86 -- gdb/testsuite/gdb.chill/gch1280.ch | 13 - gdb/testsuite/gdb.chill/gch1280.exp | 76 -- gdb/testsuite/gdb.chill/gch922.ch | 23 - gdb/testsuite/gdb.chill/gch922.exp | 183 --- gdb/testsuite/gdb.chill/gch981.ch | 60 - gdb/testsuite/gdb.chill/gch981.exp | 249 ---- gdb/testsuite/gdb.chill/misc.ch | 12 - gdb/testsuite/gdb.chill/misc.exp | 100 -- gdb/testsuite/gdb.chill/powerset.ch | 33 - gdb/testsuite/gdb.chill/powerset.exp | 187 --- gdb/testsuite/gdb.chill/pr-4975-grt.ch | 13 - gdb/testsuite/gdb.chill/pr-4975.ch | 43 - gdb/testsuite/gdb.chill/pr-4975.exp | 67 - gdb/testsuite/gdb.chill/pr-5016.ch | 24 - gdb/testsuite/gdb.chill/pr-5016.exp | 62 - gdb/testsuite/gdb.chill/pr-5020.ch | 19 - gdb/testsuite/gdb.chill/pr-5020.exp | 85 -- gdb/testsuite/gdb.chill/pr-5022.ch | 12 - gdb/testsuite/gdb.chill/pr-5022.exp | 70 - gdb/testsuite/gdb.chill/pr-5646-grt.ch | 5 - gdb/testsuite/gdb.chill/pr-5646.ch | 15 - gdb/testsuite/gdb.chill/pr-5646.exp | 64 - gdb/testsuite/gdb.chill/pr-5984.ch | 8 - gdb/testsuite/gdb.chill/pr-5984.exp | 57 - gdb/testsuite/gdb.chill/pr-6292.ch | 17 - gdb/testsuite/gdb.chill/pr-6292.exp | 58 - gdb/testsuite/gdb.chill/pr-6632-grt.ch | 34 - gdb/testsuite/gdb.chill/pr-6632.ch | 31 - gdb/testsuite/gdb.chill/pr-6632.exp | 66 - gdb/testsuite/gdb.chill/pr-8134.exp | 65 - gdb/testsuite/gdb.chill/pr-8136.ch | 34 - gdb/testsuite/gdb.chill/pr-8136.exp | 63 - gdb/testsuite/gdb.chill/pr-8405.ch | 19 - gdb/testsuite/gdb.chill/pr-8405.exp | 61 - gdb/testsuite/gdb.chill/pr-8742.ch | 32 - gdb/testsuite/gdb.chill/pr-8742.exp | 64 - gdb/testsuite/gdb.chill/pr-8894-grt.ch | 6 - gdb/testsuite/gdb.chill/pr-8894.ch | 12 - gdb/testsuite/gdb.chill/pr-8894.exp | 61 - gdb/testsuite/gdb.chill/pr-9095.ch | 13 - gdb/testsuite/gdb.chill/pr-9095.exp | 62 - gdb/testsuite/gdb.chill/pr-9946.ch | 10 - gdb/testsuite/gdb.chill/pr-9946.exp | 79 -- gdb/testsuite/gdb.chill/result.ch | 29 - gdb/testsuite/gdb.chill/result.exp | 77 -- gdb/testsuite/gdb.chill/string.ch | 24 - gdb/testsuite/gdb.chill/string.exp | 73 -- gdb/testsuite/gdb.chill/tests1.ch | 240 ---- gdb/testsuite/gdb.chill/tests1.exp | 822 ------------ gdb/testsuite/gdb.chill/tests2.ch | 193 --- gdb/testsuite/gdb.chill/tests2.exp | 271 ---- gdb/testsuite/gdb.chill/tuples.ch | 86 -- gdb/testsuite/gdb.chill/tuples.exp | 161 --- gdb/testsuite/gdb.chill/xstruct-grt.ch | 12 - gdb/testsuite/gdb.chill/xstruct.ch | 16 - gdb/testsuite/gdb.chill/xstruct.exp | 66 - gdb/testsuite/gdb.fortran/exprs.exp | 3 +- gdb/testsuite/gdb.fortran/types.exp | 3 +- gdb/testsuite/gdb.mi/ChangeLog | 6 + gdb/testsuite/gdb.mi/mi-basics.exp | 86 +- gdb/testsuite/gdb.trace/tfind.exp | 9 +- gdb/testsuite/lib/gdb.exp | 31 - gdb/testsuite/lib/mi-support.exp | 18 +- gdb/thread-db.c | 22 +- gdb/thread.c | 26 +- gdb/top.c | 2 +- gdb/tracepoint.c | 11 +- gdb/tui/ChangeLog | 38 + gdb/tui/tui-hooks.c | 12 +- gdb/tui/tui.c | 4 +- gdb/tui/tuiDisassem.c | 2 +- gdb/tui/tuiRegs.c | 10 +- gdb/tui/tuiSource.c | 2 +- gdb/tui/tuiSourceWin.c | 2 +- gdb/tui/tuiStack.c | 5 +- gdb/tui/tuiWin.c | 11 +- gdb/ui-out.c | 2 +- gdb/utils.c | 24 +- gdb/v850-tdep.c | 22 +- gdb/valops.c | 22 +- gdb/varobj.c | 38 +- gdb/vax-tdep.c | 38 +- gdb/version.in | 2 +- gdb/win32-nat.c | 27 +- gdb/x86-64-linux-nat.c | 11 + gdb/x86-64-linux-tdep.c | 33 +- gdb/x86-64-tdep.c | 106 +- gdb/x86-64-tdep.h | 3 +- gdb/xcoffread.c | 96 +- gdb/xstormy16-tdep.c | 17 +- gdb/z8k-tdep.c | 26 +- 387 files changed, 7801 insertions(+), 34521 deletions(-) delete mode 100644 gdb/arc-tdep.c delete mode 100644 gdb/ch-exp.c delete mode 100644 gdb/ch-lang.c delete mode 100644 gdb/ch-lang.h delete mode 100644 gdb/ch-typeprint.c delete mode 100644 gdb/ch-valprint.c delete mode 100644 gdb/config/arc/arc.mt delete mode 100644 gdb/config/arc/tm-arc.h delete mode 100644 gdb/config/d30v/d30v.mt delete mode 100644 gdb/config/d30v/tm-d30v.h delete mode 100644 gdb/config/fr30/fr30.mt delete mode 100644 gdb/config/fr30/tm-fr30.h delete mode 100644 gdb/config/i386/i386aix.mh delete mode 100644 gdb/config/i386/i386aix.mt delete mode 100644 gdb/config/i386/i386m3.mh delete mode 100644 gdb/config/i386/i386m3.mt delete mode 100644 gdb/config/i386/i386mach.mh delete mode 100644 gdb/config/i386/i386os9k.mt delete mode 100644 gdb/config/i386/nm-i386aix.h delete mode 100644 gdb/config/i386/nm-i386mach.h delete mode 100644 gdb/config/i386/nm-m3.h delete mode 100644 gdb/config/i386/tm-i386aix.h delete mode 100644 gdb/config/i386/tm-i386m3.h delete mode 100644 gdb/config/i386/tm-i386mk.h delete mode 100644 gdb/config/i386/xm-i386aix.h delete mode 100644 gdb/config/i386/xm-i386m3.h delete mode 100644 gdb/config/i386/xm-i386mach.h delete mode 100644 gdb/config/i386/xm-i386mk.h delete mode 100644 gdb/config/i960/mon960.mt delete mode 100644 gdb/config/i960/nindy960.mt delete mode 100644 gdb/config/i960/tm-i960.h delete mode 100644 gdb/config/i960/tm-mon960.h delete mode 100644 gdb/config/i960/tm-nindy960.h delete mode 100644 gdb/config/i960/tm-vx960.h delete mode 100644 gdb/config/i960/vxworks960.mt delete mode 100644 gdb/config/m68k/apollo68b.mh delete mode 100644 gdb/config/m68k/apollo68b.mt delete mode 100644 gdb/config/m68k/apollo68v.mh delete mode 100644 gdb/config/m68k/hp300bsd.mh delete mode 100644 gdb/config/m68k/hp300bsd.mt delete mode 100644 gdb/config/m68k/hp300hpux.mh delete mode 100644 gdb/config/m68k/hp300hpux.mt delete mode 100644 gdb/config/m88k/delta88.mh delete mode 100644 gdb/config/m88k/delta88.mt delete mode 100644 gdb/config/m88k/delta88v4.mh delete mode 100644 gdb/config/m88k/delta88v4.mt delete mode 100644 gdb/config/m88k/m88k.mh delete mode 100644 gdb/config/m88k/m88k.mt delete mode 100644 gdb/config/m88k/nm-delta88v4.h delete mode 100644 gdb/config/m88k/nm-m88k.h delete mode 100644 gdb/config/m88k/tm-delta88.h delete mode 100644 gdb/config/m88k/tm-delta88v4.h delete mode 100644 gdb/config/m88k/tm-m88k.h delete mode 100644 gdb/config/m88k/xm-delta88.h delete mode 100644 gdb/config/m88k/xm-dgux.h delete mode 100644 gdb/cxux-nat.c delete mode 100644 gdb/d30v-tdep.c delete mode 100644 gdb/dst.h delete mode 100644 gdb/dstread.c delete mode 100644 gdb/fr30-tdep.c delete mode 100644 gdb/i386aix-nat.c delete mode 100644 gdb/i386m3-nat.c delete mode 100644 gdb/i386mach-nat.c delete mode 100644 gdb/i960-tdep.c delete mode 100644 gdb/m88k-nat.c delete mode 100644 gdb/m88k-tdep.c delete mode 100644 gdb/os9kread.c delete mode 100644 gdb/remote-bug.c delete mode 100644 gdb/remote-nindy.c delete mode 100644 gdb/remote-nrom.c delete mode 100644 gdb/remote-os9k.c delete mode 100644 gdb/remote-vx960.c delete mode 100644 gdb/testsuite/gdb.chill/ChangeLog delete mode 100644 gdb/testsuite/gdb.chill/Makefile.in delete mode 100644 gdb/testsuite/gdb.chill/builtins.ch delete mode 100644 gdb/testsuite/gdb.chill/builtins.exp delete mode 100644 gdb/testsuite/gdb.chill/callch.ch delete mode 100644 gdb/testsuite/gdb.chill/callch.exp delete mode 100644 gdb/testsuite/gdb.chill/chexp.exp delete mode 100644 gdb/testsuite/gdb.chill/chillvars.ch delete mode 100644 gdb/testsuite/gdb.chill/chillvars.exp delete mode 100755 gdb/testsuite/gdb.chill/configure delete mode 100644 gdb/testsuite/gdb.chill/configure.in delete mode 100644 gdb/testsuite/gdb.chill/enum.ch delete mode 100644 gdb/testsuite/gdb.chill/enum.exp delete mode 100644 gdb/testsuite/gdb.chill/func1.ch delete mode 100644 gdb/testsuite/gdb.chill/gch1041.ch delete mode 100644 gdb/testsuite/gdb.chill/gch1041.exp delete mode 100644 gdb/testsuite/gdb.chill/gch1272.ch delete mode 100644 gdb/testsuite/gdb.chill/gch1272.exp delete mode 100644 gdb/testsuite/gdb.chill/gch1280.ch delete mode 100644 gdb/testsuite/gdb.chill/gch1280.exp delete mode 100644 gdb/testsuite/gdb.chill/gch922.ch delete mode 100644 gdb/testsuite/gdb.chill/gch922.exp delete mode 100644 gdb/testsuite/gdb.chill/gch981.ch delete mode 100644 gdb/testsuite/gdb.chill/gch981.exp delete mode 100644 gdb/testsuite/gdb.chill/misc.ch delete mode 100644 gdb/testsuite/gdb.chill/misc.exp delete mode 100644 gdb/testsuite/gdb.chill/powerset.ch delete mode 100644 gdb/testsuite/gdb.chill/powerset.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-4975-grt.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-4975.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-4975.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-5016.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5016.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-5020.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5020.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-5022.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5022.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-5646-grt.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5646.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5646.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-5984.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-5984.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-6292.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-6292.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-6632-grt.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-6632.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-6632.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-8134.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-8136.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-8136.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-8405.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-8405.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-8742.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-8742.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-8894-grt.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-8894.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-8894.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-9095.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-9095.exp delete mode 100644 gdb/testsuite/gdb.chill/pr-9946.ch delete mode 100644 gdb/testsuite/gdb.chill/pr-9946.exp delete mode 100644 gdb/testsuite/gdb.chill/result.ch delete mode 100644 gdb/testsuite/gdb.chill/result.exp delete mode 100644 gdb/testsuite/gdb.chill/string.ch delete mode 100644 gdb/testsuite/gdb.chill/string.exp delete mode 100644 gdb/testsuite/gdb.chill/tests1.ch delete mode 100644 gdb/testsuite/gdb.chill/tests1.exp delete mode 100644 gdb/testsuite/gdb.chill/tests2.ch delete mode 100644 gdb/testsuite/gdb.chill/tests2.exp delete mode 100644 gdb/testsuite/gdb.chill/tuples.ch delete mode 100644 gdb/testsuite/gdb.chill/tuples.exp delete mode 100644 gdb/testsuite/gdb.chill/xstruct-grt.ch delete mode 100644 gdb/testsuite/gdb.chill/xstruct.ch delete mode 100644 gdb/testsuite/gdb.chill/xstruct.exp (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a6b11ee..ab12afc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,1836 @@ +2002-12-23 David Carlton + + * Merge from mainline; tag is carlton_dictionary-20021223-merge. + +2002-12-23 Daniel Jacobowitz + + * config/pa/nm-hppab.h: Delete duplicate CANNOT_STORE_REGISTER decl. + * config/pa/nm-hppao.h: Delete duplicate CANNOT_STORE_REGISTER decl. + +2002-12-23 Rodney Brown + + * config/pa/nm-hppah.h: Delete duplicate CANNOT_STORE_REGISTER decl. + +2002-12-23 David Carlton + + * symtab.c (lookup_symbol_aux): Delete 'force_return' variable. + (lookup_symbol_aux_minsyms): Delete 'force_return' argument. + (search_symbols): Call lookup_symbol_aux_minsyms to find debugging + information associated to a minsym, not lookup_symbol. + +2002-12-21 Mark Kettenis + + * x86-64-tdep.h (x86_64_init_abi): New prototype. + * x86-64-tdep.c (i386_fp_regnum_p): Remove function. + (x86_64_init_abi): Make non-static. Set number of pseudo + registers to 0. + (x86_64_gdbarch_init): Remove function. + (_initialize_x86_64_tdep): Renove register_gdbarch_init call. + Remove code dealing with dissambly. + * x86-64-linux-tdep.c (x86_64_linux_init_abi): New function. + (_initialize_x86_64_linux_tdep): New function. + * config/i386/x86-64linux.mt (TDEPFILES): Add i386-tdep.o and + i386-tdep.o. + +2002-12-14 Mark Kettenis + + * osabi.c: Include "gdb_assert.h" and "gdb_string.h". + (struct gdb_osabi_handler): Remove member `arch'. Add member + `arch_info'. + (gdbarch_register_osabi): Add new argument `machine'. Use ot to + construct a `struct bfd_arch_info' and store it in the `struct + gdb_osabi_handler' that is created. + (gdbarch_init_osabi): Check for compatibility based on machine + type and architecture. + * osabi.h (gdbarch_register_osabi): Adjust prototype and update + comment. + * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as + second argument in call to gdbarch_register_osabi. + * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. + * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. + * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. + * arm-tdep.c (_initialize_arm_tdep): Likewise. + * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. + * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. + * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. + * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. + * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. + * i386-tdep.c (_initialize_i386_tdep): Likewise. + * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. + * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. + * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from + _initialize_i386bsd_tdep and updated likewise. + * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. + * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. + * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. + * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. + * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. + * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. + * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. + * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. + * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. + * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise. + +2002-12-20 Kevin Buettner + + * solib-svr4.c (elf_locate_base): Fix sizeof() related bug. Add + DT_MIPS_RLD_MAP case for 64-bit targets. + +2002-12-20 Kevin Buettner + + * mips-tdep.c (heuristic_proc_desc): Clear memory associated with + ``temp_saved_regs'', not the pointer or other storage contiguous + to this pointer. + +2002-12-20 Kevin Buettner + + * Makefile.in (mips-linux-tdep.o): Add $(osabi_h) and $(gdb_string_h). + * config/mips/tm-linux.h (mips_linux_svr4_fetch_link_map_offsets) + (mips_linux_get_longjmp_target): Delete declarations. + (SVR4_FETCH_LINK_MAP_OFFSETS, GET_LONGJMP_TARGET) + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Delete definitions. + * mips-linux-tdep.c (osabi.h, gdb_string.h): Include. + (MIPS_LINUX_JB_ELEMENT_SIZE, MIPS_LINUX_JB_PC): Define. + (mips_linux_get_longjmp_target) + (mips_linux_svr4_fetch_link_map_offsets): Make static. + (mips_linux_init_abi): New function. + (_initialize_mips_linux_tdep): Register mips_linux_init_abi(). + +2002-12-19 Keith Seitz + + patch committed by Elena Zannoni + * thread.c (do_captured_list_thread_ids): Call prune_threads and + target_find_new_threads. Fix for PR mi/669. + +2002-12-19 David Carlton + + * linespec.c (decode_line_1): Move code into decode_all_digits. + (decode_all_digits): New function. + +2002-12-19 Kevin Buettner + + * exec.c (print_section_info): Select a format string to use with + local_hex_string_custom() based upon the value of TARGET_ADDR_BIT. + +2002-12-18 Andrew Cagney + + * frame.c (deprecated_update_current_frame_pc_hack): Replace + deprecated_update_current_frame_pc_hack. + (deprecated_update_frame_base_hack): New function. + * frame.h (deprecated_update_frame_pc_hack): Replace + (deprecated_update_frame_base_hack): Declare. + * infrun.c (normal_stop): Update. + +2002-12-18 Andrew Cagney + + * rs6000-tdep.c (rs6000_init_extra_frame_info): Use + frame_extra_info_zalloc. + (rs6000_frame_args_address): Use get_frame_extra_info. + (frame_get_saved_regs): Use get_frame_saved_regs. + (frame_initial_stack_address): Use get_frame_saved_regs and + get_frame_extra_info. + (frame_initial_stack_address): Use get_frame_extra_info. + +2002-12-17 Kevin Buettner + + * dve3900-rom.c (r3900_regnames): Don't use NUM_REGS to determine + array size. + (fetch_bitmapped_register, store_bitmapped_register): Add bounds + checks for r3900_regnames[]. + +2002-12-17 Richard Earnshaw + + * armnbsd-tdep.c (ARM_NBSD_JB_PC): Renamed from JB_PC. + All uses changed + (ARM_NBSD_JB_ELELMENT_SIZE): Similarly. + +2002-12-17 David Carlton + + * symtab.c (lookup_partial_symbol): Don't search past the end of + the partial symbols. + +2002-12-17 Andrew Cagney + + * stack.c (frame_info): Use get_frame_saved_regs. + * breakpoint.c (until_break_command): Use get_frame_pc. + +2002-12-16 Kevin Buettner + + * buildsym.c (block_end_complaint, anon_block_end_complaint) + (innerblock_complaint, innerblock_anon_complaint) + (blockvector_complaint): Delete deprecated complaint structs. + (finish_block, make_blockvector, end_symtab): Replace calls + to complain() with calls to complaint(). + * coffread.c (ef_complaint, ef_stack_complaint, eb_stack_complaint) + (bf_no_aux_complaint, ef_no_aux_complaint, lineno_complaint) + (unexpected_type_complaint, bad_sclass_complaint) + (misordered_blocks_complaint, tagndx_bad_complaint, eb_complaint): + Delete deprecated complaint structs. + (coff_symtab_read, enter_linenos, decode_type, decode_base_type): + Replace calls to complain() with calls to complaint(). + * dbxread.c (lbrac_complaint, string_table_offset_complaint) + (unknown_symtype_complaint, unknown_symchar_complaint) + (lbrac_rbrac_complaint, lbrac_unmatched_complaint) + (lbrac_mismatch_complaint, repeated_header_complaint) + (unclaimed_bincl_complaint, discarding_local_symbols_complaint): + Delete deprecated complaint structs. + (unknown_symtype_complaint, lbrac_mismatch_complaint) + (repeated_header_complaint) + (function_outside_compiliation_unit_complaint): New functions. + (add_old_header_file, find_corresponding_bincl_psymtab) + (set_namestring, find_stab_function_addr, read_dbx_symtab) + (process_one_symbol): Replace calls to complain() with, possibly + indirect, calls to complaint(). + * dwarfread.c (no_bfd_get_N, malformed_die, bad_die_ref) + (unknown_attribute_form, unknown_attribute_length) + (unexpected_fund_type, unknown_type_modifier, volatile_ignored) + (const_ignored, botched_modified_type, op_deref2, op_deref4) + (basereg_not_handled, dup_user_type_allocation) + (dup_user_type_definition, missing_tag, bad_array_element_type) + (subscript_data_items, unhandled_array_subscript_format) + (unknown_array_subscript_format, not_row_major) + (missing_at_name): Delete deprecated complaint structs. + (bad_die_ref_complaint, unknown_attribute_form_complaint) + (dup_user_type_definition_complaint) + (bad_array_element_type_complaint): New functions. + (lookup_utype, alloc_utype, struct_type, decode_array_element_type) + (decode_subscript_data_item, dwarf_read_array_type) + (read_tag_string_type, read_subroutine_type, read_func_scope) + (locval, scan_partial_symbols, decode_modified_type) + (decode_func_type, basicdieinfo, completeddieinfo, target_to_host) + (attribute_size): Replace calls to complain() with, possibly + indirect, calls to complaint(). + * elfread.c (section_info_complaint, section_info_dup_complaint) + (stab_info_mismatch_complaint, stab_info_questionable_complaint): + Delete deprecated complaint structs. + (elf_symtab_read, elfstab_offset_sections): Replace calls to + complain() with calls to complaint(). + * gdbtypes.c (stub_noname_complaint): Delete deprecated complaint + struct. + (stub_noname_complaint): New function. + (check_typedef, add_mangled_type): Replace calls to complain() + with calls to complaint(). + * hpread.c (string_table_offset_complaint, lbrac_unmatched_complaint) + (lbrac_mismatch_complaint, hpread_unhandled_end_common_complaint) + (hpread_unhandled_type_complaint, hpread_struct_complaint) + (hpread_array_complaint, hpread_type_lookup_complaint) + (hpread_unexpected_end_complaint, hpread_tagdef_complaint) + (hpread_unhandled_common_complaint) + (hpread_unhandled_blockdata_complaint): Delete deprecated complaint + struct definitions and declarations. + (lbrac_unmatched_complaint, lbrac_mismatch_complaint): New functions. + (SET_NAMESTRING, hpread_type_lookup, hpread_process_one_debug_symbol): + Replace calls to complain() with, possibly indirect, calls to + complaint(). + * macrotab.c (macro_include, check_for_redefinition, macro_undef): + Likewise. + * mdebugread.c (bad_file_number_complaint, index_complaint) + (aux_index_complaint, block_index_complaint) + (unknown_ext_complaint, unknown_sym_complaint) + (unknown_st_complaint, block_overflow_complaint) + (basic_type_complaint, unknown_type_qual_complaint) + (array_index_type_complaint, bad_tag_guess_complaint) + (block_member_complaint, stEnd_complaint) + (unknown_mdebug_symtype_complaint, stab_unknown_complaint) + (pdr_for_nonsymbol_complaint, pdr_static_symbol_complaint) + (bad_setjmp_pdr_complaint, bad_fbitfield_complaint) + (bad_continued_complaint, bad_rfd_entry_complaint) + (unexpected_type_code_complaint, unable_to_cross_ref_complaint) + (bad_indirect_xref_complaint, illegal_forward_tq0_complaint) + (illegal_forward_bt_complaint, bad_linetable_guess_complaint) + (bad_ext_ifd_complaint, bad_ext_iss_complaint): Delete deprecated + complaint structs. + (index_complaint, unknown_ext_complaint, basic_type_complaint) + (bad_tag_guess_complaint, bad_rfd_entry_complaint) + (unexpected_type_code_complaint) + (function_outside_compilation_unit_complaint): New functions. + (parse_symbol, parse_type, upgrade_type, parse_procedure) + (parse_partial_symbols, psymtab_to_symtab_1, cross_ref, add_symbol): + Replace calls to complain() with, possibly indirect calls to + complaint(). + * objc-lang.c (noclass_lookup_complaint, nosel_lookup_complaint): + Delete deprecated complaint structs. + (lookup__objc_class, lookup_child_selector): Replace complain() + with complaint(). + * remote-vx.c (cant_contact_target): Delete deprecated complaint + struct. + (vx_lookup_symbol): Replace complain() with complaint(). + * stabsread.c (invalid_cpp_abbrev_complaint) + (invalid_cpp_type_complaint, member_fn_complaint) + (const_vol_complaint, error_type_complaint) + (invalid_member_complaint, range_type_base_complaint) + (reg_value_complaint, vtbl_notfound_complaint) + (unrecognized_cplus_name_complaint, rs6000_builtin_complaint) + (unresolved_sym_chain_complaint, stabs_general_complaint) + (lrs_general_complaint, multiply_defined_struct): Delete + deprecated complaint structs. + (invalid_cpp_abbrev_complaint, ref_value_complaint) + (stabs_general_complaint, lrs_general_complaint) + (msg_unknown_complaint): New functions. + (dbx_lookup_type, read_cfront_baseclasses) + (read_cfront_member_functions, resolve_symbol_reference) + (define_symbol, resolve_live_range, add_live_range, read_type) + (rs6000_builtin_type, read_member_functions, read_cpp_abbrev) + (read_one_struct_field, read_baseclasses, read_tilde_fields) + (read_cfront_static_fields, attach_fields_to_type) + (complain_about_struct_wipeout, read_range_type) + (common_block_start, common_block_end, cleanup_undefined_types) + (scan_file_globals): Replace complain() with complaint(). + * stabsread.h (unknown_symtype_complaint, unknown_symchar_complaint): + Delete deprecated complaint struct declarations. + * xcoffread.c (storclass_complaint, bf_notfound_complaint) + (ef_complaint, eb_complaint): Delete deprecated complaint structs. + (bf_not_found_complaint, ef_complaint, eb_complaint) + (function_outside_compilation_unit_complaint): New functions. + (record_include_begin, record_include_end, enter_line_range) + (xcoff_next_symbol_text, read_xcoff_symtab, process_xcoff_symbol) + (read_symbol, read_symbol_lineno, scan_xcoff_symtab) Replace + complain() with complaint(). + +2002-12-16 Andrew Cagney + + * config/arc/arc.mt, config/arc/tm-arc.h: Delete. + * config/d30v/d30v.mt, config/d30v/tm-d30v.h: Delete. + * config/fr30/fr30.mt, config/fr30/tm-fr30.h: Delete. + * config/i386/i386aix.mh, config/i386/i386aix.mt: Delete. + * config/i386/i386m3.mh, config/i386/i386m3.mt: Delete. + * config/i386/i386mach.mh, config/i386/i386os9k.mt: Delete. + * config/i386/nm-i386aix.h, config/i386/nm-i386mach.h: Delete. + * config/i386/nm-m3.h, config/i386/tm-i386aix.h: Delete. + * config/i386/tm-i386m3.h, config/i386/tm-i386mk.h: Delete. + * config/i386/xm-i386aix.h, config/i386/xm-i386m3.h: Delete. + * config/i386/xm-i386mach.h, config/i386/xm-i386mk.h: Delete. + * config/i960/mon960.mt, config/i960/nindy960.mt: Delete. + * config/i960/tm-i960.h, config/i960/tm-mon960.h: Delete. + * config/i960/tm-nindy960.h, config/i960/tm-vx960.h: Delete. + * config/i960/vxworks960.mt, config/m68k/apollo68b.mh: Delete. + * config/m68k/apollo68b.mt, config/m68k/apollo68v.mh: Delete. + * config/m68k/hp300bsd.mh, config/m68k/hp300bsd.mt: Delete. + * config/m68k/hp300hpux.mh, config/m68k/hp300hpux.mt: Delete. + * config/m88k/delta88.mh, config/m88k/delta88.mt: Delete. + * config/m88k/delta88v4.mh, config/m88k/delta88v4.mt: Delete. + * config/m88k/m88k.mh, config/m88k/m88k.mt: Delete. + * config/m88k/nm-delta88v4.h, config/m88k/nm-m88k.h: Delete. + * config/m88k/tm-delta88.h, config/m88k/tm-delta88v4.h: Delete. + * config/m88k/tm-m88k.h, config/m88k/xm-delta88.h: Delete. + * config/m88k/xm-dgux.h: Delete. + * fr30-tdep.c, i386aix-nat.c, i386m3-nat.c: Delete. + * i386mach-nat.c, i960-tdep.c, m88k-nat.c: Delete. + * os9kread.c, remote-bug.c, remote-nindy.c: Delete. + * remote-nrom.c, remote-os9k.c, remote-vx960.c: Delete. + * d30v-tdep.c, arc-tdep.c, cxux-nat.c, dst.h, dstread.c: Delete. + * ch-exp.c, ch-lang.c, ch-lang.h, ch-typeprint.c: Delete. + * ch-valprint.c: Delete. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Rearrange code to resume if + no catchpoint triggers for an event. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Merge TARGET_WAITKIND_FORKED + and TARGET_WAITKIND_VFORKED cases. + +2002-12-15 Daniel Jacobowitz + + * infrun.c (handle_inferior_event): Assume that catchpoints + are not affected by DECR_PC_AFTER_BREAK. + +2002-12-15 Daniel Jacobowitz + + * target.c (update_current_target): Don't inherit DONT_USE. + * target.h (struct target_ops): Remove DONT_USE. + (target_next): Remove macro. + +2002-12-15 Mark Kettenis + + * ui-out.c (MAX_UI_OUT_LEVELS): Raise to 6. Fixes PR cli/654. + +2002-12-14 Richard Earnshaw + + * arm-tdep.c (convert_from_extended): New argument to hold the + type of floating point result we want to convert to. Make input + argument const. Fix all callers. + (convert_to_extended): Similarly. + (arm_extract_return_value): Now takes a regcache argument. Change + code to use regcache accessor functions. Correctly extract + smaller-than-word results on big-endian machines. + (arm_store_return_value): Now takes a regcache argument. Change + code to use regcache accessor functions. Correctly zero/sign extend + smaller than word results before storing into r0. + (arm_gdbarch_init): Register new-style extract_return_value and + store_return_value functions. + +2002-12-13 Michael Snyder + + * thread-db.c (thread_from_lwp): Uniquify error msg. + (lwp_from_thread): Ditto. + (check_event): Ditto. + (find_new_threads_callback): Ditto. + (thread_db_pid_to_str): Ditto. + +2002-12-13 Andrew Cagney + + * frame.h (get_frame_saved_regs): Declare. + (frame_saved_regs_zalloc): Change return type to CORE_ADDR + pointer. + * frame.c (get_frame_saved_regs): New function. + (frame_saved_regs_zalloc): Return the allocated saved_regs. + +2002-12-13 Andrew Cagney + + * frame.c (deprecated_update_current_frame_pc_hack): New + function. + * frame.h (deprecated_update_current_frame_pc_hack): Declare. + * infrun.c (normal_stop): Use said function instead of directly + modifying the frame's PC. + +2002-12-13 Alexandre Oliva + + * frame.h (frame_id_unwind_ftype): Fix typo in return type. + +2002-12-13 Kevin Buettner + + * config/mips/tm-mips.h, config/mips/tm-irix3.h, + config/mips/tm-irix6.h (NUM_REGS): Delete. + * mips-tdep.c (mips_gdbarch_init): Call set_gdbarch_num_regs(). + (temp_saved_regs): Declare as a pointer rather than an array. + (mips32_heuristic_proc_desc, heuristic_proc_desc): Make sure + that ``temp_saved_regs'' has storage allocated to it and that + it's the correct size. + +2002-12-13 Jeff Johnston + + * defs.h (init_last_source_visited): New prototype. + (add_path): Ditto. + * source.c (add_path): New function that adds to a specified path. + (mod_path): Change to call add_path. + (init_last_source_visited): New function to allow interfaces to + initialize static variable: last_source_visited. Part of fix + for PR gdb/741. + * Makefile.in: Add support for mi/mi-cmd-env.c. + +2002-12-13 Andrew Cagney + + * frame.h (frame_id_unwind): Declare. + (struct frame_info): Add fields id_unwind, id_unwind_cache_p and + id_unwind_cache. + (frame_id_unwind_ftype): Declare. + * frame.c (frame_id_unwind): New function. + (set_unwind_by_pc): Add unwind_id parameter. Initialized. + (create_new_frame, get_prev_frame): Pass id_unwind to + set_unwind_by_pc. + (frame_saved_regs_id_unwind): New function. + (frame_saved_regs_id_unwind): New function. + * dummy-frame.c (dummy_frame_id_unwind): New function. + (struct dummy_frame): Add field id. + (generic_push_dummy_frame): Initialize `id'. + * dummy-frame.h (dummy_frame_id_unwind): Declare. + +2002-12-13 Andrew Cagney + + * infcmd.c (run_stack_dummy): Create a frame ID directly and then + pass that to set_momentary_breakpoint. Move comments to where they + belong. + * frame.h (set_current_frame): Delete declaration. + * frame.c (set_current_frame): Delete function. + +2002-12-13 Andrew Cagney + + * frame.c (frame_extra_info_zalloc): New function. + * frame.h (frame_extra_info_zalloc): Declare. + +2002-12-13 Joel Brobecker + + * hppa-tdep.c (hppa_pop_frame): Fix a compilation error introduced + in the previous prototype change to set_momentary_breakpoint. + +2002-12-12 Daniel Jacobowitz + + * infrun.c (pending_follow): Remove saw_parent_fork, saw_child_fork, + and saw_child_exec. + (follow_fork, init_wait_for_inferior, handle_inferior_event): Remove + references to saw_parent_fork, saw_child_fork, and saw_child_exec. + (stop_stepping): Remove outdated check for child vfork events. + +2002-12-12 Andrew Cagney + + * GDB 5.3 released from gdb_5_3-branch. + +2002-12-11 Daniel Jacobowitz + + * corelow.c (init_core_ops): Delete references to to_require_attach + and to_require_detach. + * exec.c (init_exec_ops): Likewise. + * hppah-nat.c (child_follow_fork): Call hppa_require_attach and + hppa_require_detach directly. + * inferior.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. + * inftarg.c (child_detach): Remove. + (child_detach_from_process): Rename to child_detach, remove + after_fork argument. + (child_attach): Remove. + (child_attach_to_process): Rename to child_attach, remove after_fork + argument. + (init_child_ops): Delete references to to_require_attach + and to_require_detach. + * infttrace.c (hppa_require_attach): Update comment. + * target.c (cleanup_target, update_current_target) + (init_dummy_target, setup_target_debug): Delete references to + to_require_attach and to_require_detach. + (find_default_require_detach, find_default_require_attach) + (debug_to_require_attach, debug_to_require_detach): Remove + functions. + * target.h (struct target_ops): Remove to_require_attach + and to_require_detach. + (target_require_attach, target_require_detach): Delete macros. + (find_default_require_detach, find_default_require_attach): Delete + prototypes. + * config/pa/nm-hppah.h (REQUIRE_ATTACH, REQUIRE_DETACH): Delete. + +2002-12-11 Andrew Cagney + + * frame.c (get_frame_extra_info): New function. + * frame.h (get_frame_extra_info): Declare. + +2002-12-11 Andrew Cagney + + * breakpoint.h (struct breakpoint): Replace frame with frame_id. + (set_momentary_breaokpoint): Replace `struct frame_info' parameter + with `struct frame_id'. + (set_longjmp_resume_breakpoint): Ditto. + * infrun.c (handle_inferior_event): Update. + * breakpoint.c (watch_command_1, until_break_command): Update. + * infrun.c (handle_inferior_event, check_sigtramp2): Update. + (handle_inferior_event, step_over_function): Update. + * breakpoint.c (bpstat_stop_status, print_one_breakpoint): Update. + (set_raw_breakpoint, set_longjmp_resume_breakpoint): Update. + (set_momentary_breakpoint, deprecated_frame_in_dummy): Update. + * infcmd.c (finish_command, run_stack_dummy): Update. + +2002-12-11 Kevin Buettner + + * dwarf2read.c (dwarf2_const_ignored, dwarf2_volatile_ignored) + (dwarf2_non_const_array_bound_ignored) + (dwarf2_missing_line_number_section) + (dwarf2_statement_list_fits_in_line_number_section) + (dwarf2_mangled_line_number_section, dwarf2_unsupported_die_ref_attr) + (dwarf2_unsupported_stack_op, dwarf2_complex_location_expr) + (dwarf2_unsupported_tag, dwarf2_unsupported_at_encoding) + (dwarf2_unsupported_at_frame_base, dwarf2_unexpected_tag) + (dwarf2_missing_at_frame_base, dwarf2_bad_static_member_name) + (dwarf2_unsupported_accessibility, dwarf2_bad_member_name_complaint) + (dwarf2_missing_member_fn_type_complaint) + (dwarf2_vtbl_not_found_complaint, dwarf2_absolute_sibling_complaint) + (dwarf2_const_value_length_mismatch) + (dwarf2_unsupported_const_value_attr, dwarf2_misplaced_line_number) + (dwarf2_line_header_too_long, dwarf2_missing_macinfo_section) + (dwarf2_macros_too_long, dwarf2_macros_not_terminated) + (dwarf2_macro_outside_file, dwarf2_macro_unmatched_end_file) + (dwarf2_macro_malformed_definition, dwarf2_macro_spaces_in_definition) + (dwarf2_invalid_attrib_class, dwarf2_invalid_pointer_size): Delete + complaints using deprecated struct.. + (dwarf2_non_const_array_bound_ignored_complaint) + (dwarf2_complex_location_expr_complaint) + (dwarf2_unsupported_at_frame_base_complaint) + (dwarf2_const_value_length_mismatch_complaint) + (dwarf2_macros_too_long_complaint) + (dwarf2_macro_malformed_definition_complaint) + (dwarf2_invalid_attrib_class_complaint): New functions. + (read_func_scope, dwarf2_attach_fields_to_type, dwarf2_add_member_fn) + (read_structure_scope, read_array_type, read_common_block) + (read_tag_pointer_type, read_base_type, read_partial_die) + (dwarf_decode_line_header, check_cu_functions, dwarf_decode_lines) + (new_symbol, dwarf2_const_value, read_type_die) + (dwarf2_get_ref_die_offset, decode_locdesc, consume_improper_spaces) + (parse_macro_definition, dwarf_decode_macros): Replace calls to + complain() with, possibly indirect, calls to complaint(). + +2002-12-11 Andrew Cagney + + * frame.c (deprecated_get_frame_saved_regs): Rename + get_frame_saved_regs. + * frame.h (deprecated_get_frame_saved_regs): Update declaration. + * sparc-tdep.c: Update. + * hppa-tdep.c: Update. + * h8500-tdep.c: Update. + +2002-12-11 Kevin Buettner + + * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME) + (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of + ``char *'' for return and parameter types. + * gdbarch.h, gdbarch.c: Regenerate. + * gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change + return type from ``char *'' to ``const char *''. + * c-typeprint.c (c_type_print_modifier): Make ``address_space_id'' + const. + +2002-12-11 Mark Kettenis + + * i386-tdep.c: Include "dummy-frame.h". + (i386_frame_chain, i386_frame_saved_pc): Replace + DEPRECATED_PC_IN_CALL_DUMMY with call to pc_in_dummy_frame. + (i386_gdbarch_init): Don't set deprecated_pc_in_call_dummy. + +2002-12-10 Andrew Cagney + + * gdbarch.sh (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. + Change to a function with predicate. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (get_prev_frame): Update. Test + DEPRECATED_INIT_FRAME_PC_P. + * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC): Update. + * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC): Update. + * config/mn10200/tm-mn10200.h (DEPRECATED_INIT_FRAME_PC): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * i386-interix-tdep.c (i386_interix_init_abi): Update. + * arm-tdep.c: Update comments. + * h8300-tdep.c (h8300_gdbarch_init): Explicitly set init_frame_pc. + * config/m32r/tm-m32r.h (DEPRECATED_INIT_FRAME_PC): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * x86-64-tdep.c (x86_64_init_abi): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * vax-tdep.c (vax_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * config/z8k/tm-z8k.h (INIT_FRAME_PC_FIRST): Delete macro. + (DEPRECATED_INIT_FRAME_PC): Rename INIT_FRAME_PC. + +2002-12-10 Daniel Jacobowitz + + * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_VFORK): Change to + CHILD_FOLLOW_FORK. + * hppah-nat.c (saved_vfork_pid): Add. + (child_post_follow_vfork): Remove. + (child_follow_fork): New function. + (child_wait): Call detach_breakpoints after receiving the child vfork. + Call child_resume directly instead of going through resume (). + Make sure we have the exec before reporting the vfork. + * inferior.h (follow_inferior_reset_breakpoints): Add prototype. + * infrun.c (follow_fork, follow_vfork, follow_inferior_fork): Remove. + (follow_fork): New function. Call target_follow_fork. + (follow_inferior_reset_breakpoints): New function broken out from + old follow_inferior_fork. + (resume): Remove hack to follow exec after vfork. + * inftarg.c (child_post_follow_vfork): Remove. + (child_follow_fork): New function. + (init_child_ops): Replace to_post_follow_vfork with to_follow_fork. + * target.c (cleanup_target): Replace to_post_follow_vfork with + to_follow_fork. + (update_current_target): Likewise. + (setup_target_debug): Likewise. + (debug_to_post_follow_vfork): Remove. + (debug_to_follow_fork): New function. + * target.h (struct target_ops): Replace to_post_folow_vfork with + to_follow_fork. + (child_post_follow_vfork): Remove prototype. + (child_follow_fork): Add prototype. + (target_post_follow_vfork): Remove macro. + (target_follow_fork): Add macro. + +2002-12-10 Daniel Jacobowitz + + * hppah-nat.c (saved_child_execd_pathname, saved_vfork_state): New. + (child_post_follow_vfork): Cancel pending exec event if we follow + the parent. + (child_wait): Only return TARGET_WAITKIND_VFORKED when all necessary + events have been processed. Return a fake TARGET_WAITKIND_EXECD + event at the following wait call if necessary. + * infrun.c (follow_vfork): Don't follow_exec here. + (handle_inferior_event): Add comment to TARGET_WAITKIND_EXECD + case about HP/UX 10.20. Remove code pushed down to + hppah-nat.c:child_wait. + * infttrace.c (child_resume): Use TT_PROC_CONTINUE if + vfork_in_flight is set. + +2002-12-10 Daniel Jacobowitz + + * hppah-nat.c (child_wait): Return TARGET_WAITKIND_IGNORE + for the parent's fork event. + * infrun.c (handle_inferior_event): Only expect one fork event. + Call prepare_to_wait for TARGET_WAITKIND_IGNORE. Update comment. + * target.h: Update comment for TARGET_WAITKIND_IGNORE. + +2002-12-10 Andrew Cagney + + * PROBLEMS: Delete reference to PR gdb/725. + + * MAINTAINERS (gdb.c++): Add David Carlton. + +2002-12-09 David Carlton + + * cli/cli-setshow.c: #include after defs.h. + * cli/cli-cmds.c: Ditto. + +2002-12-09 Andrew Cagney + + * gdbarch.sh (gdbarch_dump): Print NAME_OF_MALLOC using %s. Wrap + function address in <>. + * gdbarch.c: Re-generate. + +2002-12-09 David Carlton + + * p-exp.y: Rename TRUE and FALSE to TRUEKEYWORD and FALSEKEYWORD. + +2002-12-09 David Carlton + + * linespec.c (symtab_from_filename): New function. + (decode_line_1): Move code into symtab_from_filename. + +2002-12-09 Kevin Buettner + + * lin-lwp.c (strsignal): Make extern declaration match that of glibc. + +2002-12-07 Andrew Cagney + + * f-valprint.c (info_common_command): Use get_frame_pc. + * std-regs.c (value_of_builtin_frame_pc_reg): Ditto. + * ax-gdb.c (agent_command): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + (rs6000_pop_frame): Ditto. + (rs6000_frameless_function_invocation): Ditto. + (rs6000_frame_saved_pc, frame_get_saved_regs): Ditto. + (frame_initial_stack_address, rs6000_frame_chain): Ditto. + * macroscope.c (default_macro_scope): Ditto. + * stack.c (print_frame_info_base): Ditto. + (print_frame, frame_info, print_frame_label_vars): Ditto. + (return_command, func_command, get_frame_language): Ditto. + * infcmd.c (finish_command): Ditto. + * dummy-frame.c (cached_find_dummy_frame): Ditto. + * breakpoint.c (deprecated_frame_in_dummy): Ditto. + (break_at_finish_at_depth_command_1): Ditto. + (break_at_finish_command_1): Ditto. + (until_break_command, get_catch_sals): Ditto. + * blockframe.c (func_frame_chain_valid): Ditto. + (frameless_look_for_prologue): Ditto. + (frame_address_in_block, generic_func_frame_chain_valid): Ditto. + +2002-12-08 Andrew Cagney + + * config/rs6000/tm-rs6000.h (init_frame_pc_noop): Add declaration. + * dwarf2cfi.c (cfi_init_frame_pc): Cast the PC to a pointer. + +2002-12-08 Andrew Cagney + + * gdbarch.sh (INIT_FRAME_PC_FIRST, INIT_FRAME_PC_DEFAULT): Convert + to pure functions. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (get_prev_frame): Explictly assign prev's pc with value + returned by INIT_FRAME_PC_FIRST and INIT_EXTRA_FRAME_INFO. + + * arch-utils.h (init_frame_pc_default, init_frame_pc_noop): Change + declaration to a function returning a CORE_ADDR. + * x86-64-tdep.h (x86_64_init_frame_pc): Ditto. + * arch-utils.c (init_frame_pc_noop): Return the PC value. + (init_frame_pc_default): Ditto. + * x86-64-linux-tdep.c (x86_64_init_frame_pc): Ditto. + * s390-tdep.c (s390_init_frame_pc_first): Ditto. + * mips-tdep.c (mips_init_frame_pc_first): Ditto. + * dwarf2cfi.h (cfi_init_frame_pc): Ditto. + * dwarf2cfi.c (cfi_init_frame_pc): Ditto. + * alpha-tdep.c (alpha_init_frame_pc_first): Ditto. + + * i386-interix-tdep.c (i386_interix_init_abi): Set init_frame_pc + to init_frame_pc_noop. + (i386_interix_init_frame_pc): Delete function. + * z8k-tdep.c (init_frame_pc): Delete function. + * config/z8k/tm-z8k.h (INIT_FRAME_PC): Define as init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Ditto. + * config/mn10200/tm-mn10200.h (INIT_FRAME_PC): Ditto. + (INIT_FRAME_PC_FIRST): Ditto. + * config/sparc/tm-sparc.h (INIT_FRAME_PC): Ditto. + * config/rs6000/tm-rs6000.h (INIT_FRAME_PC): Redefine as + init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Convert to an expression. + * config/sparc/tm-sparc.h (INIT_FRAME_PC_FIRST): Ditto. + +2002-12-08 Andrew Cagney + + * blockframe.c: Use get_frame_base instead of directly accessing + the `struct frame_info' member frame. + * f-valprint.c, std-regs.c, rs6000-tdep.c: Ditto. + * stack.c, dummy-frame.c, breakpoint.c: Ditto. + +2002-12-08 Elena Zannoni + + * Makefile.in (readline_h): Define. + (completer.o): Depend on readline_h. + (corelow.o): Ditto. + (event-top.o): Ditto. + (exec.o): Ditto. + (solib.o): Ditto. + (source.o): Ditto. + (symfile.o): Ditto. + (symmisc.o): Ditto. + (top.o): Ditto. + (tracepoint.o): Ditto. + (utils.o): Ditto. + (cli-dump.o): Ditto. + (tui-hooks.o): Ditto. + (tuiWin.o): Ditto. + +2002-12-08 Elena Zannoni + + More cleanup from import of readline 4.3. + * completer.h (complete_line, readline_line_completion_function): + Update prototypes. + (line_completion_function): Removed, not used outside of completer.c. + * completer.c (readline_line_completion_function, + complete_function, line_completion_function): Use const for first + parameter. + (line_completion_function): Make static. + (filename_completer): filename_completion_function is now called + rl_filename_completion_function + * corelow.c: Include . + * exec.c: Ditto. + * solib.c: Ditto. + * source.c: Ditto. + * symfile.c: Ditto. + * symmisc.c: Ditto. + * top.c (init_main): No need to coerce + readline_line_completion_function anymore. + * cli/cli-dump.c: Include . + +2002-12-08 Andrew Cagney + + * stack.c (frame_info): Use get_prev_frame. + * blockframe.c (frame_address_in_block): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + (rs6000_frameless_function_invocation): Ditto. + (rs6000_frame_saved_pc): Ditto. + (rs6000_frame_chain): Ditto. + * arch-utils.c (init_frame_pc_default): Ditto. + +2002-12-08 Andrew Cagney + + * config/mn10200/tm-mn10200.h (DEPRECATED_PC_IN_CALL_DUMMY): + Delete redundant definition. + +2002-12-08 Elena Zannoni + + Import of readline 4.3: + * cli/cli-cmds.c: Include readline/tilde.h. + * cli/cli-setshow.c: Ditto. + * defs.h: Don't declare tilde_expand anymore, since readline + exports it. + +2002-12-08 Elena Zannoni + + * Makefile.in (thread-db.o): Add explicit rule to ignore the use of + -Werror on this file. + +2002-12-07 Andrew Cagney + + * gdbarch.sh (TARGET_FLOAT_FORMAT): Use the macro when printing + the format name. + (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. + * gdbarch.c: Regenerate. + +2002-12-06 Andrew Cagney + + * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename + INIT_FRAME_PC_FIRST. Change to a function with predicate. Do not + provide a default value. + * gdbarch.h, gdbarch.c: Regenerate. + * frame.c (get_prev_frame): Update. Check + DEPRECATED_INIT_FRAME_PC_FIRST_P. + * s390-tdep.c (s390_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. + * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2002-12-06 Elena Zannoni + + * ia64-linux-nat.c: Include gdb_string.h. + * alpha-nat.c: Ditto. + * ppc-linux-nat.c: Ditto. + * Makefile.in (ia64-linux-nat.o, alpha-nat.o, ppc-linux-nat.o): + Update dependencies. + +2002-12-05 Andrew Cagney + + * gdbthread.h: Include "frame.h". + (struct thread_info): Replace step_frame_address with + step_frame_id. + * inferior.h: Include "frame.h". + (step_frame_id): Replace external variable step_frame_address. + * gdbthread.h (save_infrun_state): Replace step_frame_address + parameter with step_frame_id parameter. + (load_infrun_state): Ditto. + * Makefile.in (gdbthread_h, inferior_h): Add $(frame_h). + * infcmd.c (step_frame_id, step_1, step_once): Update. + * thread.c (load_infrun_state, save_infrun_state): Update. + * infrun.c (clear_proceed_status, save_inferior_status): Update. + (handle_inferior_event, step_over_function): Update. + (normal_stop, context_switch, restore_inferior_status): Update. + (struct inferior_status): Replace step_frame_address with + step_frame_id. + +2002-12-05 David Carlton + + * dwarf2read.c (dwarf2_add_field): Treat a field that is a + DW_TAG_member as well as a declaration as being a C++ static data + member. + (read_structure_scope): Combine tests for DW_TAG_member and + DW_TAG_variable. + +2002-12-05 David Carlton + + * linespec.c (decode_compound): New function. + (decode_line_1): Move code into decode_compound. + +2002-12-05 David Carlton + + * symtab.c (lookup_symbol_aux_local): Add 'static_block' + argument. + (lookup_symbol_aux): Do the 'field_of_this' check before checking + the static block. See PR gdb/804. + +2002-12-05 David Carlton + + * symtab.c (lookup_symbol_aux_block): New function. + (lookup_symbol_aux_local): Move code into lookup_symbol_aux_block. + +2002-12-05 Andrew Cagney + + * gdbarch.sh: Dump the predicate function and macro values. + (read): Print error on standard error. + * gdbarch.c: Regenerate. + +2002-12-04 Kevin Buettner + + * Makefile.in (mips_tdep_h): Define. + (mips-tdep.o): Add mips_tdep_h to dependency list. + * mips-tdep.h: New file. + * mips-tdep.c (mips-tdep.h): Include. + (enum mips_abi): Move to mips-tdep.h. + (mips_abi): New function. + +2002-12-04 David Carlton + + * Makefile.in (f-exp.tab.c): Don't depend on c-exp.tab.c. + +2002-12-04 David Carlton + + * symtab.c (lookup_symbol_aux): Move minsym code into a separate + function. + (lookup_symbol_aux_minsyms): New function. + +2002-12-04 J. Brobecker + + * pa64solib.c: s/boolean/int/. Fixes a build failure on hppa64-hpux. + +2002-12-04 J. Brobecker + + * config/pa/tm-hppah.h (PC_IN_SIGTRAMP): Renamed from IN_SIGTRAMP, + which is an obsolete macro name. + +2002-12-04 Daniel Jacobowitz + + * doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int. + * config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee. + +2002-12-03 H.J. Lu (hjl@gnu.org) + + * breakpoint.c (create_thread_event_breakpoint): Use xasprintf. + (create_breakpoints): Make sure the addr_string field is not + NULL. + +2002-12-03 Andrew Cagney + + * sparc-nat.c (fetch_inferior_registers) + (store_inferior_registers): Add comment on problem of LWP vs + threads. + + From 2002-11-21 Daniel Jacobowitz + * lin-lwp.c (lin_lwp_fetch_registers): Remove. + (lin_lwp_store_registers): Remove. + (init_lin_lwp_ops): Use fetch_inferior_registers + and store_inferior_registers directly. + * sparc-nat.c (fetch_inferior_registers): Honor LWP ID. + (store_inferior_registers): Likewise. + Fix PR gdb/725. + +2002-12-03 Andrew Cagney + + * frame.h (get_frame_id): Convert to a function. + (null_frame_id, frame_id_p): Declare. + (frame_id_eq, frame_id_inner): Declare. + (frame_id_build): New function. + * frame.c (get_frame_id): Update. Use null_frame_id. + (frame_find_by_id): Rewrite using frame_id_p, frame_id_eq and + frame_id_inner. + (null_frame_id, frame_id_p): Define. + (frame_id_eq, frame_id_inner): Define. + (frame_id_build): New function. + * varobj.c (varobj_create): Update. + (varobj_update): Update. + * valops.c (value_assign): Update. + (new_root_variable): Update. + * infrun.c (save_inferior_status): Update. + * breakpoint.c (watch_command_1): Update. + +2002-12-03 J. Brobecker + + * config/pa/tm-hppah.h (SNAP1): Remove unused macro. + (SNAP2): Likewise. + +2002-12-03 Andrew Cagney + + * NEWS: Mention Daniel Jacobowitz's multi-threaded shared library + patch. + + * PROBLEMS: Mention PR gdb/725. + +2002-12-03 Andreas Schwab + + * infcmd.c (construct_inferior_arguments): Handle empty arguments. + +2002-12-02 Adam Fedor + Klee Dienes + + * objc-lang.c (objc_printstr): Add width arg to match + printstr prototype. + (compare_selectors): Add 'const' to arg types. + (compare_classes): Likewise. + (find_imps): Cast msym pointer to avoid compiler warning. + (print_object_command): Validate the address before + passing it to the print routine. + (find_objc_msgcall_submethod): Change function argument to + return an int. + * objc-lang.h: Add 'extern' to all function declarations. + (value_nsstring): Add declaration. + +2002-12-02 J. Brobecker + + * somsolib.c (dld_cache): Replace boolean by int for field is_valid. + Fixes a build failure on HP/UX. + + * hpread.c (told_objfile): Replace boolean type by int. Fixes a build + failure on HP/UX. + (hpread_has_name): Advance declaration to avoid a compilation warning. + (pst_syms_count): Add missing variable type. By change, the compiler + was defaulting to int, which seems a good choice. Fixes a compilation + warning. + (pst_syms_size): Likewise. + +2002-12-02 J. Brobecker + + * hppa-tdep.c: Add #include "osabi.h" (for hppa_gdbarch_init). + (hppa_gdbarch_init): Detect osabi from objfile. Will be needed + later to set the proper gdbarch methods depending on the osabi. + * Makefile.in (hppa-tdep.o): Add dependency on osabi.h. + +2002-12-02 J. Brobecker + + * osabi.h (gdb_osabi): Add two new enum values for HPUX ELF and SOM. + * osabi.c (gdb_osabi_name): Add strings images for the two new + enum values. + (generic_elf_osabi_sniffer): Handle HPUX objfiles. + +2002-12-02 Andrew Cagney + + * MAINTAINERS (Java): Global maintainers are responible for Java. + (Past Maintainers): Mention both Anthony Green and Per Bothner as + part Java maintainers. + +2002-12-02 J. Brobecker + + * xcoffread.c (read_symbol_lineno): Replace boolean by int. + Fixes a compilation failure on AiX. + +2002-12-02 J. Brobecker + + * config/powerpc/aix432.mh (NATDEPFILES): Add a comment explaining + why aix-thread.o is not listed. + +2002-12-01 Andrew Cagney + + * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Rename + PC_IN_CALL_DUMMY. Change to predicate. Always allow call. + * gdbarch.h, gdbarch.c: Re-generate. + * config/sparc/tm-sparc.h, config/sparc/tm-sp64.h: Update. + * config/mn10200/tm-mn10200.h, config/h8500/tm-h8500.h: Update. + * config/pa/tm-hppa.h, frame.h: Update. + * x86-64-tdep.c, vax-tdep.c, sparc-tdep.c: Update. + * s390-tdep.c, ns32k-tdep.c, mn10300-tdep.c: Update. + * m68k-tdep.c, i386-tdep.c, frv-tdep.c: Update. + * cris-tdep.c, alpha-tdep.c: Update. + * frame.c (set_unwind_by_pc, create_new_frame): Use either + DEPRECATED_PC_IN_CALL_DUMMY or pc_in_dummy_frame. + (get_prev_frame): Ditto. + +2002-11-30 Andrew Cagney + + * exec.c (xfer_memory): Replace boolean with int. + * p-exp.y: Use 0 instead of false. + * corelow.c (gdb_check_format): Change return type to int from + boolean. + * utils.c: Don't include or first. + +2002-11-29 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_register_raw_size): Remove. + (m68hc11_register_byte): Remove. + (m68hc11_gdbarch_init): Don't set the above. + +2002-11-29 Andrew Cagney + + * remote-mips.c (mips_initialize): Force a selected frame rebuild + by calling get_selected_frame. + * ocd.c (ocd_start_remote): Use get_selected frame instead of + set_current_frame, create_new_frame, select_frame and + get_current_frame. + * remote-e7000.c (e7000_start_remote): Ditto. + * remote-mips.c (common_open): Ditto + * remote-rdp.c (remote_rdp_open): Ditto. + +2002-11-29 Andreas Schwab + + * m68k-tdep.c (m68k_frame_chain, m68k_frame_saved_pc) + (altos_skip_prologue, delta68_frame_saved_pc, isi_frame_num_args) + (delta68_frame_num_args, news_frame_num_args, m68k_skip_prologue) + (m68k_frame_init_saved_regs, m68k_saved_pc_after_call): Use + read_memory_unsigned_integer instead of read_memory_integer when + dealing with addresses and instruction opcodes. + * m68klinux-tdep.c (m68k_linux_sigtramp_saved_pc) + (m68k_linux_frame_saved_pc): Likewise. + +2002-11-29 Andrew Cagney + + * stack.c (selected_frame, select_frame): Move from here ... + * frame.c (selected_frame, select_frame): ... to here. Include + "language.h". + * Makefile.in (frame.o): Update dependencies. + * frame.c (get_selected_frame): New function. + * frame.h (get_selected_frame): Declare. + (deprecated_selected_frame): Rename selected_frame. + * ada-lang.c, ada-tasks.c, breakpoint.c, corelow.c: Update. + * eval.c, f-valprint.c, findvar.c, frame.c, frame.h: Update. + * h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, infcmd.c: Update. + * inflow.c, infrun.c, macroscope.c, mips-tdep.c: Update. + * mn10300-tdep.c, ocd.c, regcache.h, remote-e7000.c: Update. + * remote-mips.c, remote-rdp.c, sh-tdep.c, sparc-tdep.c: Update. + * stack.c, thread.c, tracepoint.c, valops.c, varobj.c: Update. + * z8k-tdep.c, cli/cli-cmds.c: Update. + +2002-11-29 Andrew Cagney + + * frame.h (get_selected_block): Add comments. + +2002-11-28 Andrew Cagney + + * frame.c (pc_notcurrent): New function. + (find_frame_sal): New function. + * frame.h (find_frame_sal): Declare. + (struct symtab_and_line): Add opaque declaration. + * stack.c (print_frame_info_base): Use find_frame_sal instead of + find_pc_line. + (frame_info): Ditto. + * ada-lang.c (find_printable_frame): Ditto. + +2002-11-28 J. Brobecker + + * configure.in: Check that the pthdebug library is recent enough + before enabling thread support on native AiX. + * configure: Regenerate. + + * config/powerpc/aix432.mh (NATDEPFILES): Remove aix-thread.o + from the list of object files as it is now appended by configure + if thread support is enabled. + (NAT_CLIBS): Removed as -lpthdebug is also appended by configure + if thread support is enabled. + +2002-11-28 Andrew Cagney + + * stack.c (get_selected_block): In-line get_current_block. + * frame.h (get_current_block): Delete declaration. + * blockframe.c (get_current_block): Delete function. + +2002-11-28 Andrew Cagney + + * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Rename + USE_GENERIC_DUMMY_FRAMES. + * gdbarch.h, gdbarch.c: Regenerate. + * valops.c, frame.c: Update. + * config/z8k/tm-z8k.h, config/mn10200/tm-mn10200.h: Update. + * config/m32r/tm-m32r.h, config/h8500/tm-h8500.h: Update. + * config/pa/tm-hppa.h, blockframe.c: Update. + * vax-tdep.c, sparc-tdep.c, ns32k-tdep.c: Ditto. + * m68k-tdep.c, alpha-tdep.c: Ditto. + + * arm-tdep.c: Eliminate USE_GENERIC_DUMMY_FRAMES as always 1. + * mips-tdep.c: Ditto. + +2002-11-27 Andrew Cagney + + * gdbarch.sh (CALL_DUMMY_LOCATION): Default to AT_ENTRY_POINT. + (USE_GENERIC_DUMMY_FRAMES): Default to true. + (PC_IN_CALL_DUMMY): Default to generic_pc_in_call_dummy. + * gdbarch.c, gdbarch.h: Re-generate. + * inferior.h (USE_GENERIC_DUMMY_FRAMES): Delete macro definition. + (CALL_DUMMY_LOCATION): Delete macro definition. + (PC_IN_CALL_DUMMY): Delete macro definitions. + + * arm-tdep.c (arm_gdbarch_init): Do not set pc_in_call_dummy, + default is already generic_pc_in_call_dummy. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + + * arm-tdep.c (arm_gdbarch_init): Do not set + use_generic_dummy_frames, default is already 1. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set + call_dummy_location, default is already AT_ENTRY_POINT. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * ia64-tdep.c (ia64_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + * arm-tdep.c (arm_gdbarch_init): Ditto. + * alpha-tdep.c (alpha_gdbarch_init): Ditto. + +2002-11-28 Andrew Cagney + + * frame.h: Update comments on set_current_frame, create_new_frame, + flush_cached_frames, reinit_frame_cache, select_frame and + selected_frame. + +2002-11-27 Andrew Cagney + + * config/z8k/tm-z8k.h (PC_IN_CALL_DUMMY): Update definition to use + deprecated pc_in_call_dummy function. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Ditto. + * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Ditto. + * config/pa/tm-hppa.h (PC_IN_CALL_DUMMY): Ditto. + * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Ditto. + * config/h8500/tm-h8500.h (PC_IN_CALL_DUMMY): Ditto. + +2002-11-26 Martin M. Hunt + + * Makefile.in: Remove Tix dependencies. + * acinclude.m4: Ditto. + * aclocal.m4: Ditto. + * configure.in: Ditto. + * configure: Regenerated. + +2002-11-26 Andrew Cagney + + * gdbarch.sh (TARGET_FLOAT_FORMAT): Print the float format name. + (TARGET_DOUBLE_FORMAT, TARGET_LONG_DOUBLE_FORMAT): Ditto. + * gdbarch.c: Re-generate. + +2002-11-26 Andrew Cagney + + * config/h8500/tm-h8500.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. + * config/mn10200/tm-mn10200.h (PC_IN_CALL_DUMMY): Define as + pc_in_call_dummy_at_entry_point. + * config/pa/tm-hppa.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Define as pc_in_call_dummy_on_stack. + * config/pa/tm-hppa64.h (CALL_DUMMY_LOCATION): Delete undefine. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Define as + pc_in_call_dummy_on_stack. + * config/sparc/tm-sp64.h (PC_IN_CALL_DUMMY): Redefine as + pc_in_call_dummy_at_entry_point and pc_in_call_dummy_on_stack. + * config/z8k/tm-z8k.h (CALL_DUMMY_LOCATION): Define as ON_STACK. + (USE_GENERIC_DUMMY_FRAMES): Define as zero. + (PC_IN_CALL_DUMMY): Defile as pc_in_call_dummy_on_stack. + +2002-11-26 Andrew Cagney + + * inferior.h (deprecated_pc_in_call_dummy_before_text_end): Rename + pc_in_call_dummy_before_text_end + (deprecated_pc_in_call_dummy_after_text_end): Rename + pc_in_call_dummy_after_text_end. + (deprecated_pc_in_call_dummy_on_stack): Rename + pc_in_call_dummy_on_stack. + (deprecated_pc_in_call_dummy_at_entry_point): Rename + pc_in_call_dummy_at_entry_point. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * config/sparc/tm-sparc.h (PC_IN_CALL_DUMMY): Update. + * blockframe.c (deprecated_pc_in_call_dummy_before_text_end) + (deprecated_pc_in_call_dummy_after_text_end) + (deprecated_pc_in_call_dummy_on_stack) + (deprecated_pc_in_call_dummy_at_entry_point): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2002-11-25 Daniel Jacobowitz + + * acconfig.h (HAVE_PREAD64): Add. + * configure.in: Check for pread64. + * config.in: Regenerated. + * configure: Regenerated. + * lin-lwp.c (lin_lwp_xfer_memory): Call linux_proc_xfer_memory. + * linux-proc.c (linux_proc_xfer_memory): New function. + * config/nm-linux.h (linux_proc_xfer_memory): Add prototype. + +2002-11-25 David Carlton + + * dwarf2read.c (scan_partial_symbols): Descend into namespace + pdi's with no name. + +2002-11-25 Andrew Cagney + + * MAINTAINERS: Mark h8500 as broken. Breakage occured Fri Nov 5 + 16:32:04 1999 Andrew Cagney . + +2002-11-25 Jim Blandy + + * symfile.c (init_objfile_sect_indices): New function. + (default_symfile_offsets): Move the section-index-initializing + stuff into init_objfile_sect_indices, and call that. + + * symtab.h (SIZEOF_N_SECTION_OFFSETS): New macro. + (SIZEOF_SECTION_OFFSETS): Use SIZEOF_N_SECTION_OFFSETS. + + * symfile.c (syms_from_objfile): Adjust indentation. + + * symfile.c (symbol_file_add): Flush gdb_stdout even if from_tty + || info_verbose isn't true. + +2002-11-24 Andrew Cagney + + * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Change + default to get_frame_base. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.c (default_frame_address): Delete function. + * arch-utils.h (default_frame_address): Delete declaration + +2002-11-24 Pierre Muller + + * varobj.c (find_frame_addr_in_frame_chain): + Use get_frame_base instead of FRAME_FP, + obvious fix. + +2002-11-19 Andrew Cagney + + * frame.h (FRAME_FP): Delete macro. + (get_frame_base): New function declaration. + * frame.c (get_frame_base): New function. + (get_frame_id): Use ->frame. + (frame_find_by_id): Rewrite to use get_frame_id. + * blockframe.c: Use get_frame_base instead of FRAME_FP. + * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto. + * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto. + * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto. + * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto. + * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto. + * v850-tdep.c, valops.c, z8k-tdep.c: Ditto. + +2002-11-24 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Do not set get_saved_register. + +2002-11-24 Andrew Cagney + + * frame.c (set_unwind_by_pc): Revert change below, use + PC_IN_CALL_DUMMY. + (get_prev_frame): Ditto. + +2002-11-24 Andrew Cagney + + * dummy-frame.c (pc_in_dummy_frame): New function. + (generic_pc_in_call_dummy): Call pc_in_dummy_frame. + (find_dummy_frame): Update comment. + (generic_pop_current_frame): Use get_frame_type. + * dummy-frame.h (pc_in_dummy_frame): Declare. + * frame.c (set_unwind_by_pc): Use pc_in_dummy_frame. + (create_new_frame): Use pc_in_dummy_frame. + (get_prev_frame): Use pc_in_dummy_frame. + (frame_saved_regs_register_unwind): Use get_prev_frame. + (deprecated_generic_get_saved_register): Use get_prev_frame. + +2002-11-23 Andrew Cagney + + * blockframe.c (find_frame_addr_in_frame_chain): Move function + from here ... + * varobj.c (find_frame_addr_in_frame_chain): ... to here. + (varobj_create): Note that frame ID should be used. + * frame.h (find_frame_addr_in_frame_chain): Delete declaration. + +2002-11-23 Andrew Cagney + + * breakpoint.c: Include "gdb_assert.h". + (deprecated_frame_in_dummy): Assert that generic dummy frames are + not being used. + * Makefile.in (breakpoint.o): Update dependencies. + * ada-lang.c (find_printable_frame): Use get_frame_type instead of + deprecated_frame_in_dummy. + * stack.c (print_frame_info_base): Ditto. + (frame_info): Ditto. + (print_frame_info_base): Ditto. Delete dead code. + +2002-11-23 Andreas Schwab + + * Makefile.in (m68k_tdep_h): Define. + (abug-rom.o, cpu32bug-rom.o, dbug-rom.o, m68k-tdep.o, m68klinux-nat.o) + (remote-est.o, rom68k-rom.o): Add $(m68k_tdep_h). + * m68k-tdep.c: Move register number enum ... + * m68k-tdep.h: ... to this new file and rename the constants from + E_* to M68K_*. All uses changed. + * config/m68k/tm-m68k.h (D0_REGNUM, A0_REGNUM): Remove definitions. + * abug-rom.c: Include "m68k-tdep.h". Use + M68K_D0_REGNUM/M68K_A0_REGNUM instead of D0_REGNUM/A0_REGNUM. + * cpu32bug-rom.c: Likewise. + * dbug-rom.c: Likewise. + * m68k-tdep.c: Likewise. + * m68klinux-nat.c: Likewise. + * remote-est.c: Likewise. + * rom68k-rom.c: Likewise. + * config/m68k/tm-linux.h: Likewise. + +2002-11-23 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Remove old style non-generic + dummy frame initialization code. + * mips-tdep.c (mips_gdbarch_init): Ditto. + +2002-11-22 Christopher Faylor + + * win32-nat.c (child_attach): Reset saw_create counter or subsequent + attach will hang. + +2002-11-22 Andrew Cagney + + * gdbarch.sh (FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS): Default + to default_frame_address. + * gdbarch.h, gdbarch.c: Re-generate. + + * d10v-tdep.c (d10v_gdbarch_init): Do not set frame_args_address + or frame_locals_address to default_frame_address. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + + * cris-tdep.c (cris_frame_args_address): Delete function. + (cris_frame_locals_address): Delete function. + (cris_gdbarch_init): Do not set frame_args_address or + frame_locals_address. + +2002-11-22 Michael Snyder + + * thread-db.c (thread_db_load): Tell the user what's going on + if dlopen fails on libthread_db. + +2002-11-23 Andreas Schwab + + * m68k-tdep.c (m68k_register_virtual_type): Use architecture + invariant return values. + +2002-11-22 Andreas Schwab + + * valops.c (value_slice): Move declaration of `offset' to avoid + warning. + +2002-11-22 Christopher Faylor + + * win32-nat.c (psapi_get_dll_name): Fix a compiler warning. + (struct so_stuff): Add end_addr field. + (register_loaded_dll): Calculate and store end address of loaded dll. + (solib_address): New function. + (child_solib_loaded_library_pathname): Pass carefully constructed + section info to safe_symbol_file_add rather than ignoring it. + (get_child_debug_event): Call re_enable_breakpoints_in_shlibs when a + DLL is loaded. + (do_initial_child_stuff): Call disable_breakpoints_in_shlibs. + (child_create_inferior): Fix a compiler warning. + * config/i386/tm-cygwin.h (PC_SOLIB): Define new macro. + (solib_address): Declare new function. + +2002-11-22 Andreas Schwab + + * m68k-tdep.c (m68k_register_virtual_type): Return int for SR, FPC + and FPS registers. + +2002-11-21 Daniel Jacobowitz + + * maint.c (_initialize_maint_cmds): Fix typo. From + Francesco Potorti` . + +2002-11-21 Andrew Cagney + + * mips-tdep.c (mips_dump_tdep): Delete references to + GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. + * config/mips/tm-mips.h (GDB_TARGET_MASK_DISAS_PC): Delete macro. + (GDB_TARGET_UNMASK_DISAS_PC): Delete macro. + * printcmd.c (build_address_symbolic): Delete calls to + GDB_TARGET_UNMASK_DISAS_PC and GDB_TARGET_MASK_DISAS_PC. + (address_info): Ditto. + Fix PR gdb/773. + +2002-11-19 Klee Dienes + Adam Fedor + + * completer.c (skip_quoted_chars): Renamed from skip_chars. Add + the ability to explicitly specify the quote characters and word + break characters; if NULL is specified for either, use the old + behavior of using the characters used by the completer. + (skip_chars): New function. Convenience wrapper around + skip_quoted_chars to provide the original skip_chars behavior. + * completer.h (skip_quoted_chars): Add prototype. + +2002-11-19 Andrew Cagney + + Problems reported by Paul Eggert. + * gdbarch.sh: Use `sort -k 3`. Fix PR gdb/527. + +2002-11-19 Andreas Schwab + + * m68klinux-nat.c (IS_SIGTRAMP, IS_RT_SIGTRAMP) + (m68k_linux_in_sigtramp, SIGCONTEXT_PC_OFFSET) + (UCONTEXT_PC_OFFSET, m68k_linux_sigtramp_saved_pc) + (m68k_linux_frame_saved_pc): Move to ... + * m68klinux-tdep.c: ... here. New file. + * Makefile.in (m68klinux-tdep.o): Add dependencies. + * config/m68k/linux.mt (TDEPFILES): Add m68klinux-tdep.o. + +2002-11-19 Adam Fedor + + * objc-exp.y: Revert to old skip_quoted usage. + +2002-11-19 Adam Fedor + + * Makefile.in (SFILES): Add objc-exp.y objc-lang.c. + (objc_lang_h): Define. + (YYFILES): Add objc-exp.tab.c. + (local-maintainer-clean): Remove objc-exp.tab.c. + (objc-exp.tab.c, objc-exp.tab.o, objc-lang.o): New target. + +2002-11-19 Pierre Muller + + * p-exp.y (typecast rule): Add automatic dereference of + pascal classes if needed. + (THIS): Set current_type. + Automatically dereference pascal classes. + (typebase rule): Add ^typebase recognition. + +2002-11-18 Adam Fedor + + * expprint.c (print_subexp): Handle OP_OBJC_NSSTRING, + OP_OBJC_MSGCALL, and OP_OBJC_SELF. + (op_name): Handle OP_OBJC_SELF. + * Makefile.in (expprint.o): Add additional depends. + +2002-11-18 Adam Fedor + + * expression.h: Rename ObjC ops to OP_OBJC_MSGCALL, + OP_OBJC_SELECTOR, OP_OBJC_NSSTRING, and OP_OBJC_SELF. + * parse.c (length_of_subexp, prefixify_subexp): Likewise. + * objc-exp.y: Likewise. + +2002-11-18 Adam Fedor + + * gdb/parser-defs.h: (struct objc_class_str): New structure + for parsing ObjC classes. + +2002-11-18 Andrew Cagney + + * stack.c (frame_relative_level): Copy function from here ... + * frame.c (frame_relative_level): ...to here. + +2002-11-18 Andrew Cagney + + * frame.h (enum frame_type): Define. + (get_frame_type): Declare. + (struct frame_info): Add field `type'. Delete field + signal_handler_caller. + (deprecated_set_frame_signal_handler_caller): Declare. + * frame.c (get_frame_type): New function. + (deprecated_set_frame_type): New function. + (create_new_frame): Set the frame's type. + (get_prev_frame): Similar. + * sparc-tdep.c: Use get_frame_type instead of signal_handler_caller. + * s390-tdep.c: Ditto. + * m68klinux-nat.c: Ditto. + * ns32k-tdep.c: Ditto. + * x86-64-linux-tdep.c: Ditto. + * vax-tdep.c: Ditto. + * rs6000-tdep.c: Ditto. + * ppc-linux-tdep.c: Ditto. + * i386-interix-tdep.c: Ditto. + * mips-tdep.c: Ditto. + * m68k-tdep.c: Ditto. + * hppa-tdep.c: Ditto. + * ia64-tdep.c: Ditto. + * cris-tdep.c: Ditto. + * arm-tdep.c: Ditto. + * alpha-tdep.c: Ditto. + * i386-tdep.c: Ditto. + * stack.c: Ditto. + * ada-lang.c: Ditto. + * blockframe.c: Update. + * i386-interix-tdep.c (i386_interix_back_one_frame): Use + deprecated_set_frame_type instead of signal_handler_caller. + * ppc-linux-tdep.c (ppc_linux_init_extra_frame_info): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + * breakpoint.h: Delete FIXME suggesting get_frame_type. + +2002-11-18 Klee Dienes + + * Makefile.in (buildsym.o): Add dependency for gdb_assert.h. + +2002-11-18 Klee Dienes + + * buildsym.c (pop_context): Add comment. + +2002-11-18 Klee Dienes + + * buildsym.h (pop_context): Convert to function, defined in + buildsym.c. + * buildsym.c: Include gdb_assert.h. + (pop_context): Implement as C function. Add check for stack + underflow. + * dbxread.c (process_one_symbol): Complain and stop processing + that symbol if we are already at the top of the context stack for + a function-end N_FUN (this would imply an umatched RBRAC). Ditto + when processing N_RBRAC. + +2002-11-16 Daniel Jacobowitz + + * config/pa/nm-hppah.h (CHILD_POST_FOLLOW_INFERIOR_BY_CLONE): Don't + define. + (struct target_waitstatus): Add opaque definition. + * corelow.c (init_core_ops): Don't set to_clone_and_follow_inferior. + * exec.c (init_exec_ops): Likewise. + * fork-child.c (clone_and_follow_inferior): Remove. + * hppah-nat.c (child_post_follow_inferior_by_clone): Remove. + * inferior.h (clone_and_follow_inferior): Remove prototype. + * infrun.c (follow_fork_mode_both): Remove. + (follow_fork_mode_kind_names): Remove commented out "both". + (follow_inferior_fork): Remove follow_fork_mode_both support. + * inftarg.c (child_clone_and_follow_inferior): Remove. + (child_post_follow_inferior_by_clone): Remove. + (init_child_ops): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + * target.c (default_clone_and_follow_inferior): Remove. + (cleanup_target): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + (find_default_clone_and_follow_inferior): Remove. + (init_dummy_target): Don't set to_clone_and_follow_inferior. + (debug_to_clone_and_follow_inferior): Remove. + (debug_to_post_follow_inferior_by_clone): Remove. + (setup_target_debug): Don't set to_clone_and_follow_inferior + or to_post_follow_inferior_by_clone. + * target.h (struct target_ops): Remove to_clone_and_follow_inferior + and to_post_follow_inferior_by_clone. + (child_clone_and_follow_inferior): Remove prototype. + (child_post_follow_inferior_by_clone): Remove prototype. + (target_clone_and_follow_inferior): Remove macro. + (target_post_follow_inferior_by_clone): Remove macro. + (find_default_clone_and_follow_inferior): Remove prototype. + +2002-11-16 Daniel Jacobowitz + + * breakpoint.c (bpstat_stop_status): Call inferior_has_forked, + inferior_has_vforked, and inferior_has_execd instead of + target_has_forked, target_has_vforked, and target_has_execd. + * config/pa/nm-hppah.h (CHILD_HAS_FORKED, CHILD_HAS_VFORKED) + (CHILD_HAS_EXECD, CHILD_HAS_SYSCALL_EVENT): Don't define. + (CHILD_WAIT): Define. + (child_wait): Add prototype. + * hppah-nat.c (hpux_has_forked): Rename from child_has_forked. + Add prototype. + (hpux_has_vforked): Likewise, from child_has_vforked. + (hpux_has_execd): Likewise, from child_has_execd. + (hpux_has_syscall_event): Likewise, from child_has_syscall_event. + (not_same_real_pid, child_wait): New, copied from inftarg.c. + Call hpux_has_forked, hpux_has_vforked, hpux_has_execd, + and hpux_has_syscall_event instead of the target hooks. + * infrun.c (inferior_has_forked, inferior_has_vforked) + (inferior_has_execd): New functions. + * inftarg.c (not_same_real_pid): Remove. + (child_wait): Remove references to not_same_real_pid, + target_has_forked, target_has_vforked, target_has_execd, + and target_has_syscall_event. + (child_has_forked, child_has_vforked, child_has_execd) + (child_has_syscall_event): Remove. + (init_child_ops): Remove references to child_has_forked, + child_has_vforked, child_has_execd, and child_has_syscall_event. + * infttrace.c (hpux_has_forked): Rename from child_has_forked. + (hpux_has_vforked): Likewise, from child_has_vforked. + (hpux_has_execd): Likewise, from child_has_execd. + (hpux_has_syscall_event): Likewise, from child_has_syscall_event. + * target.c (cleanup_target): Remove references to + to_has_forked, to_has_vforked, to_has_execd, and + to_has_syscall_event. + (update_current_target): Likewise. + (setup_target_debug): Likewise. + (debug_to_has_forked): Remove. + (debug_to_has_vforked): Remove. + (debug_to_has_execd): Remove. + (debug_to_has_syscall_event): Remove. + * target.h (struct target_ops): Remove to_has_forked. + to_has_vforked, to_has_execd, and to_has_syscall_event. + (child_has_forked, child_has_vforked, child_has_execd) + (child_has_syscall_event): Remove prototypes. + (inferior_has_forked, inferior_has_vforked, inferior_has_execd): Add + prototypes. + (target_has_forked, target_has_vforked, target_has_execd) + (target_has_syscall_event): Remove macros. + +2002-11-16 Daniel Jacobowitz + + * hppah-nat.c (child_can_follow_vfork_prior_to_exec): Remove. + * inftarg.c (child_can_follow_vfork_prior_to_exec): Remove. + (init_child_ops): Don't initialize to_can_follow_vfork_prior_to_exec. + * infttrace.c (child_can_follow_vfork_prior_to_exec): Remove. + * target.c (cleanup_target): Remove reference to + to_can_follow_vfork_prior_to_exec. + (update_current_target): Likewise. + (debug_to_can_follow_vfork_prior_to_exec): Remove. + (setup_target_debug): Remove reference to + to_can_follow_vfork_prior_to_exec. + * target.h (struct target_ops): Remove + to_can_follow_vfork_prior_to_exec. + (child_can_follow_vfork_prior_to_exec): Remove prototype. + (target_can_follow_vfork_prior_to_exec): Remove definition. + * config/pa/nm-hppah.h (CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC): Don't + define. + * infrun.c (follow_vfork_when_exec): Remove. + (follow_inferior_fork): Remove references to follow_vfork_when_exec. + (follow_exec): Likewise. + (handle_inferior_event): Likewise. + (keep_going): Likewise. + +2002-11-15 Andrew Cagney + + * frame.c (generic_unwind_get_saved_register): Make static. + * frame.h (generic_unwind_get_saved_register): Delete declaration. + * avr-tdep.c (avr_gdbarch_init): Do not set get_saved_register, + defaults to generic_unwind_get_saved_register. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * i386-tdep.c (i386_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Delete macro. + +2002-11-15 Andrew Cagney + + * x86-64-linux-nat.c (i386_sse_regnum_p): New function. Copy from + i386-tdep.c. + +2002-11-15 Andrew Cagney + + * frame.h (sigtramp_saved_pc): Delete declaration. + * blockframe.c (sigtramp_saved_pc): Delete function. + * ns32k-tdep.c (ns32k_sigtramp_saved_pc): New function. + (ns32k_frame_saved_pc): Call ns32k_sigtramp_saved_pc. + * vax-tdep.c (vax_sigtramp_saved_pc): New function. + (vax_frame_saved_pc): Call vax_sigtramp_saved_pc. + +2002-11-15 Andrew Cagney + + * frame.c (frame_pc_unwind): New function. + (frame_saved_regs_pc_unwind): New function. + (frame_register_unwind): Pass unwind_cache instead of + register_unwind_cache. + (set_unwind_by_pc): Add unwind_pc parameter, set. + (create_new_frame): Pass frame->pc_unwind to set_unwind_by_pc. + (get_prev_frame): Ditto. + * frame.h (frame_pc_unwind_ftype): Declare. + (struct frame_info): Add pc_unwind, pc_unwind_cache_p and + pc_unwind_cache. Rename register_unwind_cache to unwind_cache. + (frame_pc_unwind): Declare. + * dummy-frame.c (dummy_frame_pc_unwind): New function. + (struct dummy_frame): Add comment mentioning that values are for + previous frame. + * dummy-frame.h (dummy_frame_pc_unwind): Declare. + * blockframe.c (file_frame_chain_valid): Use frame_pc_unwind. + (generic_file_frame_chain_valid): Ditto. + * stack.c (frame_info): Ditto. + +2002-11-15 David Carlton + + * linespec.c (locate_first_half): New function. + (decode_line_1): Move code into locate_first_half. + +2002-11-15 Andrew Cagney + + * complaints.h: Add comment explaining how to eliminate a + deprecated_complain call. + * complaints.h: Fix spelling errors. + +2002-11-15 David Carlton + + * printcmd.c: Remove #include "disasm.h". + 2002-12-20 David Carlton * symtab.c (lookup_symbol_aux_minsyms): Don't call diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS index 2947317f..257b718 100644 --- a/gdb/MAINTAINERS +++ b/gdb/MAINTAINERS @@ -84,7 +84,7 @@ maintainer works with the native maintainer when resolving API issues. h8300 --target=h8300hms ,-Werror Maintenance only - h8500 --target=h8500hms -Werror + h8500 (--target=h8500hms broken) Maintenance only Not multi-arch, work in progress @@ -279,9 +279,7 @@ breakpoints Michael Snyder msnyder@redhat.com Jim Blandy jimb@redhat.com language support (Blanket Write Privs Maintainers) C++ Daniel Jacobowitz dan@debian.org - Java support (devolved) - Per Bothner per@bothner.com - Anthony Green green@redhat.com + Java support (Global Maintainers) Pascal support Pierre Muller muller@sources.redhat.com Scheme support Jim Blandy jimb@redhat.com @@ -300,6 +298,7 @@ testsuite Fernando Nasser fnasser@redhat.com lib Mark Salter msalter@redhat.com gdbtk (gdb.gdbtk) Keith Seitz keiths@redhat.com c++ (gdb.c++) Michael Chastain mec@shout.net + David Carlton carlton@math.stanford.edu mi tests (gdb.mi) Elena Zannoni ezannoni@redhat.com Andrew Cagney cagney@redhat.com stabs (gdb.stabs) Elena Zannoni ezannoni@redhat.com @@ -450,6 +449,8 @@ David Taylor (d10v, sparc, utils, defs, expression evaluator, language support) taylor at candd dot org J.T. Conklin (dcache, NetBSD, remote) jtc at redback dot com Frank Ch. Eigler (sim) fche at redhat dot com +Per Bothner (Java) per at bothner dot com +Anthony Green (Java) green at redhat dot com diff --git a/gdb/Makefile.in b/gdb/Makefile.in index d3a2f4f..c427914 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -168,12 +168,12 @@ SUBDIR_CLI_UNINSTALL= # SUBDIR_MI_OBS = \ mi-out.o mi-console.o \ - mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ + mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ mi-cmd-disas.o \ mi-main.o mi-parse.o mi-getopt.o SUBDIR_MI_SRCS = \ mi/mi-out.c mi/mi-console.c \ - mi/mi-cmds.c \ + mi/mi-cmds.c mi/mi-cmd-env.c \ mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \ mi/mi-cmd-disas.c \ mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c @@ -261,11 +261,6 @@ ITK_CFLAGS = @ITKHDIR@ ITK = @ITKLIB@ ITK_DEPS = @ITK_DEPS@ -# Where is Tix? Typically in ../tix. -TIX_CFLAGS = @TIXHDIR@ -TIX = @TIXLIB@ -TIX_DEPS = @TIX_DEPS@ - X11_CFLAGS = @TK_XINCLUDES@ X11_LDFLAGS = X11_LIBS = @@ -295,7 +290,7 @@ SUBDIR_GDBTK_SRCS = \ gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c \ gdbtk/generic/gdbtk-main.c SUBDIR_GDBTK_DEPS = \ - $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS) + $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TK_DEPS) $(TCL_DEPS) SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c SUBDIR_GDBTK_LDFLAGS= SUBDIR_GDBTK_CFLAGS= -DGDBTK @@ -551,6 +546,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ macrotab.c macroexp.c macrocmd.c macroscope.c main.c maint.c \ mdebugread.c memattr.c mem-break.c minsyms.c mipsread.c \ nlmread.c \ + objc-exp.y objc-lang.c \ objfiles.c osabi.c \ p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \ regcache.c reggroups.c remote.c \ @@ -593,6 +589,7 @@ remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h demangle_h = $(INCLUDE_DIR)/demangle.h obstack_h = $(INCLUDE_DIR)/obstack.h opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h +readline_h = $(READLINE_SRC)/readline.h sh_opc_h = $(OPCODES_SRC)/sh-opc.h gdb_sim_arm_h = $(INCLUDE_DIR)/gdb/sim-arm.h gdb_sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h @@ -670,7 +667,7 @@ gdb_wait_h = gdb_wait.h gdbarch_h = gdbarch.h $(dis_asm_h) $(value_h) $(inferior_h) gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) gdbcore_h = gdbcore.h $(bfd_h) -gdbthread_h = gdbthread.h $(breakpoint_h) +gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h) gdbtypes_h = gdbtypes.h gnu_nat_h = gnu-nat.h gregset_h = gregset.h @@ -678,22 +675,25 @@ i386_linux_tdep_h = i386-linux-tdep.h i386_tdep_h = i386-tdep.h $(osabi_h) i387_tdep_h = i387-tdep.h inf_loop_h = inf-loop.h -inferior_h = inferior.h $(breakpoint_h) $(target_h) +inferior_h = inferior.h $(breakpoint_h) $(target_h) $(frame_h) jv_lang_h = jv-lang.h kod_h = kod.h language_h = language.h linespec_h = linespec.h m2_lang_h = m2-lang.h +m68k_tdep_h = m68k-tdep.h macroexp_h = macroexp.h macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) macrotab_h = macrotab.h main_h = main.h memattr_h = memattr.h minimon_h = minimon.h +mips_tdep_h = mips-tdep.h mipsnbsd_tdep_h = mipsnbsd-tdep.h monitor_h = monitor.h nbsd_tdep_h = nbsd-tdep.h ns32k_tdep_h = ns32k-tdep.h $(osabi_h) +objc_lang_h = objc-lang.h objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) ocd_h = ocd.h osabi_h = osabi.h @@ -872,6 +872,7 @@ SUBDIRS = @SUBDIRS@ # For now, shortcut the "configure GDB for fewer languages" stuff. YYFILES = c-exp.tab.c \ + objc-exp.tab.c \ ada-exp.tab.c \ jv-exp.tab.c \ f-exp.tab.c m2-exp.tab.c p-exp.tab.c @@ -1137,6 +1138,7 @@ local-maintainer-clean: @echo "it deletes files that may require special tools to rebuild." rm -f c-exp.tab.c \ ada-lex.c ada-exp.tab.c \ + objc-exp.tab.c \ jv-exp.tab \ f-exp.tab.c m2-exp.tab.c p-exp.tab.c rm -f TAGS $(INFOFILES) @@ -1232,6 +1234,22 @@ c-exp.tab.c: c-exp.y mv c-exp.new ./c-exp.tab.c # See comments above ... +.PRECIOUS: objc-exp.tab.c +objc-exp.tab.o: objc-exp.tab.c +objc-exp.tab.c: objc-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/objc-exp.y y.tab.c objc-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' \ + < objc-exp.tmp > objc-exp.new + -rm objc-exp.tmp + mv objc-exp.new ./objc-exp.tab.c + +# See comments above ... .PRECIOUS: jv-exp.tab.c jv-exp.tab.o: jv-exp.tab.c jv-exp.tab.c: jv-exp.y @@ -1361,7 +1379,8 @@ ALLDEPFILES = a68v-nat.c \ core-sol2.c core-regset.c core-aout.c corelow.c \ dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \ go32-nat.c h8300-tdep.c h8500-tdep.c \ - hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c hpread.c \ + hp300ux-nat.c hppa-tdep.c hppa-hpux-tdep.c \ + hppab-nat.c hppah-nat.c hpread.c \ i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \ i386v4-nat.c i386ly-tdep.c \ i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \ @@ -1425,9 +1444,15 @@ hpux-thread.o: $(srcdir)/hpux-thread.c procfs.o: $(srcdir)/procfs.c $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c +# FIXME: Thread-db.o gets warnings because the definitions of the register +# sets are different from kernel to kernel. +thread-db.o: $(srcdir)/thread-db.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ + $(srcdir)/thread-db.c + v850ice.o: $(srcdir)/v850ice.c $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) \ $(srcdir)/v850ice.c @@ -1447,6 +1472,10 @@ c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ $(charset_h) \ $(symfile_h) $(objfiles_h) $(block_h) +objc-exp.tab.o: objc-exp.tab.c $(objc_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) $(block_h) @@ -1474,7 +1503,7 @@ ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ a68v-nat.o: a68v-nat.c $(defs_h) $(inferior_h) $(regcache_h) abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(serial_h) $(regcache_h) + $(serial_h) $(regcache_h) $(m68k_tdep_h) ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ $(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \ $(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ @@ -1496,7 +1525,7 @@ aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \ alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ $(value_h) $(alpha_tdep_h) alpha-nat.o: alpha-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ - $(regcache_h) $(alpha_tdep_h) $(gregset_h) + $(regcache_h) $(alpha_tdep_h) $(gregset_h) $(gdb_string_h) alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ $(value_h) $(alpha_tdep_h) alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ @@ -1550,14 +1579,13 @@ breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ $(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \ - $(cli_script_h) $(gdb_events_h) $(source_h) $(dictionary_h) \ - $(block_h) + $(cli_script_h) $(gdb_events_h) $(source_h) $(gdb_assert_h) \ + $(block_h) $(dictionary_h) buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ - $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(complaints_h) \ - $(gdb_string_h) $(expression_h) $(language_h) $(bcache_h) \ - $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ - $(stabsread_h) $(dictionary_h) $(gdb_assert_h) $(cp_support_h) \ - $(block_h) + $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \ + $(complaints_h) $(gdb_string_h) $(expression_h) $(language_h) \ + $(bcache_h) $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ + $(stabsread_h) $(dictionary_h) $(cp_support_h) $(block_h) builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ $(gdb_string_h) $(gdb_assert_h) c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ @@ -1587,7 +1615,7 @@ coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \ complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \ $(command_h) $(gdbcmd_h) completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ - $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) + $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) $(readline_h) copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h) core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \ $(gdb_dirent_h) $(gdb_stat_h) @@ -1600,7 +1628,7 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ $(dis_asm_h) $(gdb_stat_h) $(completer_h) corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \ - $(gdbthread_h) $(regcache_h) $(symfile_h) + $(gdbthread_h) $(regcache_h) $(symfile_h) $(readline_h) cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(gdb_string_h) cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \ $(demangle_h) $(gdb_obstack_h) $(gdb_assert_h) $(symtab_h) \ @@ -1611,7 +1639,7 @@ cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ $(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \ $(cp_abi_h) cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(monitor_h) $(serial_h) $(regcache_h) + $(monitor_h) $(serial_h) $(regcache_h) $(m68k_tdep_h) cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \ $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \ @@ -1624,7 +1652,7 @@ d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ $(sim_regno_h) # OBSOLETE d30v-tdep.o: d30v-tdep.c dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(serial_h) $(regcache_h) + $(serial_h) $(regcache_h) $(m68k_tdep_h) dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \ $(gdb_stat_h) $(symtab_h) $(breakpoint_h) $(target_h) $(gdbcore_h) \ $(libaout_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ @@ -1671,12 +1699,14 @@ eval.o: eval.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \ $(gdb_string_h) event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ - $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) + $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) $(readline_h) exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ - $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) + $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) \ + $(readline_h) expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ - $(value_h) $(language_h) $(parser_defs_h) $(block_h) + $(value_h) $(language_h) $(parser_defs_h) $(target_h) $(gdb_string_h) \ + $(block_h) f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ $(valprint_h) @@ -1697,8 +1727,9 @@ fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ $(terminal_h) $(gdbthread_h) $(command_h) # OBSOLETE fr30-tdep.o: fr30-tdep.c frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ - $(regcache_h) $(gdb_assert_h) $(gdb_obstack_h) $(dummy_frame_h) \ - $(gdbcore_h) $(annotate_h) + $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(builtin_regs_h) \ + $(gdb_obstack_h) $(dummy_frame_h) $(gdbcore_h) $(annotate_h) \ + $(language_h) frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ $(arch_utils_h) $(regcache_h) gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \ @@ -1739,7 +1770,8 @@ hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ $(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \ $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \ - $(symfile_h) $(objfiles_h) $(language_h) + $(symfile_h) $(objfiles_h) $(language_h) $(osabi_h) +hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ $(gdb_wait_h) $(regcache_h) @@ -1799,7 +1831,7 @@ ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \ $(objfiles_h) $(gdb_stat_h) ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h) ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \ - $(gdbcore_h) $(regcache_h) $(gregset_h) + $(gdbcore_h) $(regcache_h) $(gregset_h) $(gdb_string_h) ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ $(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \ @@ -1879,10 +1911,12 @@ m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) \ m68k-stub.o: m68k-stub.c m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \ $(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \ - $(arch_utils_h) $(gregset_h) + $(arch_utils_h) $(gregset_h) $(m68k_tdep_h) m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ $(language_h) $(gdbcore_h) $(regcache_h) $(gdb_stat_h) \ - $(floatformat_h) $(target_h) $(gregset_h) + $(floatformat_h) $(target_h) $(gregset_h) $(m68k_tdep_h) +m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(target_h) m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(regcache_h) m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h) @@ -1924,13 +1958,13 @@ minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h) mips-linux-nat.o: mips-linux-nat.c $(defs_h) mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ - $(solib_svr4_h) + $(solib_svr4_h) $(osabi_h) $(gdb_string_h) mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ - $(regcache_h) $(osabi_h) $(opcode_mips_h) $(elf_mips_h) $(elf_bfd_h) \ - $(symcat_h) $(block_h) + $(regcache_h) $(osabi_h) $(mips_tdep_h) $(opcode_mips_h) \ + $(elf_mips_h) $(elf_bfd_h) $(symcat_h) $(block_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(mipsnbsd_tdep_h) @@ -1965,6 +1999,11 @@ ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \ ns32knbsd-nat.o: ns32knbsd-nat.c $(defs_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(regcache_h) ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h) $(gdb_string_h) +objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \ + $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) \ + $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) \ + $(gdb_regex_h) $(regcache_h) objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \ @@ -1999,7 +2038,7 @@ ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ $(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \ $(regcache_h) ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ - $(gdbcore_h) $(regcache_h) $(gregset_h) $(ppc_tdep_h) + $(gdbcore_h) $(regcache_h) $(gregset_h) $(ppc_tdep_h) $(gdb_string_h) ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ $(objfiles_h) $(regcache_h) $(value_h) $(solib_svr4_h) $(ppc_tdep_h) @@ -2044,7 +2083,7 @@ remote-es.o: remote-es.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ $(target_h) $(command_h) $(symfile_h) $(remote_utils_h) $(gdbcore_h) \ $(serial_h) $(regcache_h) $(value_h) remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(serial_h) $(regcache_h) + $(serial_h) $(regcache_h) $(m68k_tdep_h) remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) remote-mips.o: remote-mips.c $(defs_h) $(inferior_h) $(bfd_h) $(symfile_h) \ @@ -2101,7 +2140,7 @@ remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ $(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \ $(gdbcore_h) rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ - $(serial_h) $(regcache_h) $(value_h) + $(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_h) rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ $(xcoffsolib_h) $(symfile_h) $(objfiles_h) $(libbfd_h) $(bfd_h) \ $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \ @@ -2167,7 +2206,7 @@ solib-svr4.o: solib-svr4.c $(defs_h) $(elf_external_h) $(elf_common_h) \ solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \ $(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \ - $(completer_h) $(filenames_h) $(solist_h) + $(completer_h) $(filenames_h) $(solist_h) $(readline_h) somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(buildsym_h) $(stabsread_h) $(gdb_stabs_h) \ $(complaints_h) $(gdb_string_h) $(demangle_h) $(som_h) $(libhppa_h) @@ -2179,7 +2218,7 @@ source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \ $(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \ $(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \ $(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \ - $(filenames_h) $(completer_h) $(ui_out_h) + $(filenames_h) $(completer_h) $(ui_out_h) $(readline_h) sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h) sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ $(regcache_h) @@ -2221,7 +2260,7 @@ symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) \ - $(block_h) + $(readline_h) $(block_h) symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(target_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) $(gdbcore_h) symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ @@ -2229,7 +2268,7 @@ symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ $(gdb_obstack_h) $(language_h) $(bcache_h) $(dictionary_h) \ - $(gdb_string_h) $(block_h) + $(gdb_string_h) $(readline_h) $(block_h) symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ @@ -2252,12 +2291,12 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \ $(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \ $(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \ $(gdb_assert_h) $(event_top_h) $(gdb_string_h) $(gdb_stat_h) \ - $(ui_out_h) $(cli_out_h) + $(ui_out_h) $(cli_out_h) $(readline_h) tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ - $(ax_gdb_h) $(dictionary_h) $(block_h) + $(ax_gdb_h) $(dictionary_h) $(block_h) $(readline_h) typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) @@ -2267,7 +2306,7 @@ ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ utils.o: utils.c $(config_h) $(defs_h) $(gdb_assert_h) $(gdb_string_h) \ $(event_top_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) \ $(demangle_h) $(expression_h) $(language_h) $(annotate_h) \ - $(filenames_h) $(inferior_h) $(mmalloc_h) $(charset_h) + $(filenames_h) $(inferior_h) $(mmalloc_h) $(charset_h) $(readline_h) uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \ $(regcache_h) $(gregset_h) v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ @@ -2346,7 +2385,7 @@ cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) \ $(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \ - $(cli_dump_h) $(gdb_assert_h) $(target_h) + $(cli_dump_h) $(gdb_assert_h) $(target_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \ $(ui_out_h) $(gdb_string_h) $(top_h) $(cli_cmds_h) $(cli_decode_h) \ @@ -2428,7 +2467,7 @@ gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \ $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \ $(tracepoint_h) $(top_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(ITK_CFLAGS) $(TIX_CFLAGS) \ + $(ITK_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk.c \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" -DSRC_DIR=\"$(GDBTK_SRC_DIR)\" @@ -2439,7 +2478,7 @@ gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \ $(defs_h) $(breakpoint_h) $(tracepoint_h) \ $(symfile_h) $(symtab_h) $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" @@ -2449,7 +2488,7 @@ gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ $(command_h) $(bfd_h) $(top_h) $(symfile_h) $(objfiles_h) $(target_h) \ $(gdb_string_h) $(tracepoint_h) $(source_h) $(regcache_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" @@ -2458,13 +2497,13 @@ gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \ $(symtab_h) $(inferior_h) $(command_h) \ $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \ $(tracepoint_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" gdbtk-main.o: $(srcdir)/gdbtk/generic/gdbtk-main.c $(defs_h) $(main_h) \ $(gdb_string_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-main.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" @@ -2473,7 +2512,7 @@ gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \ $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ $(defs_h) $(frame_h) $(value_h) $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" @@ -2483,14 +2522,14 @@ gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \ $(defs_h) $(frame_h) $(value_h) $(target_h) $(breakpoint_h) \ $(linespec_h) $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ - $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \ $(srcdir)/gdbtk/generic/gdbtk.h \ $(defs_h) $(value_h) $(varobj_h) $(gdb_string_h) - $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ $(srcdir)/gdbtk/generic/gdbtk-varobj.c @@ -2513,6 +2552,10 @@ mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c +mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ + $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) $(inferior.h) \ + $(mi_getopt_h) $(environ_h) $(gdbcmd_h) $(top_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(dictionary_h) \ $(block_h) @@ -2597,7 +2640,7 @@ tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(config_h) $(defs_h) $(symtab_h) \ $(target_h) $(gdbcore_h) $(event_loop_h) $(frame_h) $(breakpoint_h) \ $(gdb_events_h) $(tui_h) $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) \ $(tuiRegs_h) $(tuiWin_h) $(tuiStack_h) $(tuiDataWin_h) \ - $(tuiSourceWin_h) + $(tuiSourceWin_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \ $(gdb_string_h) $(gdb_assert_h) @@ -2655,7 +2698,8 @@ tuiStack.o: $(srcdir)/tui/tuiStack.c $(config_h) $(defs_h) $(symtab_h) \ tuiWin.o: $(srcdir)/tui/tuiWin.c $(config_h) $(defs_h) $(command_h) \ $(symtab_h) $(breakpoint_h) $(frame_h) $(cli_cmds_h) $(tui_h) \ $(tuiData_h) $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) \ - $(tuiDisassem_h) $(tuiSource_h) $(tuiSourceWin_h) $(tuiDataWin_h) + $(tuiDisassem_h) $(tuiSource_h) $(tuiSourceWin_h) $(tuiDataWin_h) \ + $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiWin.c # diff --git a/gdb/NEWS b/gdb/NEWS index 0ba805d..f9feaf0 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -31,6 +31,14 @@ The GNU Source-Level Debugger''. *** Changes in GDB 5.3: +* GNU/Linux shared library multi-threaded performance improved. + +When debugging a multi-threaded application on GNU/Linux, GDB now uses +`/proc', in preference to `ptrace' for memory reads. This may result +in an improvement in the start-up time of multi-threaded, shared +library applications when run under GDB. One GDB user writes: ``loads +shared libs like mad''. + * ``gdbserver'' now supports multi-threaded applications on some targets Support for debugging multi-threaded applications which use diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c index 8a9e8ff..d3a9c2e 100644 --- a/gdb/abug-rom.c +++ b/gdb/abug-rom.c @@ -28,6 +28,8 @@ #include "serial.h" #include "regcache.h" +#include "m68k-tdep.h" + /* Prototypes for local functions. */ static void abug_open (char *args, int from_tty); @@ -55,12 +57,12 @@ abug_supply_register (char *regname, int regnamelen, char *val, int vallen) case 'D': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + D0_REGNUM; + regno = regname[1] - '0' + M68K_D0_REGNUM; break; case 'A': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + A0_REGNUM; + regno = regname[1] - '0' + M68K_A0_REGNUM; break; default: return; diff --git a/gdb/acconfig.h b/gdb/acconfig.h index 619b0ae..88c15e1 100644 --- a/gdb/acconfig.h +++ b/gdb/acconfig.h @@ -49,6 +49,9 @@ /* Define if has pr_siginfo64_t */ #undef HAVE_PR_SIGINFO64_T +/* Define if the pread64 function is available. */ +#undef HAVE_PREAD64 + /* Define if exists and defines struct link_map which has members with an ``l_'' prefix. (For Solaris, SVR4, and SVR4-like systems.) */ diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index 8aa4602..ef6876d 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -733,132 +733,6 @@ 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) -]) dnl sinclude(../gettext.m4) already included by bfd/acinclude.m4 dnl The lines below arrange for aclocal not to bring gettext.m4's diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 index 8701621..4ac2651 100644 --- a/gdb/aclocal.m4 +++ b/gdb/aclocal.m4 @@ -745,132 +745,6 @@ 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) -]) dnl sinclude(../gettext.m4) already included by bfd/acinclude.m4 dnl The lines below arrange for aclocal not to bring gettext.m4's diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 99abad6..23c8827 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3542,7 +3542,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); } - frame = selected_frame; + frame = deprecated_selected_frame; while (frame != NULL && ndefns == 0) { struct block *block; @@ -4973,17 +4973,7 @@ find_printable_frame (struct frame_info *fi, int level) for (; fi != NULL; level += 1, fi = get_prev_frame (fi)) { - /* If fi is not the innermost frame, that normally means that fi->pc - points to *after* the call instruction, and we want to get the line - containing the call, never the next line. But if the next frame is - a signal_handler_caller or a dummy frame, then the next frame was - not entered as the result of a call, and we want to get the line - containing fi->pc. */ - sal = - find_pc_line (fi->pc, - fi->next != NULL - && !fi->next->signal_handler_caller - && !deprecated_frame_in_dummy (fi->next)); + find_frame_sal (fi, &sal); if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename)) { #if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) @@ -4994,7 +4984,7 @@ find_printable_frame (struct frame_info *fi, int level) STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so")) continue; #endif - selected_frame = fi; + deprecated_selected_frame = fi; break; } } diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 2e6bff3..ad67cba 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -795,10 +795,10 @@ task_command (char *tidstr, int from_tty) { /* FIXME: find_printable_frame should be defined in frame.h, and implemented in ada-lang.c */ - /* find_printable_frame (selected_frame, frame_relative_level (selected_frame)); */ + /* find_printable_frame (deprecated_selected_frame, frame_relative_level (deprecated_selected_frame)); */ printf_filtered ("[Switching to task %d]\n", num); - print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } else printf_filtered ("Unable to switch to task %d\n", num); diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c index 4596d37..26f4db4 100644 --- a/gdb/alpha-linux-tdep.c +++ b/gdb/alpha-linux-tdep.c @@ -116,6 +116,6 @@ alpha_linux_init_abi (struct gdbarch_info info, void _initialize_alpha_linux_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_LINUX, + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_LINUX, alpha_linux_init_abi); } diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index 6d7a3d6..f315508 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_string.h" #include "inferior.h" #include "gdbcore.h" #include "target.h" diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c index ece5e26..c170a37 100644 --- a/gdb/alpha-osf1-tdep.c +++ b/gdb/alpha-osf1-tdep.c @@ -73,5 +73,6 @@ alpha_osf1_init_abi (struct gdbarch_info info, void _initialize_alpha_osf1_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_OSF1, alpha_osf1_init_abi); + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1, + alpha_osf1_init_abi); } diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 5ff21f0..ed4be14 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -74,7 +74,6 @@ static gdbarch_push_arguments_ftype alpha_push_arguments; static gdbarch_push_dummy_frame_ftype alpha_push_dummy_frame; static gdbarch_pop_frame_ftype alpha_pop_frame; static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy; -static gdbarch_init_frame_pc_first_ftype alpha_init_frame_pc_first; static gdbarch_init_extra_frame_info_ftype alpha_init_extra_frame_info; static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target; @@ -378,7 +377,7 @@ alpha_find_saved_regs (struct frame_info *frame) #define SIGFRAME_REGSAVE_OFF (4 * 8) #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_REGSAVE_OFF + 32 * 8 + 8) #endif - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) { CORE_ADDR sigcontext_addr; @@ -458,11 +457,12 @@ alpha_frame_init_saved_regs (struct frame_info *fi) fi->saved_regs[SP_REGNUM] = fi->frame; } -static void +static CORE_ADDR alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev) { - prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : - prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); + return (fromleaf ? SAVED_PC_AFTER_CALL (get_next_frame (prev)) + : get_next_frame (prev) ? FRAME_SAVED_PC (prev->next) + : read_pc ()); } static CORE_ADDR @@ -472,7 +472,7 @@ read_next_frame_reg (struct frame_info *fi, int regno) { /* We have to get the saved sp from the sigcontext if it is a signal handler frame. */ - if (regno == SP_REGNUM && !fi->signal_handler_caller) + if (regno == SP_REGNUM && !(get_frame_type (fi) == SIGTRAMP_FRAME)) return fi->frame; else { @@ -491,7 +491,7 @@ alpha_frame_saved_pc (struct frame_info *frame) alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc; /* We have to get the saved pc from the sigcontext if it is a signal handler frame. */ - int pcreg = frame->signal_handler_caller ? PC_REGNUM + int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM : frame->extra_info->pc_reg; if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc)) @@ -516,7 +516,7 @@ alpha_saved_pc_after_call (struct frame_info *frame) proc_desc = find_proc_desc (pc, frame->next); pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM; - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return alpha_frame_saved_pc (frame); else return read_register (pcreg); @@ -823,7 +823,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame) So we have to find the proc_desc whose frame is closest to the current stack pointer. */ - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) { struct linked_proc_info *link; CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM); @@ -957,7 +957,7 @@ alpha_frame_chain (struct frame_info *frame) && PROC_FRAME_OFFSET (proc_desc) == 0 /* The previous frame from a sigtramp frame might be frameless and have frame size zero. */ - && !frame->signal_handler_caller) + && !(get_frame_type (frame) == SIGTRAMP_FRAME)) return alpha_frame_past_sigtramp_frame (frame, saved_pc); else return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc)) @@ -1020,8 +1020,12 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame) char *name; /* Do not set the saved registers for a sigtramp frame, - alpha_find_saved_registers will do that for us. - We can't use frame->signal_handler_caller, it is not yet set. */ + alpha_find_saved_registers will do that for us. We can't + use (get_frame_type (frame) == SIGTRAMP_FRAME), it is not + yet set. */ + /* FIXME: cagney/2002-11-18: This problem will go away once + frame.c:get_prev_frame() is modified to set the frame's + type before calling functions like this. */ find_pc_partial_function (frame->pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); if (!PC_IN_SIGTRAMP (frame->pc, name)) @@ -1866,7 +1870,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) alpha_extract_struct_value_address); /* Settings for calling functions in the inferior. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_push_arguments (gdbarch, alpha_push_arguments); set_gdbarch_pop_frame (gdbarch, alpha_pop_frame); @@ -1885,17 +1889,16 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Alpha OSF/1 inhibits execution of code on the stack. But there is no need for a dummy on the Alpha. PUSH_ARGUMENTS takes care of all argument handling and bp_call_dummy takes care of stopping the dummy. */ - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy); - set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop); - set_gdbarch_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first); + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); + set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c index f8f515d..6af3b4d 100644 --- a/gdb/alphafbsd-tdep.c +++ b/gdb/alphafbsd-tdep.c @@ -78,6 +78,6 @@ alphafbsd_init_abi (struct gdbarch_info info, void _initialize_alphafbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_FREEBSD_ELF, alphafbsd_init_abi); } diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c index bc7b1a4..e09b945 100644 --- a/gdb/alphanbsd-tdep.c +++ b/gdb/alphanbsd-tdep.c @@ -232,7 +232,7 @@ alphanbsd_init_abi (struct gdbarch_info info, void _initialize_alphanbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF, alphanbsd_init_abi); add_core_fns (&alphanbsd_core_fns); diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c deleted file mode 100644 index 5c44915..0000000 --- a/gdb/arc-tdep.c +++ /dev/null @@ -1,738 +0,0 @@ -// OBSOLETE /* ARC target-dependent stuff. -// OBSOLETE Copyright 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "floatformat.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "gdbcmd.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE -// OBSOLETE /* Local functions */ -// OBSOLETE -// OBSOLETE static int arc_set_cpu_type (char *str); -// OBSOLETE -// OBSOLETE /* Current CPU, set with the "set cpu" command. */ -// OBSOLETE static int arc_bfd_mach_type; -// OBSOLETE char *arc_cpu_type; -// OBSOLETE char *tmp_arc_cpu_type; -// OBSOLETE -// OBSOLETE /* Table of cpu names. */ -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE char *name; -// OBSOLETE int value; -// OBSOLETE } -// OBSOLETE arc_cpu_type_table[] = -// OBSOLETE { -// OBSOLETE { "arc5", bfd_mach_arc_5 }, -// OBSOLETE { "arc6", bfd_mach_arc_6 }, -// OBSOLETE { "arc7", bfd_mach_arc_7 }, -// OBSOLETE { "arc8", bfd_mach_arc_8 }, -// OBSOLETE { NULL, 0 } -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Used by simulator. */ -// OBSOLETE int display_pipeline_p; -// OBSOLETE int cpu_timer; -// OBSOLETE /* This one must have the same type as used in the emulator. -// OBSOLETE It's currently an enum so this should be ok for now. */ -// OBSOLETE int debug_pipeline_p; -// OBSOLETE -// OBSOLETE #define ARC_CALL_SAVED_REG(r) ((r) >= 16 && (r) < 24) -// OBSOLETE -// OBSOLETE #define OPMASK 0xf8000000 -// OBSOLETE -// OBSOLETE /* Instruction field accessor macros. -// OBSOLETE See the Programmer's Reference Manual. */ -// OBSOLETE #define X_OP(i) (((i) >> 27) & 0x1f) -// OBSOLETE #define X_A(i) (((i) >> 21) & 0x3f) -// OBSOLETE #define X_B(i) (((i) >> 15) & 0x3f) -// OBSOLETE #define X_C(i) (((i) >> 9) & 0x3f) -// OBSOLETE #define X_D(i) ((((i) & 0x1ff) ^ 0x100) - 0x100) -// OBSOLETE #define X_L(i) (((((i) >> 5) & 0x3ffffc) ^ 0x200000) - 0x200000) -// OBSOLETE #define X_N(i) (((i) >> 5) & 3) -// OBSOLETE #define X_Q(i) ((i) & 0x1f) -// OBSOLETE -// OBSOLETE /* Return non-zero if X is a short immediate data indicator. */ -// OBSOLETE #define SHIMM_P(x) ((x) == 61 || (x) == 63) -// OBSOLETE -// OBSOLETE /* Return non-zero if X is a "long" (32 bit) immediate data indicator. */ -// OBSOLETE #define LIMM_P(x) ((x) == 62) -// OBSOLETE -// OBSOLETE /* Build a simple instruction. */ -// OBSOLETE #define BUILD_INSN(op, a, b, c, d) \ -// OBSOLETE ((((op) & 31) << 27) \ -// OBSOLETE | (((a) & 63) << 21) \ -// OBSOLETE | (((b) & 63) << 15) \ -// OBSOLETE | (((c) & 63) << 9) \ -// OBSOLETE | ((d) & 511)) -// OBSOLETE -// OBSOLETE /* Codestream stuff. */ -// OBSOLETE static void codestream_read (unsigned int *, int); -// OBSOLETE static void codestream_seek (CORE_ADDR); -// OBSOLETE static unsigned int codestream_fill (int); -// OBSOLETE -// OBSOLETE #define CODESTREAM_BUFSIZ 16 -// OBSOLETE static CORE_ADDR codestream_next_addr; -// OBSOLETE static CORE_ADDR codestream_addr; -// OBSOLETE /* FIXME assumes sizeof (int) == 32? */ -// OBSOLETE static unsigned int codestream_buf[CODESTREAM_BUFSIZ]; -// OBSOLETE static int codestream_off; -// OBSOLETE static int codestream_cnt; -// OBSOLETE -// OBSOLETE #define codestream_tell() \ -// OBSOLETE (codestream_addr + codestream_off * sizeof (codestream_buf[0])) -// OBSOLETE #define codestream_peek() \ -// OBSOLETE (codestream_cnt == 0 \ -// OBSOLETE ? codestream_fill (1) \ -// OBSOLETE : codestream_buf[codestream_off]) -// OBSOLETE #define codestream_get() \ -// OBSOLETE (codestream_cnt-- == 0 \ -// OBSOLETE ? codestream_fill (0) \ -// OBSOLETE : codestream_buf[codestream_off++]) -// OBSOLETE -// OBSOLETE static unsigned int -// OBSOLETE codestream_fill (int peek_flag) -// OBSOLETE { -// OBSOLETE codestream_addr = codestream_next_addr; -// OBSOLETE codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]); -// OBSOLETE codestream_off = 0; -// OBSOLETE codestream_cnt = CODESTREAM_BUFSIZ; -// OBSOLETE read_memory (codestream_addr, (char *) codestream_buf, -// OBSOLETE CODESTREAM_BUFSIZ * sizeof (codestream_buf[0])); -// OBSOLETE /* FIXME: check return code? */ -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Handle byte order differences -> convert to host byte ordering. */ -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE for (i = 0; i < CODESTREAM_BUFSIZ; i++) -// OBSOLETE codestream_buf[i] = -// OBSOLETE extract_unsigned_integer (&codestream_buf[i], -// OBSOLETE sizeof (codestream_buf[i])); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (peek_flag) -// OBSOLETE return codestream_peek (); -// OBSOLETE else -// OBSOLETE return codestream_get (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE codestream_seek (CORE_ADDR place) -// OBSOLETE { -// OBSOLETE codestream_next_addr = place / CODESTREAM_BUFSIZ; -// OBSOLETE codestream_next_addr *= CODESTREAM_BUFSIZ; -// OBSOLETE codestream_cnt = 0; -// OBSOLETE codestream_fill (1); -// OBSOLETE while (codestream_tell () != place) -// OBSOLETE codestream_get (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* This function is currently unused but leave in for now. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE codestream_read (unsigned int *buf, int count) -// OBSOLETE { -// OBSOLETE unsigned int *p; -// OBSOLETE int i; -// OBSOLETE p = buf; -// OBSOLETE for (i = 0; i < count; i++) -// OBSOLETE *p++ = codestream_get (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Set up prologue scanning and return the first insn. */ -// OBSOLETE -// OBSOLETE static unsigned int -// OBSOLETE setup_prologue_scan (CORE_ADDR pc) -// OBSOLETE { -// OBSOLETE unsigned int insn; -// OBSOLETE -// OBSOLETE codestream_seek (pc); -// OBSOLETE insn = codestream_get (); -// OBSOLETE -// OBSOLETE return insn; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Find & return amount a local space allocated, and advance codestream to -// OBSOLETE * first register push (if any). -// OBSOLETE * If entry sequence doesn't make sense, return -1, and leave -// OBSOLETE * codestream pointer random. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static long -// OBSOLETE arc_get_frame_setup (CORE_ADDR pc) -// OBSOLETE { -// OBSOLETE unsigned int insn; -// OBSOLETE /* Size of frame or -1 if unrecognizable prologue. */ -// OBSOLETE int frame_size = -1; -// OBSOLETE /* An initial "sub sp,sp,N" may or may not be for a stdarg fn. */ -// OBSOLETE int maybe_stdarg_decr = -1; -// OBSOLETE -// OBSOLETE insn = setup_prologue_scan (pc); -// OBSOLETE -// OBSOLETE /* The authority for what appears here is the home-grown ABI. -// OBSOLETE The most recent version is 1.2. */ -// OBSOLETE -// OBSOLETE /* First insn may be "sub sp,sp,N" if stdarg fn. */ -// OBSOLETE if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) -// OBSOLETE == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0)) -// OBSOLETE { -// OBSOLETE maybe_stdarg_decr = X_D (insn); -// OBSOLETE insn = codestream_get (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */ -// OBSOLETE == BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4)) -// OBSOLETE { -// OBSOLETE insn = codestream_get (); -// OBSOLETE /* Frame may not be necessary, even though blink is saved. -// OBSOLETE At least this is something we recognize. */ -// OBSOLETE frame_size = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */ -// OBSOLETE == BUILD_INSN (2, 0, SP_REGNUM, FP_REGNUM, 0)) -// OBSOLETE { -// OBSOLETE insn = codestream_get (); -// OBSOLETE if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) -// OBSOLETE != BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0)) -// OBSOLETE return -1; -// OBSOLETE -// OBSOLETE /* Check for stack adjustment sub sp,sp,N. */ -// OBSOLETE insn = codestream_peek (); -// OBSOLETE if ((insn & BUILD_INSN (-1, -1, -1, 0, 0)) -// OBSOLETE == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, 0, 0)) -// OBSOLETE { -// OBSOLETE if (LIMM_P (X_C (insn))) -// OBSOLETE frame_size = codestream_get (); -// OBSOLETE else if (SHIMM_P (X_C (insn))) -// OBSOLETE frame_size = X_D (insn); -// OBSOLETE else -// OBSOLETE return -1; -// OBSOLETE if (frame_size < 0) -// OBSOLETE return -1; -// OBSOLETE -// OBSOLETE codestream_get (); -// OBSOLETE -// OBSOLETE /* This sequence is used to get the address of the return -// OBSOLETE buffer for a function that returns a structure. */ -// OBSOLETE insn = codestream_peek (); -// OBSOLETE if ((insn & OPMASK) == 0x60000000) -// OBSOLETE codestream_get (); -// OBSOLETE } -// OBSOLETE /* Frameless fn. */ -// OBSOLETE else -// OBSOLETE { -// OBSOLETE frame_size = 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If we found a "sub sp,sp,N" and nothing else, it may or may not be a -// OBSOLETE stdarg fn. The stdarg decrement is not treated as part of the frame size, -// OBSOLETE so we have a dilemma: what do we return? For now, if we get a -// OBSOLETE "sub sp,sp,N" and nothing else assume this isn't a stdarg fn. One way -// OBSOLETE to fix this completely would be to add a bit to the function descriptor -// OBSOLETE that says the function is a stdarg function. */ -// OBSOLETE -// OBSOLETE if (frame_size < 0 && maybe_stdarg_decr > 0) -// OBSOLETE return maybe_stdarg_decr; -// OBSOLETE return frame_size; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given a pc value, skip it forward past the function prologue by -// OBSOLETE disassembling instructions that appear to be a prologue. -// OBSOLETE -// OBSOLETE If FRAMELESS_P is set, we are only testing to see if the function -// OBSOLETE is frameless. If it is a frameless function, return PC unchanged. -// OBSOLETE This allows a quicker answer. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE arc_skip_prologue (CORE_ADDR pc, int frameless_p) -// OBSOLETE { -// OBSOLETE unsigned int insn; -// OBSOLETE int i, frame_size; -// OBSOLETE -// OBSOLETE if ((frame_size = arc_get_frame_setup (pc)) < 0) -// OBSOLETE return (pc); -// OBSOLETE -// OBSOLETE if (frameless_p) -// OBSOLETE return frame_size == 0 ? pc : codestream_tell (); -// OBSOLETE -// OBSOLETE /* Skip over register saves. */ -// OBSOLETE for (i = 0; i < 8; i++) -// OBSOLETE { -// OBSOLETE insn = codestream_peek (); -// OBSOLETE if ((insn & BUILD_INSN (-1, 0, -1, 0, 0)) -// OBSOLETE != BUILD_INSN (2, 0, SP_REGNUM, 0, 0)) -// OBSOLETE break; /* not st insn */ -// OBSOLETE if (!ARC_CALL_SAVED_REG (X_C (insn))) -// OBSOLETE break; -// OBSOLETE codestream_get (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return codestream_tell (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Is the prologue at PC frameless? */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE arc_prologue_frameless_p (CORE_ADDR pc) -// OBSOLETE { -// OBSOLETE return (pc == arc_skip_prologue (pc, 1)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the return address for a frame. -// OBSOLETE This is used to implement FRAME_SAVED_PC. -// OBSOLETE This is taken from frameless_look_for_prologue. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE arc_frame_saved_pc (struct frame_info *frame) -// OBSOLETE { -// OBSOLETE CORE_ADDR func_start; -// OBSOLETE unsigned int insn; -// OBSOLETE -// OBSOLETE func_start = get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET; -// OBSOLETE if (func_start == 0) -// OBSOLETE { -// OBSOLETE /* Best guess. */ -// OBSOLETE return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The authority for what appears here is the home-grown ABI. -// OBSOLETE The most recent version is 1.2. */ -// OBSOLETE -// OBSOLETE insn = setup_prologue_scan (func_start); -// OBSOLETE -// OBSOLETE /* First insn may be "sub sp,sp,N" if stdarg fn. */ -// OBSOLETE if ((insn & BUILD_INSN (-1, -1, -1, -1, 0)) -// OBSOLETE == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0)) -// OBSOLETE insn = codestream_get (); -// OBSOLETE -// OBSOLETE /* If the next insn is "st blink,[sp,4]" we can get blink from there. -// OBSOLETE Otherwise this is a leaf function and we can use blink. Note that -// OBSOLETE this still allows for the case where a leaf function saves/clobbers/ -// OBSOLETE restores blink. */ -// OBSOLETE -// OBSOLETE if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */ -// OBSOLETE != BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4)) -// OBSOLETE return ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM)); -// OBSOLETE else -// OBSOLETE return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Parse the first few instructions of the function to see -// OBSOLETE * what registers were stored. -// OBSOLETE * -// OBSOLETE * The startup sequence can be at the start of the function. -// OBSOLETE * 'st blink,[sp+4], st fp,[sp], mov fp,sp' -// OBSOLETE * -// OBSOLETE * Local space is allocated just below by sub sp,sp,nnn. -// OBSOLETE * Next, the registers used by this function are stored (as offsets from sp). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp) -// OBSOLETE { -// OBSOLETE long locals; -// OBSOLETE unsigned int insn; -// OBSOLETE CORE_ADDR dummy_bottom; -// OBSOLETE CORE_ADDR adr; -// OBSOLETE int i, regnum, offset; -// OBSOLETE -// OBSOLETE memset (fsrp, 0, sizeof *fsrp); -// OBSOLETE -// OBSOLETE /* If frame is the end of a dummy, compute where the beginning would be. */ -// OBSOLETE dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH; -// OBSOLETE -// OBSOLETE /* Check if the PC is in the stack, in a dummy frame. */ -// OBSOLETE if (dummy_bottom <= fip->pc && fip->pc <= fip->frame) -// OBSOLETE { -// OBSOLETE /* all regs were saved by push_call_dummy () */ -// OBSOLETE adr = fip->frame; -// OBSOLETE for (i = 0; i < NUM_REGS; i++) -// OBSOLETE { -// OBSOLETE adr -= REGISTER_RAW_SIZE (i); -// OBSOLETE fsrp->regs[i] = adr; -// OBSOLETE } -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE locals = arc_get_frame_setup (get_pc_function_start (fip->pc)); -// OBSOLETE -// OBSOLETE if (locals >= 0) -// OBSOLETE { -// OBSOLETE /* Set `adr' to the value of `sp'. */ -// OBSOLETE adr = fip->frame - locals; -// OBSOLETE for (i = 0; i < 8; i++) -// OBSOLETE { -// OBSOLETE insn = codestream_get (); -// OBSOLETE if ((insn & BUILD_INSN (-1, 0, -1, 0, 0)) -// OBSOLETE != BUILD_INSN (2, 0, SP_REGNUM, 0, 0)) -// OBSOLETE break; -// OBSOLETE regnum = X_C (insn); -// OBSOLETE offset = X_D (insn); -// OBSOLETE fsrp->regs[regnum] = adr + offset; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE fsrp->regs[PC_REGNUM] = fip->frame + 4; -// OBSOLETE fsrp->regs[FP_REGNUM] = fip->frame; -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE arc_push_dummy_frame (void) -// OBSOLETE { -// OBSOLETE CORE_ADDR sp = read_register (SP_REGNUM); -// OBSOLETE int regnum; -// OBSOLETE char regbuf[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE -// OBSOLETE read_register_gen (PC_REGNUM, regbuf); -// OBSOLETE write_memory (sp + 4, regbuf, REGISTER_SIZE); -// OBSOLETE read_register_gen (FP_REGNUM, regbuf); -// OBSOLETE write_memory (sp, regbuf, REGISTER_SIZE); -// OBSOLETE write_register (FP_REGNUM, sp); -// OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++) -// OBSOLETE { -// OBSOLETE read_register_gen (regnum, regbuf); -// OBSOLETE sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum)); -// OBSOLETE } -// OBSOLETE sp += (2 * REGISTER_SIZE); -// OBSOLETE write_register (SP_REGNUM, sp); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE arc_pop_frame (void) -// OBSOLETE { -// OBSOLETE struct frame_info *frame = get_current_frame (); -// OBSOLETE CORE_ADDR fp; -// OBSOLETE int regnum; -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE char regbuf[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE -// OBSOLETE fp = FRAME_FP (frame); -// OBSOLETE get_frame_saved_regs (frame, &fsr); -// OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++) -// OBSOLETE { -// OBSOLETE CORE_ADDR adr; -// OBSOLETE adr = fsr.regs[regnum]; -// OBSOLETE if (adr) -// OBSOLETE { -// OBSOLETE read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum)); -// OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), regbuf, -// OBSOLETE REGISTER_RAW_SIZE (regnum)); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp, 4)); -// OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); -// OBSOLETE write_register (SP_REGNUM, fp + 8); -// OBSOLETE flush_cached_frames (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Simulate single-step. */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE NORMAL4, /* a normal 4 byte insn */ -// OBSOLETE NORMAL8, /* a normal 8 byte insn */ -// OBSOLETE BRANCH4, /* a 4 byte branch insn, including ones without delay slots */ -// OBSOLETE BRANCH8, /* an 8 byte branch insn, including ones with delay slots */ -// OBSOLETE } -// OBSOLETE insn_type; -// OBSOLETE -// OBSOLETE /* Return the type of INSN and store in TARGET the destination address of a -// OBSOLETE branch if this is one. */ -// OBSOLETE /* ??? Need to verify all cases are properly handled. */ -// OBSOLETE -// OBSOLETE static insn_type -// OBSOLETE get_insn_type (unsigned long insn, CORE_ADDR pc, CORE_ADDR *target) -// OBSOLETE { -// OBSOLETE unsigned long limm; -// OBSOLETE -// OBSOLETE switch (insn >> 27) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE case 1: -// OBSOLETE case 2: /* load/store insns */ -// OBSOLETE if (LIMM_P (X_A (insn)) -// OBSOLETE || LIMM_P (X_B (insn)) -// OBSOLETE || LIMM_P (X_C (insn))) -// OBSOLETE return NORMAL8; -// OBSOLETE return NORMAL4; -// OBSOLETE case 4: -// OBSOLETE case 5: -// OBSOLETE case 6: /* branch insns */ -// OBSOLETE *target = pc + 4 + X_L (insn); -// OBSOLETE /* ??? It isn't clear that this is always the right answer. -// OBSOLETE The problem occurs when the next insn is an 8 byte insn. If the -// OBSOLETE branch is conditional there's no worry as there shouldn't be an 8 -// OBSOLETE byte insn following. The programmer may be cheating if s/he knows -// OBSOLETE the branch will never be taken, but we don't deal with that. -// OBSOLETE Note that the programmer is also allowed to play games by putting -// OBSOLETE an insn with long immediate data in the delay slot and then duplicate -// OBSOLETE the long immediate data at the branch target. Ugh! */ -// OBSOLETE if (X_N (insn) == 0) -// OBSOLETE return BRANCH4; -// OBSOLETE return BRANCH8; -// OBSOLETE case 7: /* jump insns */ -// OBSOLETE if (LIMM_P (X_B (insn))) -// OBSOLETE { -// OBSOLETE limm = read_memory_integer (pc + 4, 4); -// OBSOLETE *target = ARC_PC_TO_REAL_ADDRESS (limm); -// OBSOLETE return BRANCH8; -// OBSOLETE } -// OBSOLETE if (SHIMM_P (X_B (insn))) -// OBSOLETE *target = ARC_PC_TO_REAL_ADDRESS (X_D (insn)); -// OBSOLETE else -// OBSOLETE *target = ARC_PC_TO_REAL_ADDRESS (read_register (X_B (insn))); -// OBSOLETE if (X_Q (insn) == 0 && X_N (insn) == 0) -// OBSOLETE return BRANCH4; -// OBSOLETE return BRANCH8; -// OBSOLETE default: /* arithmetic insns, etc. */ -// OBSOLETE if (LIMM_P (X_A (insn)) -// OBSOLETE || LIMM_P (X_B (insn)) -// OBSOLETE || LIMM_P (X_C (insn))) -// OBSOLETE return NORMAL8; -// OBSOLETE return NORMAL4; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* single_step() is called just before we want to resume the inferior, if we -// OBSOLETE want to single-step it but there is no hardware or kernel single-step -// OBSOLETE support. We find all the possible targets of the coming instruction and -// OBSOLETE breakpoint them. -// OBSOLETE -// OBSOLETE single_step is also called just after the inferior stops. If we had -// OBSOLETE set up a simulated single-step, we undo our damage. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE arc_software_single_step (enum target_signal ignore, /* sig but we don't need it */ -// OBSOLETE int insert_breakpoints_p) -// OBSOLETE { -// OBSOLETE static CORE_ADDR next_pc, target; -// OBSOLETE static int brktrg_p; -// OBSOLETE typedef char binsn_quantum[BREAKPOINT_MAX]; -// OBSOLETE static binsn_quantum break_mem[2]; -// OBSOLETE -// OBSOLETE if (insert_breakpoints_p) -// OBSOLETE { -// OBSOLETE insn_type type; -// OBSOLETE CORE_ADDR pc; -// OBSOLETE unsigned long insn; -// OBSOLETE -// OBSOLETE pc = read_register (PC_REGNUM); -// OBSOLETE insn = read_memory_integer (pc, 4); -// OBSOLETE type = get_insn_type (insn, pc, &target); -// OBSOLETE -// OBSOLETE /* Always set a breakpoint for the insn after the branch. */ -// OBSOLETE next_pc = pc + ((type == NORMAL8 || type == BRANCH8) ? 8 : 4); -// OBSOLETE target_insert_breakpoint (next_pc, break_mem[0]); -// OBSOLETE -// OBSOLETE brktrg_p = 0; -// OBSOLETE -// OBSOLETE if ((type == BRANCH4 || type == BRANCH8) -// OBSOLETE /* Watch out for branches to the following location. -// OBSOLETE We just stored a breakpoint there and another call to -// OBSOLETE target_insert_breakpoint will think the real insn is the -// OBSOLETE breakpoint we just stored there. */ -// OBSOLETE && target != next_pc) -// OBSOLETE { -// OBSOLETE brktrg_p = 1; -// OBSOLETE target_insert_breakpoint (target, break_mem[1]); -// OBSOLETE } -// OBSOLETE -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Remove breakpoints. */ -// OBSOLETE target_remove_breakpoint (next_pc, break_mem[0]); -// OBSOLETE -// OBSOLETE if (brktrg_p) -// OBSOLETE target_remove_breakpoint (target, break_mem[1]); -// OBSOLETE -// OBSOLETE /* Fix the pc. */ -// OBSOLETE stop_pc -= DECR_PC_AFTER_BREAK; -// OBSOLETE write_pc (stop_pc); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test -// OBSOLETE for a definition of JB_PC. */ -// OBSOLETE #ifdef JB_PC -// OBSOLETE /* Figure out where the longjmp will land. Slurp the args out of the stack. -// OBSOLETE We expect the first arg to be a pointer to the jmp_buf structure from which -// OBSOLETE we extract the pc (JB_PC) that we will land at. The pc is copied into PC. -// OBSOLETE This routine returns true on success. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE get_longjmp_target (CORE_ADDR *pc) -// OBSOLETE { -// OBSOLETE char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; -// OBSOLETE CORE_ADDR sp, jb_addr; -// OBSOLETE -// OBSOLETE sp = read_register (SP_REGNUM); -// OBSOLETE -// OBSOLETE if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */ -// OBSOLETE buf, -// OBSOLETE TARGET_PTR_BIT / TARGET_CHAR_BIT)) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); -// OBSOLETE -// OBSOLETE if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, -// OBSOLETE TARGET_PTR_BIT / TARGET_CHAR_BIT)) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); -// OBSOLETE -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE #endif /* GET_LONGJMP_TARGET */ -// OBSOLETE -// OBSOLETE /* Disassemble one instruction. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE arc_print_insn (bfd_vma vma, disassemble_info *info) -// OBSOLETE { -// OBSOLETE static int current_mach; -// OBSOLETE static int current_endian; -// OBSOLETE static disassembler_ftype current_disasm; -// OBSOLETE -// OBSOLETE if (current_disasm == NULL -// OBSOLETE || arc_bfd_mach_type != current_mach -// OBSOLETE || TARGET_BYTE_ORDER != current_endian) -// OBSOLETE { -// OBSOLETE current_mach = arc_bfd_mach_type; -// OBSOLETE current_endian = TARGET_BYTE_ORDER; -// OBSOLETE current_disasm = arc_get_disassembler (NULL); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (*current_disasm) (vma, info); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Command to set cpu type. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE arc_set_cpu_type_command (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE if (tmp_arc_cpu_type == NULL || *tmp_arc_cpu_type == '\0') -// OBSOLETE { -// OBSOLETE printf_unfiltered ("The known ARC cpu types are as follows:\n"); -// OBSOLETE for (i = 0; arc_cpu_type_table[i].name != NULL; ++i) -// OBSOLETE printf_unfiltered ("%s\n", arc_cpu_type_table[i].name); -// OBSOLETE -// OBSOLETE /* Restore the value. */ -// OBSOLETE tmp_arc_cpu_type = xstrdup (arc_cpu_type); -// OBSOLETE -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (!arc_set_cpu_type (tmp_arc_cpu_type)) -// OBSOLETE { -// OBSOLETE error ("Unknown cpu type `%s'.", tmp_arc_cpu_type); -// OBSOLETE /* Restore its value. */ -// OBSOLETE tmp_arc_cpu_type = xstrdup (arc_cpu_type); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE arc_show_cpu_type_command (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Modify the actual cpu type. -// OBSOLETE Result is a boolean indicating success. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE arc_set_cpu_type (char *str) -// OBSOLETE { -// OBSOLETE int i, j; -// OBSOLETE -// OBSOLETE if (str == NULL) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE for (i = 0; arc_cpu_type_table[i].name != NULL; ++i) -// OBSOLETE { -// OBSOLETE if (strcasecmp (str, arc_cpu_type_table[i].name) == 0) -// OBSOLETE { -// OBSOLETE arc_cpu_type = str; -// OBSOLETE arc_bfd_mach_type = arc_cpu_type_table[i].value; -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_arc_tdep (void) -// OBSOLETE { -// OBSOLETE struct cmd_list_element *c; -// OBSOLETE -// OBSOLETE c = add_set_cmd ("cpu", class_support, var_string_noescape, -// OBSOLETE (char *) &tmp_arc_cpu_type, -// OBSOLETE "Set the type of ARC cpu in use.\n\ -// OBSOLETE This command has two purposes. In a multi-cpu system it lets one\n\ -// OBSOLETE change the cpu being debugged. It also gives one access to\n\ -// OBSOLETE cpu-type-specific registers and recognize cpu-type-specific instructions.\ -// OBSOLETE ", -// OBSOLETE &setlist); -// OBSOLETE set_cmd_cfunc (c, arc_set_cpu_type_command); -// OBSOLETE c = add_show_from_set (c, &showlist); -// OBSOLETE set_cmd_cfunc (c, arc_show_cpu_type_command); -// OBSOLETE -// OBSOLETE /* We have to use xstrdup() here because the `set' command frees it -// OBSOLETE before setting a new value. */ -// OBSOLETE tmp_arc_cpu_type = xstrdup (DEFAULT_ARC_CPU_TYPE); -// OBSOLETE arc_set_cpu_type (tmp_arc_cpu_type); -// OBSOLETE -// OBSOLETE c = add_set_cmd ("displaypipeline", class_support, var_zinteger, -// OBSOLETE (char *) &display_pipeline_p, -// OBSOLETE "Set pipeline display (simulator only).\n\ -// OBSOLETE When enabled, the state of the pipeline after each cycle is displayed.", -// OBSOLETE &setlist); -// OBSOLETE c = add_show_from_set (c, &showlist); -// OBSOLETE -// OBSOLETE c = add_set_cmd ("debugpipeline", class_support, var_zinteger, -// OBSOLETE (char *) &debug_pipeline_p, -// OBSOLETE "Set pipeline debug display (simulator only).\n\ -// OBSOLETE When enabled, debugging information about the pipeline is displayed.", -// OBSOLETE &setlist); -// OBSOLETE c = add_show_from_set (c, &showlist); -// OBSOLETE -// OBSOLETE c = add_set_cmd ("cputimer", class_support, var_zinteger, -// OBSOLETE (char *) &cpu_timer, -// OBSOLETE "Set maximum cycle count (simulator only).\n\ -// OBSOLETE Control will return to gdb if the timer expires.\n\ -// OBSOLETE A negative value disables the timer.", -// OBSOLETE &setlist); -// OBSOLETE c = add_show_from_set (c, &showlist); -// OBSOLETE -// OBSOLETE tm_print_insn = arc_print_insn; -// OBSOLETE } diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 732c40b..de3d284 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -313,13 +313,6 @@ no_op_reg_to_regnum (int reg) return reg; } -/* For use by frame_args_address and frame_locals_address. */ -CORE_ADDR -default_frame_address (struct frame_info *fi) -{ - return fi->frame; -} - /* Default prepare_to_procced(). */ int default_prepare_to_proceed (int select_it) @@ -380,21 +373,22 @@ generic_prepare_to_proceed (int select_it) } -void +CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev) { - return; + /* Do nothing, implies return the same PC value. */ + return get_frame_pc (prev); } -void +CORE_ADDR init_frame_pc_default (int fromleaf, struct frame_info *prev) { if (fromleaf) - prev->pc = SAVED_PC_AFTER_CALL (prev->next); - else if (prev->next != NULL) - prev->pc = FRAME_SAVED_PC (prev->next); + return SAVED_PC_AFTER_CALL (get_next_frame (prev)); + else if (get_next_frame (prev) != NULL) + return FRAME_SAVED_PC (get_next_frame (prev)); else - prev->pc = read_pc (); + return read_pc (); } void diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 91aa2f8..3452fc8 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -109,10 +109,6 @@ extern CORE_ADDR core_addr_identity (CORE_ADDR addr); extern int no_op_reg_to_regnum (int reg); -/* Default frame_args_address and frame_locals_address. */ - -extern CORE_ADDR default_frame_address (struct frame_info *); - /* Default prepare_to_procced. */ extern int default_prepare_to_proceed (int select_it); @@ -121,9 +117,9 @@ extern int generic_prepare_to_proceed (int select_it); /* Versions of init_frame_pc(). Do nothing; do the default. */ -void init_frame_pc_noop (int fromleaf, struct frame_info *prev); +extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); -void init_frame_pc_default (int fromleaf, struct frame_info *prev); +extern CORE_ADDR init_frame_pc_default (int fromleaf, struct frame_info *prev); /* Do nothing version of elf_make_msymbol_special. */ diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index cb930b6..627ed8d 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -543,5 +543,6 @@ arm_linux_init_abi (struct gdbarch_info info, void _initialize_arm_linux_tdep (void) { - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_LINUX, arm_linux_init_abi); + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_LINUX, + arm_linux_init_abi); } diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 2adce63..3543cc1 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -131,7 +131,10 @@ static void set_disassembly_flavor_sfunc(char *, int, struct cmd_list_element *); static void set_disassembly_flavor (void); -static void convert_from_extended (void *ptr, void *dbl); +static void convert_from_extended (const struct floatformat *, const void *, + void *); +static void convert_to_extended (const struct floatformat *, void *, + const void *); /* Define other aspects of the stack frame. We keep the offsets of all saved registers, 'cause we need 'em a lot! We also keep the @@ -215,7 +218,7 @@ arm_pc_is_thumb_dummy (CORE_ADDR memaddr) frame location (true if we have not pushed large data structures or gone too many levels deep) and that our 1024 is not enough to consider code regions as part of the stack (true for most practical purposes). */ - if (PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024)) + if (DEPRECATED_PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024)) return caller_is_thumb; else return 0; @@ -410,8 +413,7 @@ arm_skip_prologue (CORE_ADDR pc) struct symtab_and_line sal; /* If we're in a dummy frame, don't even try to skip the prologue. */ - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return pc; /* See what the symbol table says. */ @@ -536,9 +538,8 @@ thumb_scan_prologue (struct frame_info *fi) int i; /* Don't try to scan dummy frames. */ - if (USE_GENERIC_DUMMY_FRAMES - && fi != NULL - && PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (fi != NULL + && DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) return; if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end)) @@ -992,8 +993,7 @@ arm_find_callers_reg (struct frame_info *fi, int regnum) function could be called directly. */ for (; fi; fi = fi->next) { - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) { return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); } @@ -1012,9 +1012,9 @@ arm_find_callers_reg (struct frame_info *fi, int regnum) } /* 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. */ + GDB frame struct, and then INIT_EXTRA_FRAME_INFO and + DEPRECATED_INIT_FRAME_PC will be called for the new frame. For + ARM, we save the frame size when we initialize the frame_info. */ static CORE_ADDR arm_frame_chain (struct frame_info *fi) @@ -1022,8 +1022,7 @@ arm_frame_chain (struct frame_info *fi) CORE_ADDR caller_pc; int framereg = fi->extra_info->framereg; - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) /* A generic call dummy's frame is the same as caller's. */ return fi->frame; @@ -1106,8 +1105,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) the sigtramp and call dummy cases. */ if (!fi->next) sp = read_sp(); - else if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) /* For generic dummy frames, pull the value direct from the frame. Having an unwind function to do this would be nice. */ sp = deprecated_read_register_dummy (fi->next->pc, fi->next->frame, @@ -1117,19 +1115,24 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) + fi->next->extra_info->framesize); /* Determine whether or not we're in a sigtramp frame. - Unfortunately, it isn't sufficient to test - fi->signal_handler_caller because this value is sometimes set - after invoking INIT_EXTRA_FRAME_INFO. So we test *both* - fi->signal_handler_caller and PC_IN_SIGTRAMP to determine if we - need to use the sigcontext addresses for the saved registers. + Unfortunately, it isn't sufficient to test (get_frame_type (fi) + == SIGTRAMP_FRAME) because this value is sometimes set after + invoking INIT_EXTRA_FRAME_INFO. So we test *both* + (get_frame_type (fi) == SIGTRAMP_FRAME) and PC_IN_SIGTRAMP to + determine if we need to use the sigcontext addresses for the + saved registers. Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare against the name of the function, the code below will have to be changed to first fetch the name of the function and then pass this name to PC_IN_SIGTRAMP. */ + /* FIXME: cagney/2002-11-18: This problem will go away once + frame.c:get_prev_frame() is modified to set the frame's type + before calling functions like this. */ + if (SIGCONTEXT_REGISTER_ADDRESS_P () - && (fi->signal_handler_caller || PC_IN_SIGTRAMP (fi->pc, (char *)0))) + && ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (fi->pc, (char *)0))) { for (reg = 0; reg < NUM_REGS; reg++) fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg); @@ -1143,33 +1146,6 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info->frameoffset = 0; } - else if (!USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->pc, sp, fi->frame)) - { - CORE_ADDR rp; - CORE_ADDR callers_sp; - - /* Set rp point at the high end of the saved registers. */ - rp = fi->frame - REGISTER_SIZE; - - /* Fill in addresses of saved registers. */ - fi->saved_regs[ARM_PS_REGNUM] = rp; - rp -= REGISTER_RAW_SIZE (ARM_PS_REGNUM); - for (reg = ARM_PC_REGNUM; reg >= 0; reg--) - { - fi->saved_regs[reg] = rp; - rp -= REGISTER_RAW_SIZE (reg); - } - - callers_sp = read_memory_integer (fi->saved_regs[ARM_SP_REGNUM], - REGISTER_RAW_SIZE (ARM_SP_REGNUM)); - if (arm_pc_is_thumb (fi->pc)) - fi->extra_info->framereg = THUMB_FP_REGNUM; - else - fi->extra_info->framereg = ARM_FP_REGNUM; - fi->extra_info->framesize = callers_sp - sp; - fi->extra_info->frameoffset = fi->frame - sp; - } else { arm_scan_prologue (fi); @@ -1177,8 +1153,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (!fi->next) /* This is the innermost frame? */ fi->frame = read_register (fi->extra_info->framereg); - else if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fi->next->pc, 0, 0)) /* Next inner most frame is a dummy, just grab its frame. Dummy frames always have the same FP as their caller. */ fi->frame = fi->next->frame; @@ -1219,11 +1194,10 @@ static CORE_ADDR arm_frame_saved_pc (struct frame_info *fi) { /* If a dummy frame, pull the PC out of the frame's register buffer. */ - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fi->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, 0, 0)) return deprecated_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset, + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame - fi->extra_info->frameoffset, fi->frame)) { return read_memory_integer (fi->saved_regs[ARM_PC_REGNUM], @@ -1549,8 +1523,7 @@ arm_pop_frame (void) CORE_ADDR old_SP = (frame->frame - frame->extra_info->frameoffset + frame->extra_info->framesize); - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); flush_cached_frames (); @@ -1694,7 +1667,8 @@ arm_register_sim_regno (int regnum) little-endian systems. */ static void -convert_from_extended (void *ptr, void *dbl) +convert_from_extended (const struct floatformat *fmt, const void *ptr, + void *dbl) { DOUBLEST d; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) @@ -1702,14 +1676,14 @@ convert_from_extended (void *ptr, void *dbl) else floatformat_to_doublest (&floatformat_arm_ext_littlebyte_bigword, ptr, &d); - floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &d, dbl); + floatformat_from_doublest (fmt, &d, dbl); } static void -convert_to_extended (void *dbl, void *ptr) +convert_to_extended (const struct floatformat *fmt, void *dbl, const void *ptr) { DOUBLEST d; - floatformat_to_doublest (TARGET_DOUBLE_FORMAT, ptr, &d); + floatformat_to_doublest (fmt, ptr, &d); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) floatformat_from_doublest (&floatformat_arm_ext_big, &d, dbl); else @@ -2247,9 +2221,11 @@ arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) static void arm_extract_return_value (struct type *type, - char regbuf[REGISTER_BYTES], - char *valbuf) + struct regcache *regs, + void *dst) { + bfd_byte *valbuf = dst; + if (TYPE_CODE_FLT == TYPE_CODE (type)) { struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); @@ -2257,14 +2233,24 @@ arm_extract_return_value (struct type *type, switch (tdep->fp_model) { case ARM_FLOAT_FPA: - convert_from_extended (®buf[REGISTER_BYTE (ARM_F0_REGNUM)], - valbuf); + { + /* The value is in register F0 in internal format. We need to + extract the raw value and then convert it to the desired + internal type. */ + bfd_byte tmpbuf[FP_REGISTER_RAW_SIZE]; + + regcache_cooked_read (regs, ARM_F0_REGNUM, tmpbuf); + convert_from_extended (floatformat_from_type (type), tmpbuf, + valbuf); + } break; case ARM_FLOAT_SOFT: case ARM_FLOAT_SOFT_VFP: - memcpy (valbuf, ®buf[REGISTER_BYTE (ARM_A1_REGNUM)], - TYPE_LENGTH (type)); + regcache_cooked_read (regs, ARM_A1_REGNUM, valbuf); + if (TYPE_LENGTH (type) > 4) + regcache_cooked_read (regs, ARM_A1_REGNUM + 1, + valbuf + INT_REGISTER_RAW_SIZE); break; default: @@ -2274,9 +2260,50 @@ arm_extract_return_value (struct type *type, break; } } + else if (TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_CHAR + || TYPE_CODE (type) == TYPE_CODE_BOOL + || TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF + || TYPE_CODE (type) == TYPE_CODE_ENUM) + { + /* If the the type is a plain integer, then the access is + straight-forward. Otherwise we have to play around a bit more. */ + int len = TYPE_LENGTH (type); + int regno = ARM_A1_REGNUM; + ULONGEST tmp; + + while (len > 0) + { + /* By using store_unsigned_integer we avoid having to do + anything special for small big-endian values. */ + regcache_cooked_read_unsigned (regs, regno++, &tmp); + store_unsigned_integer (valbuf, + (len > INT_REGISTER_RAW_SIZE + ? INT_REGISTER_RAW_SIZE : len), + tmp); + len -= INT_REGISTER_RAW_SIZE; + valbuf += INT_REGISTER_RAW_SIZE; + } + } else - memcpy (valbuf, ®buf[REGISTER_BYTE (ARM_A1_REGNUM)], - TYPE_LENGTH (type)); + { + /* For a structure or union the behaviour is as if the value had + been stored to word-aligned memory and then loaded into + registers with 32-bit load instruction(s). */ + int len = TYPE_LENGTH (type); + int regno = ARM_A1_REGNUM; + bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE]; + + while (len > 0) + { + regcache_cooked_read (regs, regno++, tmpbuf); + memcpy (valbuf, tmpbuf, + len > INT_REGISTER_RAW_SIZE ? INT_REGISTER_RAW_SIZE : len); + len -= INT_REGISTER_RAW_SIZE; + valbuf += INT_REGISTER_RAW_SIZE; + } + } } /* Extract from an array REGBUF containing the (raw) register state @@ -2389,8 +2416,11 @@ arm_use_struct_convention (int gcc_p, struct type *type) TYPE, given in virtual format. */ static void -arm_store_return_value (struct type *type, char *valbuf) +arm_store_return_value (struct type *type, struct regcache *regs, + const void *src) { + const bfd_byte *valbuf = src; + if (TYPE_CODE (type) == TYPE_CODE_FLT) { struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); @@ -2400,15 +2430,16 @@ arm_store_return_value (struct type *type, char *valbuf) { case ARM_FLOAT_FPA: - convert_to_extended (valbuf, buf); - deprecated_write_register_bytes (REGISTER_BYTE (ARM_F0_REGNUM), buf, - FP_REGISTER_RAW_SIZE); + convert_to_extended (floatformat_from_type (type), buf, valbuf); + regcache_cooked_write (regs, ARM_F0_REGNUM, buf); break; case ARM_FLOAT_SOFT: case ARM_FLOAT_SOFT_VFP: - deprecated_write_register_bytes (ARM_A1_REGNUM, valbuf, - TYPE_LENGTH (type)); + regcache_cooked_write (regs, ARM_A1_REGNUM, valbuf); + if (TYPE_LENGTH (type) > 4) + regcache_cooked_write (regs, ARM_A1_REGNUM + 1, + valbuf + INT_REGISTER_RAW_SIZE); break; default: @@ -2418,9 +2449,57 @@ arm_store_return_value (struct type *type, char *valbuf) break; } } + else if (TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_CHAR + || TYPE_CODE (type) == TYPE_CODE_BOOL + || TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF + || TYPE_CODE (type) == TYPE_CODE_ENUM) + { + if (TYPE_LENGTH (type) <= 4) + { + /* Values of one word or less are zero/sign-extended and + returned in r0. */ + bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE]; + LONGEST val = unpack_long (type, valbuf); + + store_signed_integer (tmpbuf, INT_REGISTER_RAW_SIZE, val); + regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf); + } + else + { + /* Integral values greater than one word are stored in consecutive + registers starting with r0. This will always be a multiple of + the regiser size. */ + int len = TYPE_LENGTH (type); + int regno = ARM_A1_REGNUM; + + while (len > 0) + { + regcache_cooked_write (regs, regno++, valbuf); + len -= INT_REGISTER_RAW_SIZE; + valbuf += INT_REGISTER_RAW_SIZE; + } + } + } else - deprecated_write_register_bytes (ARM_A1_REGNUM, valbuf, - TYPE_LENGTH (type)); + { + /* For a structure or union the behaviour is as if the value had + been stored to word-aligned memory and then loaded into + registers with 32-bit load instruction(s). */ + int len = TYPE_LENGTH (type); + int regno = ARM_A1_REGNUM; + bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE]; + + while (len > 0) + { + memcpy (tmpbuf, valbuf, + len > INT_REGISTER_RAW_SIZE ? INT_REGISTER_RAW_SIZE : len); + regcache_cooked_write (regs, regno++, tmpbuf); + len -= INT_REGISTER_RAW_SIZE; + valbuf += INT_REGISTER_RAW_SIZE; + } + } } /* Store the address of the place in which to copy the structure the @@ -2778,6 +2857,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->osabi = osabi; /* This is the way it has always defaulted. */ @@ -2814,34 +2897,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->lowest_pc = 0x20; tdep->jb_pc = -1; /* Longjump support not enabled by default. */ -#if OLD_STYLE_ARM_DUMMY_FRAMES - /* NOTE: cagney/2002-05-07: Enable the below to restore the old ARM - specific (non-generic) dummy frame code. Might be useful if - there appears to be a problem with the generic dummy frame - mechanism that replaced it. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); - - /* Call dummy code. */ - set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); - /* We have to give this a value now, even though we will re-set it - during each call to arm_fix_call_dummy. */ - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8); - set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - - set_gdbarch_call_dummy_words (gdbarch, arm_call_dummy_words); - set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (arm_call_dummy_words)); - set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_call_dummy_length (gdbarch, 0); - - set_gdbarch_fix_call_dummy (gdbarch, arm_fix_call_dummy); - - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); -#else - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); - set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); @@ -2854,13 +2909,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_push_return_address (gdbarch, arm_push_return_address); -#endif - set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register); set_gdbarch_push_arguments (gdbarch, arm_push_arguments); set_gdbarch_coerce_float_to_double (gdbarch, standard_coerce_float_to_double); @@ -2878,15 +2930,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_num_args (gdbarch, arm_frame_num_args); set_gdbarch_frame_args_skip (gdbarch, 0); set_gdbarch_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs); -#if OLD_STYLE_ARM_DUMMY_FRAMES - /* NOTE: cagney/2002-05-07: Enable the below to restore the old ARM - specific (non-generic) dummy frame code. Might be useful if - there appears to be a problem with the generic dummy frame - mechanism that replaced it. */ - set_gdbarch_push_dummy_frame (gdbarch, arm_push_dummy_frame); -#else set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); -#endif set_gdbarch_pop_frame (gdbarch, arm_pop_frame); /* Address manipulation. */ @@ -2934,8 +2978,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, arm_register_name); /* Returning results. */ - set_gdbarch_deprecated_extract_return_value (gdbarch, arm_extract_return_value); - set_gdbarch_deprecated_store_return_value (gdbarch, arm_store_return_value); + set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value); + set_gdbarch_store_return_value (gdbarch, arm_store_return_value); set_gdbarch_store_struct_return (gdbarch, arm_store_struct_return); set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention); set_gdbarch_extract_struct_value_address (gdbarch, @@ -3066,11 +3110,11 @@ _initialize_arm_tdep (void) arm_elf_osabi_sniffer); /* Register some ABI variants for embedded systems. */ - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_EABI_V1, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_EABI_V1, arm_init_abi_eabi_v1); - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_EABI_V2, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_EABI_V2, arm_init_abi_eabi_v2); - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_APCS, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_APCS, arm_init_abi_apcs); tm_print_insn = gdb_print_insn_arm; diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c index ea92020..80113f5 100644 --- a/gdb/armnbsd-tdep.c +++ b/gdb/armnbsd-tdep.c @@ -25,8 +25,8 @@ #include "solib-svr4.h" /* Description of the longjmp buffer. */ -#define JB_PC 24 -#define JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE +#define ARM_NBSD_JB_PC 24 +#define ARM_NBSD_JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE /* For compatibility with previous implemenations of GDB on arm/NetBSD, override the default little-endian breakpoint. */ @@ -51,8 +51,8 @@ arm_netbsd_init_abi_common (struct gdbarch_info info, tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint; tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint); - tdep->jb_pc = JB_PC; - tdep->jb_elt_size = JB_ELEMENT_SIZE; + tdep->jb_pc = ARM_NBSD_JB_PC; + tdep->jb_elt_size = ARM_NBSD_JB_ELEMENT_SIZE; } static void @@ -97,8 +97,8 @@ _initialize_arm_netbsd_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_aout_flavour, arm_netbsd_aout_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_AOUT, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_AOUT, arm_netbsd_aout_init_abi); - gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_ELF, arm_netbsd_elf_init_abi); } diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index c67e4e8..1c93860 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -750,7 +750,7 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi) avr_scan_prologue (fi); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -833,7 +833,7 @@ avr_pop_frame (void) CORE_ADDR saddr; struct frame_info *frame = get_current_frame (); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); } @@ -866,7 +866,7 @@ avr_pop_frame (void) static CORE_ADDR avr_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, AVR_PC_REGNUM); else @@ -1020,9 +1020,10 @@ avr_frame_address (struct frame_info *fi) return avr_make_saddr (fi->frame); } -/* 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. +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -1030,7 +1031,7 @@ avr_frame_address (struct frame_info *fi) static CORE_ADDR avr_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { /* initialize the return_pc now */ frame->extra_info->return_pc @@ -1166,6 +1167,10 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + /* If we ever need to differentiate the device types, do it here. */ switch (info.bfd_arch_info->mach) { @@ -1215,18 +1220,13 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_max_register_virtual_size (gdbarch, 4); set_gdbarch_register_virtual_type (gdbarch, avr_register_virtual_type); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); - set_gdbarch_print_insn (gdbarch, print_insn_avr); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index dc2adef..2bf12a8 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1837,7 +1837,7 @@ agent_command (char *exp, int from_tty) expr = parse_expression (exp); old_chain = make_cleanup (free_current_contents, &expr); - agent = gen_trace_for_expr (fi->pc, expr); + agent = gen_trace_for_expr (get_frame_pc (fi), expr); make_cleanup_free_agent_expr (agent); ax_print (gdb_stdout, agent); diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 7b92044..7b9641f 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -50,7 +50,7 @@ int file_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) { return ((chain) != 0 - && !inside_entry_file (FRAME_SAVED_PC (thisframe))); + && !inside_entry_file (frame_pc_unwind (thisframe))); } /* Use the alternate method of avoiding running up off the end of the @@ -61,8 +61,8 @@ int func_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) { return ((chain) != 0 - && !inside_main_func ((thisframe)->pc) - && !inside_entry_func ((thisframe)->pc)); + && !inside_main_func (get_frame_pc (thisframe)) + && !inside_entry_func (get_frame_pc (thisframe))); } /* A very simple method of determining a valid frame */ @@ -93,7 +93,7 @@ inside_entry_file (CORE_ADDR addr) /* 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 (addr, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0)) return 0; } return (addr >= symfile_objfile->ei.entry_file_lowpc && @@ -158,7 +158,7 @@ inside_entry_func (CORE_ADDR pc) /* 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)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return 0; } return (symfile_objfile->ei.entry_func_lowpc <= pc && @@ -174,7 +174,7 @@ frameless_look_for_prologue (struct frame_info *frame) { CORE_ADDR func_start, after_prologue; - func_start = get_pc_function_start (frame->pc); + func_start = get_pc_function_start (get_frame_pc (frame)); if (func_start) { func_start += FUNCTION_START_OFFSET; @@ -182,7 +182,7 @@ frameless_look_for_prologue (struct frame_info *frame) prologue, not how long it is. */ return PROLOGUE_FRAMELESS_P (func_start); } - else if (frame->pc == 0) + else if (get_frame_pc (frame) == 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 @@ -203,7 +203,7 @@ frameless_look_for_prologue (struct frame_info *frame) CORE_ADDR frame_address_in_block (struct frame_info *frame) { - CORE_ADDR pc = frame->pc; + CORE_ADDR pc = get_frame_pc (frame); /* If we are not in the innermost frame, and we are not interrupted by a signal, frame->pc points to the instruction following the @@ -211,7 +211,11 @@ frame_address_in_block (struct frame_info *frame) instruction. Unfortunately, this is not straightforward to do, so we just use the address minus one, which is a good enough approximation. */ - if (frame->next != 0 && frame->next->signal_handler_caller == 0) + /* FIXME: cagney/2002-11-10: Should this instead test for + NORMAL_FRAME? A dummy frame (in fact all the abnormal frames) + save the PC value in the block. */ + if (get_next_frame (frame) != 0 + && get_frame_type (get_next_frame (frame)) != SIGTRAMP_FRAME) --pc; return pc; @@ -244,17 +248,6 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) return block_for_pc (pc); } -struct block * -get_current_block (CORE_ADDR *addr_in_block) -{ - CORE_ADDR pc = read_pc (); - - if (addr_in_block) - *addr_in_block = pc; - - return block_for_pc (pc); -} - CORE_ADDR get_pc_function_start (CORE_ADDR pc) { @@ -640,56 +633,6 @@ block_innermost_frame (const struct block *block) } } -/* Return the full FRAME which corresponds to the given CORE_ADDR - or NULL if no FRAME on the chain corresponds to CORE_ADDR. */ - -struct frame_info * -find_frame_addr_in_frame_chain (CORE_ADDR frame_addr) -{ - struct frame_info *frame = NULL; - - if (frame_addr == (CORE_ADDR) 0) - return NULL; - - while (1) - { - frame = get_prev_frame (frame); - if (frame == NULL) - return NULL; - if (FRAME_FP (frame) == frame_addr) - return frame; - } -} - -#ifdef SIGCONTEXT_PC_OFFSET -/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */ - -CORE_ADDR -sigtramp_saved_pc (struct frame_info *frame) -{ - CORE_ADDR sigcontext_addr; - char *buf; - int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr); - int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; - - buf = alloca (ptrbytes); - /* Get sigcontext address, it is the third parameter on the stack. */ - if (frame->next) - sigcontext_addr = read_memory_typed_address - (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs, - builtin_type_void_data_ptr); - else - sigcontext_addr = read_memory_typed_address - (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr); - - /* Don't cause a memory_error when accessing sigcontext in case the stack - layout has changed or the stack is corrupt. */ - target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); - return extract_typed_address (buf, builtin_type_void_func_ptr); -} -#endif /* SIGCONTEXT_PC_OFFSET */ - - /* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK below is for infrun.c, which may give the macro a pc without that subtracted out. */ @@ -697,16 +640,16 @@ sigtramp_saved_pc (struct frame_info *frame) extern CORE_ADDR text_end; int -pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) +deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address) { return ((pc) >= text_end - CALL_DUMMY_LENGTH && (pc) <= text_end + DECR_PC_AFTER_BREAK); } int -pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) +deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address) { return ((pc) >= text_end && (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK); @@ -723,7 +666,7 @@ pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, have that meaning, but the 29k doesn't use ON_STACK. This could be fixed by generalizing this scheme, perhaps by passing in a frame and adding a few fields, at least on machines which need them for - PC_IN_CALL_DUMMY. + DEPRECATED_PC_IN_CALL_DUMMY. Something simpler, like checking for the stack segment, doesn't work, since various programs (threads implementations, gcc nested function @@ -731,7 +674,8 @@ pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, allocate other kinds of code on the stack. */ int -pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) +deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address) { return (INNER_THAN ((sp), (pc)) && (frame_address != 0) @@ -739,8 +683,8 @@ pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) } int -pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) +deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, + CORE_ADDR frame_address) { return ((pc) >= CALL_DUMMY_ADDRESS () && (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK)); @@ -754,24 +698,26 @@ pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, int generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (FRAME_SAVED_PC (fi), fp, fp)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame_pc_unwind (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))); + && (INNER_THAN (get_frame_base (fi), fp) + || get_frame_base (fi) == fp) + && !inside_entry_file (frame_pc_unwind (fi))); } int generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY ((fi)->pc, 0, 0)) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0)) 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_main_func ((fi)->pc) - && !inside_entry_func ((fi)->pc)); + && (INNER_THAN (get_frame_base (fi), fp) + || get_frame_base (fi) == fp) + && !inside_main_func (get_frame_pc (fi)) + && !inside_entry_func (get_frame_pc (fi))); } diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 80f31c2..e3083e6 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -49,6 +49,7 @@ #include "ui-out.h" #include "cli/cli-script.h" #include "dictionary.h" +#include "gdb_assert.h" #include "gdb-events.h" @@ -953,8 +954,8 @@ insert_breakpoints (void) /* 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 = frame_relative_level (selected_frame); + saved_frame = deprecated_selected_frame; + saved_level = frame_relative_level (deprecated_selected_frame); /* Determine if the watchpoint is within scope. */ if (b->exp_valid_block == NULL) @@ -1050,8 +1051,8 @@ insert_breakpoints (void) } /* Restore the frame and level. */ - if ((saved_frame != selected_frame) || - (saved_level != frame_relative_level (selected_frame))) + if ((saved_frame != deprecated_selected_frame) || + (saved_level != frame_relative_level (deprecated_selected_frame))) select_frame (saved_frame); if (val) @@ -1684,9 +1685,9 @@ breakpoint_inserted_here_p (CORE_ADDR pc) } /* Return nonzero if FRAME is a dummy frame. We can't use - PC_IN_CALL_DUMMY because figuring out the saved SP would take too - much time, at least using get_saved_register on the 68k. This - means that for this function to work right a port must use the + DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would + take too much time, at least using get_saved_register on the 68k. + This means that for this function to work right a port must use the bp_call_dummy breakpoint. */ int @@ -1697,19 +1698,21 @@ deprecated_frame_in_dummy (struct frame_info *frame) if (!CALL_DUMMY_P) return 0; - if (USE_GENERIC_DUMMY_FRAMES) - return generic_pc_in_call_dummy (frame->pc, frame->frame, frame->frame); + /* This function is used by two files: get_frame_type(), after first + checking that !DEPRECATED_USE_GENERIC_DUMMY_FRAMES; and + sparc-tdep.c, which doesn't yet use generic dummy frames anyway. */ + gdb_assert (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES); ALL_BREAKPOINTS (b) { if (b->type == bp_call_dummy - && b->frame == frame->frame + && frame_id_eq (b->frame_id, get_frame_id (frame)) /* We need to check the PC as well as the frame on the sparc, for signals.exp in the testsuite. */ - && (frame->pc + && (get_frame_pc (frame) >= (b->address - - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE)) - && frame->pc <= b->address) + - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE)) + && get_frame_pc (frame) <= b->address) return 1; } return 0; @@ -2572,17 +2575,17 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint) continue; if ((b->type == bp_catch_fork) - && !target_has_forked (PIDGET (inferior_ptid), - &b->forked_inferior_pid)) + && !inferior_has_forked (PIDGET (inferior_ptid), + &b->forked_inferior_pid)) continue; if ((b->type == bp_catch_vfork) - && !target_has_vforked (PIDGET (inferior_ptid), - &b->forked_inferior_pid)) + && !inferior_has_vforked (PIDGET (inferior_ptid), + &b->forked_inferior_pid)) continue; if ((b->type == bp_catch_exec) - && !target_has_execd (PIDGET (inferior_ptid), &b->exec_pathname)) + && !inferior_has_execd (PIDGET (inferior_ptid), &b->exec_pathname)) continue; if (ep_is_exception_catchpoint (b) && @@ -2726,8 +2729,8 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint) real_breakpoint = 1; } - if (b->frame && - b->frame != (get_current_frame ())->frame) + if (frame_id_p (b->frame_id) + && !frame_id_eq (b->frame_id, get_frame_id (get_current_frame ()))) bs->stop = 0; else { @@ -3416,11 +3419,13 @@ print_one_breakpoint (struct breakpoint *b, ui_out_text (uiout, "\n"); - if (b->frame) + if (frame_id_p (b->frame_id)) { annotate_field (6); ui_out_text (uiout, "\tstop only in stack frame at "); - ui_out_field_core_addr (uiout, "frame", b->frame); + /* FIXME: cagney/2002-12-01: Shouldn't be poeking around inside + the frame ID. */ + ui_out_field_core_addr (uiout, "frame", b->frame_id.base); ui_out_text (uiout, "\n"); } @@ -3841,7 +3846,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) b->silent = 0; b->ignore_count = 0; b->commands = NULL; - b->frame = 0; + b->frame_id = null_frame_id; b->dll_pathname = NULL; b->triggered_dll_pathname = NULL; b->forked_inferior_pid = 0; @@ -4009,14 +4014,12 @@ struct breakpoint * create_thread_event_breakpoint (CORE_ADDR address) { struct breakpoint *b; - char addr_string[80]; /* Surely an addr can't be longer than that. */ b = create_internal_breakpoint (address, bp_thread_event); b->enable_state = bp_enabled; /* addr_string has to be used or breakpoint_re_set will delete me. */ - sprintf (addr_string, "*0x%s", paddr (b->address)); - b->addr_string = xstrdup (addr_string); + xasprintf (&b->addr_string, "*0x%s", paddr (b->address)); return b; } @@ -4309,7 +4312,7 @@ hw_watchpoint_used_count (enum bptype type, int *other_type_used) that gets deleted automatically... */ void -set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame) +set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_id frame_id) { register struct breakpoint *b; @@ -4318,10 +4321,7 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame) { b->address = pc; b->enable_state = bp_enabled; - if (frame != NULL) - b->frame = frame->frame; - else - b->frame = 0; + b->frame_id = frame_id; check_duplicates (b); return; } @@ -4373,14 +4373,14 @@ enable_watchpoints_after_interactive_call_stop (void) Restrict it to frame FRAME if FRAME is nonzero. */ struct breakpoint * -set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame, +set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id, enum bptype type) { register struct breakpoint *b; b = set_raw_breakpoint (sal, type); b->enable_state = bp_enabled; b->disposition = disp_donttouch; - b->frame = (frame ? frame->frame : 0); + b->frame_id = frame_id; /* If we're debugging a multi-threaded program, then we want momentary breakpoints to be active in only a @@ -4572,7 +4572,12 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, b->number = breakpoint_count; b->cond = cond[i]; b->thread = thread; - b->addr_string = addr_string[i]; + if (addr_string[i]) + b->addr_string = addr_string[i]; + else + /* addr_string has to be used or breakpoint_re_set will delete + me. */ + xasprintf (&b->addr_string, "*0x%s", paddr (b->address)); b->cond_string = cond_string[i]; b->ignore_count = ignore_count; b->enable_state = bp_enabled; @@ -4962,9 +4967,9 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty) if (default_breakpoint_valid) { - if (selected_frame) + if (deprecated_selected_frame) { - selected_pc = selected_frame->pc; + selected_pc = get_frame_pc (deprecated_selected_frame); if (arg) if_arg = 1; } @@ -4993,7 +4998,7 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty) frame = parse_frame_specification (level_arg); if (frame) - selected_pc = frame->pc; + selected_pc = get_frame_pc (frame); else selected_pc = 0; } @@ -5040,10 +5045,11 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty) { if (default_breakpoint_valid) { - if (selected_frame) + if (deprecated_selected_frame) { addr_string = (char *) xmalloc (15); - sprintf (addr_string, "*0x%s", paddr_nz (selected_frame->pc)); + sprintf (addr_string, "*0x%s", + paddr_nz (get_frame_pc (deprecated_selected_frame))); if (arg) if_arg = 1; } @@ -5399,7 +5405,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty) if (frame) { prev_frame = get_prev_frame (frame); - get_frame_id (frame, &b->watchpoint_frame); + b->watchpoint_frame = get_frame_id (frame); } else { @@ -5423,7 +5429,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty) scope_breakpoint->disposition = disp_del; /* Only break in the proper frame (help with recursion). */ - scope_breakpoint->frame = prev_frame->frame; + scope_breakpoint->frame_id = get_frame_id (prev_frame); /* Set the address at which we will stop. */ scope_breakpoint->address = get_frame_pc (prev_frame); @@ -5582,7 +5588,7 @@ until_break_command (char *arg, int from_tty) { struct symtabs_and_lines sals; struct symtab_and_line sal; - struct frame_info *prev_frame = get_prev_frame (selected_frame); + struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame); struct breakpoint *breakpoint; struct cleanup *old_chain; struct continuation_arg *arg1; @@ -5611,7 +5617,9 @@ until_break_command (char *arg, int from_tty) resolve_sal_pc (&sal); - breakpoint = set_momentary_breakpoint (sal, selected_frame, bp_until); + breakpoint = + set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame), + bp_until); if (!event_loop_p || !target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -5643,9 +5651,10 @@ until_break_command (char *arg, int from_tty) if (prev_frame) { - sal = find_pc_line (prev_frame->pc, 0); - sal.pc = prev_frame->pc; - breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until); + sal = find_pc_line (get_frame_pc (prev_frame), 0); + sal.pc = get_frame_pc (prev_frame); + breakpoint = set_momentary_breakpoint (sal, get_frame_id (prev_frame), + bp_until); if (!event_loop_p || !target_can_async_p ()) make_cleanup_delete_breakpoint (breakpoint); else @@ -5769,10 +5778,10 @@ get_catch_sals (int this_level_only) /* Not sure whether an error message is always the correct response, but it's better than a core dump. */ - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); - block = get_frame_block (selected_frame, 0); - pc = selected_frame->pc; + block = get_frame_block (deprecated_selected_frame, 0); + pc = get_frame_pc (deprecated_selected_frame); sals.nelts = 0; sals.sals = NULL; @@ -7367,8 +7376,8 @@ is valid is not currently in scope.\n", bpt->number); return; } - save_selected_frame = selected_frame; - save_selected_frame_level = frame_relative_level (selected_frame); + save_selected_frame = deprecated_selected_frame; + save_selected_frame_level = frame_relative_level (deprecated_selected_frame); select_frame (fr); } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 3abdca7..7b359cb 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -237,7 +237,7 @@ struct breakpoint struct command_line *commands; /* Stack depth (address of frame). If nonzero, break only if fp equals this. */ - CORE_ADDR frame; + struct frame_id frame_id; /* Conditional. Break only if this expression's value is nonzero. */ struct expression *cond; @@ -521,9 +521,6 @@ enum breakpoint_here /* Prototypes for breakpoint-related functions. */ -/* Forward declarations for prototypes */ -struct frame_info; - extern enum breakpoint_here breakpoint_here_p (CORE_ADDR); extern int breakpoint_inserted_here_p (CORE_ADDR); @@ -532,11 +529,7 @@ extern int breakpoint_inserted_here_p (CORE_ADDR); implements a functional superset of this function. The only reason it hasn't been removed is because some architectures still don't use the new framework. Once they have been fixed, this can go. */ -/* FIXME: cagney/2002-11-10: There should be a function (hmm, - something like, enum { NORMAL_FRAME, DUMMY_FRAME, SIGTRAMP_FRAME } - get_frame_type() ...) that the caller can use to determine the - frame's type. This could replace this function, PC_IN_CALL_DUMMY, - and fi->signal_handler_caller. */ +struct frame_info; extern int deprecated_frame_in_dummy (struct frame_info *); extern int breakpoint_thread_match (CORE_ADDR, ptid_t); @@ -550,7 +543,7 @@ extern void breakpoint_re_set_thread (struct breakpoint *); extern int ep_is_exception_catchpoint (struct breakpoint *); extern struct breakpoint *set_momentary_breakpoint - (struct symtab_and_line, struct frame_info *, enum bptype); + (struct symtab_and_line, struct frame_id, enum bptype); extern void set_ignore_count (int, int, int); @@ -624,7 +617,7 @@ extern void disable_longjmp_breakpoint (void); extern void enable_overlay_breakpoints (void); extern void disable_overlay_breakpoints (void); -extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_info *); +extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_id); /* These functions respectively disable or reenable all currently enabled watchpoints. When disabled, the watchpoints are marked call_disabled. When reenabled, they are marked enabled. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 8583942..66650bd 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -34,6 +34,7 @@ #include "symfile.h" #include "objfiles.h" #include "gdbtypes.h" +#include "gdb_assert.h" #include "complaints.h" #include "gdb_string.h" #include "expression.h" /* For "enum exp_opcode" used by... */ @@ -89,23 +90,6 @@ static struct using_direct_node *copy_usings_to_obstack (struct #define INITIAL_LINE_VECTOR_LENGTH 1000 -/* Complaints about the symbols we have encountered. */ - -struct deprecated_complaint block_end_complaint = -{"block end address less than block start address in %s (patched it)", 0, 0}; - -struct deprecated_complaint anon_block_end_complaint = -{"block end address 0x%lx less than block start address 0x%lx (patched it)", 0, 0}; - -struct deprecated_complaint innerblock_complaint = -{"inner block not inside outer block in %s", 0, 0}; - -struct deprecated_complaint innerblock_anon_complaint = -{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0}; - -struct deprecated_complaint blockvector_complaint = -{"block at %s out of order", 0, 0}; - /* maintain the lists of symbols and blocks */ /* Add a pending list to free_pendings. */ @@ -508,11 +492,15 @@ finish_block (struct symbol *symbol, struct pending **listhead, { if (symbol) { - complain (&block_end_complaint, SYMBOL_PRINT_NAME (symbol)); + complaint (&symfile_complaints, + "block end address less than block start address in %s (patched it)", + SYMBOL_PRINT_NAME (symbol)); } else { - complain (&anon_block_end_complaint, BLOCK_END (block), BLOCK_START (block)); + complaint (&symfile_complaints, + "block end address 0x%s less than block start address 0x%s (patched it)", + paddr_nz (BLOCK_END (block)), paddr_nz (BLOCK_START (block))); } /* Better than nothing */ BLOCK_END (block) = BLOCK_START (block); @@ -538,14 +526,18 @@ finish_block (struct symbol *symbol, struct pending **listhead, { if (symbol) { - complain (&innerblock_complaint, - SYMBOL_PRINT_NAME (symbol)); + complaint (&symfile_complaints, + "inner block not inside outer block in %s", + SYMBOL_PRINT_NAME (symbol)); } else { - complain (&innerblock_anon_complaint, BLOCK_START (pblock->block), - BLOCK_END (pblock->block), BLOCK_START (block), - BLOCK_END (block)); + complaint (&symfile_complaints, + "inner block (0x%s-0x%s) not inside outer block (0x%s-0x%s)", + paddr_nz (BLOCK_START (pblock->block)), + paddr_nz (BLOCK_END (pblock->block)), + paddr_nz (BLOCK_START (block)), + paddr_nz (BLOCK_END (block))); } if (BLOCK_START (pblock->block) < BLOCK_START (block)) BLOCK_START (pblock->block) = BLOCK_START (block); @@ -650,8 +642,8 @@ make_blockvector (struct objfile *objfile) CORE_ADDR start = BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)); - complain (&blockvector_complaint, - local_hex_string ((LONGEST) start)); + complaint (&symfile_complaints, "block at %s out of order", + local_hex_string ((LONGEST) start)); } } } @@ -972,9 +964,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section) 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 deprecated_complaint msg = - {"Context stack not empty in end_symtab", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, + "Context stack not empty in end_symtab"); context_stack_depth = 0; } } @@ -1237,6 +1228,17 @@ push_context (int desc, CORE_ADDR valu) return new; } + +/* Pop a context block. Returns the address of the context block just + popped. */ + +struct context_stack * +pop_context (void) +{ + gdb_assert (context_stack_depth > 0); + return (&context_stack[--context_stack_depth]); +} + /* Compute a small integer hash code for the given name. */ diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 92e101e..41c85fd 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -187,12 +187,6 @@ 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. */ - -#define pop_context() (&context_stack[--context_stack_depth]); - /* Non-zero if the context stack is empty. */ #define outermost_context_p() (context_stack_depth == 0) @@ -289,6 +283,8 @@ extern void buildsym_init (void); extern struct context_stack *push_context (int desc, CORE_ADDR valu); +extern struct context_stack *pop_context (void); + extern void record_line (struct subfile *subfile, int line, CORE_ADDR pc); extern void start_symtab (char *name, char *dirname, CORE_ADDR start_addr); diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 07a8449..fa26abc 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -302,7 +302,7 @@ c_type_print_modifier (struct type *type, struct ui_file *stream, int need_pre_space, int need_post_space) { int did_print_modifier = 0; - char *address_space_id; + const char *address_space_id; /* We don't print `const' qualifiers for references --- since all operators affect the thing referenced, not the reference itself, diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c deleted file mode 100644 index d588ec2..0000000 --- a/gdb/ch-exp.c +++ /dev/null @@ -1,2233 +0,0 @@ -// OBSOLETE /* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*- -// OBSOLETE Copyright 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Parse a Chill expression from text in a string, -// OBSOLETE and return the result as a struct expression pointer. -// OBSOLETE That structure contains arithmetic operations in reverse polish, -// OBSOLETE with constants represented by operations that are followed by special data. -// OBSOLETE See expression.h for the details of the format. -// OBSOLETE What is important here is that it can be built up sequentially -// OBSOLETE during the process of parsing; the lower levels of the tree always -// OBSOLETE come first in the result. -// OBSOLETE -// OBSOLETE Note that the language accepted by this parser is more liberal -// OBSOLETE than the one accepted by an actual Chill compiler. For example, the -// OBSOLETE language rule that a simple name string can not be one of the reserved -// OBSOLETE simple name strings is not enforced (e.g "case" is not treated as a -// OBSOLETE reserved name). Another example is that Chill is a strongly typed -// OBSOLETE language, and certain expressions that violate the type constraints -// OBSOLETE may still be evaluated if gdb can do so in a meaningful manner, while -// OBSOLETE such expressions would be rejected by the compiler. The reason for -// OBSOLETE this more liberal behavior is the philosophy that the debugger -// OBSOLETE is intended to be a tool that is used by the programmer when things -// OBSOLETE go wrong, and as such, it should provide as few artificial barriers -// OBSOLETE to it's use as possible. If it can do something meaningful, even -// OBSOLETE something that violates language contraints that are enforced by the -// OBSOLETE compiler, it should do so without complaint. -// OBSOLETE -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include -// OBSOLETE #include "expression.h" -// OBSOLETE #include "language.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "parser-defs.h" -// OBSOLETE #include "ch-lang.h" -// OBSOLETE #include "bfd.h" /* Required by objfiles.h. */ -// OBSOLETE #include "symfile.h" /* Required by objfiles.h. */ -// OBSOLETE #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ -// OBSOLETE -// OBSOLETE #ifdef __GNUC__ -// OBSOLETE #define INLINE __inline__ -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE typedef union -// OBSOLETE -// OBSOLETE { -// OBSOLETE LONGEST lval; -// OBSOLETE ULONGEST ulval; -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE LONGEST val; -// OBSOLETE struct type *type; -// OBSOLETE } -// OBSOLETE typed_val; -// OBSOLETE double dval; -// OBSOLETE struct symbol *sym; -// OBSOLETE struct type *tval; -// OBSOLETE struct stoken sval; -// OBSOLETE struct ttype tsym; -// OBSOLETE struct symtoken ssym; -// OBSOLETE } -// OBSOLETE YYSTYPE; -// OBSOLETE -// OBSOLETE enum ch_terminal -// OBSOLETE { -// OBSOLETE END_TOKEN = 0, -// OBSOLETE /* '\001' ... '\xff' come first. */ -// OBSOLETE OPEN_PAREN = '(', -// OBSOLETE TOKEN_NOT_READ = 999, -// OBSOLETE INTEGER_LITERAL, -// OBSOLETE BOOLEAN_LITERAL, -// OBSOLETE CHARACTER_LITERAL, -// OBSOLETE FLOAT_LITERAL, -// OBSOLETE GENERAL_PROCEDURE_NAME, -// OBSOLETE LOCATION_NAME, -// OBSOLETE EMPTINESS_LITERAL, -// OBSOLETE CHARACTER_STRING_LITERAL, -// OBSOLETE BIT_STRING_LITERAL, -// OBSOLETE TYPENAME, -// OBSOLETE DOT_FIELD_NAME, /* '.' followed by */ -// OBSOLETE CASE, -// OBSOLETE OF, -// OBSOLETE ESAC, -// OBSOLETE LOGIOR, -// OBSOLETE ORIF, -// OBSOLETE LOGXOR, -// OBSOLETE LOGAND, -// OBSOLETE ANDIF, -// OBSOLETE NOTEQUAL, -// OBSOLETE GEQ, -// OBSOLETE LEQ, -// OBSOLETE IN, -// OBSOLETE SLASH_SLASH, -// OBSOLETE MOD, -// OBSOLETE REM, -// OBSOLETE NOT, -// OBSOLETE POINTER, -// OBSOLETE RECEIVE, -// OBSOLETE UP, -// OBSOLETE IF, -// OBSOLETE THEN, -// OBSOLETE ELSE, -// OBSOLETE FI, -// OBSOLETE ELSIF, -// OBSOLETE ILLEGAL_TOKEN, -// OBSOLETE NUM, -// OBSOLETE PRED, -// OBSOLETE SUCC, -// OBSOLETE ABS, -// OBSOLETE CARD, -// OBSOLETE MAX_TOKEN, -// OBSOLETE MIN_TOKEN, -// OBSOLETE ADDR_TOKEN, -// OBSOLETE SIZE, -// OBSOLETE UPPER, -// OBSOLETE LOWER, -// OBSOLETE LENGTH, -// OBSOLETE ARRAY, -// OBSOLETE GDB_VARIABLE, -// OBSOLETE GDB_ASSIGNMENT -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Forward declarations. */ -// OBSOLETE -// OBSOLETE static void write_lower_upper_value (enum exp_opcode, struct type *); -// OBSOLETE static enum ch_terminal match_bitstring_literal (void); -// OBSOLETE static enum ch_terminal match_integer_literal (void); -// OBSOLETE static enum ch_terminal match_character_literal (void); -// OBSOLETE static enum ch_terminal match_string_literal (void); -// OBSOLETE static enum ch_terminal match_float_literal (void); -// OBSOLETE static int decode_integer_literal (LONGEST *, char **); -// OBSOLETE static int decode_integer_value (int, char **, LONGEST *); -// OBSOLETE static char *match_simple_name_string (void); -// OBSOLETE static void growbuf_by_size (int); -// OBSOLETE static void parse_case_label (void); -// OBSOLETE static void parse_untyped_expr (void); -// OBSOLETE static void parse_if_expression (void); -// OBSOLETE static void parse_if_expression_body (void); -// OBSOLETE static void parse_else_alternative (void); -// OBSOLETE static void parse_then_alternative (void); -// OBSOLETE static void parse_expr (void); -// OBSOLETE static void parse_operand0 (void); -// OBSOLETE static void parse_operand1 (void); -// OBSOLETE static void parse_operand2 (void); -// OBSOLETE static void parse_operand3 (void); -// OBSOLETE static void parse_operand4 (void); -// OBSOLETE static void parse_operand5 (void); -// OBSOLETE static void parse_operand6 (void); -// OBSOLETE static void parse_primval (void); -// OBSOLETE static void parse_tuple (struct type *); -// OBSOLETE static void parse_opt_element_list (struct type *); -// OBSOLETE static void parse_tuple_element (struct type *); -// OBSOLETE static void parse_named_record_element (void); -// OBSOLETE static void parse_call (void); -// OBSOLETE static struct type *parse_mode_or_normal_call (void); -// OBSOLETE #if 0 -// OBSOLETE static struct type *parse_mode_call (void); -// OBSOLETE #endif -// OBSOLETE static void parse_unary_call (void); -// OBSOLETE static int parse_opt_untyped_expr (void); -// OBSOLETE static int expect (enum ch_terminal, char *); -// OBSOLETE static enum ch_terminal ch_lex (void); -// OBSOLETE INLINE static enum ch_terminal PEEK_TOKEN (void); -// OBSOLETE static enum ch_terminal peek_token_ (int); -// OBSOLETE static void forward_token_ (void); -// OBSOLETE static void require (enum ch_terminal); -// OBSOLETE static int check_token (enum ch_terminal); -// OBSOLETE -// OBSOLETE #define MAX_LOOK_AHEAD 2 -// OBSOLETE static enum ch_terminal terminal_buffer[MAX_LOOK_AHEAD + 1] = -// OBSOLETE { -// OBSOLETE TOKEN_NOT_READ, TOKEN_NOT_READ, TOKEN_NOT_READ}; -// OBSOLETE static YYSTYPE yylval; -// OBSOLETE static YYSTYPE val_buffer[MAX_LOOK_AHEAD + 1]; -// OBSOLETE -// OBSOLETE /*int current_token, lookahead_token; */ -// OBSOLETE -// OBSOLETE INLINE static enum ch_terminal -// OBSOLETE PEEK_TOKEN (void) -// OBSOLETE { -// OBSOLETE if (terminal_buffer[0] == TOKEN_NOT_READ) -// OBSOLETE { -// OBSOLETE terminal_buffer[0] = ch_lex (); -// OBSOLETE val_buffer[0] = yylval; -// OBSOLETE } -// OBSOLETE return terminal_buffer[0]; -// OBSOLETE } -// OBSOLETE #define PEEK_LVAL() val_buffer[0] -// OBSOLETE #define PEEK_TOKEN1() peek_token_(1) -// OBSOLETE #define PEEK_TOKEN2() peek_token_(2) -// OBSOLETE static enum ch_terminal -// OBSOLETE peek_token_ (int i) -// OBSOLETE { -// OBSOLETE if (i > MAX_LOOK_AHEAD) -// OBSOLETE internal_error (__FILE__, __LINE__, -// OBSOLETE "too much lookahead"); -// OBSOLETE if (terminal_buffer[i] == TOKEN_NOT_READ) -// OBSOLETE { -// OBSOLETE terminal_buffer[i] = ch_lex (); -// OBSOLETE val_buffer[i] = yylval; -// OBSOLETE } -// OBSOLETE return terminal_buffer[i]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE -// OBSOLETE static void -// OBSOLETE pushback_token (enum ch_terminal code, YYSTYPE node) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ) -// OBSOLETE internal_error (__FILE__, __LINE__, -// OBSOLETE "cannot pushback token"); -// OBSOLETE for (i = MAX_LOOK_AHEAD; i > 0; i--) -// OBSOLETE { -// OBSOLETE terminal_buffer[i] = terminal_buffer[i - 1]; -// OBSOLETE val_buffer[i] = val_buffer[i - 1]; -// OBSOLETE } -// OBSOLETE terminal_buffer[0] = code; -// OBSOLETE val_buffer[0] = node; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE static void -// OBSOLETE forward_token_ (void) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE for (i = 0; i < MAX_LOOK_AHEAD; i++) -// OBSOLETE { -// OBSOLETE terminal_buffer[i] = terminal_buffer[i + 1]; -// OBSOLETE val_buffer[i] = val_buffer[i + 1]; -// OBSOLETE } -// OBSOLETE terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ; -// OBSOLETE } -// OBSOLETE #define FORWARD_TOKEN() forward_token_() -// OBSOLETE -// OBSOLETE /* Skip the next token. -// OBSOLETE if it isn't TOKEN, the parser is broken. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE require (enum ch_terminal token) -// OBSOLETE { -// OBSOLETE if (PEEK_TOKEN () != token) -// OBSOLETE { -// OBSOLETE internal_error (__FILE__, __LINE__, -// OBSOLETE "expected token %d", (int) token); -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE check_token (enum ch_terminal token) -// OBSOLETE { -// OBSOLETE if (PEEK_TOKEN () != token) -// OBSOLETE return 0; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* return 0 if expected token was not found, -// OBSOLETE else return 1. -// OBSOLETE */ -// OBSOLETE static int -// OBSOLETE expect (enum ch_terminal token, char *message) -// OBSOLETE { -// OBSOLETE if (PEEK_TOKEN () != token) -// OBSOLETE { -// OBSOLETE if (message) -// OBSOLETE error (message); -// OBSOLETE else if (token < 256) -// OBSOLETE error ("syntax error - expected a '%c' here \"%s\"", token, lexptr); -// OBSOLETE else -// OBSOLETE error ("syntax error"); -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE /* Parse a name string. If ALLOW_ALL is 1, ALL is allowed as a postfix. */ -// OBSOLETE -// OBSOLETE static tree -// OBSOLETE parse_opt_name_string (int allow_all) -// OBSOLETE { -// OBSOLETE int token = PEEK_TOKEN (); -// OBSOLETE tree name; -// OBSOLETE if (token != NAME) -// OBSOLETE { -// OBSOLETE if (token == ALL && allow_all) -// OBSOLETE { -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE return ALL_POSTFIX; -// OBSOLETE } -// OBSOLETE return NULL_TREE; -// OBSOLETE } -// OBSOLETE name = PEEK_LVAL (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE token = PEEK_TOKEN (); -// OBSOLETE if (token != '!') -// OBSOLETE return name; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE token = PEEK_TOKEN (); -// OBSOLETE if (token == ALL && allow_all) -// OBSOLETE return get_identifier3 (IDENTIFIER_POINTER (name), "!", "*"); -// OBSOLETE if (token != NAME) -// OBSOLETE { -// OBSOLETE if (pass == 1) -// OBSOLETE error ("'%s!' is not followed by an identifier", -// OBSOLETE IDENTIFIER_POINTER (name)); -// OBSOLETE return name; -// OBSOLETE } -// OBSOLETE name = get_identifier3 (IDENTIFIER_POINTER (name), -// OBSOLETE "!", IDENTIFIER_POINTER (PEEK_LVAL ())); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static tree -// OBSOLETE parse_simple_name_string (void) -// OBSOLETE { -// OBSOLETE int token = PEEK_TOKEN (); -// OBSOLETE tree name; -// OBSOLETE if (token != NAME) -// OBSOLETE { -// OBSOLETE error ("expected a name here"); -// OBSOLETE return error_mark_node; -// OBSOLETE } -// OBSOLETE name = PEEK_LVAL (); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE return name; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static tree -// OBSOLETE parse_name_string (void) -// OBSOLETE { -// OBSOLETE tree name = parse_opt_name_string (0); -// OBSOLETE if (name) -// OBSOLETE return name; -// OBSOLETE if (pass == 1) -// OBSOLETE error ("expected a name string here"); -// OBSOLETE return error_mark_node; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Matches: -// OBSOLETE Returns if pass 1: the identifier. -// OBSOLETE Returns if pass 2: a decl or value for identifier. */ -// OBSOLETE -// OBSOLETE static tree -// OBSOLETE parse_name (void) -// OBSOLETE { -// OBSOLETE tree name = parse_name_string (); -// OBSOLETE if (pass == 1 || ignoring) -// OBSOLETE return name; -// OBSOLETE else -// OBSOLETE { -// OBSOLETE tree decl = lookup_name (name); -// OBSOLETE if (decl == NULL_TREE) -// OBSOLETE { -// OBSOLETE error ("`%s' undeclared", IDENTIFIER_POINTER (name)); -// OBSOLETE return error_mark_node; -// OBSOLETE } -// OBSOLETE else if (TREE_CODE (TREE_TYPE (decl)) == ERROR_MARK) -// OBSOLETE return error_mark_node; -// OBSOLETE else if (TREE_CODE (decl) == CONST_DECL) -// OBSOLETE return DECL_INITIAL (decl); -// OBSOLETE else if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE) -// OBSOLETE return convert_from_reference (decl); -// OBSOLETE else -// OBSOLETE return decl; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE static void -// OBSOLETE pushback_paren_expr (tree expr) -// OBSOLETE { -// OBSOLETE if (pass == 1 && !ignoring) -// OBSOLETE expr = build1 (PAREN_EXPR, NULL_TREE, expr); -// OBSOLETE pushback_token (EXPR, expr); -// OBSOLETE } -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* Matches: */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_case_label (void) -// OBSOLETE { -// OBSOLETE if (check_token (ELSE)) -// OBSOLETE error ("ELSE in tuples labels not implemented"); -// OBSOLETE /* Does not handle the case of a mode name. FIXME */ -// OBSOLETE parse_expr (); -// OBSOLETE if (check_token (':')) -// OBSOLETE { -// OBSOLETE parse_expr (); -// OBSOLETE write_exp_elt_opcode (BINOP_RANGE); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE parse_opt_untyped_expr (void) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case ',': -// OBSOLETE case ':': -// OBSOLETE case ')': -// OBSOLETE return 0; -// OBSOLETE default: -// OBSOLETE parse_untyped_expr (); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_unary_call (void) -// OBSOLETE { -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE expect ('(', NULL); -// OBSOLETE parse_expr (); -// OBSOLETE expect (')', NULL); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Parse NAME '(' MODENAME ')'. */ -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE parse_mode_call (void) -// OBSOLETE { -// OBSOLETE struct type *type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE expect ('(', NULL); -// OBSOLETE if (PEEK_TOKEN () != TYPENAME) -// OBSOLETE error ("expect MODENAME here `%s'", lexptr); -// OBSOLETE type = PEEK_LVAL ().tsym.type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE expect (')', NULL); -// OBSOLETE return type; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE parse_mode_or_normal_call (void) -// OBSOLETE { -// OBSOLETE struct type *type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE expect ('(', NULL); -// OBSOLETE if (PEEK_TOKEN () == TYPENAME) -// OBSOLETE { -// OBSOLETE type = PEEK_LVAL ().tsym.type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE parse_expr (); -// OBSOLETE type = NULL; -// OBSOLETE } -// OBSOLETE expect (')', NULL); -// OBSOLETE return type; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Parse something that looks like a function call. -// OBSOLETE Assume we have parsed the function, and are at the '('. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_call (void) -// OBSOLETE { -// OBSOLETE int arg_count; -// OBSOLETE require ('('); -// OBSOLETE /* This is to save the value of arglist_len -// OBSOLETE being accumulated for each dimension. */ -// OBSOLETE start_arglist (); -// OBSOLETE if (parse_opt_untyped_expr ()) -// OBSOLETE { -// OBSOLETE int tok = PEEK_TOKEN (); -// OBSOLETE arglist_len = 1; -// OBSOLETE if (tok == UP || tok == ':') -// OBSOLETE { -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_expr (); -// OBSOLETE expect (')', "expected ')' to terminate slice"); -// OBSOLETE end_arglist (); -// OBSOLETE write_exp_elt_opcode (tok == UP ? TERNOP_SLICE_COUNT -// OBSOLETE : TERNOP_SLICE); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE while (check_token (',')) -// OBSOLETE { -// OBSOLETE parse_untyped_expr (); -// OBSOLETE arglist_len++; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE arglist_len = 0; -// OBSOLETE expect (')', NULL); -// OBSOLETE arg_count = end_arglist (); -// OBSOLETE write_exp_elt_opcode (MULTI_SUBSCRIPT); -// OBSOLETE write_exp_elt_longcst (arg_count); -// OBSOLETE write_exp_elt_opcode (MULTI_SUBSCRIPT); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_named_record_element (void) -// OBSOLETE { -// OBSOLETE struct stoken label; -// OBSOLETE char buf[256]; -// OBSOLETE -// OBSOLETE label = PEEK_LVAL ().sval; -// OBSOLETE sprintf (buf, "expected a field name here `%s'", lexptr); -// OBSOLETE expect (DOT_FIELD_NAME, buf); -// OBSOLETE if (check_token (',')) -// OBSOLETE parse_named_record_element (); -// OBSOLETE else if (check_token (':')) -// OBSOLETE parse_expr (); -// OBSOLETE else -// OBSOLETE error ("syntax error near `%s' in named record tuple element", lexptr); -// OBSOLETE write_exp_elt_opcode (OP_LABELED); -// OBSOLETE write_exp_string (label); -// OBSOLETE write_exp_elt_opcode (OP_LABELED); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Returns one or more TREE_LIST nodes, in reverse order. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_tuple_element (struct type *type) -// OBSOLETE { -// OBSOLETE if (PEEK_TOKEN () == DOT_FIELD_NAME) -// OBSOLETE { -// OBSOLETE /* Parse a labelled structure tuple. */ -// OBSOLETE parse_named_record_element (); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (check_token ('(')) -// OBSOLETE { -// OBSOLETE if (check_token ('*')) -// OBSOLETE { -// OBSOLETE expect (')', "missing ')' after '*' case label list"); -// OBSOLETE if (type) -// OBSOLETE { -// OBSOLETE if (TYPE_CODE (type) == TYPE_CODE_ARRAY) -// OBSOLETE { -// OBSOLETE /* do this as a range from low to high */ -// OBSOLETE struct type *range_type = TYPE_FIELD_TYPE (type, 0); -// OBSOLETE LONGEST low_bound, high_bound; -// OBSOLETE if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -// OBSOLETE error ("cannot determine bounds for (*)"); -// OBSOLETE /* lower bound */ -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (range_type); -// OBSOLETE write_exp_elt_longcst (low_bound); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE /* upper bound */ -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (range_type); -// OBSOLETE write_exp_elt_longcst (high_bound); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_opcode (BINOP_RANGE); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE error ("(*) in invalid context"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE error ("(*) only possible with modename in front of tuple (mode[..])"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE parse_case_label (); -// OBSOLETE while (check_token (',')) -// OBSOLETE { -// OBSOLETE parse_case_label (); -// OBSOLETE write_exp_elt_opcode (BINOP_COMMA); -// OBSOLETE } -// OBSOLETE expect (')', NULL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE parse_untyped_expr (); -// OBSOLETE if (check_token (':')) -// OBSOLETE { -// OBSOLETE /* A powerset range or a labeled Array. */ -// OBSOLETE parse_untyped_expr (); -// OBSOLETE write_exp_elt_opcode (BINOP_RANGE); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Matches: a COMMA-separated list of tuple elements. -// OBSOLETE Returns a list (of TREE_LIST nodes). */ -// OBSOLETE static void -// OBSOLETE parse_opt_element_list (struct type *type) -// OBSOLETE { -// OBSOLETE arglist_len = 0; -// OBSOLETE if (PEEK_TOKEN () == ']') -// OBSOLETE return; -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE parse_tuple_element (type); -// OBSOLETE arglist_len++; -// OBSOLETE if (PEEK_TOKEN () == ']') -// OBSOLETE break; -// OBSOLETE if (!check_token (',')) -// OBSOLETE error ("bad syntax in tuple"); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Parses: '[' elements ']' -// OBSOLETE If modename is non-NULL it prefixed the tuple. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_tuple (struct type *mode) -// OBSOLETE { -// OBSOLETE struct type *type; -// OBSOLETE if (mode) -// OBSOLETE type = check_typedef (mode); -// OBSOLETE else -// OBSOLETE type = 0; -// OBSOLETE require ('['); -// OBSOLETE start_arglist (); -// OBSOLETE parse_opt_element_list (type); -// OBSOLETE expect (']', "missing ']' after tuple"); -// OBSOLETE write_exp_elt_opcode (OP_ARRAY); -// OBSOLETE write_exp_elt_longcst ((LONGEST) 0); -// OBSOLETE write_exp_elt_longcst ((LONGEST) end_arglist () - 1); -// OBSOLETE write_exp_elt_opcode (OP_ARRAY); -// OBSOLETE if (type) -// OBSOLETE { -// OBSOLETE if (TYPE_CODE (type) != TYPE_CODE_ARRAY -// OBSOLETE && TYPE_CODE (type) != TYPE_CODE_STRUCT -// OBSOLETE && TYPE_CODE (type) != TYPE_CODE_SET) -// OBSOLETE error ("invalid tuple mode"); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE write_exp_elt_type (mode); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_primval (void) -// OBSOLETE { -// OBSOLETE struct type *type; -// OBSOLETE enum exp_opcode op; -// OBSOLETE char *op_name; -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case INTEGER_LITERAL: -// OBSOLETE case CHARACTER_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (PEEK_LVAL ().typed_val.type); -// OBSOLETE write_exp_elt_longcst (PEEK_LVAL ().typed_val.val); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case BOOLEAN_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_BOOL); -// OBSOLETE write_exp_elt_longcst ((LONGEST) PEEK_LVAL ().ulval); -// OBSOLETE write_exp_elt_opcode (OP_BOOL); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case FLOAT_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_DOUBLE); -// OBSOLETE write_exp_elt_type (builtin_type_double); -// OBSOLETE write_exp_elt_dblcst (PEEK_LVAL ().dval); -// OBSOLETE write_exp_elt_opcode (OP_DOUBLE); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case EMPTINESS_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (lookup_pointer_type (builtin_type_void)); -// OBSOLETE write_exp_elt_longcst (0); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case CHARACTER_STRING_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_STRING); -// OBSOLETE write_exp_string (PEEK_LVAL ().sval); -// OBSOLETE write_exp_elt_opcode (OP_STRING); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case BIT_STRING_LITERAL: -// OBSOLETE write_exp_elt_opcode (OP_BITSTRING); -// OBSOLETE write_exp_bitstring (PEEK_LVAL ().sval); -// OBSOLETE write_exp_elt_opcode (OP_BITSTRING); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case ARRAY: -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE /* This is pseudo-Chill, similar to C's '(TYPE[])EXPR' -// OBSOLETE which casts to an artificial array. */ -// OBSOLETE expect ('(', NULL); -// OBSOLETE expect (')', NULL); -// OBSOLETE if (PEEK_TOKEN () != TYPENAME) -// OBSOLETE error ("missing MODENAME after ARRAY()"); -// OBSOLETE type = PEEK_LVAL ().tsym.type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE expect ('(', NULL); -// OBSOLETE parse_expr (); -// OBSOLETE expect (')', "missing right parenthesis"); -// OBSOLETE type = create_array_type ((struct type *) NULL, type, -// OBSOLETE create_range_type ((struct type *) NULL, -// OBSOLETE builtin_type_int, 0, 0)); -// OBSOLETE TYPE_ARRAY_UPPER_BOUND_TYPE (type) = BOUND_CANNOT_BE_DETERMINED; -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE write_exp_elt_type (type); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE break; -// OBSOLETE #if 0 -// OBSOLETE case CONST: -// OBSOLETE case EXPR: -// OBSOLETE val = PEEK_LVAL (); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE #endif -// OBSOLETE case '(': -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_expr (); -// OBSOLETE expect (')', "missing right parenthesis"); -// OBSOLETE break; -// OBSOLETE case '[': -// OBSOLETE parse_tuple (NULL); -// OBSOLETE break; -// OBSOLETE case GENERAL_PROCEDURE_NAME: -// OBSOLETE case LOCATION_NAME: -// OBSOLETE write_exp_elt_opcode (OP_VAR_VALUE); -// OBSOLETE write_exp_elt_block (NULL); -// OBSOLETE write_exp_elt_sym (PEEK_LVAL ().ssym.sym); -// OBSOLETE write_exp_elt_opcode (OP_VAR_VALUE); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case GDB_VARIABLE: /* gdb specific */ -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE break; -// OBSOLETE case NUM: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE write_exp_elt_type (builtin_type_int); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE break; -// OBSOLETE case CARD: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_CARD); -// OBSOLETE break; -// OBSOLETE case MAX_TOKEN: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_CHMAX); -// OBSOLETE break; -// OBSOLETE case MIN_TOKEN: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_CHMIN); -// OBSOLETE break; -// OBSOLETE case PRED: -// OBSOLETE op_name = "PRED"; -// OBSOLETE goto unimplemented_unary_builtin; -// OBSOLETE case SUCC: -// OBSOLETE op_name = "SUCC"; -// OBSOLETE goto unimplemented_unary_builtin; -// OBSOLETE case ABS: -// OBSOLETE op_name = "ABS"; -// OBSOLETE goto unimplemented_unary_builtin; -// OBSOLETE unimplemented_unary_builtin: -// OBSOLETE parse_unary_call (); -// OBSOLETE error ("not implemented: %s builtin function", op_name); -// OBSOLETE break; -// OBSOLETE case ADDR_TOKEN: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_ADDR); -// OBSOLETE break; -// OBSOLETE case SIZE: -// OBSOLETE type = parse_mode_or_normal_call (); -// OBSOLETE if (type) -// OBSOLETE { -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (builtin_type_int); -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (type)); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE write_exp_elt_opcode (UNOP_SIZEOF); -// OBSOLETE break; -// OBSOLETE case LOWER: -// OBSOLETE op = UNOP_LOWER; -// OBSOLETE goto lower_upper; -// OBSOLETE case UPPER: -// OBSOLETE op = UNOP_UPPER; -// OBSOLETE goto lower_upper; -// OBSOLETE lower_upper: -// OBSOLETE type = parse_mode_or_normal_call (); -// OBSOLETE write_lower_upper_value (op, type); -// OBSOLETE break; -// OBSOLETE case LENGTH: -// OBSOLETE parse_unary_call (); -// OBSOLETE write_exp_elt_opcode (UNOP_LENGTH); -// OBSOLETE break; -// OBSOLETE case TYPENAME: -// OBSOLETE type = PEEK_LVAL ().tsym.type; -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case '[': -// OBSOLETE parse_tuple (type); -// OBSOLETE break; -// OBSOLETE case '(': -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_expr (); -// OBSOLETE expect (')', "missing right parenthesis"); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE write_exp_elt_type (type); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE error ("typename in invalid context"); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE error ("invalid expression syntax at `%s'", lexptr); -// OBSOLETE } -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case DOT_FIELD_NAME: -// OBSOLETE write_exp_elt_opcode (STRUCTOP_STRUCT); -// OBSOLETE write_exp_string (PEEK_LVAL ().sval); -// OBSOLETE write_exp_elt_opcode (STRUCTOP_STRUCT); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE continue; -// OBSOLETE case POINTER: -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE if (PEEK_TOKEN () == TYPENAME) -// OBSOLETE { -// OBSOLETE type = PEEK_LVAL ().tsym.type; -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE write_exp_elt_type (lookup_pointer_type (type)); -// OBSOLETE write_exp_elt_opcode (UNOP_CAST); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE } -// OBSOLETE write_exp_elt_opcode (UNOP_IND); -// OBSOLETE continue; -// OBSOLETE case OPEN_PAREN: -// OBSOLETE parse_call (); -// OBSOLETE continue; -// OBSOLETE case CHARACTER_STRING_LITERAL: -// OBSOLETE case CHARACTER_LITERAL: -// OBSOLETE case BIT_STRING_LITERAL: -// OBSOLETE /* Handle string repetition. (See comment in parse_operand5.) */ -// OBSOLETE parse_primval (); -// OBSOLETE write_exp_elt_opcode (MULTI_SUBSCRIPT); -// OBSOLETE write_exp_elt_longcst (1); -// OBSOLETE write_exp_elt_opcode (MULTI_SUBSCRIPT); -// OBSOLETE continue; -// OBSOLETE case END_TOKEN: -// OBSOLETE case TOKEN_NOT_READ: -// OBSOLETE case INTEGER_LITERAL: -// OBSOLETE case BOOLEAN_LITERAL: -// OBSOLETE case FLOAT_LITERAL: -// OBSOLETE case GENERAL_PROCEDURE_NAME: -// OBSOLETE case LOCATION_NAME: -// OBSOLETE case EMPTINESS_LITERAL: -// OBSOLETE case TYPENAME: -// OBSOLETE case CASE: -// OBSOLETE case OF: -// OBSOLETE case ESAC: -// OBSOLETE case LOGIOR: -// OBSOLETE case ORIF: -// OBSOLETE case LOGXOR: -// OBSOLETE case LOGAND: -// OBSOLETE case ANDIF: -// OBSOLETE case NOTEQUAL: -// OBSOLETE case GEQ: -// OBSOLETE case LEQ: -// OBSOLETE case IN: -// OBSOLETE case SLASH_SLASH: -// OBSOLETE case MOD: -// OBSOLETE case REM: -// OBSOLETE case NOT: -// OBSOLETE case RECEIVE: -// OBSOLETE case UP: -// OBSOLETE case IF: -// OBSOLETE case THEN: -// OBSOLETE case ELSE: -// OBSOLETE case FI: -// OBSOLETE case ELSIF: -// OBSOLETE case ILLEGAL_TOKEN: -// OBSOLETE case NUM: -// OBSOLETE case PRED: -// OBSOLETE case SUCC: -// OBSOLETE case ABS: -// OBSOLETE case CARD: -// OBSOLETE case MAX_TOKEN: -// OBSOLETE case MIN_TOKEN: -// OBSOLETE case ADDR_TOKEN: -// OBSOLETE case SIZE: -// OBSOLETE case UPPER: -// OBSOLETE case LOWER: -// OBSOLETE case LENGTH: -// OBSOLETE case ARRAY: -// OBSOLETE case GDB_VARIABLE: -// OBSOLETE case GDB_ASSIGNMENT: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand6 (void) -// OBSOLETE { -// OBSOLETE if (check_token (RECEIVE)) -// OBSOLETE { -// OBSOLETE parse_primval (); -// OBSOLETE error ("not implemented: RECEIVE expression"); -// OBSOLETE } -// OBSOLETE else if (check_token (POINTER)) -// OBSOLETE { -// OBSOLETE parse_primval (); -// OBSOLETE write_exp_elt_opcode (UNOP_ADDR); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE parse_primval (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand5 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE /* We are supposed to be looking for a , -// OBSOLETE but in general we can't distinguish that from a parenthesized -// OBSOLETE expression. This is especially difficult if we allow the -// OBSOLETE string operand to be a constant expression (as requested by -// OBSOLETE some users), and not just a string literal. -// OBSOLETE Consider: LPRN expr RPRN LPRN expr RPRN -// OBSOLETE Is that a function call or string repetition? -// OBSOLETE Instead, we handle string repetition in parse_primval, -// OBSOLETE and build_generalized_call. */ -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case NOT: -// OBSOLETE op = UNOP_LOGICAL_NOT; -// OBSOLETE break; -// OBSOLETE case '-': -// OBSOLETE op = UNOP_NEG; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE op = OP_NULL; -// OBSOLETE } -// OBSOLETE if (op != OP_NULL) -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand6 (); -// OBSOLETE if (op != OP_NULL) -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand4 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE parse_operand5 (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case '*': -// OBSOLETE op = BINOP_MUL; -// OBSOLETE break; -// OBSOLETE case '/': -// OBSOLETE op = BINOP_DIV; -// OBSOLETE break; -// OBSOLETE case MOD: -// OBSOLETE op = BINOP_MOD; -// OBSOLETE break; -// OBSOLETE case REM: -// OBSOLETE op = BINOP_REM; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand5 (); -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand3 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE parse_operand4 (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case '+': -// OBSOLETE op = BINOP_ADD; -// OBSOLETE break; -// OBSOLETE case '-': -// OBSOLETE op = BINOP_SUB; -// OBSOLETE break; -// OBSOLETE case SLASH_SLASH: -// OBSOLETE op = BINOP_CONCAT; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand4 (); -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand2 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE parse_operand3 (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE if (check_token (IN)) -// OBSOLETE { -// OBSOLETE parse_operand3 (); -// OBSOLETE write_exp_elt_opcode (BINOP_IN); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case '>': -// OBSOLETE op = BINOP_GTR; -// OBSOLETE break; -// OBSOLETE case GEQ: -// OBSOLETE op = BINOP_GEQ; -// OBSOLETE break; -// OBSOLETE case '<': -// OBSOLETE op = BINOP_LESS; -// OBSOLETE break; -// OBSOLETE case LEQ: -// OBSOLETE op = BINOP_LEQ; -// OBSOLETE break; -// OBSOLETE case '=': -// OBSOLETE op = BINOP_EQUAL; -// OBSOLETE break; -// OBSOLETE case NOTEQUAL: -// OBSOLETE op = BINOP_NOTEQUAL; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand3 (); -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand1 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE parse_operand2 (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case LOGAND: -// OBSOLETE op = BINOP_BITWISE_AND; -// OBSOLETE break; -// OBSOLETE case ANDIF: -// OBSOLETE op = BINOP_LOGICAL_AND; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand2 (); -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_operand0 (void) -// OBSOLETE { -// OBSOLETE enum exp_opcode op; -// OBSOLETE parse_operand1 (); -// OBSOLETE for (;;) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case LOGIOR: -// OBSOLETE op = BINOP_BITWISE_IOR; -// OBSOLETE break; -// OBSOLETE case LOGXOR: -// OBSOLETE op = BINOP_BITWISE_XOR; -// OBSOLETE break; -// OBSOLETE case ORIF: -// OBSOLETE op = BINOP_LOGICAL_OR; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_operand1 (); -// OBSOLETE write_exp_elt_opcode (op); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_expr (void) -// OBSOLETE { -// OBSOLETE parse_operand0 (); -// OBSOLETE if (check_token (GDB_ASSIGNMENT)) -// OBSOLETE { -// OBSOLETE parse_expr (); -// OBSOLETE write_exp_elt_opcode (BINOP_ASSIGN); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_then_alternative (void) -// OBSOLETE { -// OBSOLETE expect (THEN, "missing 'THEN' in 'IF' expression"); -// OBSOLETE parse_expr (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_else_alternative (void) -// OBSOLETE { -// OBSOLETE if (check_token (ELSIF)) -// OBSOLETE parse_if_expression_body (); -// OBSOLETE else if (check_token (ELSE)) -// OBSOLETE parse_expr (); -// OBSOLETE else -// OBSOLETE error ("missing ELSE/ELSIF in IF expression"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Matches: */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_if_expression_body (void) -// OBSOLETE { -// OBSOLETE parse_expr (); -// OBSOLETE parse_then_alternative (); -// OBSOLETE parse_else_alternative (); -// OBSOLETE write_exp_elt_opcode (TERNOP_COND); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_if_expression (void) -// OBSOLETE { -// OBSOLETE require (IF); -// OBSOLETE parse_if_expression_body (); -// OBSOLETE expect (FI, "missing 'FI' at end of conditional expression"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* An is a superset of . It also includes -// OBSOLETE and untyped , whose types -// OBSOLETE are not given by their constituents. Hence, these are only -// OBSOLETE allowed in certain contexts that expect a certain type. -// OBSOLETE You should call convert() to fix up the . */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE parse_untyped_expr (void) -// OBSOLETE { -// OBSOLETE switch (PEEK_TOKEN ()) -// OBSOLETE { -// OBSOLETE case IF: -// OBSOLETE parse_if_expression (); -// OBSOLETE return; -// OBSOLETE case CASE: -// OBSOLETE error ("not implemented: CASE expression"); -// OBSOLETE case '(': -// OBSOLETE switch (PEEK_TOKEN1 ()) -// OBSOLETE { -// OBSOLETE case IF: -// OBSOLETE case CASE: -// OBSOLETE goto skip_lprn; -// OBSOLETE case '[': -// OBSOLETE skip_lprn: -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE parse_untyped_expr (); -// OBSOLETE expect (')', "missing ')'"); -// OBSOLETE return; -// OBSOLETE default:; -// OBSOLETE /* fall through */ -// OBSOLETE } -// OBSOLETE default: -// OBSOLETE parse_operand0 (); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE int -// OBSOLETE chill_parse (void) -// OBSOLETE { -// OBSOLETE terminal_buffer[0] = TOKEN_NOT_READ; -// OBSOLETE if (PEEK_TOKEN () == TYPENAME && PEEK_TOKEN1 () == END_TOKEN) -// OBSOLETE { -// OBSOLETE write_exp_elt_opcode (OP_TYPE); -// OBSOLETE write_exp_elt_type (PEEK_LVAL ().tsym.type); -// OBSOLETE write_exp_elt_opcode (OP_TYPE); -// OBSOLETE FORWARD_TOKEN (); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE parse_expr (); -// OBSOLETE if (terminal_buffer[0] != END_TOKEN) -// OBSOLETE { -// OBSOLETE if (comma_terminates && terminal_buffer[0] == ',') -// OBSOLETE lexptr--; /* Put the comma back. */ -// OBSOLETE else -// OBSOLETE error ("Junk after end of expression."); -// OBSOLETE } -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Implementation of a dynamically expandable buffer for processing input -// OBSOLETE characters acquired through lexptr and building a value to return in -// OBSOLETE yylval. */ -// OBSOLETE -// OBSOLETE static char *tempbuf; /* Current buffer contents */ -// OBSOLETE static int tempbufsize; /* Size of allocated buffer */ -// OBSOLETE static int tempbufindex; /* Current index into buffer */ -// OBSOLETE -// OBSOLETE #define GROWBY_MIN_SIZE 64 /* Minimum amount to grow buffer by */ -// OBSOLETE -// OBSOLETE #define CHECKBUF(size) \ -// OBSOLETE do { \ -// OBSOLETE if (tempbufindex + (size) >= tempbufsize) \ -// OBSOLETE { \ -// OBSOLETE growbuf_by_size (size); \ -// OBSOLETE } \ -// OBSOLETE } while (0); -// OBSOLETE -// OBSOLETE /* Grow the static temp buffer if necessary, including allocating the first one -// OBSOLETE on demand. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE growbuf_by_size (int count) -// OBSOLETE { -// OBSOLETE int growby; -// OBSOLETE -// OBSOLETE growby = max (count, GROWBY_MIN_SIZE); -// OBSOLETE tempbufsize += growby; -// OBSOLETE if (tempbuf == NULL) -// OBSOLETE { -// OBSOLETE tempbuf = (char *) xmalloc (tempbufsize); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE tempbuf = (char *) xrealloc (tempbuf, tempbufsize); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Try to consume a simple name string token. If successful, returns -// OBSOLETE a pointer to a nullbyte terminated copy of the name that can be used -// OBSOLETE in symbol table lookups. If not successful, returns NULL. */ -// OBSOLETE -// OBSOLETE static char * -// OBSOLETE match_simple_name_string (void) -// OBSOLETE { -// OBSOLETE char *tokptr = lexptr; -// OBSOLETE -// OBSOLETE if (isalpha (*tokptr) || *tokptr == '_') -// OBSOLETE { -// OBSOLETE char *result; -// OBSOLETE do -// OBSOLETE { -// OBSOLETE tokptr++; -// OBSOLETE } -// OBSOLETE while (isalnum (*tokptr) || (*tokptr == '_')); -// OBSOLETE yylval.sval.ptr = lexptr; -// OBSOLETE yylval.sval.length = tokptr - lexptr; -// OBSOLETE lexptr = tokptr; -// OBSOLETE result = copy_name (yylval.sval); -// OBSOLETE return result; -// OBSOLETE } -// OBSOLETE return (NULL); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Start looking for a value composed of valid digits as set by the base -// OBSOLETE in use. Note that '_' characters are valid anywhere, in any quantity, -// OBSOLETE and are simply ignored. Since we must find at least one valid digit, -// OBSOLETE or reject this token as an integer literal, we keep track of how many -// OBSOLETE digits we have encountered. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE decode_integer_value (int base, char **tokptrptr, LONGEST *ivalptr) -// OBSOLETE { -// OBSOLETE char *tokptr = *tokptrptr; -// OBSOLETE int temp; -// OBSOLETE int digits = 0; -// OBSOLETE -// OBSOLETE while (*tokptr != '\0') -// OBSOLETE { -// OBSOLETE temp = *tokptr; -// OBSOLETE if (isupper (temp)) -// OBSOLETE temp = tolower (temp); -// OBSOLETE tokptr++; -// OBSOLETE switch (temp) -// OBSOLETE { -// OBSOLETE case '_': -// OBSOLETE continue; -// OBSOLETE case '0': -// OBSOLETE case '1': -// OBSOLETE case '2': -// OBSOLETE case '3': -// OBSOLETE case '4': -// OBSOLETE case '5': -// OBSOLETE case '6': -// OBSOLETE case '7': -// OBSOLETE case '8': -// OBSOLETE case '9': -// OBSOLETE temp -= '0'; -// OBSOLETE break; -// OBSOLETE case 'a': -// OBSOLETE case 'b': -// OBSOLETE case 'c': -// OBSOLETE case 'd': -// OBSOLETE case 'e': -// OBSOLETE case 'f': -// OBSOLETE temp -= 'a'; -// OBSOLETE temp += 10; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE temp = base; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE if (temp < base) -// OBSOLETE { -// OBSOLETE digits++; -// OBSOLETE *ivalptr *= base; -// OBSOLETE *ivalptr += temp; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Found something not in domain for current base. */ -// OBSOLETE tokptr--; /* Unconsume what gave us indigestion. */ -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If we didn't find any digits, then we don't have a valid integer -// OBSOLETE value, so reject the entire token. Otherwise, update the lexical -// OBSOLETE scan pointer, and return non-zero for success. */ -// OBSOLETE -// OBSOLETE if (digits == 0) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE *tokptrptr = tokptr; -// OBSOLETE return (1); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE decode_integer_literal (LONGEST *valptr, char **tokptrptr) -// OBSOLETE { -// OBSOLETE char *tokptr = *tokptrptr; -// OBSOLETE int base = 0; -// OBSOLETE LONGEST ival = 0; -// OBSOLETE int explicit_base = 0; -// OBSOLETE -// OBSOLETE /* Look for an explicit base specifier, which is optional. */ -// OBSOLETE -// OBSOLETE switch (*tokptr) -// OBSOLETE { -// OBSOLETE case 'd': -// OBSOLETE case 'D': -// OBSOLETE explicit_base++; -// OBSOLETE base = 10; -// OBSOLETE tokptr++; -// OBSOLETE break; -// OBSOLETE case 'b': -// OBSOLETE case 'B': -// OBSOLETE explicit_base++; -// OBSOLETE base = 2; -// OBSOLETE tokptr++; -// OBSOLETE break; -// OBSOLETE case 'h': -// OBSOLETE case 'H': -// OBSOLETE explicit_base++; -// OBSOLETE base = 16; -// OBSOLETE tokptr++; -// OBSOLETE break; -// OBSOLETE case 'o': -// OBSOLETE case 'O': -// OBSOLETE explicit_base++; -// OBSOLETE base = 8; -// OBSOLETE tokptr++; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE base = 10; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If we found an explicit base ensure that the character after the -// OBSOLETE explicit base is a single quote. */ -// OBSOLETE -// OBSOLETE if (explicit_base && (*tokptr++ != '\'')) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Attempt to decode whatever follows as an integer value in the -// OBSOLETE indicated base, updating the token pointer in the process and -// OBSOLETE computing the value into ival. Also, if we have an explicit -// OBSOLETE base, then the next character must not be a single quote, or we -// OBSOLETE have a bitstring literal, so reject the entire token in this case. -// OBSOLETE Otherwise, update the lexical scan pointer, and return non-zero -// OBSOLETE for success. */ -// OBSOLETE -// OBSOLETE if (!decode_integer_value (base, &tokptr, &ival)) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else if (explicit_base && (*tokptr == '\'')) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE *valptr = ival; -// OBSOLETE *tokptrptr = tokptr; -// OBSOLETE return (1); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If it wasn't for the fact that floating point values can contain '_' -// OBSOLETE characters, we could just let strtod do all the hard work by letting it -// OBSOLETE try to consume as much of the current token buffer as possible and -// OBSOLETE find a legal conversion. Unfortunately we need to filter out the '_' -// OBSOLETE characters before calling strtod, which we do by copying the other -// OBSOLETE legal chars to a local buffer to be converted. However since we also -// OBSOLETE need to keep track of where the last unconsumed character in the input -// OBSOLETE buffer is, we have transfer only as many characters as may compose a -// OBSOLETE legal floating point value. */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE match_float_literal (void) -// OBSOLETE { -// OBSOLETE char *tokptr = lexptr; -// OBSOLETE char *buf; -// OBSOLETE char *copy; -// OBSOLETE double dval; -// OBSOLETE extern double strtod (); -// OBSOLETE -// OBSOLETE /* Make local buffer in which to build the string to convert. This is -// OBSOLETE required because underscores are valid in chill floating point numbers -// OBSOLETE but not in the string passed to strtod to convert. The string will be -// OBSOLETE no longer than our input string. */ -// OBSOLETE -// OBSOLETE copy = buf = (char *) alloca (strlen (tokptr) + 1); -// OBSOLETE -// OBSOLETE /* Transfer all leading digits to the conversion buffer, discarding any -// OBSOLETE underscores. */ -// OBSOLETE -// OBSOLETE while (isdigit (*tokptr) || *tokptr == '_') -// OBSOLETE { -// OBSOLETE if (*tokptr != '_') -// OBSOLETE { -// OBSOLETE *copy++ = *tokptr; -// OBSOLETE } -// OBSOLETE tokptr++; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Now accept either a '.', or one of [eEdD]. Dot is legal regardless -// OBSOLETE of whether we found any leading digits, and we simply accept it and -// OBSOLETE continue on to look for the fractional part and/or exponent. One of -// OBSOLETE [eEdD] is legal only if we have seen digits, and means that there -// OBSOLETE is no fractional part. If we find neither of these, then this is -// OBSOLETE not a floating point number, so return failure. */ -// OBSOLETE -// OBSOLETE switch (*tokptr++) -// OBSOLETE { -// OBSOLETE case '.': -// OBSOLETE /* Accept and then look for fractional part and/or exponent. */ -// OBSOLETE *copy++ = '.'; -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 'e': -// OBSOLETE case 'E': -// OBSOLETE case 'd': -// OBSOLETE case 'D': -// OBSOLETE if (copy == buf) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE *copy++ = 'e'; -// OBSOLETE goto collect_exponent; -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE return (0); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* We found a '.', copy any fractional digits to the conversion buffer, up -// OBSOLETE to the first nondigit, non-underscore character. */ -// OBSOLETE -// OBSOLETE while (isdigit (*tokptr) || *tokptr == '_') -// OBSOLETE { -// OBSOLETE if (*tokptr != '_') -// OBSOLETE { -// OBSOLETE *copy++ = *tokptr; -// OBSOLETE } -// OBSOLETE tokptr++; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Look for an exponent, which must start with one of [eEdD]. If none -// OBSOLETE is found, jump directly to trying to convert what we have collected -// OBSOLETE so far. */ -// OBSOLETE -// OBSOLETE switch (*tokptr) -// OBSOLETE { -// OBSOLETE case 'e': -// OBSOLETE case 'E': -// OBSOLETE case 'd': -// OBSOLETE case 'D': -// OBSOLETE *copy++ = 'e'; -// OBSOLETE tokptr++; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE goto convert_float; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept an optional '-' or '+' following one of [eEdD]. */ -// OBSOLETE -// OBSOLETE collect_exponent: -// OBSOLETE if (*tokptr == '+' || *tokptr == '-') -// OBSOLETE { -// OBSOLETE *copy++ = *tokptr++; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Now copy an exponent into the conversion buffer. Note that at the -// OBSOLETE moment underscores are *not* allowed in exponents. */ -// OBSOLETE -// OBSOLETE while (isdigit (*tokptr)) -// OBSOLETE { -// OBSOLETE *copy++ = *tokptr++; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If we transfered any chars to the conversion buffer, try to interpret its -// OBSOLETE contents as a floating point value. If any characters remain, then we -// OBSOLETE must not have a valid floating point string. */ -// OBSOLETE -// OBSOLETE convert_float: -// OBSOLETE *copy = '\0'; -// OBSOLETE if (copy != buf) -// OBSOLETE { -// OBSOLETE dval = strtod (buf, ©); -// OBSOLETE if (*copy == '\0') -// OBSOLETE { -// OBSOLETE yylval.dval = dval; -// OBSOLETE lexptr = tokptr; -// OBSOLETE return (FLOAT_LITERAL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Recognize a string literal. A string literal is a sequence -// OBSOLETE of characters enclosed in matching single or double quotes, except that -// OBSOLETE a single character inside single quotes is a character literal, which -// OBSOLETE we reject as a string literal. To embed the terminator character inside -// OBSOLETE a string, it is simply doubled (I.E. "this""is""one""string") */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE match_string_literal (void) -// OBSOLETE { -// OBSOLETE char *tokptr = lexptr; -// OBSOLETE int in_ctrlseq = 0; -// OBSOLETE LONGEST ival; -// OBSOLETE -// OBSOLETE for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++) -// OBSOLETE { -// OBSOLETE CHECKBUF (1); -// OBSOLETE tryagain:; -// OBSOLETE if (in_ctrlseq) -// OBSOLETE { -// OBSOLETE /* skip possible whitespaces */ -// OBSOLETE while ((*tokptr == ' ' || *tokptr == '\t') && *tokptr) -// OBSOLETE tokptr++; -// OBSOLETE if (*tokptr == ')') -// OBSOLETE { -// OBSOLETE in_ctrlseq = 0; -// OBSOLETE tokptr++; -// OBSOLETE goto tryagain; -// OBSOLETE } -// OBSOLETE else if (*tokptr != ',') -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE tokptr++; -// OBSOLETE /* skip possible whitespaces */ -// OBSOLETE while ((*tokptr == ' ' || *tokptr == '\t') && *tokptr) -// OBSOLETE tokptr++; -// OBSOLETE if (!decode_integer_literal (&ival, &tokptr)) -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE tokptr--; -// OBSOLETE } -// OBSOLETE else if (*tokptr == *lexptr) -// OBSOLETE { -// OBSOLETE if (*(tokptr + 1) == *lexptr) -// OBSOLETE { -// OBSOLETE ival = *tokptr++; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (*tokptr == '^') -// OBSOLETE { -// OBSOLETE if (*(tokptr + 1) == '(') -// OBSOLETE { -// OBSOLETE in_ctrlseq = 1; -// OBSOLETE tokptr += 2; -// OBSOLETE if (!decode_integer_literal (&ival, &tokptr)) -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE tokptr--; -// OBSOLETE } -// OBSOLETE else if (*(tokptr + 1) == '^') -// OBSOLETE ival = *tokptr++; -// OBSOLETE else -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE ival = *tokptr; -// OBSOLETE tempbuf[tempbufindex++] = ival; -// OBSOLETE } -// OBSOLETE if (in_ctrlseq) -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE -// OBSOLETE if (*tokptr == '\0' /* no terminator */ -// OBSOLETE || (tempbufindex == 1 && *tokptr == '\'')) /* char literal */ -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE tempbuf[tempbufindex] = '\0'; -// OBSOLETE yylval.sval.ptr = tempbuf; -// OBSOLETE yylval.sval.length = tempbufindex; -// OBSOLETE lexptr = ++tokptr; -// OBSOLETE return (CHARACTER_STRING_LITERAL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Recognize a character literal. A character literal is single character -// OBSOLETE or a control sequence, enclosed in single quotes. A control sequence -// OBSOLETE is a comma separated list of one or more integer literals, enclosed -// OBSOLETE in parenthesis and introduced with a circumflex character. -// OBSOLETE -// OBSOLETE EX: 'a' '^(7)' '^(7,8)' -// OBSOLETE -// OBSOLETE As a GNU chill extension, the syntax C'xx' is also recognized as a -// OBSOLETE character literal, where xx is a hex value for the character. -// OBSOLETE -// OBSOLETE Note that more than a single character, enclosed in single quotes, is -// OBSOLETE a string literal. -// OBSOLETE -// OBSOLETE Returns CHARACTER_LITERAL if a match is found. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE match_character_literal (void) -// OBSOLETE { -// OBSOLETE char *tokptr = lexptr; -// OBSOLETE LONGEST ival = 0; -// OBSOLETE -// OBSOLETE if ((*tokptr == 'c' || *tokptr == 'C') && (*(tokptr + 1) == '\'')) -// OBSOLETE { -// OBSOLETE /* We have a GNU chill extension form, so skip the leading "C'", -// OBSOLETE decode the hex value, and then ensure that we have a trailing -// OBSOLETE single quote character. */ -// OBSOLETE tokptr += 2; -// OBSOLETE if (!decode_integer_value (16, &tokptr, &ival) || (*tokptr != '\'')) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE tokptr++; -// OBSOLETE } -// OBSOLETE else if (*tokptr == '\'') -// OBSOLETE { -// OBSOLETE tokptr++; -// OBSOLETE -// OBSOLETE /* Determine which form we have, either a control sequence or the -// OBSOLETE single character form. */ -// OBSOLETE -// OBSOLETE if (*tokptr == '^') -// OBSOLETE { -// OBSOLETE if (*(tokptr + 1) == '(') -// OBSOLETE { -// OBSOLETE /* Match and decode a control sequence. Return zero if we don't -// OBSOLETE find a valid integer literal, or if the next unconsumed character -// OBSOLETE after the integer literal is not the trailing ')'. */ -// OBSOLETE tokptr += 2; -// OBSOLETE if (!decode_integer_literal (&ival, &tokptr) || (*tokptr++ != ')')) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (*(tokptr + 1) == '^') -// OBSOLETE { -// OBSOLETE ival = *tokptr; -// OBSOLETE tokptr += 2; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE /* fail */ -// OBSOLETE error ("Invalid control sequence"); -// OBSOLETE } -// OBSOLETE else if (*tokptr == '\'') -// OBSOLETE { -// OBSOLETE /* this must be duplicated */ -// OBSOLETE ival = *tokptr; -// OBSOLETE tokptr += 2; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE ival = *tokptr++; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The trailing quote has not yet been consumed. If we don't find -// OBSOLETE it, then we have no match. */ -// OBSOLETE -// OBSOLETE if (*tokptr++ != '\'') -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Not a character literal. */ -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE yylval.typed_val.val = ival; -// OBSOLETE yylval.typed_val.type = builtin_type_chill_char; -// OBSOLETE lexptr = tokptr; -// OBSOLETE return (CHARACTER_LITERAL); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Recognize an integer literal, as specified in Z.200 sec 5.2.4.2. -// OBSOLETE Note that according to 5.2.4.2, a single "_" is also a valid integer -// OBSOLETE literal, however GNU-chill requires there to be at least one "digit" -// OBSOLETE in any integer literal. */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE match_integer_literal (void) -// OBSOLETE { -// OBSOLETE char *tokptr = lexptr; -// OBSOLETE LONGEST ival; -// OBSOLETE -// OBSOLETE if (!decode_integer_literal (&ival, &tokptr)) -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE yylval.typed_val.val = ival; -// OBSOLETE #if defined(CC_HAS_LONG_LONG) -// OBSOLETE if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U) -// OBSOLETE yylval.typed_val.type = builtin_type_long_long; -// OBSOLETE else -// OBSOLETE #endif -// OBSOLETE yylval.typed_val.type = builtin_type_int; -// OBSOLETE lexptr = tokptr; -// OBSOLETE return (INTEGER_LITERAL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Recognize a bit-string literal, as specified in Z.200 sec 5.2.4.8 -// OBSOLETE Note that according to 5.2.4.8, a single "_" is also a valid bit-string -// OBSOLETE literal, however GNU-chill requires there to be at least one "digit" -// OBSOLETE in any bit-string literal. */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE match_bitstring_literal (void) -// OBSOLETE { -// OBSOLETE register char *tokptr = lexptr; -// OBSOLETE int bitoffset = 0; -// OBSOLETE int bitcount = 0; -// OBSOLETE int bits_per_char; -// OBSOLETE int digit; -// OBSOLETE -// OBSOLETE tempbufindex = 0; -// OBSOLETE CHECKBUF (1); -// OBSOLETE tempbuf[0] = 0; -// OBSOLETE -// OBSOLETE /* Look for the required explicit base specifier. */ -// OBSOLETE -// OBSOLETE switch (*tokptr++) -// OBSOLETE { -// OBSOLETE case 'b': -// OBSOLETE case 'B': -// OBSOLETE bits_per_char = 1; -// OBSOLETE break; -// OBSOLETE case 'o': -// OBSOLETE case 'O': -// OBSOLETE bits_per_char = 3; -// OBSOLETE break; -// OBSOLETE case 'h': -// OBSOLETE case 'H': -// OBSOLETE bits_per_char = 4; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE return (0); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Ensure that the character after the explicit base is a single quote. */ -// OBSOLETE -// OBSOLETE if (*tokptr++ != '\'') -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE while (*tokptr != '\0' && *tokptr != '\'') -// OBSOLETE { -// OBSOLETE digit = *tokptr; -// OBSOLETE if (isupper (digit)) -// OBSOLETE digit = tolower (digit); -// OBSOLETE tokptr++; -// OBSOLETE switch (digit) -// OBSOLETE { -// OBSOLETE case '_': -// OBSOLETE continue; -// OBSOLETE case '0': -// OBSOLETE case '1': -// OBSOLETE case '2': -// OBSOLETE case '3': -// OBSOLETE case '4': -// OBSOLETE case '5': -// OBSOLETE case '6': -// OBSOLETE case '7': -// OBSOLETE case '8': -// OBSOLETE case '9': -// OBSOLETE digit -= '0'; -// OBSOLETE break; -// OBSOLETE case 'a': -// OBSOLETE case 'b': -// OBSOLETE case 'c': -// OBSOLETE case 'd': -// OBSOLETE case 'e': -// OBSOLETE case 'f': -// OBSOLETE digit -= 'a'; -// OBSOLETE digit += 10; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE /* this is not a bitstring literal, probably an integer */ -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE if (digit >= 1 << bits_per_char) -// OBSOLETE { -// OBSOLETE /* Found something not in domain for current base. */ -// OBSOLETE error ("Too-large digit in bitstring or integer."); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Extract bits from digit, packing them into the bitstring byte. */ -// OBSOLETE int k = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? bits_per_char - 1 : 0; -// OBSOLETE for (; TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k >= 0 : k < bits_per_char; -// OBSOLETE TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k-- : k++) -// OBSOLETE { -// OBSOLETE bitcount++; -// OBSOLETE if (digit & (1 << k)) -// OBSOLETE { -// OBSOLETE tempbuf[tempbufindex] |= -// OBSOLETE (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) -// OBSOLETE ? (1 << (HOST_CHAR_BIT - 1 - bitoffset)) -// OBSOLETE : (1 << bitoffset); -// OBSOLETE } -// OBSOLETE bitoffset++; -// OBSOLETE if (bitoffset == HOST_CHAR_BIT) -// OBSOLETE { -// OBSOLETE bitoffset = 0; -// OBSOLETE tempbufindex++; -// OBSOLETE CHECKBUF (1); -// OBSOLETE tempbuf[tempbufindex] = 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Verify that we consumed everything up to the trailing single quote, -// OBSOLETE and that we found some bits (IE not just underbars). */ -// OBSOLETE -// OBSOLETE if (*tokptr++ != '\'') -// OBSOLETE { -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE yylval.sval.ptr = tempbuf; -// OBSOLETE yylval.sval.length = bitcount; -// OBSOLETE lexptr = tokptr; -// OBSOLETE return (BIT_STRING_LITERAL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE struct token -// OBSOLETE { -// OBSOLETE char *operator; -// OBSOLETE int token; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static const struct token idtokentab[] = -// OBSOLETE { -// OBSOLETE {"array", ARRAY}, -// OBSOLETE {"length", LENGTH}, -// OBSOLETE {"lower", LOWER}, -// OBSOLETE {"upper", UPPER}, -// OBSOLETE {"andif", ANDIF}, -// OBSOLETE {"pred", PRED}, -// OBSOLETE {"succ", SUCC}, -// OBSOLETE {"card", CARD}, -// OBSOLETE {"size", SIZE}, -// OBSOLETE {"orif", ORIF}, -// OBSOLETE {"num", NUM}, -// OBSOLETE {"abs", ABS}, -// OBSOLETE {"max", MAX_TOKEN}, -// OBSOLETE {"min", MIN_TOKEN}, -// OBSOLETE {"mod", MOD}, -// OBSOLETE {"rem", REM}, -// OBSOLETE {"not", NOT}, -// OBSOLETE {"xor", LOGXOR}, -// OBSOLETE {"and", LOGAND}, -// OBSOLETE {"in", IN}, -// OBSOLETE {"or", LOGIOR}, -// OBSOLETE {"up", UP}, -// OBSOLETE {"addr", ADDR_TOKEN}, -// OBSOLETE {"null", EMPTINESS_LITERAL} -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static const struct token tokentab2[] = -// OBSOLETE { -// OBSOLETE {":=", GDB_ASSIGNMENT}, -// OBSOLETE {"//", SLASH_SLASH}, -// OBSOLETE {"->", POINTER}, -// OBSOLETE {"/=", NOTEQUAL}, -// OBSOLETE {"<=", LEQ}, -// OBSOLETE {">=", GEQ} -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Read one token, getting characters through lexptr. */ -// OBSOLETE /* This is where we will check to make sure that the language and the -// OBSOLETE operators used are compatible. */ -// OBSOLETE -// OBSOLETE static enum ch_terminal -// OBSOLETE ch_lex (void) -// OBSOLETE { -// OBSOLETE unsigned int i; -// OBSOLETE enum ch_terminal token; -// OBSOLETE char *inputname; -// OBSOLETE struct symbol *sym; -// OBSOLETE -// OBSOLETE /* Skip over any leading whitespace. */ -// OBSOLETE while (isspace (*lexptr)) -// OBSOLETE { -// OBSOLETE lexptr++; -// OBSOLETE } -// OBSOLETE /* Look for special single character cases which can't be the first -// OBSOLETE character of some other multicharacter token. */ -// OBSOLETE switch (*lexptr) -// OBSOLETE { -// OBSOLETE case '\0': -// OBSOLETE return END_TOKEN; -// OBSOLETE case ',': -// OBSOLETE case '=': -// OBSOLETE case ';': -// OBSOLETE case '!': -// OBSOLETE case '+': -// OBSOLETE case '*': -// OBSOLETE case '(': -// OBSOLETE case ')': -// OBSOLETE case '[': -// OBSOLETE case ']': -// OBSOLETE return (*lexptr++); -// OBSOLETE } -// OBSOLETE /* Look for characters which start a particular kind of multicharacter -// OBSOLETE token, such as a character literal, register name, convenience -// OBSOLETE variable name, string literal, etc. */ -// OBSOLETE switch (*lexptr) -// OBSOLETE { -// OBSOLETE case '\'': -// OBSOLETE case '\"': -// OBSOLETE /* First try to match a string literal, which is any -// OBSOLETE sequence of characters enclosed in matching single or double -// OBSOLETE quotes, except that a single character inside single quotes -// OBSOLETE is a character literal, so we have to catch that case also. */ -// OBSOLETE token = match_string_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE if (*lexptr == '\'') -// OBSOLETE { -// OBSOLETE token = match_character_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case 'C': -// OBSOLETE case 'c': -// OBSOLETE token = match_character_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case '$': -// OBSOLETE yylval.sval.ptr = lexptr; -// OBSOLETE do -// OBSOLETE { -// OBSOLETE lexptr++; -// OBSOLETE } -// OBSOLETE while (isalnum (*lexptr) || *lexptr == '_' || *lexptr == '$'); -// OBSOLETE yylval.sval.length = lexptr - yylval.sval.ptr; -// OBSOLETE write_dollar_variable (yylval.sval); -// OBSOLETE return GDB_VARIABLE; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE /* See if it is a special token of length 2. */ -// OBSOLETE for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++) -// OBSOLETE { -// OBSOLETE if (STREQN (lexptr, tokentab2[i].operator, 2)) -// OBSOLETE { -// OBSOLETE lexptr += 2; -// OBSOLETE return (tokentab2[i].token); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE /* Look for single character cases which which could be the first -// OBSOLETE character of some other multicharacter token, but aren't, or we -// OBSOLETE would already have found it. */ -// OBSOLETE switch (*lexptr) -// OBSOLETE { -// OBSOLETE case '-': -// OBSOLETE case ':': -// OBSOLETE case '/': -// OBSOLETE case '<': -// OBSOLETE case '>': -// OBSOLETE return (*lexptr++); -// OBSOLETE } -// OBSOLETE /* Look for a float literal before looking for an integer literal, so -// OBSOLETE we match as much of the input stream as possible. */ -// OBSOLETE token = match_float_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE token = match_bitstring_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE token = match_integer_literal (); -// OBSOLETE if (token != 0) -// OBSOLETE { -// OBSOLETE return (token); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Try to match a simple name string, and if a match is found, then -// OBSOLETE further classify what sort of name it is and return an appropriate -// OBSOLETE token. Note that attempting to match a simple name string consumes -// OBSOLETE the token from lexptr, so we can't back out if we later find that -// OBSOLETE we can't classify what sort of name it is. */ -// OBSOLETE -// OBSOLETE inputname = match_simple_name_string (); -// OBSOLETE -// OBSOLETE if (inputname != NULL) -// OBSOLETE { -// OBSOLETE char *simplename = (char *) alloca (strlen (inputname) + 1); -// OBSOLETE -// OBSOLETE char *dptr = simplename, *sptr = inputname; -// OBSOLETE for (; *sptr; sptr++) -// OBSOLETE *dptr++ = isupper (*sptr) ? tolower (*sptr) : *sptr; -// OBSOLETE *dptr = '\0'; -// OBSOLETE -// OBSOLETE /* See if it is a reserved identifier. */ -// OBSOLETE for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++) -// OBSOLETE { -// OBSOLETE if (STREQ (simplename, idtokentab[i].operator)) -// OBSOLETE { -// OBSOLETE return (idtokentab[i].token); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Look for other special tokens. */ -// OBSOLETE if (STREQ (simplename, "true")) -// OBSOLETE { -// OBSOLETE yylval.ulval = 1; -// OBSOLETE return (BOOLEAN_LITERAL); -// OBSOLETE } -// OBSOLETE if (STREQ (simplename, "false")) -// OBSOLETE { -// OBSOLETE yylval.ulval = 0; -// OBSOLETE return (BOOLEAN_LITERAL); -// OBSOLETE } -// OBSOLETE -// OBSOLETE sym = lookup_symbol (inputname, expression_context_block, -// OBSOLETE VAR_NAMESPACE, (int *) NULL, -// OBSOLETE (struct symtab **) NULL); -// OBSOLETE if (sym == NULL && strcmp (inputname, simplename) != 0) -// OBSOLETE { -// OBSOLETE sym = lookup_symbol (simplename, expression_context_block, -// OBSOLETE VAR_NAMESPACE, (int *) NULL, -// OBSOLETE (struct symtab **) NULL); -// OBSOLETE } -// OBSOLETE if (sym != NULL) -// OBSOLETE { -// OBSOLETE yylval.ssym.stoken.ptr = NULL; -// OBSOLETE yylval.ssym.stoken.length = 0; -// OBSOLETE yylval.ssym.sym = sym; -// OBSOLETE yylval.ssym.is_a_field_of_this = 0; /* FIXME, C++'ism */ -// OBSOLETE switch (SYMBOL_CLASS (sym)) -// OBSOLETE { -// OBSOLETE case LOC_BLOCK: -// OBSOLETE /* Found a procedure name. */ -// OBSOLETE return (GENERAL_PROCEDURE_NAME); -// OBSOLETE case LOC_STATIC: -// OBSOLETE /* Found a global or local static variable. */ -// OBSOLETE return (LOCATION_NAME); -// OBSOLETE case LOC_REGISTER: -// OBSOLETE case LOC_ARG: -// OBSOLETE case LOC_REF_ARG: -// OBSOLETE case LOC_REGPARM: -// OBSOLETE case LOC_REGPARM_ADDR: -// OBSOLETE case LOC_LOCAL: -// OBSOLETE case LOC_LOCAL_ARG: -// OBSOLETE case LOC_BASEREG: -// OBSOLETE case LOC_BASEREG_ARG: -// OBSOLETE if (innermost_block == NULL -// OBSOLETE || contained_in (block_found, innermost_block)) -// OBSOLETE { -// OBSOLETE innermost_block = block_found; -// OBSOLETE } -// OBSOLETE return (LOCATION_NAME); -// OBSOLETE break; -// OBSOLETE case LOC_CONST: -// OBSOLETE case LOC_LABEL: -// OBSOLETE return (LOCATION_NAME); -// OBSOLETE break; -// OBSOLETE case LOC_TYPEDEF: -// OBSOLETE yylval.tsym.type = SYMBOL_TYPE (sym); -// OBSOLETE return TYPENAME; -// OBSOLETE case LOC_UNDEF: -// OBSOLETE case LOC_CONST_BYTES: -// OBSOLETE case LOC_OPTIMIZED_OUT: -// OBSOLETE error ("Symbol \"%s\" names no location.", inputname); -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE internal_error (__FILE__, __LINE__, -// OBSOLETE "unhandled SYMBOL_CLASS in ch_lex()"); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (!have_full_symbols () && !have_partial_symbols ()) -// OBSOLETE { -// OBSOLETE error ("No symbol table is loaded. Use the \"file\" command."); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE error ("No symbol \"%s\" in current context.", inputname); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Catch single character tokens which are not part of some -// OBSOLETE longer token. */ -// OBSOLETE -// OBSOLETE switch (*lexptr) -// OBSOLETE { -// OBSOLETE case '.': /* Not float for example. */ -// OBSOLETE lexptr++; -// OBSOLETE while (isspace (*lexptr)) -// OBSOLETE lexptr++; -// OBSOLETE inputname = match_simple_name_string (); -// OBSOLETE if (!inputname) -// OBSOLETE return '.'; -// OBSOLETE return DOT_FIELD_NAME; -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (ILLEGAL_TOKEN); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE write_lower_upper_value (enum exp_opcode opcode, /* Either UNOP_LOWER or UNOP_UPPER */ -// OBSOLETE struct type *type) -// OBSOLETE { -// OBSOLETE if (type == NULL) -// OBSOLETE write_exp_elt_opcode (opcode); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE struct type *result_type; -// OBSOLETE LONGEST val = type_lower_upper (opcode, type, &result_type); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE write_exp_elt_type (result_type); -// OBSOLETE write_exp_elt_longcst (val); -// OBSOLETE write_exp_elt_opcode (OP_LONG); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE chill_error (char *msg) -// OBSOLETE { -// OBSOLETE /* Never used. */ -// OBSOLETE } diff --git a/gdb/ch-lang.c b/gdb/ch-lang.c deleted file mode 100644 index 50b446e..0000000 --- a/gdb/ch-lang.c +++ /dev/null @@ -1,663 +0,0 @@ -// OBSOLETE /* Chill language support routines for GDB, the GNU debugger. -// OBSOLETE Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "gdbtypes.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "expression.h" -// OBSOLETE #include "parser-defs.h" -// OBSOLETE #include "language.h" -// OBSOLETE #include "ch-lang.h" -// OBSOLETE #include "valprint.h" -// OBSOLETE -// OBSOLETE extern void _initialize_chill_language (void); -// OBSOLETE -// OBSOLETE static struct value *evaluate_subexp_chill (struct type *, struct expression *, -// OBSOLETE int *, enum noside); -// OBSOLETE -// OBSOLETE static struct value *value_chill_max_min (enum exp_opcode, struct value *); -// OBSOLETE -// OBSOLETE static struct value *value_chill_card (struct value *); -// OBSOLETE -// OBSOLETE static struct value *value_chill_length (struct value *); -// OBSOLETE -// OBSOLETE static struct type *chill_create_fundamental_type (struct objfile *, int); -// OBSOLETE -// OBSOLETE static void chill_printstr (struct ui_file * stream, char *string, -// OBSOLETE unsigned int length, int width, -// OBSOLETE int force_ellipses); -// OBSOLETE -// OBSOLETE static void chill_printchar (int, struct ui_file *); -// OBSOLETE -// OBSOLETE /* For now, Chill uses a simple mangling algorithm whereby you simply -// OBSOLETE discard everything after the occurance of two successive CPLUS_MARKER -// OBSOLETE characters to derive the demangled form. */ -// OBSOLETE -// OBSOLETE char * -// OBSOLETE chill_demangle (const char *mangled) -// OBSOLETE { -// OBSOLETE const char *joiner = NULL; -// OBSOLETE char *demangled; -// OBSOLETE const char *cp = mangled; -// OBSOLETE -// OBSOLETE while (*cp) -// OBSOLETE { -// OBSOLETE if (is_cplus_marker (*cp)) -// OBSOLETE { -// OBSOLETE joiner = cp; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE cp++; -// OBSOLETE } -// OBSOLETE if (joiner != NULL && *(joiner + 1) == *joiner) -// OBSOLETE { -// OBSOLETE demangled = savestring (mangled, joiner - mangled); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE demangled = NULL; -// OBSOLETE } -// OBSOLETE return (demangled); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_printchar (register int c, struct ui_file *stream) -// OBSOLETE { -// OBSOLETE c &= 0xFF; /* Avoid sign bit follies */ -// OBSOLETE -// OBSOLETE if (PRINT_LITERAL_FORM (c)) -// OBSOLETE { -// OBSOLETE if (c == '\'' || c == '^') -// OBSOLETE fprintf_filtered (stream, "'%c%c'", c, c); -// OBSOLETE else -// OBSOLETE fprintf_filtered (stream, "'%c'", c); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "'^(%u)'", (unsigned int) c); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Print the character string STRING, printing at most LENGTH characters. -// OBSOLETE Printing stops early if the number hits print_max; repeat counts -// OBSOLETE are printed as appropriate. Print ellipses at the end if we -// OBSOLETE had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. -// OBSOLETE Note that gdb maintains the length of strings without counting the -// OBSOLETE terminating null byte, while chill strings are typically written with -// OBSOLETE an explicit null byte. So we always assume an implied null byte -// OBSOLETE until gdb is able to maintain non-null terminated strings as well -// OBSOLETE as null terminated strings (FIXME). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_printstr (struct ui_file *stream, char *string, unsigned int length, -// OBSOLETE int width, int force_ellipses) -// OBSOLETE { -// OBSOLETE register unsigned int i; -// OBSOLETE unsigned int things_printed = 0; -// OBSOLETE int in_literal_form = 0; -// OBSOLETE int in_control_form = 0; -// OBSOLETE int need_slashslash = 0; -// OBSOLETE unsigned int c; -// OBSOLETE -// OBSOLETE if (length == 0) -// OBSOLETE { -// OBSOLETE fputs_filtered ("\"\"", stream); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE for (i = 0; i < length && things_printed < print_max; ++i) -// OBSOLETE { -// OBSOLETE /* Position of the character we are examining -// OBSOLETE to see whether it is repeated. */ -// OBSOLETE unsigned int rep1; -// OBSOLETE /* Number of repetitions we have detected so far. */ -// OBSOLETE unsigned int reps; -// OBSOLETE -// OBSOLETE QUIT; -// OBSOLETE -// OBSOLETE if (need_slashslash) -// OBSOLETE { -// OBSOLETE fputs_filtered ("//", stream); -// OBSOLETE need_slashslash = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE rep1 = i + 1; -// OBSOLETE reps = 1; -// OBSOLETE while (rep1 < length && string[rep1] == string[i]) -// OBSOLETE { -// OBSOLETE ++rep1; -// OBSOLETE ++reps; -// OBSOLETE } -// OBSOLETE -// OBSOLETE c = string[i]; -// OBSOLETE if (reps > repeat_count_threshold) -// OBSOLETE { -// OBSOLETE if (in_control_form || in_literal_form) -// OBSOLETE { -// OBSOLETE if (in_control_form) -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE fputs_filtered ("\"//", stream); -// OBSOLETE in_control_form = in_literal_form = 0; -// OBSOLETE } -// OBSOLETE chill_printchar (c, stream); -// OBSOLETE fprintf_filtered (stream, "", reps); -// OBSOLETE i = rep1 - 1; -// OBSOLETE things_printed += repeat_count_threshold; -// OBSOLETE need_slashslash = 1; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (!in_literal_form && !in_control_form) -// OBSOLETE fputs_filtered ("\"", stream); -// OBSOLETE if (PRINT_LITERAL_FORM (c)) -// OBSOLETE { -// OBSOLETE if (!in_literal_form) -// OBSOLETE { -// OBSOLETE if (in_control_form) -// OBSOLETE { -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE in_control_form = 0; -// OBSOLETE } -// OBSOLETE in_literal_form = 1; -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, "%c", c); -// OBSOLETE if (c == '"' || c == '^') -// OBSOLETE /* duplicate this one as must be done at input */ -// OBSOLETE fprintf_filtered (stream, "%c", c); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (!in_control_form) -// OBSOLETE { -// OBSOLETE if (in_literal_form) -// OBSOLETE { -// OBSOLETE in_literal_form = 0; -// OBSOLETE } -// OBSOLETE fputs_filtered ("^(", stream); -// OBSOLETE in_control_form = 1; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE fprintf_filtered (stream, ","); -// OBSOLETE c = c & 0xff; -// OBSOLETE fprintf_filtered (stream, "%u", (unsigned int) c); -// OBSOLETE } -// OBSOLETE ++things_printed; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Terminate the quotes if necessary. */ -// OBSOLETE if (in_control_form) -// OBSOLETE { -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE } -// OBSOLETE if (in_literal_form || in_control_form) -// OBSOLETE { -// OBSOLETE fputs_filtered ("\"", stream); -// OBSOLETE } -// OBSOLETE if (force_ellipses || (i < length)) -// OBSOLETE { -// OBSOLETE fputs_filtered ("...", stream); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE chill_create_fundamental_type (struct objfile *objfile, int typeid) -// OBSOLETE { -// OBSOLETE register struct type *type = NULL; -// OBSOLETE -// OBSOLETE switch (typeid) -// OBSOLETE { -// OBSOLETE default: -// OBSOLETE /* FIXME: For now, if we are asked to produce a type not in this -// OBSOLETE language, create the equivalent of a C integer type with the -// OBSOLETE name "". When all the dust settles from the type -// OBSOLETE reconstruction work, this should probably become an error. */ -// OBSOLETE type = init_type (TYPE_CODE_INT, 2, 0, "", objfile); -// OBSOLETE warning ("internal error: no chill fundamental type %d", typeid); -// OBSOLETE break; -// OBSOLETE case FT_VOID: -// OBSOLETE /* FIXME: Currently the GNU Chill compiler emits some DWARF entries for -// OBSOLETE typedefs, unrelated to anything directly in the code being compiled, -// OBSOLETE that have some FT_VOID types. Just fake it for now. */ -// OBSOLETE type = init_type (TYPE_CODE_VOID, 0, 0, "", objfile); -// OBSOLETE break; -// OBSOLETE case FT_BOOLEAN: -// OBSOLETE type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile); -// OBSOLETE break; -// OBSOLETE case FT_CHAR: -// OBSOLETE type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile); -// OBSOLETE break; -// OBSOLETE case FT_SIGNED_CHAR: -// OBSOLETE type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile); -// OBSOLETE break; -// OBSOLETE case FT_UNSIGNED_CHAR: -// OBSOLETE type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile); -// OBSOLETE break; -// OBSOLETE case FT_SHORT: /* Chill ints are 2 bytes */ -// OBSOLETE type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile); -// OBSOLETE break; -// OBSOLETE case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */ -// OBSOLETE type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile); -// OBSOLETE break; -// OBSOLETE case FT_INTEGER: /* FIXME? */ -// OBSOLETE case FT_SIGNED_INTEGER: /* FIXME? */ -// OBSOLETE case FT_LONG: /* Chill longs are 4 bytes */ -// OBSOLETE case FT_SIGNED_LONG: /* Chill longs are 4 bytes */ -// OBSOLETE type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile); -// OBSOLETE break; -// OBSOLETE case FT_UNSIGNED_INTEGER: /* FIXME? */ -// OBSOLETE case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */ -// OBSOLETE type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile); -// OBSOLETE break; -// OBSOLETE case FT_FLOAT: -// OBSOLETE type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile); -// OBSOLETE break; -// OBSOLETE case FT_DBL_PREC_FLOAT: -// OBSOLETE type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE return (type); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Table of operators and their precedences for printing expressions. */ -// OBSOLETE -// OBSOLETE static const struct op_print chill_op_print_tab[] = -// OBSOLETE { -// OBSOLETE {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0}, -// OBSOLETE {"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0}, -// OBSOLETE {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, -// OBSOLETE {"MOD", BINOP_MOD, PREC_MUL, 0}, -// OBSOLETE {"REM", BINOP_REM, PREC_MUL, 0}, -// OBSOLETE {"SIZE", UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {"LOWER", UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {"UPPER", UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {"CARD", UNOP_CARD, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {"MAX", UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {"MIN", UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0}, -// OBSOLETE {":=", BINOP_ASSIGN, PREC_ASSIGN, 1}, -// OBSOLETE {"=", BINOP_EQUAL, PREC_EQUAL, 0}, -// OBSOLETE {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, -// OBSOLETE {"<=", BINOP_LEQ, PREC_ORDER, 0}, -// OBSOLETE {">=", BINOP_GEQ, PREC_ORDER, 0}, -// OBSOLETE {">", BINOP_GTR, PREC_ORDER, 0}, -// OBSOLETE {"<", BINOP_LESS, PREC_ORDER, 0}, -// OBSOLETE {"+", BINOP_ADD, PREC_ADD, 0}, -// OBSOLETE {"-", BINOP_SUB, PREC_ADD, 0}, -// OBSOLETE {"*", BINOP_MUL, PREC_MUL, 0}, -// OBSOLETE {"/", BINOP_DIV, PREC_MUL, 0}, -// OBSOLETE {"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */ -// OBSOLETE {"-", UNOP_NEG, PREC_PREFIX, 0}, -// OBSOLETE {"->", UNOP_IND, PREC_SUFFIX, 1}, -// OBSOLETE {"->", UNOP_ADDR, PREC_PREFIX, 0}, -// OBSOLETE {":", BINOP_RANGE, PREC_ASSIGN, 0}, -// OBSOLETE {NULL, 0, 0, 0} -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* The built-in types of Chill. */ -// OBSOLETE -// OBSOLETE struct type *builtin_type_chill_bool; -// OBSOLETE struct type *builtin_type_chill_char; -// OBSOLETE struct type *builtin_type_chill_long; -// OBSOLETE struct type *builtin_type_chill_ulong; -// OBSOLETE struct type *builtin_type_chill_real; -// OBSOLETE -// OBSOLETE struct type **const (chill_builtin_types[]) = -// OBSOLETE { -// OBSOLETE &builtin_type_chill_bool, -// OBSOLETE &builtin_type_chill_char, -// OBSOLETE &builtin_type_chill_long, -// OBSOLETE &builtin_type_chill_ulong, -// OBSOLETE &builtin_type_chill_real, -// OBSOLETE 0 -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Calculate LOWER or UPPER of TYPE. -// OBSOLETE Returns the result as an integer. -// OBSOLETE *RESULT_TYPE is the appropriate type for the result. */ -// OBSOLETE -// OBSOLETE LONGEST -// OBSOLETE type_lower_upper (enum exp_opcode op, /* Either UNOP_LOWER or UNOP_UPPER */ -// OBSOLETE struct type *type, struct type **result_type) -// OBSOLETE { -// OBSOLETE LONGEST low, high; -// OBSOLETE *result_type = type; -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_STRUCT: -// OBSOLETE *result_type = builtin_type_int; -// OBSOLETE if (chill_varying_type (type)) -// OBSOLETE return type_lower_upper (op, TYPE_FIELD_TYPE (type, 1), result_type); -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_ARRAY: -// OBSOLETE case TYPE_CODE_BITSTRING: -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE type = TYPE_FIELD_TYPE (type, 0); /* Get index type */ -// OBSOLETE -// OBSOLETE /* ... fall through ... */ -// OBSOLETE case TYPE_CODE_RANGE: -// OBSOLETE *result_type = TYPE_TARGET_TYPE (type); -// OBSOLETE return op == UNOP_LOWER ? TYPE_LOW_BOUND (type) : TYPE_HIGH_BOUND (type); -// OBSOLETE -// OBSOLETE case TYPE_CODE_ENUM: -// OBSOLETE case TYPE_CODE_BOOL: -// OBSOLETE case TYPE_CODE_INT: -// OBSOLETE case TYPE_CODE_CHAR: -// OBSOLETE if (get_discrete_bounds (type, &low, &high) >= 0) -// OBSOLETE { -// OBSOLETE *result_type = type; -// OBSOLETE return op == UNOP_LOWER ? low : high; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_UNDEF: -// OBSOLETE case TYPE_CODE_PTR: -// OBSOLETE case TYPE_CODE_UNION: -// OBSOLETE case TYPE_CODE_FUNC: -// OBSOLETE case TYPE_CODE_FLT: -// OBSOLETE case TYPE_CODE_VOID: -// OBSOLETE case TYPE_CODE_SET: -// OBSOLETE case TYPE_CODE_ERROR: -// OBSOLETE case TYPE_CODE_MEMBER: -// OBSOLETE case TYPE_CODE_METHOD: -// OBSOLETE case TYPE_CODE_REF: -// OBSOLETE case TYPE_CODE_COMPLEX: -// OBSOLETE default: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE error ("unknown mode for LOWER/UPPER builtin"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct value * -// OBSOLETE value_chill_length (struct value *val) -// OBSOLETE { -// OBSOLETE LONGEST tmp; -// OBSOLETE struct type *type = VALUE_TYPE (val); -// OBSOLETE struct type *ttype; -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_ARRAY: -// OBSOLETE case TYPE_CODE_BITSTRING: -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE tmp = type_lower_upper (UNOP_UPPER, type, &ttype) -// OBSOLETE - type_lower_upper (UNOP_LOWER, type, &ttype) + 1; -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_STRUCT: -// OBSOLETE if (chill_varying_type (type)) -// OBSOLETE { -// OBSOLETE tmp = unpack_long (TYPE_FIELD_TYPE (type, 0), VALUE_CONTENTS (val)); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE /* ... else fall through ... */ -// OBSOLETE default: -// OBSOLETE error ("bad argument to LENGTH builtin"); -// OBSOLETE } -// OBSOLETE return value_from_longest (builtin_type_int, tmp); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct value * -// OBSOLETE value_chill_card (struct value *val) -// OBSOLETE { -// OBSOLETE LONGEST tmp = 0; -// OBSOLETE struct type *type = VALUE_TYPE (val); -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE -// OBSOLETE if (TYPE_CODE (type) == TYPE_CODE_SET) -// OBSOLETE { -// OBSOLETE struct type *range_type = TYPE_INDEX_TYPE (type); -// OBSOLETE LONGEST lower_bound, upper_bound; -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE get_discrete_bounds (range_type, &lower_bound, &upper_bound); -// OBSOLETE for (i = lower_bound; i <= upper_bound; i++) -// OBSOLETE if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0) -// OBSOLETE tmp++; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE error ("bad argument to CARD builtin"); -// OBSOLETE -// OBSOLETE return value_from_longest (builtin_type_int, tmp); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct value * -// OBSOLETE value_chill_max_min (enum exp_opcode op, struct value *val) -// OBSOLETE { -// OBSOLETE LONGEST tmp = 0; -// OBSOLETE struct type *type = VALUE_TYPE (val); -// OBSOLETE struct type *elttype; -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE -// OBSOLETE if (TYPE_CODE (type) == TYPE_CODE_SET) -// OBSOLETE { -// OBSOLETE LONGEST lower_bound, upper_bound; -// OBSOLETE int i, empty = 1; -// OBSOLETE -// OBSOLETE elttype = TYPE_INDEX_TYPE (type); -// OBSOLETE CHECK_TYPEDEF (elttype); -// OBSOLETE get_discrete_bounds (elttype, &lower_bound, &upper_bound); -// OBSOLETE -// OBSOLETE if (op == UNOP_CHMAX) -// OBSOLETE { -// OBSOLETE for (i = upper_bound; i >= lower_bound; i--) -// OBSOLETE { -// OBSOLETE if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0) -// OBSOLETE { -// OBSOLETE tmp = i; -// OBSOLETE empty = 0; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (i = lower_bound; i <= upper_bound; i++) -// OBSOLETE { -// OBSOLETE if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0) -// OBSOLETE { -// OBSOLETE tmp = i; -// OBSOLETE empty = 0; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE if (empty) -// OBSOLETE error ("%s for empty powerset", op == UNOP_CHMAX ? "MAX" : "MIN"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE error ("bad argument to %s builtin", op == UNOP_CHMAX ? "MAX" : "MIN"); -// OBSOLETE -// OBSOLETE return value_from_longest (TYPE_CODE (elttype) == TYPE_CODE_RANGE -// OBSOLETE ? TYPE_TARGET_TYPE (elttype) -// OBSOLETE : elttype, -// OBSOLETE tmp); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct value * -// OBSOLETE evaluate_subexp_chill (struct type *expect_type, -// OBSOLETE register struct expression *exp, register int *pos, -// OBSOLETE enum noside noside) -// OBSOLETE { -// OBSOLETE int pc = *pos; -// OBSOLETE struct type *type; -// OBSOLETE int tem, nargs; -// OBSOLETE struct value *arg1; -// OBSOLETE struct value **argvec; -// OBSOLETE enum exp_opcode op = exp->elts[*pos].opcode; -// OBSOLETE switch (op) -// OBSOLETE { -// OBSOLETE case MULTI_SUBSCRIPT: -// OBSOLETE if (noside == EVAL_SKIP) -// OBSOLETE break; -// OBSOLETE (*pos) += 3; -// OBSOLETE nargs = longest_to_int (exp->elts[pc + 1].longconst); -// OBSOLETE arg1 = evaluate_subexp_with_coercion (exp, pos, noside); -// OBSOLETE type = check_typedef (VALUE_TYPE (arg1)); -// OBSOLETE -// OBSOLETE if (nargs == 1 && TYPE_CODE (type) == TYPE_CODE_INT) -// OBSOLETE { -// OBSOLETE /* Looks like string repetition. */ -// OBSOLETE struct value *string = evaluate_subexp_with_coercion (exp, pos, -// OBSOLETE noside); -// OBSOLETE return value_concat (arg1, string); -// OBSOLETE } -// OBSOLETE -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_PTR: -// OBSOLETE type = check_typedef (TYPE_TARGET_TYPE (type)); -// OBSOLETE if (!type || TYPE_CODE (type) != TYPE_CODE_FUNC) -// OBSOLETE error ("reference value used as function"); -// OBSOLETE /* ... fall through ... */ -// OBSOLETE case TYPE_CODE_FUNC: -// OBSOLETE /* It's a function call. */ -// OBSOLETE if (noside == EVAL_AVOID_SIDE_EFFECTS) -// OBSOLETE break; -// OBSOLETE -// OBSOLETE /* Allocate arg vector, including space for the function to be -// OBSOLETE called in argvec[0] and a terminating NULL */ -// OBSOLETE argvec = (struct value **) alloca (sizeof (struct value *) -// OBSOLETE * (nargs + 2)); -// OBSOLETE argvec[0] = arg1; -// OBSOLETE tem = 1; -// OBSOLETE for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++) -// OBSOLETE { -// OBSOLETE argvec[tem] -// OBSOLETE = evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem - 1), -// OBSOLETE exp, pos, noside); -// OBSOLETE } -// OBSOLETE for (; tem <= nargs; tem++) -// OBSOLETE argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside); -// OBSOLETE argvec[tem] = 0; /* signal end of arglist */ -// OBSOLETE -// OBSOLETE return call_function_by_hand (argvec[0], nargs, argvec + 1); -// OBSOLETE default: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE while (nargs-- > 0) -// OBSOLETE { -// OBSOLETE struct value *index = evaluate_subexp_with_coercion (exp, pos, -// OBSOLETE noside); -// OBSOLETE arg1 = value_subscript (arg1, index); -// OBSOLETE } -// OBSOLETE return (arg1); -// OBSOLETE -// OBSOLETE case UNOP_LOWER: -// OBSOLETE case UNOP_UPPER: -// OBSOLETE (*pos)++; -// OBSOLETE if (noside == EVAL_SKIP) -// OBSOLETE { -// OBSOLETE (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, EVAL_SKIP); -// OBSOLETE goto nosideret; -// OBSOLETE } -// OBSOLETE arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, -// OBSOLETE EVAL_AVOID_SIDE_EFFECTS); -// OBSOLETE tem = type_lower_upper (op, VALUE_TYPE (arg1), &type); -// OBSOLETE return value_from_longest (type, tem); -// OBSOLETE -// OBSOLETE case UNOP_LENGTH: -// OBSOLETE (*pos)++; -// OBSOLETE arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside); -// OBSOLETE return value_chill_length (arg1); -// OBSOLETE -// OBSOLETE case UNOP_CARD: -// OBSOLETE (*pos)++; -// OBSOLETE arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside); -// OBSOLETE return value_chill_card (arg1); -// OBSOLETE -// OBSOLETE case UNOP_CHMAX: -// OBSOLETE case UNOP_CHMIN: -// OBSOLETE (*pos)++; -// OBSOLETE arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside); -// OBSOLETE return value_chill_max_min (op, arg1); -// OBSOLETE -// OBSOLETE case BINOP_COMMA: -// OBSOLETE error ("',' operator used in invalid context"); -// OBSOLETE -// OBSOLETE default: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE return evaluate_subexp_standard (expect_type, exp, pos, noside); -// OBSOLETE nosideret: -// OBSOLETE return value_from_longest (builtin_type_long, (LONGEST) 1); -// OBSOLETE } -// OBSOLETE -// OBSOLETE const struct language_defn chill_language_defn = -// OBSOLETE { -// OBSOLETE "chill", -// OBSOLETE language_chill, -// OBSOLETE chill_builtin_types, -// OBSOLETE range_check_on, -// OBSOLETE type_check_on, -// OBSOLETE case_sensitive_on, -// OBSOLETE chill_parse, /* parser */ -// OBSOLETE chill_error, /* parser error function */ -// OBSOLETE evaluate_subexp_chill, -// OBSOLETE chill_printchar, /* print a character constant */ -// OBSOLETE chill_printstr, /* function to print a string constant */ -// OBSOLETE NULL, /* Function to print a single char */ -// OBSOLETE chill_create_fundamental_type, /* Create fundamental type in this language */ -// OBSOLETE chill_print_type, /* Print a type using appropriate syntax */ -// OBSOLETE chill_val_print, /* Print a value using appropriate syntax */ -// OBSOLETE chill_value_print, /* Print a top-levl value */ -// OBSOLETE {"", "B'", "", ""}, /* Binary format info */ -// OBSOLETE {"O'%lo", "O'", "o", ""}, /* Octal format info */ -// OBSOLETE {"D'%ld", "D'", "d", ""}, /* Decimal format info */ -// OBSOLETE {"H'%lx", "H'", "x", ""}, /* Hex format info */ -// OBSOLETE chill_op_print_tab, /* expression operators for printing */ -// OBSOLETE 0, /* arrays are first-class (not c-style) */ -// OBSOLETE 0, /* String lower bound */ -// OBSOLETE &builtin_type_chill_char, /* Type of string elements */ -// OBSOLETE LANG_MAGIC -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Initialization for Chill */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_chill_language (void) -// OBSOLETE { -// OBSOLETE builtin_type_chill_bool = -// OBSOLETE init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, -// OBSOLETE TYPE_FLAG_UNSIGNED, -// OBSOLETE "BOOL", (struct objfile *) NULL); -// OBSOLETE builtin_type_chill_char = -// OBSOLETE init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, -// OBSOLETE TYPE_FLAG_UNSIGNED, -// OBSOLETE "CHAR", (struct objfile *) NULL); -// OBSOLETE builtin_type_chill_long = -// OBSOLETE init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, -// OBSOLETE 0, -// OBSOLETE "LONG", (struct objfile *) NULL); -// OBSOLETE builtin_type_chill_ulong = -// OBSOLETE init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, -// OBSOLETE TYPE_FLAG_UNSIGNED, -// OBSOLETE "ULONG", (struct objfile *) NULL); -// OBSOLETE builtin_type_chill_real = -// OBSOLETE init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, -// OBSOLETE 0, -// OBSOLETE "LONG_REAL", (struct objfile *) NULL); -// OBSOLETE -// OBSOLETE add_language (&chill_language_defn); -// OBSOLETE } diff --git a/gdb/ch-lang.h b/gdb/ch-lang.h deleted file mode 100644 index d4e5356..0000000 --- a/gdb/ch-lang.h +++ /dev/null @@ -1,41 +0,0 @@ -// OBSOLETE /* Chill language support definitions for GDB, the GNU debugger. -// OBSOLETE Copyright 1992, 1994, 1996, 1998, 1999, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Forward decls for prototypes */ -// OBSOLETE struct value; -// OBSOLETE -// OBSOLETE extern int chill_parse (void); /* Defined in ch-exp.y */ -// OBSOLETE -// OBSOLETE extern void chill_error (char *); /* Defined in ch-exp.y */ -// OBSOLETE -// OBSOLETE /* Defined in ch-typeprint.c */ -// OBSOLETE extern void chill_print_type (struct type *, char *, struct ui_file *, int, -// OBSOLETE int); -// OBSOLETE -// OBSOLETE extern int chill_val_print (struct type *, char *, int, CORE_ADDR, -// OBSOLETE struct ui_file *, int, int, int, -// OBSOLETE enum val_prettyprint); -// OBSOLETE -// OBSOLETE extern int chill_value_print (struct value *, struct ui_file *, -// OBSOLETE int, enum val_prettyprint); -// OBSOLETE -// OBSOLETE extern LONGEST -// OBSOLETE type_lower_upper (enum exp_opcode, struct type *, struct type **); diff --git a/gdb/ch-typeprint.c b/gdb/ch-typeprint.c deleted file mode 100644 index 32590f8..0000000 --- a/gdb/ch-typeprint.c +++ /dev/null @@ -1,340 +0,0 @@ -// OBSOLETE /* Support for printing Chill types for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdb_obstack.h" -// OBSOLETE #include "bfd.h" /* Binary File Description */ -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "gdbtypes.h" -// OBSOLETE #include "expression.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "language.h" -// OBSOLETE #include "ch-lang.h" -// OBSOLETE #include "typeprint.h" -// OBSOLETE -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE static void chill_type_print_base (struct type *, struct ui_file *, int, int); -// OBSOLETE -// OBSOLETE void -// OBSOLETE chill_print_type (struct type *type, char *varstring, struct ui_file *stream, -// OBSOLETE int show, int level) -// OBSOLETE { -// OBSOLETE if (varstring != NULL && *varstring != '\0') -// OBSOLETE { -// OBSOLETE fputs_filtered (varstring, stream); -// OBSOLETE fputs_filtered (" ", stream); -// OBSOLETE } -// OBSOLETE chill_type_print_base (type, stream, show, level); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Print the name of the type (or the ultimate pointer target, -// OBSOLETE function value or array element). -// OBSOLETE -// OBSOLETE SHOW nonzero means don't print this type as just its name; -// OBSOLETE show its real definition even if it has a name. -// OBSOLETE SHOW zero means print just typename or tag if there is one -// OBSOLETE SHOW negative means abbreviate structure elements. -// OBSOLETE SHOW is decremented for printing of structure elements. -// OBSOLETE -// OBSOLETE LEVEL is the depth to indent by. -// OBSOLETE We increase it for some recursive calls. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_type_print_base (struct type *type, struct ui_file *stream, int show, -// OBSOLETE int level) -// OBSOLETE { -// OBSOLETE register int len; -// OBSOLETE register int i; -// OBSOLETE struct type *index_type; -// OBSOLETE struct type *range_type; -// OBSOLETE LONGEST low_bound; -// OBSOLETE LONGEST high_bound; -// OBSOLETE -// OBSOLETE QUIT; -// OBSOLETE -// OBSOLETE wrap_here (" "); -// OBSOLETE if (type == NULL) -// OBSOLETE { -// OBSOLETE fputs_filtered ("", stream); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* When SHOW is zero or less, and there is a valid type name, then always -// OBSOLETE just print the type name directly from the type. */ -// OBSOLETE -// OBSOLETE if ((show <= 0) && (TYPE_NAME (type) != NULL)) -// OBSOLETE { -// OBSOLETE fputs_filtered (TYPE_NAME (type), stream); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF) -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_TYPEDEF: -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level); -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_PTR: -// OBSOLETE if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, -// OBSOLETE TYPE_NAME (type) ? TYPE_NAME (type) : "PTR"); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, "REF "); -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_BOOL: -// OBSOLETE /* FIXME: we should probably just print the TYPE_NAME, in case -// OBSOLETE anyone ever fixes the compiler to give us the real names -// OBSOLETE in the presence of the chill equivalent of typedef (assuming -// OBSOLETE there is one). */ -// OBSOLETE fprintf_filtered (stream, -// OBSOLETE TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL"); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_ARRAY: -// OBSOLETE fputs_filtered ("ARRAY (", stream); -// OBSOLETE range_type = TYPE_FIELD_TYPE (type, 0); -// OBSOLETE if (TYPE_CODE (range_type) != TYPE_CODE_RANGE) -// OBSOLETE chill_print_type (range_type, "", stream, 0, level); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE index_type = TYPE_TARGET_TYPE (range_type); -// OBSOLETE low_bound = TYPE_FIELD_BITPOS (range_type, 0); -// OBSOLETE high_bound = TYPE_FIELD_BITPOS (range_type, 1); -// OBSOLETE print_type_scalar (index_type, low_bound, stream); -// OBSOLETE fputs_filtered (":", stream); -// OBSOLETE print_type_scalar (index_type, high_bound, stream); -// OBSOLETE } -// OBSOLETE fputs_filtered (") ", stream); -// OBSOLETE chill_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, level); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_BITSTRING: -// OBSOLETE fprintf_filtered (stream, "BOOLS (%d)", -// OBSOLETE TYPE_FIELD_BITPOS (TYPE_FIELD_TYPE (type, 0), 1) + 1); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_SET: -// OBSOLETE fputs_filtered ("POWERSET ", stream); -// OBSOLETE chill_print_type (TYPE_INDEX_TYPE (type), "", stream, -// OBSOLETE show - 1, level); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE range_type = TYPE_FIELD_TYPE (type, 0); -// OBSOLETE index_type = TYPE_TARGET_TYPE (range_type); -// OBSOLETE high_bound = TYPE_FIELD_BITPOS (range_type, 1); -// OBSOLETE fputs_filtered ("CHARS (", stream); -// OBSOLETE print_type_scalar (index_type, high_bound + 1, stream); -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_MEMBER: -// OBSOLETE fprintf_filtered (stream, "MEMBER "); -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level); -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_REF: -// OBSOLETE fprintf_filtered (stream, "/*LOC*/ "); -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level); -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_FUNC: -// OBSOLETE fprintf_filtered (stream, "PROC ("); -// OBSOLETE len = TYPE_NFIELDS (type); -// OBSOLETE for (i = 0; i < len; i++) -// OBSOLETE { -// OBSOLETE struct type *param_type = TYPE_FIELD_TYPE (type, i); -// OBSOLETE if (i > 0) -// OBSOLETE { -// OBSOLETE fputs_filtered (", ", stream); -// OBSOLETE wrap_here (" "); -// OBSOLETE } -// OBSOLETE if (TYPE_CODE (param_type) == TYPE_CODE_REF) -// OBSOLETE { -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (param_type), -// OBSOLETE stream, 0, level); -// OBSOLETE fputs_filtered (" LOC", stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE chill_type_print_base (param_type, stream, show, level); -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, ")"); -// OBSOLETE if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID) -// OBSOLETE { -// OBSOLETE fputs_filtered (" RETURNS (", stream); -// OBSOLETE chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level); -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_STRUCT: -// OBSOLETE if (chill_varying_type (type)) -// OBSOLETE { -// OBSOLETE chill_type_print_base (TYPE_FIELD_TYPE (type, 1), -// OBSOLETE stream, 0, level); -// OBSOLETE fputs_filtered (" VARYING", stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "STRUCT "); -// OBSOLETE -// OBSOLETE fprintf_filtered (stream, "(\n"); -// OBSOLETE if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0)) -// OBSOLETE { -// OBSOLETE if (TYPE_STUB (type)) -// OBSOLETE { -// OBSOLETE fprintfi_filtered (level + 4, stream, "\n"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintfi_filtered (level + 4, stream, "\n"); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE len = TYPE_NFIELDS (type); -// OBSOLETE for (i = TYPE_N_BASECLASSES (type); i < len; i++) -// OBSOLETE { -// OBSOLETE struct type *field_type = TYPE_FIELD_TYPE (type, i); -// OBSOLETE QUIT; -// OBSOLETE print_spaces_filtered (level + 4, stream); -// OBSOLETE if (TYPE_CODE (field_type) == TYPE_CODE_UNION) -// OBSOLETE { -// OBSOLETE int j; /* variant number */ -// OBSOLETE fputs_filtered ("CASE OF\n", stream); -// OBSOLETE for (j = 0; j < TYPE_NFIELDS (field_type); j++) -// OBSOLETE { -// OBSOLETE int k; /* variant field index */ -// OBSOLETE struct type *variant_type -// OBSOLETE = TYPE_FIELD_TYPE (field_type, j); -// OBSOLETE int var_len = TYPE_NFIELDS (variant_type); -// OBSOLETE print_spaces_filtered (level + 4, stream); -// OBSOLETE if (strcmp (TYPE_FIELD_NAME (field_type, j), -// OBSOLETE "else") == 0) -// OBSOLETE fputs_filtered ("ELSE\n", stream); -// OBSOLETE else -// OBSOLETE fputs_filtered (":\n", stream); -// OBSOLETE if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT) -// OBSOLETE error ("variant record confusion"); -// OBSOLETE for (k = 0; k < var_len; k++) -// OBSOLETE { -// OBSOLETE print_spaces_filtered (level + 8, stream); -// OBSOLETE chill_print_type (TYPE_FIELD_TYPE (variant_type, k), -// OBSOLETE TYPE_FIELD_NAME (variant_type, k), -// OBSOLETE stream, show - 1, level + 8); -// OBSOLETE if (k < (var_len - 1)) -// OBSOLETE fputs_filtered (",", stream); -// OBSOLETE fputs_filtered ("\n", stream); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE print_spaces_filtered (level + 4, stream); -// OBSOLETE fputs_filtered ("ESAC", stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE chill_print_type (field_type, -// OBSOLETE TYPE_FIELD_NAME (type, i), -// OBSOLETE stream, show - 1, level + 4); -// OBSOLETE if (i < (len - 1)) -// OBSOLETE { -// OBSOLETE fputs_filtered (",", stream); -// OBSOLETE } -// OBSOLETE fputs_filtered ("\n", stream); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE fprintfi_filtered (level, stream, ")"); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_RANGE: -// OBSOLETE { -// OBSOLETE struct type *target = TYPE_TARGET_TYPE (type); -// OBSOLETE if (target && TYPE_NAME (target)) -// OBSOLETE fputs_filtered (TYPE_NAME (target), stream); -// OBSOLETE else -// OBSOLETE fputs_filtered ("RANGE", stream); -// OBSOLETE if (target == NULL) -// OBSOLETE target = builtin_type_long; -// OBSOLETE fputs_filtered (" (", stream); -// OBSOLETE print_type_scalar (target, TYPE_LOW_BOUND (type), stream); -// OBSOLETE fputs_filtered (":", stream); -// OBSOLETE print_type_scalar (target, TYPE_HIGH_BOUND (type), stream); -// OBSOLETE fputs_filtered (")", stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_ENUM: -// OBSOLETE { -// OBSOLETE register int lastval = 0; -// OBSOLETE fprintf_filtered (stream, "SET ("); -// OBSOLETE len = TYPE_NFIELDS (type); -// OBSOLETE for (i = 0; i < len; i++) -// OBSOLETE { -// OBSOLETE QUIT; -// OBSOLETE if (i) -// OBSOLETE fprintf_filtered (stream, ", "); -// OBSOLETE wrap_here (" "); -// OBSOLETE fputs_filtered (TYPE_FIELD_NAME (type, i), stream); -// OBSOLETE if (lastval != TYPE_FIELD_BITPOS (type, i)) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); -// OBSOLETE lastval = TYPE_FIELD_BITPOS (type, i); -// OBSOLETE } -// OBSOLETE lastval++; -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, ")"); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_VOID: -// OBSOLETE case TYPE_CODE_UNDEF: -// OBSOLETE case TYPE_CODE_ERROR: -// OBSOLETE case TYPE_CODE_UNION: -// OBSOLETE case TYPE_CODE_METHOD: -// OBSOLETE error ("missing language support in chill_type_print_base"); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE -// OBSOLETE /* Handle types not explicitly handled by the other cases, -// OBSOLETE such as fundamental types. For these, just print whatever -// OBSOLETE the type name is, as recorded in the type itself. If there -// OBSOLETE is no type name, then complain. */ -// OBSOLETE -// OBSOLETE if (TYPE_NAME (type) != NULL) -// OBSOLETE { -// OBSOLETE fputs_filtered (TYPE_NAME (type), stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE error ("Unrecognized type code (%d) in symbol table.", -// OBSOLETE TYPE_CODE (type)); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } diff --git a/gdb/ch-valprint.c b/gdb/ch-valprint.c deleted file mode 100644 index f2a35b3..0000000 --- a/gdb/ch-valprint.c +++ /dev/null @@ -1,605 +0,0 @@ -// OBSOLETE /* Support for printing Chill values for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, -// OBSOLETE 1998, 2000, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdb_obstack.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "gdbtypes.h" -// OBSOLETE #include "valprint.h" -// OBSOLETE #include "expression.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "language.h" -// OBSOLETE #include "demangle.h" -// OBSOLETE #include "c-lang.h" /* For c_val_print */ -// OBSOLETE #include "typeprint.h" -// OBSOLETE #include "ch-lang.h" -// OBSOLETE #include "annotate.h" -// OBSOLETE -// OBSOLETE static void chill_print_value_fields (struct type *, char *, -// OBSOLETE struct ui_file *, int, int, -// OBSOLETE enum val_prettyprint, struct type **); -// OBSOLETE -// OBSOLETE static void chill_print_type_scalar (struct type *, LONGEST, -// OBSOLETE struct ui_file *); -// OBSOLETE -// OBSOLETE static void chill_val_print_array_elements (struct type *, char *, -// OBSOLETE CORE_ADDR, struct ui_file *, -// OBSOLETE int, int, int, -// OBSOLETE enum val_prettyprint); -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM. -// OBSOLETE Used to print data from type structures in a specified type. For example, -// OBSOLETE array bounds may be characters or booleans in some languages, and this -// OBSOLETE allows the ranges to be printed in their "natural" form rather than as -// OBSOLETE decimal integer values. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream) -// OBSOLETE { -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_RANGE: -// OBSOLETE if (TYPE_TARGET_TYPE (type)) -// OBSOLETE { -// OBSOLETE chill_print_type_scalar (TYPE_TARGET_TYPE (type), val, stream); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case TYPE_CODE_UNDEF: -// OBSOLETE case TYPE_CODE_PTR: -// OBSOLETE case TYPE_CODE_ARRAY: -// OBSOLETE case TYPE_CODE_STRUCT: -// OBSOLETE case TYPE_CODE_UNION: -// OBSOLETE case TYPE_CODE_ENUM: -// OBSOLETE case TYPE_CODE_FUNC: -// OBSOLETE case TYPE_CODE_INT: -// OBSOLETE case TYPE_CODE_FLT: -// OBSOLETE case TYPE_CODE_VOID: -// OBSOLETE case TYPE_CODE_SET: -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE case TYPE_CODE_BITSTRING: -// OBSOLETE case TYPE_CODE_ERROR: -// OBSOLETE case TYPE_CODE_MEMBER: -// OBSOLETE case TYPE_CODE_METHOD: -// OBSOLETE case TYPE_CODE_REF: -// OBSOLETE case TYPE_CODE_CHAR: -// OBSOLETE case TYPE_CODE_BOOL: -// OBSOLETE case TYPE_CODE_COMPLEX: -// OBSOLETE case TYPE_CODE_TYPEDEF: -// OBSOLETE default: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE print_type_scalar (type, val, stream); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Print the elements of an array. -// OBSOLETE Similar to val_print_array_elements, but prints -// OBSOLETE element indexes (in Chill syntax). */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_val_print_array_elements (struct type *type, char *valaddr, -// OBSOLETE CORE_ADDR address, struct ui_file *stream, -// OBSOLETE int format, int deref_ref, int recurse, -// OBSOLETE enum val_prettyprint pretty) -// OBSOLETE { -// OBSOLETE unsigned int i = 0; -// OBSOLETE unsigned int things_printed = 0; -// OBSOLETE unsigned len; -// OBSOLETE struct type *elttype; -// OBSOLETE struct type *range_type = TYPE_FIELD_TYPE (type, 0); -// OBSOLETE struct type *index_type = TYPE_TARGET_TYPE (range_type); -// OBSOLETE unsigned eltlen; -// OBSOLETE /* Position of the array element we are examining to see -// OBSOLETE whether it is repeated. */ -// OBSOLETE unsigned int rep1; -// OBSOLETE /* Number of repetitions we have detected so far. */ -// OBSOLETE unsigned int reps; -// OBSOLETE LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0); -// OBSOLETE -// OBSOLETE elttype = check_typedef (TYPE_TARGET_TYPE (type)); -// OBSOLETE eltlen = TYPE_LENGTH (elttype); -// OBSOLETE len = TYPE_LENGTH (type) / eltlen; -// OBSOLETE -// OBSOLETE annotate_array_section_begin (i, elttype); -// OBSOLETE -// OBSOLETE for (; i < len && things_printed < print_max; i++) -// OBSOLETE { -// OBSOLETE if (i != 0) -// OBSOLETE { -// OBSOLETE if (prettyprint_arrays) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, ",\n"); -// OBSOLETE print_spaces_filtered (2 + 2 * recurse, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, ", "); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE wrap_here (n_spaces (2 + 2 * recurse)); -// OBSOLETE -// OBSOLETE rep1 = i + 1; -// OBSOLETE reps = 1; -// OBSOLETE while ((rep1 < len) && -// OBSOLETE !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen)) -// OBSOLETE { -// OBSOLETE ++reps; -// OBSOLETE ++rep1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE fputs_filtered ("(", stream); -// OBSOLETE chill_print_type_scalar (index_type, low_bound + i, stream); -// OBSOLETE if (reps > 1) -// OBSOLETE { -// OBSOLETE fputs_filtered (":", stream); -// OBSOLETE chill_print_type_scalar (index_type, low_bound + i + reps - 1, -// OBSOLETE stream); -// OBSOLETE fputs_filtered ("): ", stream); -// OBSOLETE val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format, -// OBSOLETE deref_ref, recurse + 1, pretty); -// OBSOLETE -// OBSOLETE i = rep1 - 1; -// OBSOLETE things_printed += 1; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fputs_filtered ("): ", stream); -// OBSOLETE val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format, -// OBSOLETE deref_ref, recurse + 1, pretty); -// OBSOLETE annotate_elt (); -// OBSOLETE things_printed++; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE annotate_array_section_end (); -// OBSOLETE if (i < len) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "..."); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Print data of type TYPE located at VALADDR (within GDB), which came from -// OBSOLETE the inferior at address ADDRESS, onto stdio stream STREAM according to -// OBSOLETE FORMAT (a letter or 0 for natural format). The data at VALADDR is in -// OBSOLETE target byte order. -// OBSOLETE -// OBSOLETE If the data are a string pointer, returns the number of string characters -// OBSOLETE printed. -// OBSOLETE -// OBSOLETE If DEREF_REF is nonzero, then dereference references, otherwise just print -// OBSOLETE them like pointers. -// OBSOLETE -// OBSOLETE The PRETTY parameter controls prettyprinting. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE chill_val_print (struct type *type, char *valaddr, int embedded_offset, -// OBSOLETE CORE_ADDR address, struct ui_file *stream, int format, -// OBSOLETE int deref_ref, int recurse, enum val_prettyprint pretty) -// OBSOLETE { -// OBSOLETE LONGEST val; -// OBSOLETE unsigned int i = 0; /* Number of characters printed. */ -// OBSOLETE struct type *elttype; -// OBSOLETE CORE_ADDR addr; -// OBSOLETE -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE -// OBSOLETE switch (TYPE_CODE (type)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_ARRAY: -// OBSOLETE if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) -// OBSOLETE { -// OBSOLETE if (prettyprint_arrays) -// OBSOLETE { -// OBSOLETE print_spaces_filtered (2 + 2 * recurse, stream); -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, "["); -// OBSOLETE chill_val_print_array_elements (type, valaddr, address, stream, -// OBSOLETE format, deref_ref, recurse, pretty); -// OBSOLETE fprintf_filtered (stream, "]"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE error ("unimplemented in chill_val_print; unspecified array length"); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_INT: -// OBSOLETE format = format ? format : output_format; -// OBSOLETE if (format) -// OBSOLETE { -// OBSOLETE print_scalar_formatted (valaddr, type, format, 0, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE val_print_type_code_int (type, valaddr, stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_CHAR: -// OBSOLETE format = format ? format : output_format; -// OBSOLETE if (format) -// OBSOLETE { -// OBSOLETE print_scalar_formatted (valaddr, type, format, 0, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr), -// OBSOLETE stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_FLT: -// OBSOLETE if (format) -// OBSOLETE { -// OBSOLETE print_scalar_formatted (valaddr, type, format, 0, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE print_floating (valaddr, type, stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_BOOL: -// OBSOLETE format = format ? format : output_format; -// OBSOLETE if (format) -// OBSOLETE { -// OBSOLETE print_scalar_formatted (valaddr, type, format, 0, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* FIXME: Why is this using builtin_type_chill_bool not type? */ -// OBSOLETE val = unpack_long (builtin_type_chill_bool, valaddr); -// OBSOLETE fprintf_filtered (stream, val ? "TRUE" : "FALSE"); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_UNDEF: -// OBSOLETE /* This happens (without TYPE_FLAG_STUB set) on systems which don't use -// OBSOLETE dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar" -// OBSOLETE and no complete type for struct foo in that file. */ -// OBSOLETE fprintf_filtered (stream, ""); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_PTR: -// OBSOLETE if (format && format != 's') -// OBSOLETE { -// OBSOLETE print_scalar_formatted (valaddr, type, format, 0, stream); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE addr = unpack_pointer (type, valaddr); -// OBSOLETE elttype = check_typedef (TYPE_TARGET_TYPE (type)); -// OBSOLETE -// OBSOLETE /* We assume a NULL pointer is all zeros ... */ -// OBSOLETE if (addr == 0) -// OBSOLETE { -// OBSOLETE fputs_filtered ("NULL", stream); -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (TYPE_CODE (elttype) == TYPE_CODE_FUNC) -// OBSOLETE { -// OBSOLETE /* Try to print what function it points to. */ -// OBSOLETE print_address_demangle (addr, stream, demangle); -// OBSOLETE /* Return value is irrelevant except for string pointers. */ -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE if (addressprint && format != 's') -// OBSOLETE { -// OBSOLETE print_address_numeric (addr, 1, stream); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* For a pointer to char or unsigned char, also print the string -// OBSOLETE pointed to, unless pointer is null. */ -// OBSOLETE if (TYPE_LENGTH (elttype) == 1 -// OBSOLETE && TYPE_CODE (elttype) == TYPE_CODE_CHAR -// OBSOLETE && (format == 0 || format == 's') -// OBSOLETE && addr != 0 -// OBSOLETE && /* If print_max is UINT_MAX, the alloca below will fail. -// OBSOLETE In that case don't try to print the string. */ -// OBSOLETE print_max < UINT_MAX) -// OBSOLETE i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream); -// OBSOLETE -// OBSOLETE /* Return number of characters printed, plus one for the -// OBSOLETE terminating null if we have "reached the end". */ -// OBSOLETE return (i + (print_max && i != print_max)); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE i = TYPE_LENGTH (type); -// OBSOLETE LA_PRINT_STRING (stream, valaddr, i, 1, 0); -// OBSOLETE /* Return number of characters printed, plus one for the terminating -// OBSOLETE null if we have "reached the end". */ -// OBSOLETE return (i + (print_max && i != print_max)); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_BITSTRING: -// OBSOLETE case TYPE_CODE_SET: -// OBSOLETE elttype = TYPE_INDEX_TYPE (type); -// OBSOLETE CHECK_TYPEDEF (elttype); -// OBSOLETE if (TYPE_STUB (elttype)) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, ""); -// OBSOLETE gdb_flush (stream); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE { -// OBSOLETE struct type *range = elttype; -// OBSOLETE LONGEST low_bound, high_bound; -// OBSOLETE int i; -// OBSOLETE int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING; -// OBSOLETE int need_comma = 0; -// OBSOLETE -// OBSOLETE if (is_bitstring) -// OBSOLETE fputs_filtered ("B'", stream); -// OBSOLETE else -// OBSOLETE fputs_filtered ("[", stream); -// OBSOLETE -// OBSOLETE i = get_discrete_bounds (range, &low_bound, &high_bound); -// OBSOLETE maybe_bad_bstring: -// OBSOLETE if (i < 0) -// OBSOLETE { -// OBSOLETE fputs_filtered ("", stream); -// OBSOLETE goto done; -// OBSOLETE } -// OBSOLETE -// OBSOLETE for (i = low_bound; i <= high_bound; i++) -// OBSOLETE { -// OBSOLETE int element = value_bit_index (type, valaddr, i); -// OBSOLETE if (element < 0) -// OBSOLETE { -// OBSOLETE i = element; -// OBSOLETE goto maybe_bad_bstring; -// OBSOLETE } -// OBSOLETE if (is_bitstring) -// OBSOLETE fprintf_filtered (stream, "%d", element); -// OBSOLETE else if (element) -// OBSOLETE { -// OBSOLETE if (need_comma) -// OBSOLETE fputs_filtered (", ", stream); -// OBSOLETE chill_print_type_scalar (range, (LONGEST) i, stream); -// OBSOLETE need_comma = 1; -// OBSOLETE -// OBSOLETE /* Look for a continuous range of true elements. */ -// OBSOLETE if (i + 1 <= high_bound && value_bit_index (type, valaddr, ++i)) -// OBSOLETE { -// OBSOLETE int j = i; /* j is the upper bound so far of the range */ -// OBSOLETE fputs_filtered (":", stream); -// OBSOLETE while (i + 1 <= high_bound -// OBSOLETE && value_bit_index (type, valaddr, ++i)) -// OBSOLETE j = i; -// OBSOLETE chill_print_type_scalar (range, (LONGEST) j, stream); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE done: -// OBSOLETE if (is_bitstring) -// OBSOLETE fputs_filtered ("'", stream); -// OBSOLETE else -// OBSOLETE fputs_filtered ("]", stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_STRUCT: -// OBSOLETE if (chill_varying_type (type)) -// OBSOLETE { -// OBSOLETE struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 1)); -// OBSOLETE long length = unpack_long (TYPE_FIELD_TYPE (type, 0), valaddr); -// OBSOLETE char *data_addr = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8; -// OBSOLETE -// OBSOLETE switch (TYPE_CODE (inner)) -// OBSOLETE { -// OBSOLETE case TYPE_CODE_STRING: -// OBSOLETE if (length > TYPE_LENGTH (type) - 2) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, -// OBSOLETE " static length %d> *invalid*", -// OBSOLETE length, TYPE_LENGTH (type)); -// OBSOLETE -// OBSOLETE /* Don't print the string; doing so might produce a -// OBSOLETE segfault. */ -// OBSOLETE return length; -// OBSOLETE } -// OBSOLETE LA_PRINT_STRING (stream, data_addr, length, 1, 0); -// OBSOLETE return length; -// OBSOLETE default: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE chill_print_value_fields (type, valaddr, stream, format, recurse, pretty, -// OBSOLETE 0); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_REF: -// OBSOLETE if (addressprint) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "LOC("); -// OBSOLETE print_address_numeric -// OBSOLETE (extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT), -// OBSOLETE 1, -// OBSOLETE stream); -// OBSOLETE fprintf_filtered (stream, ")"); -// OBSOLETE if (deref_ref) -// OBSOLETE fputs_filtered (": ", stream); -// OBSOLETE } -// OBSOLETE /* De-reference the reference. */ -// OBSOLETE if (deref_ref) -// OBSOLETE { -// OBSOLETE if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF) -// OBSOLETE { -// OBSOLETE struct value *deref_val = -// OBSOLETE value_at -// OBSOLETE (TYPE_TARGET_TYPE (type), -// OBSOLETE unpack_pointer (lookup_pointer_type (builtin_type_void), -// OBSOLETE valaddr), -// OBSOLETE NULL); -// OBSOLETE val_print (VALUE_TYPE (deref_val), -// OBSOLETE VALUE_CONTENTS (deref_val), -// OBSOLETE 0, -// OBSOLETE VALUE_ADDRESS (deref_val), stream, format, -// OBSOLETE deref_ref, recurse + 1, pretty); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE fputs_filtered ("???", stream); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_ENUM: -// OBSOLETE c_val_print (type, valaddr, 0, address, stream, format, -// OBSOLETE deref_ref, recurse, pretty); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_RANGE: -// OBSOLETE if (TYPE_TARGET_TYPE (type)) -// OBSOLETE chill_val_print (TYPE_TARGET_TYPE (type), valaddr, 0, address, stream, -// OBSOLETE format, deref_ref, recurse, pretty); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case TYPE_CODE_MEMBER: -// OBSOLETE case TYPE_CODE_UNION: -// OBSOLETE case TYPE_CODE_FUNC: -// OBSOLETE case TYPE_CODE_VOID: -// OBSOLETE case TYPE_CODE_ERROR: -// OBSOLETE default: -// OBSOLETE /* Let's defer printing to the C printer, rather than -// OBSOLETE print an error message. FIXME! */ -// OBSOLETE c_val_print (type, valaddr, 0, address, stream, format, -// OBSOLETE deref_ref, recurse, pretty); -// OBSOLETE } -// OBSOLETE gdb_flush (stream); -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Mutually recursive subroutines of cplus_print_value and c_val_print to -// OBSOLETE print out a structure's fields: cp_print_value_fields and cplus_print_value. -// OBSOLETE -// OBSOLETE TYPE, VALADDR, STREAM, RECURSE, and PRETTY have the -// OBSOLETE same meanings as in cplus_print_value and c_val_print. -// OBSOLETE -// OBSOLETE DONT_PRINT is an array of baseclass types that we -// OBSOLETE should not print, or zero if called from top level. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE chill_print_value_fields (struct type *type, char *valaddr, -// OBSOLETE struct ui_file *stream, int format, int recurse, -// OBSOLETE enum val_prettyprint pretty, struct type **dont_print) -// OBSOLETE { -// OBSOLETE int i, len; -// OBSOLETE int fields_seen = 0; -// OBSOLETE -// OBSOLETE CHECK_TYPEDEF (type); -// OBSOLETE -// OBSOLETE fprintf_filtered (stream, "["); -// OBSOLETE len = TYPE_NFIELDS (type); -// OBSOLETE if (len == 0) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, ""); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (i = 0; i < len; i++) -// OBSOLETE { -// OBSOLETE if (fields_seen) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, ", "); -// OBSOLETE } -// OBSOLETE fields_seen = 1; -// OBSOLETE if (pretty) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "\n"); -// OBSOLETE print_spaces_filtered (2 + 2 * recurse, stream); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE wrap_here (n_spaces (2 + 2 * recurse)); -// OBSOLETE } -// OBSOLETE fputs_filtered (".", stream); -// OBSOLETE fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), -// OBSOLETE language_chill, DMGL_NO_OPTS); -// OBSOLETE fputs_filtered (": ", stream); -// OBSOLETE if (TYPE_FIELD_PACKED (type, i)) -// OBSOLETE { -// OBSOLETE struct value *v; -// OBSOLETE -// OBSOLETE /* Bitfields require special handling, especially due to byte -// OBSOLETE order problems. */ -// OBSOLETE v = value_from_longest (TYPE_FIELD_TYPE (type, i), -// OBSOLETE unpack_field_as_long (type, valaddr, i)); -// OBSOLETE -// OBSOLETE chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0, -// OBSOLETE stream, format, 0, recurse + 1, pretty); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE chill_val_print (TYPE_FIELD_TYPE (type, i), -// OBSOLETE valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0, -// OBSOLETE 0, stream, format, 0, recurse + 1, pretty); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE if (pretty) -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "\n"); -// OBSOLETE print_spaces_filtered (2 * recurse, stream); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, "]"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE int -// OBSOLETE chill_value_print (struct value *val, struct ui_file *stream, int format, -// OBSOLETE enum val_prettyprint pretty) -// OBSOLETE { -// OBSOLETE struct type *type = VALUE_TYPE (val); -// OBSOLETE struct type *real_type = check_typedef (type); -// OBSOLETE -// OBSOLETE /* If it is a pointer, indicate what it points to. -// OBSOLETE -// OBSOLETE Print type also if it is a reference. */ -// OBSOLETE -// OBSOLETE if (TYPE_CODE (real_type) == TYPE_CODE_PTR || -// OBSOLETE TYPE_CODE (real_type) == TYPE_CODE_REF) -// OBSOLETE { -// OBSOLETE char *valaddr = VALUE_CONTENTS (val); -// OBSOLETE CORE_ADDR addr = unpack_pointer (type, valaddr); -// OBSOLETE if (TYPE_CODE (type) != TYPE_CODE_PTR || addr != 0) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE char *name = TYPE_NAME (type); -// OBSOLETE if (name) -// OBSOLETE fputs_filtered (name, stream); -// OBSOLETE else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID) -// OBSOLETE fputs_filtered ("PTR", stream); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintf_filtered (stream, "("); -// OBSOLETE type_print (type, "", stream, -1); -// OBSOLETE fprintf_filtered (stream, ")"); -// OBSOLETE } -// OBSOLETE fprintf_filtered (stream, "("); -// OBSOLETE i = val_print (type, valaddr, 0, VALUE_ADDRESS (val), -// OBSOLETE stream, format, 1, 0, pretty); -// OBSOLETE fprintf_filtered (stream, ")"); -// OBSOLETE return i; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE return (val_print (type, VALUE_CONTENTS (val), 0, -// OBSOLETE VALUE_ADDRESS (val), stream, format, 1, 0, pretty)); -// OBSOLETE } diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index fb7c237..0e74575 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include #include "completer.h" #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ #include "gdb_wait.h" /* For shell escape implementation */ @@ -844,10 +845,10 @@ disassemble_command (char *arg, int from_tty) name = NULL; if (!arg) { - if (!selected_frame) + if (!deprecated_selected_frame) error ("No frame selected.\n"); - pc = get_frame_pc (selected_frame); + pc = get_frame_pc (deprecated_selected_frame); if (find_pc_partial_function (pc, &name, &low, &high) == 0) error ("No function contains program counter for selected frame.\n"); #if defined(TUI) diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index a648093..7a58fcb 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -31,6 +31,7 @@ #include "gdb_assert.h" #include #include "target.h" +#include #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 44b0b4e..6fe2ff0 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include #include "value.h" #include #include "gdb_string.h" diff --git a/gdb/coffread.c b/gdb/coffread.c index a6f615a..cfd5a9f 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -124,41 +124,6 @@ static int pe_file; static struct symbol *opaque_type_chain[HASHSIZE]; -/* Complaints about various problems in the file being read */ - -struct deprecated_complaint ef_complaint = -{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0}; - -struct deprecated_complaint ef_stack_complaint = -{"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0}; - -struct deprecated_complaint eb_stack_complaint = -{"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0}; - -struct deprecated_complaint bf_no_aux_complaint = -{"`.bf' symbol %d has no aux entry", 0, 0}; - -struct deprecated_complaint ef_no_aux_complaint = -{"`.ef' symbol %d has no aux entry", 0, 0}; - -struct deprecated_complaint lineno_complaint = -{"Line number pointer %d lower than start of line numbers", 0, 0}; - -struct deprecated_complaint unexpected_type_complaint = -{"Unexpected type for symbol %s", 0, 0}; - -struct deprecated_complaint bad_sclass_complaint = -{"Bad n_sclass for symbol %s", 0, 0}; - -struct deprecated_complaint misordered_blocks_complaint = -{"Blocks out of order at address %x", 0, 0}; - -struct deprecated_complaint tagndx_bad_complaint = -{"Symbol table entry for %s has bad tagndx value", 0, 0}; - -struct deprecated_complaint eb_complaint = -{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0}; - /* Simplified internal version of coff symbol table information */ struct coff_symbol @@ -814,7 +779,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, case C_LINE: case C_ALIAS: case C_HIDDEN: - complain (&bad_sclass_complaint, cs->c_name); + complaint (&symfile_complaints, "Bad n_sclass for symbol %s", + cs->c_name); break; case C_FILE: @@ -980,7 +946,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, /* main_aux.x_sym.x_misc.x_lnsz.x_lnno contains line number of '{' } */ if (cs->c_naux != 1) - complain (&bf_no_aux_complaint, cs->c_symnum); + complaint (&symfile_complaints, + "`.bf' symbol %d has no aux entry", cs->c_symnum); fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno; fcn_first_line_addr = cs->c_value; @@ -1004,7 +971,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, if (context_stack_depth <= 0) { /* We attempted to pop an empty context stack */ - complain (&ef_stack_complaint, cs->c_symnum); + complaint (&symfile_complaints, + "`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", + cs->c_symnum); within_function = 0; break; } @@ -1013,13 +982,16 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, /* Stack must be empty now. */ if (context_stack_depth > 0 || new == NULL) { - complain (&ef_complaint, cs->c_symnum); + complaint (&symfile_complaints, + "Unmatched .ef symbol(s) ignored starting at symnum %d", + cs->c_symnum); within_function = 0; break; } if (cs->c_naux != 1) { - complain (&ef_no_aux_complaint, cs->c_symnum); + complaint (&symfile_complaints, + "`.ef' symbol %d has no aux entry", cs->c_symnum); fcn_last_line = 0x7FFFFFFF; } else @@ -1074,14 +1046,18 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, { if (context_stack_depth <= 0) { /* We attempted to pop an empty context stack */ - complain (&eb_stack_complaint, cs->c_symnum); + complaint (&symfile_complaints, + "`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", + cs->c_symnum); break; } new = pop_context (); if (depth-- != new->depth) { - complain (&eb_complaint, symnum); + complaint (&symfile_complaints, + "Mismatched .eb symbol ignored starting at symnum %d", + symnum); break; } if (local_symbols && context_stack_depth > 0) @@ -1360,7 +1336,9 @@ enter_linenos (long file_offset, register int first_line, return; if (file_offset < linetab_offset) { - complain (&lineno_complaint, file_offset); + complaint (&symfile_complaints, + "Line number pointer %ld lower than start of line numbers", + file_offset); if (file_offset > linetab_size) /* Too big to be an offset? */ return; file_offset += linetab_offset; /* Try reading at that linetab offset */ @@ -1765,7 +1743,9 @@ decode_type (register struct coff_symbol *cs, unsigned int c_type, } else { - complain (&tagndx_bad_complaint, cs->c_name); + complaint (&symfile_complaints, + "Symbol table entry for %s has bad tagndx value", + cs->c_name); /* And fall through to decode_base_type... */ } } @@ -1931,7 +1911,7 @@ decode_base_type (register struct coff_symbol *cs, unsigned int c_type, else return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG); } - complain (&unexpected_type_complaint, cs->c_name); + complaint (&symfile_complaints, "Unexpected type for symbol %s", cs->c_name); return lookup_fundamental_type (current_objfile, FT_VOID); } diff --git a/gdb/complaints.h b/gdb/complaints.h index 159dcd1..a94de27 100644 --- a/gdb/complaints.h +++ b/gdb/complaints.h @@ -53,12 +53,24 @@ extern void clear_complaints (struct complaints **complaints, /* Deprecated interfaces to keep the old code working (until it is all converted to the above). Existing code such as: - struct deprecated_complaint msg = { "msg", 0, 0 }; - complaint (&msg); + struct deprecated_complaint msg = { "msg 0x%08x[sic]", 0, 0 }; + deprecated_complain (&msg, addr); - should be replaced by: + should be replaced by either the new call (for the singular case): - complaint (&symtab_complaints, __FILE__, __LINE__, "msg"); + complaint (&symtab_complaints, "msg 0x%s", paddr (addr)); + + or with a wrapper function (for the many-of case): + + msg_complaint (CORE_ADDR addr) + { complaint (&symtab_complaints, "msg 0x%s", paddr (addr)); } + ... + msg_complaint (addr); + + Yes, the typo is intentional. The motivation behind this interface + change is to eliminate all possibility of this problem re-occurring + (it has occurred in the past and no one is sure that it isn't + present now). Support for complaining about things in the symbol file that aren't catastrophic. diff --git a/gdb/completer.c b/gdb/completer.c index 67ea300..4274241 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -31,7 +31,7 @@ #include "gdbcmd.h" /* Needed for rl_completer_word_break_characters() and for - filename_completion_function. */ + rl_filename_completion_function. */ #include /* readline defines this. */ @@ -40,7 +40,8 @@ #include "completer.h" /* Prototypes for local functions */ -char *line_completion_function (char *text, int matches, char *line_buffer, +static +char *line_completion_function (const char *text, int matches, char *line_buffer, int point); /* readline uses the word breaks for two things: @@ -104,7 +105,7 @@ get_gdb_completer_quote_characters (void) /* Line completion interface function for readline. */ char * -readline_line_completion_function (char *text, int matches) +readline_line_completion_function (const char *text, int matches) { return line_completion_function (text, matches, rl_line_buffer, rl_point); } @@ -135,7 +136,7 @@ filename_completer (char *text, char *word) while (1) { char *p; - p = filename_completion_function (text, subsequent_name); + p = rl_filename_completion_function (text, subsequent_name); if (return_val_used >= return_val_alloced) { return_val_alloced *= 2; @@ -382,7 +383,7 @@ command_completer (char *text, char *word) should pretend that the line ends at POINT. */ char ** -complete_line (char *text, char *line_buffer, int point) +complete_line (const char *text, char *line_buffer, int point) { char **list = NULL; char *tmp_command, *p; @@ -628,8 +629,8 @@ complete_line (char *text, char *line_buffer, int point) which is a possible completion, it is the caller's responsibility to free the string. */ -char * -line_completion_function (char *text, int matches, char *line_buffer, int point) +static char * +line_completion_function (const char *text, int matches, char *line_buffer, int point) { static char **list = (char **) NULL; /* Cache of completions */ static int index; /* Next cached completion */ @@ -678,16 +679,25 @@ line_completion_function (char *text, int matches, char *line_buffer, int point) return (output); } -/* Skip over a possibly quoted word (as defined by the quote characters - and word break characters the completer uses). Returns pointer to the - location after the "word". */ + +/* Skip over the possibly quoted word STR (as defined by the quote + characters QUOTECHARS and the the word break characters + BREAKCHARS). Returns pointer to the location after the "word". If + either QUOTECHARS or BREAKCHARS is NULL, use the same values used + by the completer. */ char * -skip_quoted (char *str) +skip_quoted_chars (char *str, char *quotechars, char *breakchars) { char quote_char = '\0'; char *scan; + if (quotechars == NULL) + quotechars = gdb_completer_quote_characters; + + if (breakchars == NULL) + breakchars = gdb_completer_word_break_characters; + for (scan = str; *scan != '\0'; scan++) { if (quote_char != '\0') @@ -700,16 +710,26 @@ skip_quoted (char *str) break; } } - else if (strchr (gdb_completer_quote_characters, *scan)) + else if (strchr (quotechars, *scan)) { /* Found start of a quoted string. */ quote_char = *scan; } - else if (strchr (gdb_completer_word_break_characters, *scan)) + else if (strchr (breakchars, *scan)) { break; } } + return (scan); } +/* Skip over the possibly quoted word STR (as defined by the quote + characters and word break characters used by the completer). + Returns pointer to the location after the "word". */ + +char * +skip_quoted (char *str) +{ + return skip_quoted_chars (str, NULL, NULL); +} diff --git a/gdb/completer.h b/gdb/completer.h index 98b9ed8..7a96951 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -19,11 +19,9 @@ #if !defined (COMPLETER_H) #define COMPLETER_H 1 -extern char **complete_line (char *text, char *line_buffer, int point); +extern char **complete_line (const char *text, char *line_buffer, int point); -extern char *line_completion_function (char *, int, char *, int); - -extern char *readline_line_completion_function (char *text, int matches); +extern char *readline_line_completion_function (const char *text, int matches); extern char **noop_completer (char *, char *); @@ -39,6 +37,8 @@ extern char *get_gdb_completer_quote_characters (void); /* Exported to linespec.c */ -extern char *skip_quoted (char *str); +extern char *skip_quoted_chars (char *, char *, char *); + +extern char *skip_quoted (char *); #endif /* defined (COMPLETER_H) */ diff --git a/gdb/config.in b/gdb/config.in index fa1ab9a..921b168 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -80,6 +80,9 @@ /* Define if your struct reg has r_gs. */ #undef HAVE_STRUCT_REG_R_GS +/* Define if the pread64 function is available. */ +#undef HAVE_PREAD64 + /* Define if exists and defines struct link_map which has members with an ``l_'' prefix. (For Solaris, SVR4, and SVR4-like systems.) */ @@ -517,3 +520,12 @@ /* Define if has the TD_NOTALLOC error code. */ #undef THREAD_DB_HAS_TD_NOTALLOC +/* Define to be a string naming the default host character set. */ +#undef GDB_DEFAULT_HOST_CHARSET + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + diff --git a/gdb/config/alpha/alpha-linux.mh b/gdb/config/alpha/alpha-linux.mh index 39f3532..7691d07 100644 --- a/gdb/config/alpha/alpha-linux.mh +++ b/gdb/config/alpha/alpha-linux.mh @@ -8,3 +8,7 @@ LOADLIBES = -ldl -rdynamic MMALLOC = MMALLOC_CFLAGS = -DNO_MMALLOC + +# doublest.c currently assumes some properties of FP arithmetic +# on the host which require this. +MH_CFLAGS = -mieee diff --git a/gdb/config/arc/arc.mt b/gdb/config/arc/arc.mt deleted file mode 100644 index 3ed7410..0000000 --- a/gdb/config/arc/arc.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: ARC processor -# OBSOLETE TDEPFILES = arc-tdep.o -# OBSOLETE TM_FILE = tm-arc.h diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h deleted file mode 100644 index 1c7c74f..0000000 --- a/gdb/config/arc/tm-arc.h +++ /dev/null @@ -1,336 +0,0 @@ -// OBSOLETE /* Parameters for target machine ARC, for GDB, the GNU debugger. -// OBSOLETE Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE Contributed by Cygnus Support. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* Used by arc-tdep.c to set the default cpu type. */ -// OBSOLETE #define DEFAULT_ARC_CPU_TYPE "base" -// OBSOLETE -// OBSOLETE /* Offset from address of function to start of its code. -// OBSOLETE Zero on most machines. */ -// OBSOLETE #define FUNCTION_START_OFFSET 0 -// OBSOLETE -// OBSOLETE /* Advance PC across any function entry prologue instructions -// OBSOLETE to reach some "real" code. */ -// OBSOLETE -// OBSOLETE #define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0)) -// OBSOLETE extern CORE_ADDR arc_skip_prologue (CORE_ADDR, int); -// OBSOLETE -// OBSOLETE #define PROLOGUE_FRAMELESS_P(pc) arc_prologue_frameless_p(pc) -// OBSOLETE extern int arc_prologue_frameless_p (CORE_ADDR); -// OBSOLETE -// OBSOLETE /* Sequence of bytes for breakpoint instruction. -// OBSOLETE ??? The current value is "sr -1,[-1]" and is for the simulator only. -// OBSOLETE The simulator watches for this and does the right thing. -// OBSOLETE The hardware version will have to associate with each breakpoint -// OBSOLETE the sequence "flag 1; nop; nop; nop". IE: The breakpoint insn will not -// OBSOLETE be a fixed set of bits but instead will be a branch to a semi-random -// OBSOLETE address. Presumably this will be cleaned up for "second silicon". */ -// OBSOLETE #define BIG_BREAKPOINT { 0x12, 0x1f, 0xff, 0xff } -// OBSOLETE #define LITTLE_BREAKPOINT { 0xff, 0xff, 0x1f, 0x12 } -// OBSOLETE -// OBSOLETE /* Given the exposed pipeline, there isn't any one correct value. -// OBSOLETE However, this value must be 4. GDB can't handle any other value (other than -// OBSOLETE zero). See for example infrun.c: -// OBSOLETE "prev_pc != stop_pc - DECR_PC_AFTER_BREAK" */ -// OBSOLETE /* FIXME */ -// OBSOLETE #define DECR_PC_AFTER_BREAK 8 -// OBSOLETE -// OBSOLETE /* We don't have a reliable single step facility. -// OBSOLETE ??? We do have a cycle single step facility, but that won't work. */ -// OBSOLETE #define SOFTWARE_SINGLE_STEP_P() 1 -// OBSOLETE extern void arc_software_single_step (enum target_signal, int); -// OBSOLETE #define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p) -// OBSOLETE -// OBSOLETE /* FIXME: Need to set STEP_SKIPS_DELAY. */ -// OBSOLETE -// OBSOLETE /* Given a pc value as defined by the hardware, return the real address. -// OBSOLETE Remember that on the ARC blink contains that status register which -// OBSOLETE includes PC + flags (so we have to mask out the flags). */ -// OBSOLETE #define ARC_PC_TO_REAL_ADDRESS(pc) (((pc) & 0xffffff) << 2) -// OBSOLETE -// OBSOLETE /* Immediately after a function call, return the saved pc. -// OBSOLETE Can't always go through the frames for this because on some machines -// OBSOLETE the new frame is not set up until the new function -// OBSOLETE executes some instructions. */ -// OBSOLETE -// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ -// OBSOLETE (ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM))) -// OBSOLETE -// OBSOLETE /* Stack grows upward */ -// OBSOLETE -// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) -// OBSOLETE -// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity -// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the -// OBSOLETE real way to know how big a register is. */ -// OBSOLETE #define REGISTER_SIZE 4 -// OBSOLETE -// OBSOLETE /* Number of machine registers */ -// OBSOLETE #define NUM_REGS 92 -// OBSOLETE -// OBSOLETE /* Initializer for an array of names of registers. -// OBSOLETE There should be NUM_REGS strings in this initializer. */ -// OBSOLETE -// OBSOLETE #define REGISTER_NAMES \ -// OBSOLETE { \ -// OBSOLETE /* 0 */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ -// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ -// OBSOLETE /* 16 */ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ -// OBSOLETE /* 24 */ "r24", "r25", "r26", "fp", "sp", "ilink1", "ilink2", "blink", \ -// OBSOLETE /* 32 */ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \ -// OBSOLETE /* 40 */ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \ -// OBSOLETE /* 48 */ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \ -// OBSOLETE /* 56 */ "r56", "mlo", "mmid", "mhi", "lp_count", \ -// OBSOLETE /* 61 */ "status", "sema", "lp_start", "lp_end", "identity", "debug", \ -// OBSOLETE /* 67 */ "aux10", "aux11", "aux12", "aux13", "aux14", \ -// OBSOLETE /* 72 */ "aux15", "aux16", "aux17", "aux18", "aux19", \ -// OBSOLETE /* 77 */ "aux1a", "aux1b", "aux1c", "aux1d", "aux1e", \ -// OBSOLETE /* 82 */ "aux1f", "aux20", "aux21", "aux22", \ -// OBSOLETE /* 86 */ "aux30", "aux31", "aux32", "aux33", "aux40", \ -// OBSOLETE /* 91 */ "pc" \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Register numbers of various important registers (used to index -// OBSOLETE into arrays of register names and register values). */ -// OBSOLETE -// OBSOLETE #define R0_REGNUM 0 /* First local register */ -// OBSOLETE #define R59_REGNUM 59 /* Last local register */ -// OBSOLETE #define FP_REGNUM 27 /* Contains address of executing stack frame */ -// OBSOLETE #define SP_REGNUM 28 /* stack pointer */ -// OBSOLETE #define BLINK_REGNUM 31 /* link register */ -// OBSOLETE #define STA_REGNUM 61 /* processor status word */ -// OBSOLETE #define PC_REGNUM 91 /* instruction pointer */ -// OBSOLETE #define AUX_BEG_REGNUM 61 /* aux reg begins */ -// OBSOLETE #define AUX_END_REGNUM 90 /* aux reg ends, pc not real aux reg */ -// OBSOLETE -// OBSOLETE /* Fake registers used to mark immediate data. */ -// OBSOLETE #define SHIMM_FLAG_REGNUM 61 -// OBSOLETE #define LIMM_REGNUM 62 -// OBSOLETE #define SHIMM_REGNUM 63 -// OBSOLETE -// OBSOLETE #define AUX_REG_MAP \ -// OBSOLETE { \ -// OBSOLETE { 0, 1, 2, 3, 4, 5, \ -// OBSOLETE 16, -1, -1, -1, -1, \ -// OBSOLETE -1, -1, -1, -1, -1, \ -// OBSOLETE -1, -1, -1, -1, 30, \ -// OBSOLETE -1, 32, 33, -1, \ -// OBSOLETE 48, 49, 50, 51, 64, \ -// OBSOLETE 0 \ -// OBSOLETE }, \ -// OBSOLETE { 0, 1, 2, 3, 4, 5, \ -// OBSOLETE 16, -1, -1, -1, -1, \ -// OBSOLETE -1, -1, -1, -1, -1, \ -// OBSOLETE -1, -1, -1, -1, 30, \ -// OBSOLETE 31, 32, 33, -1, \ -// OBSOLETE -1, -1, -1, -1, -1, \ -// OBSOLETE 0 \ -// OBSOLETE }, \ -// OBSOLETE { 0, 1, 2, 3, 4, 5, \ -// OBSOLETE 16, 17, 18, 19, 20, \ -// OBSOLETE 21, 22, 23, 24, 25, \ -// OBSOLETE 26, 27, 28, 29, 30, \ -// OBSOLETE 31, 32, 33, 34, \ -// OBSOLETE -1, -1, -1, -1, -1, \ -// OBSOLETE 0 \ -// OBSOLETE } \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define PFP_REGNUM R0_REGNUM /* Previous frame pointer */ -// OBSOLETE -// OBSOLETE /* Total amount of space needed to store our copies of the machine's -// OBSOLETE register state, the array `registers'. */ -// OBSOLETE #define REGISTER_BYTES (NUM_REGS * 4) -// OBSOLETE -// OBSOLETE /* Index within `registers' of the first byte of the space for register N. */ -// OBSOLETE #define REGISTER_BYTE(N) (4*(N)) -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the actual machine representation -// OBSOLETE for register N. */ -// OBSOLETE #define REGISTER_RAW_SIZE(N) 4 -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */ -// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4 -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ -// OBSOLETE #define MAX_REGISTER_RAW_SIZE 4 -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ -// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 4 -// OBSOLETE -// OBSOLETE /* Return the GDB type object for the "standard" data type -// OBSOLETE of data in register N. */ -// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Macros for understanding function return values... */ -// OBSOLETE -// OBSOLETE /* Does the specified function use the "struct returning" convention -// OBSOLETE or the "value returning" convention? The "value returning" convention -// OBSOLETE almost invariably returns the entire value in registers. The -// OBSOLETE "struct returning" convention often returns the entire value in -// OBSOLETE memory, and passes a pointer (out of or into the function) saying -// OBSOLETE where the value (is or should go). -// OBSOLETE -// OBSOLETE Since this sometimes depends on whether it was compiled with GCC, -// OBSOLETE this is also an argument. This is used in call_function to build a -// OBSOLETE stack, and in value_being_returned to print return values. -// OBSOLETE -// OBSOLETE On arc, a structure is always retunred with pointer in r0. */ -// OBSOLETE -// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) 1 -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE a function return value of type TYPE, and copy that, in virtual format, -// OBSOLETE into VALBUF. This is only called if USE_STRUCT_CONVENTION for this -// OBSOLETE type is 0. -// OBSOLETE */ -// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -// OBSOLETE memcpy(VALBUF, REGBUF+REGISTER_BYTE(R0_REGNUM), TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, -// OBSOLETE extract from an array REGBUF containing the (raw) register state -// OBSOLETE the address in which a function should return its structure value, -// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */ -// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ -// OBSOLETE (error("Don't know where large structure is returned on arc"), 0) -// OBSOLETE -// OBSOLETE /* Write into appropriate registers a function return value -// OBSOLETE of type TYPE, given in virtual format, for "value returning" functions. -// OBSOLETE For 'return' command: not (yet) implemented for arc. */ -// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ -// OBSOLETE error ("Returning values from functions is not implemented in arc gdb") -// OBSOLETE -// OBSOLETE /* Store the address of the place in which to copy the structure the -// OBSOLETE subroutine will return. This is called from call_function. */ -// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ -// OBSOLETE error ("Returning values from functions is not implemented in arc gdb") -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame -// OBSOLETE (its caller). */ -// OBSOLETE -// OBSOLETE /* We cache information about saved registers in the frame structure, -// OBSOLETE to save us from having to re-scan function prologues every time -// OBSOLETE a register in a non-current frame is accessed. */ -// OBSOLETE -// OBSOLETE #define EXTRA_FRAME_INFO \ -// OBSOLETE struct frame_saved_regs *fsr; \ -// OBSOLETE CORE_ADDR arg_pointer; -// OBSOLETE -// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized, -// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and -// OBSOLETE initialize a frame_saved_regs struct the first time it is called. -// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values -// OBSOLETE indicate real, cached values. */ -// OBSOLETE -// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ -// OBSOLETE ((fi)->fsr = 0, (fi)->arg_pointer = -1) -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address -// OBSOLETE and produces the frame's chain-pointer. -// OBSOLETE However, if FRAME_CHAIN_VALID returns zero, -// OBSOLETE it means the given frame is the outermost one and has no caller. */ -// OBSOLETE /* On the arc, we get the chain pointer by reading the PFP saved -// OBSOLETE on the stack. */ -// OBSOLETE /* The PFP and RPC is in fp and fp+4. */ -// OBSOLETE -// OBSOLETE #define FRAME_CHAIN(thisframe) \ -// OBSOLETE (read_memory_integer (FRAME_FP (thisframe), 4)) -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one -// OBSOLETE and has no caller. */ -// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) -// OBSOLETE -// OBSOLETE /* An expression that tells us whether the function invocation represented -// OBSOLETE by FI does not have a frame on the stack associated with it. */ -// OBSOLETE -// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ -// OBSOLETE (((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI)) -// OBSOLETE -// OBSOLETE /* Where is the PC for a specific frame. -// OBSOLETE A leaf function may never save blink, so we have to check for that here. */ -// OBSOLETE -// OBSOLETE #define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame)) -// OBSOLETE struct frame_info; /* in case frame.h not included yet */ -// OBSOLETE CORE_ADDR arc_frame_saved_pc (struct frame_info *); -// OBSOLETE -// OBSOLETE /* If the argument is on the stack, it will be here. -// OBSOLETE We cache this value in the frame info if we've already looked it up. */ -// OBSOLETE /* ??? Is the arg_pointer check necessary? */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ -// OBSOLETE (((fi)->arg_pointer != -1) ? (fi)->arg_pointer : (fi)->frame) -// OBSOLETE -// OBSOLETE /* This is the same except it should return 0 when -// OBSOLETE it does not really know where the args are, rather than guessing. -// OBSOLETE This value is not cached since it is only used infrequently. */ -// OBSOLETE -// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) -// OBSOLETE -// OBSOLETE /* Set NUMARGS to the number of args passed to a frame. -// OBSOLETE Can return -1, meaning no way to tell. */ -// OBSOLETE -// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) -// OBSOLETE -// OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_SKIP 0 -// OBSOLETE -// OBSOLETE /* Produce the positions of the saved registers in a stack frame. */ -// OBSOLETE -// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \ -// OBSOLETE frame_find_saved_regs (frame_info_addr, &sr) -// OBSOLETE extern void frame_find_saved_regs (); /* See arc-tdep.c */ -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Things needed for making calls to functions in the inferior process */ -// OBSOLETE void arc_push_dummy_frame (void); -// OBSOLETE #define PUSH_DUMMY_FRAME \ -// OBSOLETE arc_push_dummy_frame () -// OBSOLETE -// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. */ -// OBSOLETE void arc_pop_frame (void); -// OBSOLETE #define POP_FRAME \ -// OBSOLETE arc_pop_frame () -// OBSOLETE -// OBSOLETE /* This sequence of words is the instructions bl xxxx, flag 1 */ -// OBSOLETE #define CALL_DUMMY { 0x28000000, 0x1fbe8001 } -// OBSOLETE #define CALL_DUMMY_LENGTH 8 -// OBSOLETE -// OBSOLETE /* Start execution at beginning of dummy */ -// OBSOLETE #define CALL_DUMMY_START_OFFSET 0 -// OBSOLETE -// OBSOLETE /* Insert the specified number of args and function address -// OBSOLETE into a call sequence of the above form stored at 'dummyname'. */ -// OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ -// OBSOLETE { \ -// OBSOLETE int from, to, delta, loc; \ -// OBSOLETE loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \ -// OBSOLETE from = loc + 4; \ -// OBSOLETE to = (int)(fun); \ -// OBSOLETE delta = (to - from) >> 2; \ -// OBSOLETE *((char *)(dummyname) + 1) = (delta & 0x1); \ -// OBSOLETE *((char *)(dummyname) + 2) = ((delta >> 1) & 0xff); \ -// OBSOLETE *((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \ -// OBSOLETE *((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \ -// OBSOLETE } diff --git a/gdb/config/d30v/d30v.mt b/gdb/config/d30v/d30v.mt deleted file mode 100644 index 49bd83b..0000000 --- a/gdb/config/d30v/d30v.mt +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Target: Mitsubishi D30V processor -# OBSOLETE TDEPFILES= d30v-tdep.o -# OBSOLETE TM_FILE= tm-d30v.h -# OBSOLETE SIM_OBS= remote-sim.o -# OBSOLETE SIM= ../sim/d30v/libsim.a diff --git a/gdb/config/d30v/tm-d30v.h b/gdb/config/d30v/tm-d30v.h deleted file mode 100644 index 3e1ea3f..0000000 --- a/gdb/config/d30v/tm-d30v.h +++ /dev/null @@ -1,323 +0,0 @@ -/* OBSOLETE /* Target-specific definition for the Mitsubishi D30V */ -/* OBSOLETE Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */ -/* OBSOLETE Boston, MA 02111-1307, USA. */ */ -/* OBSOLETE */ -/* OBSOLETE #ifndef TM_D30V_H */ -/* OBSOLETE #define TM_D30V_H */ -/* OBSOLETE */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE /* Offset from address of function to start of its code. */ -/* OBSOLETE Zero on most machines. */ */ -/* OBSOLETE */ -/* OBSOLETE #define FUNCTION_START_OFFSET 0 */ -/* OBSOLETE */ -/* OBSOLETE /* these are the addresses the D30V-EVA board maps data */ */ -/* OBSOLETE /* and instruction memory to. */ */ -/* OBSOLETE */ -/* OBSOLETE #define DMEM_START 0x20000000 */ -/* OBSOLETE #define IMEM_START 0x00000000 /* was 0x10000000 */ */ -/* OBSOLETE #define STACK_START 0x20007ffe */ -/* OBSOLETE */ -/* OBSOLETE /* Forward decls for prototypes */ */ -/* OBSOLETE struct frame_info; */ -/* OBSOLETE struct frame_saved_regs; */ -/* OBSOLETE struct type; */ -/* OBSOLETE struct value; */ -/* OBSOLETE */ -/* OBSOLETE /* Advance PC across any function entry prologue instructions */ -/* OBSOLETE to reach some "real" code. */ */ -/* OBSOLETE */ -/* OBSOLETE extern CORE_ADDR d30v_skip_prologue (CORE_ADDR); */ -/* OBSOLETE #define SKIP_PROLOGUE(ip) (d30v_skip_prologue (ip)) */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Stack grows downward. */ */ -/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */ -/* OBSOLETE */ -/* OBSOLETE /* for a breakpoint, use "dbt || nop" */ */ -/* OBSOLETE #define BREAKPOINT {0x00, 0xb0, 0x00, 0x00,\ */ -/* OBSOLETE 0x00, 0xf0, 0x00, 0x00} */ -/* OBSOLETE */ -/* OBSOLETE /* If your kernel resets the pc after the trap happens you may need to */ -/* OBSOLETE define this before including this file. */ */ -/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_NAMES \ */ -/* OBSOLETE { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ */ -/* OBSOLETE "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ */ -/* OBSOLETE "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ */ -/* OBSOLETE "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \ */ -/* OBSOLETE "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \ */ -/* OBSOLETE "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \ */ -/* OBSOLETE "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \ */ -/* OBSOLETE "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", \ */ -/* OBSOLETE "spi", "spu", \ */ -/* OBSOLETE "psw", "bpsw", "pc", "bpc", "dpsw", "dpc", "cr6", "rpt_c", \ */ -/* OBSOLETE "rpt_s", "rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "eit_vb",\ */ -/* OBSOLETE "int_s", "int_m", "a0", "a1" \ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #define NUM_REGS 86 */ -/* OBSOLETE */ -/* OBSOLETE /* Register numbers of various important registers. */ -/* OBSOLETE Note that some of these values are "real" register numbers, */ -/* OBSOLETE and correspond to the general registers of the machine, */ -/* OBSOLETE and some are "phony" register numbers which are too large */ -/* OBSOLETE to be actual register numbers as far as the user is concerned */ -/* OBSOLETE but do serve to get the desired values when passed to read_register. */ */ -/* OBSOLETE */ -/* OBSOLETE #define R0_REGNUM 0 */ -/* OBSOLETE #define FP_REGNUM 61 */ -/* OBSOLETE #define LR_REGNUM 62 */ -/* OBSOLETE #define SP_REGNUM 63 */ -/* OBSOLETE #define SPI_REGNUM 64 /* Interrupt stack pointer */ */ -/* OBSOLETE #define SPU_REGNUM 65 /* User stack pointer */ */ -/* OBSOLETE #define CREGS_START 66 */ -/* OBSOLETE */ -/* OBSOLETE #define PSW_REGNUM (CREGS_START + 0) /* psw, bpsw, or dpsw??? */ */ -/* OBSOLETE #define PSW_SM (((unsigned long)0x80000000) >> 0) /* Stack mode: 0/SPI */ */ -/* OBSOLETE /* 1/SPU */ */ -/* OBSOLETE #define PSW_EA (((unsigned long)0x80000000) >> 2) /* Execution status */ */ -/* OBSOLETE #define PSW_DB (((unsigned long)0x80000000) >> 3) /* Debug mode */ */ -/* OBSOLETE #define PSW_DS (((unsigned long)0x80000000) >> 4) /* Debug EIT status */ */ -/* OBSOLETE #define PSW_IE (((unsigned long)0x80000000) >> 5) /* Interrupt enable */ */ -/* OBSOLETE #define PSW_RP (((unsigned long)0x80000000) >> 6) /* Repeat enable */ */ -/* OBSOLETE #define PSW_MD (((unsigned long)0x80000000) >> 7) /* Modulo enable */ */ -/* OBSOLETE #define PSW_F0 (((unsigned long)0x80000000) >> 17) /* F0 flag */ */ -/* OBSOLETE #define PSW_F1 (((unsigned long)0x80000000) >> 19) /* F1 flag */ */ -/* OBSOLETE #define PSW_F2 (((unsigned long)0x80000000) >> 21) /* F2 flag */ */ -/* OBSOLETE #define PSW_F3 (((unsigned long)0x80000000) >> 23) /* F3 flag */ */ -/* OBSOLETE #define PSW_S (((unsigned long)0x80000000) >> 25) /* Saturation flag */ */ -/* OBSOLETE #define PSW_V (((unsigned long)0x80000000) >> 27) /* Overflow flag */ */ -/* OBSOLETE #define PSW_VA (((unsigned long)0x80000000) >> 29) /* Accum. overflow */ */ -/* OBSOLETE #define PSW_C (((unsigned long)0x80000000) >> 31) /* Carry/Borrow flag */ */ -/* OBSOLETE */ -/* OBSOLETE #define BPSW_REGNUM (CREGS_START + 1) /* Backup PSW (on interrupt) */ */ -/* OBSOLETE #define PC_REGNUM (CREGS_START + 2) /* pc, bpc, or dpc??? */ */ -/* OBSOLETE #define BPC_REGNUM (CREGS_START + 3) /* Backup PC (on interrupt) */ */ -/* OBSOLETE #define DPSW_REGNUM (CREGS_START + 4) /* Backup PSW (on debug trap) */ */ -/* OBSOLETE #define DPC_REGNUM (CREGS_START + 5) /* Backup PC (on debug trap) */ */ -/* OBSOLETE #define RPT_C_REGNUM (CREGS_START + 7) /* Loop count */ */ -/* OBSOLETE #define RPT_S_REGNUM (CREGS_START + 8) /* Loop start address */ */ -/* OBSOLETE #define RPT_E_REGNUM (CREGS_START + 9) /* Loop end address */ */ -/* OBSOLETE #define MOD_S_REGNUM (CREGS_START + 10) */ -/* OBSOLETE #define MOD_E_REGNUM (CREGS_START + 11) */ -/* OBSOLETE #define IBA_REGNUM (CREGS_START + 14) /* Instruction break address */ */ -/* OBSOLETE #define EIT_VB_REGNUM (CREGS_START + 15) /* Vector base address */ */ -/* OBSOLETE #define INT_S_REGNUM (CREGS_START + 16) /* Interrupt status */ */ -/* OBSOLETE #define INT_M_REGNUM (CREGS_START + 17) /* Interrupt mask */ */ -/* OBSOLETE #define A0_REGNUM 84 */ -/* OBSOLETE #define A1_REGNUM 85 */ -/* OBSOLETE */ -/* OBSOLETE /* Say how much memory is needed to store a copy of the register set */ */ -/* OBSOLETE #define REGISTER_BYTES ((NUM_REGS - 2) * 4 + 2 * 8) */ -/* OBSOLETE */ -/* OBSOLETE /* Index within `registers' of the first byte of the space for */ -/* OBSOLETE register N. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_BYTE(N) \ */ -/* OBSOLETE ( ((N) >= A0_REGNUM) ? ( ((N) - A0_REGNUM) * 8 + A0_REGNUM * 4 ) : ((N) * 4) ) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the actual machine representation */ -/* OBSOLETE for register N. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 4 ) */ -/* OBSOLETE */ -/* OBSOLETE /* Number of bytes of storage in the program's representation */ -/* OBSOLETE for register N. */ */ -/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 8 */ -/* OBSOLETE */ -/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ */ -/* OBSOLETE */ -/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 */ -/* OBSOLETE */ -/* OBSOLETE /* Return the GDB type object for the "standard" data type */ -/* OBSOLETE of data in register N. */ */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */ -/* OBSOLETE ( ((N) < A0_REGNUM ) ? builtin_type_long : builtin_type_long_long) */ -/* OBSOLETE */ -/* OBSOLETE /* Writing to r0 is a noop (not an error or exception or anything like */ -/* OBSOLETE that, however). */ */ -/* OBSOLETE */ -/* OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) == R0_REGNUM) */ -/* OBSOLETE */ -/* OBSOLETE void d30v_do_registers_info (int regnum, int fpregs); */ -/* OBSOLETE */ -/* OBSOLETE #define DO_REGISTERS_INFO d30v_do_registers_info */ -/* OBSOLETE */ -/* OBSOLETE /* Store the address of the place in which to copy the structure the */ -/* OBSOLETE subroutine will return. This is called from call_function. */ -/* OBSOLETE */ -/* OBSOLETE We store structs through a pointer passed in R2 */ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */ -/* OBSOLETE { write_register (2, (ADDR)); } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Write into appropriate registers a function return value */ -/* OBSOLETE of type TYPE, given in virtual format. */ -/* OBSOLETE */ -/* OBSOLETE Things always get returned in R2/R3 */ */ -/* OBSOLETE */ -/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */ -/* OBSOLETE write_register_bytes (REGISTER_BYTE(2), VALBUF, TYPE_LENGTH (TYPE)) */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ -/* OBSOLETE the address in which a function should return its structure value, */ -/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */ */ -/* OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (((CORE_ADDR *)(REGBUF))[2]) */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Define other aspects of the stack frame. */ -/* OBSOLETE we keep a copy of the worked out return pc lying around, since it */ -/* OBSOLETE is a useful bit of info */ */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRA_FRAME_INFO \ */ -/* OBSOLETE CORE_ADDR return_pc; \ */ -/* OBSOLETE CORE_ADDR dummy; \ */ -/* OBSOLETE int frameless; \ */ -/* OBSOLETE int size; */ -/* OBSOLETE */ -/* OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ */ -/* OBSOLETE d30v_init_extra_frame_info(fromleaf, fi) */ -/* OBSOLETE */ -/* OBSOLETE extern void d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi); */ -/* OBSOLETE */ -/* OBSOLETE /* A macro that tells us whether the function invocation represented */ -/* OBSOLETE by FI does not have a frame on the stack associated with it. If it */ -/* OBSOLETE does not, FRAMELESS is set to 1, else 0. */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ */ -/* OBSOLETE (frameless_look_for_prologue (FI)) */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR d30v_frame_chain (struct frame_info *frame); */ -/* OBSOLETE #define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME) */ -/* OBSOLETE extern int d30v_frame_chain_valid (CORE_ADDR, struct frame_info *); */ -/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe) */ -/* OBSOLETE #define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc) */ -/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) (fi)->frame */ -/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame */ -/* OBSOLETE */ -/* OBSOLETE void d30v_init_frame_pc (int fromleaf, struct frame_info *prev); */ -/* OBSOLETE #define INIT_FRAME_PC_FIRST(fromleaf, prev) d30v_init_frame_pc(fromleaf, prev) */ -/* OBSOLETE #define INIT_FRAME_PC(fromleaf, prev) /* nada */ */ -/* OBSOLETE */ -/* OBSOLETE /* Immediately after a function call, return the saved pc. We can't */ */ -/* OBSOLETE /* use frame->return_pc beause that is determined by reading R62 off the */ */ -/* OBSOLETE /* stack and that may not be written yet. */ */ -/* OBSOLETE */ -/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) (read_register(LR_REGNUM)) */ -/* OBSOLETE */ -/* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */ -/* OBSOLETE Can set VAL to -1, meaning no way to tell. */ */ -/* OBSOLETE /* We can't tell how many args there are */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) */ -/* OBSOLETE */ -/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_ARGS_SKIP 0 */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */ -/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */ -/* OBSOLETE This includes special registers such as pc and fp saved in special */ -/* OBSOLETE ways in the stack frame. sp is even more special: */ -/* OBSOLETE the address we return for it IS the sp for the next frame. */ */ -/* OBSOLETE */ -/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */ -/* OBSOLETE d30v_frame_find_saved_regs(frame_info, &(frame_saved_regs)) */ -/* OBSOLETE */ -/* OBSOLETE extern void d30v_frame_find_saved_regs (struct frame_info *, */ -/* OBSOLETE struct frame_saved_regs *); */ -/* OBSOLETE */ -/* OBSOLETE /* DUMMY FRAMES. Need these to support inferior function calls. */ -/* OBSOLETE They work like this on D30V: */ -/* OBSOLETE First we set a breakpoint at 0 or __start. */ -/* OBSOLETE Then we push all the registers onto the stack. */ -/* OBSOLETE Then put the function arguments in the proper registers and set r13 */ -/* OBSOLETE to our breakpoint address. */ -/* OBSOLETE Finally call the function directly. */ -/* OBSOLETE When it hits the breakpoint, clear the break point and pop the old */ -/* OBSOLETE register contents off the stack. */ */ -/* OBSOLETE */ -/* OBSOLETE #define CALL_DUMMY { 0 } */ -/* OBSOLETE #define PUSH_DUMMY_FRAME */ -/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 */ -/* OBSOLETE #define CALL_DUMMY_LOCATION AT_ENTRY_POINT */ -/* OBSOLETE #define CALL_DUMMY_BREAKPOINT_OFFSET (0) */ -/* OBSOLETE */ -/* OBSOLETE extern CORE_ADDR d30v_call_dummy_address (void); */ -/* OBSOLETE #define CALL_DUMMY_ADDRESS() d30v_call_dummy_address() */ -/* OBSOLETE */ -/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */ -/* OBSOLETE sp = d30v_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p) */ -/* OBSOLETE */ -/* OBSOLETE #define PC_IN_CALL_DUMMY(pc, sp, frame_address) ( pc == IMEM_START + 4 ) */ -/* OBSOLETE */ -/* OBSOLETE extern CORE_ADDR d30v_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, */ -/* OBSOLETE int, struct value **, */ -/* OBSOLETE struct type *, int); */ -/* OBSOLETE #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \ */ -/* OBSOLETE (d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))) */ -/* OBSOLETE extern CORE_ADDR d30v_push_arguments (int, struct value **, CORE_ADDR, int, */ -/* OBSOLETE CORE_ADDR); */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */ -/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */ -/* OBSOLETE into VALBUF. */ */ -/* OBSOLETE */ -/* OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */ -/* OBSOLETE d30v_extract_return_value(TYPE, REGBUF, VALBUF) */ -/* OBSOLETE extern void d30v_extract_return_value (struct type *, char *, char *); */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, */ -/* OBSOLETE restoring all saved registers. */ */ -/* OBSOLETE #define POP_FRAME d30v_pop_frame(); */ -/* OBSOLETE extern void d30v_pop_frame (void); */ -/* OBSOLETE */ -/* OBSOLETE #define REGISTER_SIZE 4 */ -/* OBSOLETE */ -/* OBSOLETE /* Need to handle SP special, as we need to select between spu and spi. */ */ -/* OBSOLETE #if 0 /* XXX until the simulator is fixed */ */ -/* OBSOLETE #define TARGET_READ_SP() ((read_register (PSW_REGNUM) & PSW_SM) \ */ -/* OBSOLETE ? read_register (SPU_REGNUM) \ */ -/* OBSOLETE : read_register (SPI_REGNUM)) */ -/* OBSOLETE */ -/* OBSOLETE #define TARGET_WRITE_SP(val) ((read_register (PSW_REGNUM) & PSW_SM) \ */ -/* OBSOLETE ? write_register (SPU_REGNUM, (val)) \ */ -/* OBSOLETE : write_register (SPI_REGNUM, (val))) */ -/* OBSOLETE #endif */ -/* OBSOLETE */ -/* OBSOLETE #define STACK_ALIGN(len) (((len) + 7 ) & ~7) */ -/* OBSOLETE */ -/* OBSOLETE /* Turn this on to cause remote-sim.c to use sim_set/clear_breakpoint. */ */ -/* OBSOLETE */ -/* OBSOLETE #define SIM_HAS_BREAKPOINTS */ -/* OBSOLETE */ -/* OBSOLETE #endif /* TM_D30V_H */ */ diff --git a/gdb/config/fr30/fr30.mt b/gdb/config/fr30/fr30.mt deleted file mode 100644 index b702970..0000000 --- a/gdb/config/fr30/fr30.mt +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Target: Fujitsu FR30 processor -# OBSOLETE TDEPFILES= fr30-tdep.o -# OBSOLETE TM_FILE= tm-fr30.h -# OBSOLETE SIM_OBS = remote-sim.o -# OBSOLETE SIM = ../sim/fr30/libsim.a diff --git a/gdb/config/fr30/tm-fr30.h b/gdb/config/fr30/tm-fr30.h deleted file mode 100644 index 7a58337..0000000 --- a/gdb/config/fr30/tm-fr30.h +++ /dev/null @@ -1,233 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Fujitsu FR30 processor. -// OBSOLETE Copyright 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #define FR30_GENREGS 16 -// OBSOLETE #define FR30_DEDICATEDREGS 8 -// OBSOLETE #define FR30_REGSIZE 4 /* bytes */ -// OBSOLETE -// OBSOLETE #define NUM_REGS (FR30_GENREGS + FR30_DEDICATEDREGS) -// OBSOLETE #define REGISTER_BYTES ((FR30_GENREGS + FR30_DEDICATEDREGS)*FR30_REGSIZE) -// OBSOLETE -// OBSOLETE /* Index within `registers' of the first byte of the space for -// OBSOLETE register N. */ -// OBSOLETE #define REGISTER_BYTE(N) ((N) * FR30_REGSIZE) -// OBSOLETE -// OBSOLETE /* Initializer for an array of names of registers. -// OBSOLETE There should be NUM_REGS strings in this initializer. */ -// OBSOLETE #define REGISTER_NAMES \ -// OBSOLETE { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \ -// OBSOLETE "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ -// OBSOLETE "pc", "ps", "tbr", "rp", "ssp", "usp", "mdh", "mdl" } -// OBSOLETE -// OBSOLETE /* Offset from address of function to start of its code. -// OBSOLETE Zero on most machines. */ -// OBSOLETE #define FUNCTION_START_OFFSET 0 -// OBSOLETE -// OBSOLETE /* Amount PC must be decremented by after a breakpoint. -// OBSOLETE This is often the number of bytes in BREAKPOINT -// OBSOLETE but not always. */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 -// OBSOLETE -// OBSOLETE /* Stack grows downward. */ -// OBSOLETE -// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) -// OBSOLETE -// OBSOLETE #define R0_REGNUM 0 -// OBSOLETE #define R1_REGNUM 1 -// OBSOLETE #define R2_REGNUM 2 -// OBSOLETE #define R3_REGNUM 3 -// OBSOLETE #define R4_REGNUM 4 -// OBSOLETE #define R5_REGNUM 5 -// OBSOLETE #define R6_REGNUM 6 -// OBSOLETE #define R7_REGNUM 7 -// OBSOLETE #define R8_REGNUM 8 -// OBSOLETE #define R9_REGNUM 9 -// OBSOLETE #define R10_REGNUM 10 -// OBSOLETE #define R11_REGNUM 11 -// OBSOLETE #define R12_REGNUM 12 -// OBSOLETE #define R13_REGNUM 13 -// OBSOLETE #define FP_REGNUM 14 /* Frame pointer */ -// OBSOLETE #define SP_REGNUM 15 /* Stack pointer */ -// OBSOLETE #define PC_REGNUM 16 /* Program counter */ -// OBSOLETE #define RP_REGNUM 19 /* Return pointer */ -// OBSOLETE -// OBSOLETE #define FIRST_ARGREG R4_REGNUM /* first arg (or struct ret val addr) */ -// OBSOLETE #define LAST_ARGREG R7_REGNUM /* fourth (or third arg) */ -// OBSOLETE #define RETVAL_REG R4_REGNUM /* return vaue */ -// OBSOLETE -// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity -// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the -// OBSOLETE real way to know how big a register is. */ -// OBSOLETE #define REGISTER_SIZE FR30_REGSIZE -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the actual machine representation -// OBSOLETE for register N. */ -// OBSOLETE #define REGISTER_RAW_SIZE(N) FR30_REGSIZE -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ -// OBSOLETE #define MAX_REGISTER_RAW_SIZE FR30_REGSIZE -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the program's representation -// OBSOLETE for register N. */ -// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ -// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE FR30_REGSIZE -// OBSOLETE -// OBSOLETE extern void fr30_pop_frame (void); -// OBSOLETE #define POP_FRAME fr30_pop_frame() -// OBSOLETE -// OBSOLETE #define USE_GENERIC_DUMMY_FRAMES 1 -// OBSOLETE #define CALL_DUMMY {0} -// OBSOLETE #define CALL_DUMMY_START_OFFSET (0) -// OBSOLETE #define CALL_DUMMY_BREAKPOINT_OFFSET (0) -// OBSOLETE #define CALL_DUMMY_LOCATION AT_ENTRY_POINT -// OBSOLETE #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP) -// OBSOLETE #define CALL_DUMMY_ADDRESS() entry_point_address () -// OBSOLETE #define PUSH_RETURN_ADDRESS(PC, SP) (write_register(RP_REGNUM, CALL_DUMMY_ADDRESS()), SP) -// OBSOLETE #define PUSH_DUMMY_FRAME generic_push_dummy_frame () -// OBSOLETE -// OBSOLETE /* Number of bytes at start of arglist that are not really args. */ -// OBSOLETE #define FRAME_ARGS_SKIP 0 -// OBSOLETE -// OBSOLETE /* Return the GDB type object for the "standard" data type -// OBSOLETE of data in register N. */ -// OBSOLETE #define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE a function return value of type TYPE, and copy that, in virtual format, -// OBSOLETE into VALBUF. */ -// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -// OBSOLETE memcpy (VALBUF, REGBUF + REGISTER_BYTE(RETVAL_REG) + \ -// OBSOLETE (TYPE_LENGTH(TYPE) < 4 ? 4 - TYPE_LENGTH(TYPE) : 0), TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE the address in which a function should return its structure value, -// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */ -// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ -// OBSOLETE extract_address (REGBUF + REGISTER_BYTE (RETVAL_REG), \ -// OBSOLETE REGISTER_RAW_SIZE (RETVAL_REG)) -// OBSOLETE -// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ -// OBSOLETE { write_register (RETVAL_REG, (ADDR)); } -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) -// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) -// OBSOLETE -// OBSOLETE /* Return number of args passed to a frame. -// OBSOLETE Can return -1, meaning no way to tell. */ -// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) -// OBSOLETE -// OBSOLETE /* Forward decls for prototypes */ -// OBSOLETE struct frame_info; -// OBSOLETE struct frame_saved_regs; -// OBSOLETE struct type; -// OBSOLETE struct value; -// OBSOLETE -// OBSOLETE #define EXTRA_FRAME_INFO \ -// OBSOLETE struct frame_saved_regs fsr; \ -// OBSOLETE int framesize; \ -// OBSOLETE int frameoffset; \ -// OBSOLETE int framereg; -// OBSOLETE -// OBSOLETE extern CORE_ADDR fr30_frame_chain (struct frame_info *fi); -// OBSOLETE #define FRAME_CHAIN(fi) fr30_frame_chain (fi) -// OBSOLETE -// OBSOLETE extern CORE_ADDR fr30_frame_saved_pc (struct frame_info *); -// OBSOLETE #define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi)) -// OBSOLETE -// OBSOLETE #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM) -// OBSOLETE -// OBSOLETE extern CORE_ADDR fr30_skip_prologue (CORE_ADDR pc); -// OBSOLETE #define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc)) -// OBSOLETE -// OBSOLETE /* Write into appropriate registers a function return value of type -// OBSOLETE TYPE, given in virtual format. VALBUF is in the target byte order; -// OBSOLETE it's typically the VALUE_CONTENTS of some struct value, and those -// OBSOLETE are in the target's byte order. */ -// OBSOLETE extern void fr30_store_return_value (struct type *type, char *valbuf); -// OBSOLETE -// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ -// OBSOLETE (fr30_store_return_value ((TYPE), (VALBUF))) -// OBSOLETE -// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, -// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. -// OBSOLETE This includes special registers such as pc and fp saved in special -// OBSOLETE ways in the stack frame. sp is even more special: -// OBSOLETE the address we return for it IS the sp for the next frame. */ -// OBSOLETE #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr -// OBSOLETE -// OBSOLETE /* Use INT #BREAKPOINT_INTNUM instruction for breakpoint */ -// OBSOLETE #define FR30_BREAKOP 0x1f /* opcode, type D instruction */ -// OBSOLETE #define BREAKPOINT_INTNUM 9 /* one of the reserved traps */ -// OBSOLETE #define BREAKPOINT {FR30_BREAKOP, BREAKPOINT_INTNUM} -// OBSOLETE -// OBSOLETE /* Define this for Wingdb */ -// OBSOLETE #define TARGET_FR30 -// OBSOLETE -// OBSOLETE /* Define other aspects of the stack frame. */ -// OBSOLETE -// OBSOLETE /* An expression that tells us whether the function invocation represented -// OBSOLETE by FI does not have a frame on the stack associated with it. */ -// OBSOLETE extern int fr30_frameless_function_invocation (struct frame_info *frame); -// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI)); -// OBSOLETE -// OBSOLETE extern void fr30_init_extra_frame_info (struct frame_info *fi); -// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi) -// OBSOLETE -// OBSOLETE #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI) -// OBSOLETE -// OBSOLETE extern CORE_ADDR -// OBSOLETE fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp, -// OBSOLETE int struct_return, CORE_ADDR struct_addr); -// OBSOLETE #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ -// OBSOLETE (fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) -// OBSOLETE -// OBSOLETE #define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) -// OBSOLETE -// OBSOLETE /* Fujitsu's ABI requires all structs to be passed using a pointer. -// OBSOLETE That is obviously not very efficient, so I am leaving the definitions -// OBSOLETE to make gdb work with GCC style struct passing, in case we decide -// OBSOLETE to go for better performance, rather than for compatibility with -// OBSOLETE Fujitsu (just change STRUCT_ALWAYS_BY_ADDR to 0) */ -// OBSOLETE -// OBSOLETE #define STRUCT_ALWAYS_BY_ADDR 1 -// OBSOLETE -// OBSOLETE #if(STRUCT_ALWAYS_BY_ADDR) -// OBSOLETE #define REG_STRUCT_HAS_ADDR(gcc_p,type) 1 -// OBSOLETE #else -// OBSOLETE /* more standard GCC (optimized) */ -// OBSOLETE #define REG_STRUCT_HAS_ADDR(gcc_p,type) \ -// OBSOLETE ((TYPE_LENGTH(type) > 4) && (TYPE_LENGTH(type) & 0x3)) -// OBSOLETE #endif -// OBSOLETE /* alway return struct by value by input pointer */ -// OBSOLETE #define USE_STRUCT_CONVENTION(GCC_P, TYPE) 1 -// OBSOLETE -// OBSOLETE /* The stack should always be aligned on a four-word boundary. */ -// OBSOLETE #define STACK_ALIGN(len) (((len) + 3) & ~3) -// OBSOLETE -// OBSOLETE /* I think the comment about this in value_arg_coerce is wrong; this -// OBSOLETE should be true on any system where you can rely on the prototyping -// OBSOLETE information. When this is true, value_arg_coerce will promote -// OBSOLETE floats to doubles iff the function is not prototyped. */ -// OBSOLETE #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1) diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h index 8c4ae45..4f8f347 100644 --- a/gdb/config/h8500/tm-h8500.h +++ b/gdb/config/h8500/tm-h8500.h @@ -22,6 +22,11 @@ #include "regcache.h" +/* NOTE: cagney/2002-11-24: This is a guess. */ +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 +#define CALL_DUMMY_LOCATION ON_STACK +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) + /* Contributed by Steve Chamberlain sac@cygnus.com */ #define GDB_TARGET_IS_H8500 diff --git a/gdb/config/i386/i386aix.mh b/gdb/config/i386/i386aix.mh deleted file mode 100644 index df571bf..0000000 --- a/gdb/config/i386/i386aix.mh +++ /dev/null @@ -1,9 +0,0 @@ -# OBSOLETE # Host: IBM PS/2 (i386) running AIX PS/2 -# OBSOLETE -# OBSOLETE XM_FILE= xm-i386aix.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-i386aix.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o -# OBSOLETE -# OBSOLETE # Use gcc. Only coff output can be debugged -# OBSOLETE CC=gcc diff --git a/gdb/config/i386/i386aix.mt b/gdb/config/i386/i386aix.mt deleted file mode 100644 index 57d124d..0000000 --- a/gdb/config/i386/i386aix.mt +++ /dev/null @@ -1,7 +0,0 @@ -# OBSOLETE # This port, for aix ps/2 (i386), will allow you to debug the coff -# OBSOLETE # output generated gcc-2.3.3 + gas. It will not understand IBM's -# OBSOLETE # proprietary debug info. -# OBSOLETE # -# OBSOLETE # Target: IBM PS/2 (i386) running AIX PS/2 -# OBSOLETE TDEPFILES= i386-tdep.o i387-tdep.o -# OBSOLETE TM_FILE= tm-i386aix.h diff --git a/gdb/config/i386/i386m3.mh b/gdb/config/i386/i386m3.mh deleted file mode 100644 index 7b840e2..0000000 --- a/gdb/config/i386/i386m3.mh +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Host: Intel 386 running Mach3 -# OBSOLETE -# OBSOLETE NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o -# OBSOLETE NAT_CLIBS= -lmachid -lnetname -lmach -# OBSOLETE XM_FILE= xm-i386m3.h -# OBSOLETE NAT_FILE= nm-m3.h diff --git a/gdb/config/i386/i386m3.mt b/gdb/config/i386/i386m3.mt deleted file mode 100644 index 550e92e..0000000 --- a/gdb/config/i386/i386m3.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Intel 386 with a.out under Mach 3 -# OBSOLETE TDEPFILES= i386-tdep.o -# OBSOLETE TM_FILE= tm-i386m3.h diff --git a/gdb/config/i386/i386mach.mh b/gdb/config/i386/i386mach.mh deleted file mode 100644 index 4e4e097..0000000 --- a/gdb/config/i386/i386mach.mh +++ /dev/null @@ -1,9 +0,0 @@ -# OBSOLETE # Host: Intel 386 running Mach -# OBSOLETE -# OBSOLETE # This is for mach2, maybe, or is obsolete (and seems to have only -# OBSOLETE # host and native, not target). Once we get the mach3 stuff working, -# OBSOLETE # I think it can go away. -# OBSOLETE -# OBSOLETE XM_FILE= xm-i386mach.h -# OBSOLETE NAT_FILE= nm-i386mach.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o diff --git a/gdb/config/i386/i386os9k.mt b/gdb/config/i386/i386os9k.mt deleted file mode 100644 index 939e9e2..0000000 --- a/gdb/config/i386/i386os9k.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Intel 386 running OS9000 -# OBSOLETE TDEPFILES= i386-tdep.o remote-os9k.o -# OBSOLETE TM_FILE= tm-i386os9k.h diff --git a/gdb/config/i386/nm-i386aix.h b/gdb/config/i386/nm-i386aix.h deleted file mode 100644 index 08f0779..0000000 --- a/gdb/config/i386/nm-i386aix.h +++ /dev/null @@ -1,43 +0,0 @@ -// OBSOLETE /* Native support for i386 aix ps/2. -// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com) -// OBSOLETE * Revision: 5-May-93 00:11:35 -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #ifndef NM_I386AIX_H -// OBSOLETE #define NM_I386AIX_H 1 -// OBSOLETE -// OBSOLETE /* code to execute to print interesting information about the -// OBSOLETE * floating point processor (if any) -// OBSOLETE * No need to define if there is nothing to do. -// OBSOLETE */ -// OBSOLETE #define FLOAT_INFO { i386_float_info (); } -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE #undef KERNEL_U_ADDR -// OBSOLETE #define KERNEL_U_ADDR 0xf03fd000 -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE #endif /* NM_I386AIX_H */ diff --git a/gdb/config/i386/nm-i386mach.h b/gdb/config/i386/nm-i386mach.h deleted file mode 100644 index 21f3c61..0000000 --- a/gdb/config/i386/nm-i386mach.h +++ /dev/null @@ -1,30 +0,0 @@ -// OBSOLETE /* Native definitions for Mach on an Intel 386 -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1996 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* Do implement the attach and detach commands. */ -// OBSOLETE /* #define ATTACH_DETACH 1 */ -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE #define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES) diff --git a/gdb/config/i386/nm-m3.h b/gdb/config/i386/nm-m3.h deleted file mode 100644 index 87d587b..0000000 --- a/gdb/config/i386/nm-m3.h +++ /dev/null @@ -1,23 +0,0 @@ -// OBSOLETE /* Native-dependent definitions for Intel 386 running Mach 3. -// OBSOLETE Copyright 1994 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Include the generic Mach 3 definitions. */ -// OBSOLETE -// OBSOLETE #include "config/nm-m3.h" diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h index 59f60f0..f30c432 100644 --- a/gdb/config/i386/tm-cygwin.h +++ b/gdb/config/i386/tm-cygwin.h @@ -1,5 +1,5 @@ /* Macro definitions for i386 running under the win32 API Unix. - Copyright 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -30,6 +30,7 @@ #define ATTACH_NO_WAIT #define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms) +#define PC_SOLIB(addr) solib_address (addr) #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid) #define CLEAR_SOLIB child_clear_solibs #define ADD_SHARED_SYMBOL_FILES dll_symbol_command @@ -37,6 +38,9 @@ struct target_ops; char *cygwin_pid_to_str (ptid_t ptid); void child_solib_add (char *, int, struct target_ops *, int); +char *solib_address (CORE_ADDR); char *child_solib_loaded_library_pathname(int); void child_clear_solibs (void); void dll_symbol_command (char *, int); + +#define LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES (1) diff --git a/gdb/config/i386/tm-i386aix.h b/gdb/config/i386/tm-i386aix.h deleted file mode 100644 index fe11420..0000000 --- a/gdb/config/i386/tm-i386aix.h +++ /dev/null @@ -1,48 +0,0 @@ -// OBSOLETE /* Macro defintions for IBM AIX PS/2 (i386). -// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com). */ -// OBSOLETE -// OBSOLETE #ifndef TM_I386AIX_H -// OBSOLETE #define TM_I386AIX_H 1 -// OBSOLETE -// OBSOLETE #include "i386/tm-i386.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #ifndef I386 -// OBSOLETE #define I386 1 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* AIX/i386 has FPU support. However, the native configuration (which -// OBSOLETE is the only supported configuration) doesn't make the FPU control -// OBSOLETE registers available. Override the appropriate symbols such that -// OBSOLETE only the normal FPU registers are included in GDB's register array. */ -// OBSOLETE -// OBSOLETE #undef NUM_FPREGS -// OBSOLETE #define NUM_FPREGS (8) -// OBSOLETE -// OBSOLETE #undef NUM_REGS -// OBSOLETE #define NUM_REGS (NUM_GREGS + NUM_FPREGS) -// OBSOLETE -// OBSOLETE #undef REGISTER_BYTES -// OBSOLETE #define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS) -// OBSOLETE -// OBSOLETE #endif /* TM_I386AIX_H */ diff --git a/gdb/config/i386/tm-i386m3.h b/gdb/config/i386/tm-i386m3.h deleted file mode 100644 index cadd5cd..0000000 --- a/gdb/config/i386/tm-i386m3.h +++ /dev/null @@ -1,56 +0,0 @@ -// OBSOLETE /* Macro definitions for i386, Mach 3.0 -// OBSOLETE Copyright 1992, 1993, 1995, 1999 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Include common definitions for Mach3 systems */ -// OBSOLETE #include "config/nm-m3.h" -// OBSOLETE -// OBSOLETE /* Define offsets to access CPROC stack when it does not have -// OBSOLETE * a kernel thread. -// OBSOLETE */ -// OBSOLETE #define MACHINE_CPROC_SP_OFFSET 20 -// OBSOLETE #define MACHINE_CPROC_PC_OFFSET 16 -// OBSOLETE #define MACHINE_CPROC_FP_OFFSET 12 -// OBSOLETE -// OBSOLETE /* Thread flavors used in re-setting the T bit. -// OBSOLETE * @@ this is also bad for cross debugging. -// OBSOLETE */ -// OBSOLETE #define TRACE_FLAVOR i386_THREAD_STATE -// OBSOLETE #define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT -// OBSOLETE #define TRACE_SET(x,state) \ -// OBSOLETE ((struct i386_thread_state *)state)->efl |= 0x100 -// OBSOLETE #define TRACE_CLEAR(x,state) \ -// OBSOLETE ((((struct i386_thread_state *)state)->efl &= ~0x100), 1) -// OBSOLETE -// OBSOLETE /* we can do it */ -// OBSOLETE #define ATTACH_DETACH 1 -// OBSOLETE -// OBSOLETE /* Sigh. There should be a file for i386 but no sysv stuff in it */ -// OBSOLETE #include "i386/tm-i386.h" -// OBSOLETE -// OBSOLETE /* I want to test this float info code. See comment in tm-i386v.h */ -// OBSOLETE #undef FLOAT_INFO -// OBSOLETE #define FLOAT_INFO { i386_mach3_float_info (); } -// OBSOLETE -// OBSOLETE /* Address of end of stack space. -// OBSOLETE * for MACH, see -// OBSOLETE * @@@ I don't know what is in the 5 ints... -// OBSOLETE */ -// OBSOLETE #undef STACK_END_ADDR -// OBSOLETE #define STACK_END_ADDR (0xc0000000-sizeof(int [5])) diff --git a/gdb/config/i386/tm-i386mk.h b/gdb/config/i386/tm-i386mk.h deleted file mode 100644 index 74355a8..0000000 --- a/gdb/config/i386/tm-i386mk.h +++ /dev/null @@ -1,38 +0,0 @@ -// OBSOLETE /* Macro definitions for i386, Mach 3.0, OSF 1/MK -// OBSOLETE Copyright 1992, 1993, 2000 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Until OSF switches to a newer Mach kernel that has -// OBSOLETE * a different get_emul_vector() interface. -// OBSOLETE */ -// OBSOLETE #define MK67 1 -// OBSOLETE -// OBSOLETE #include "i386/tm-i386m3.h" -// OBSOLETE -// OBSOLETE /* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent -// OBSOLETE to `double'. However, I'm not sure what is the consequence of: -// OBSOLETE -// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT -// OBSOLETE #define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT -// OBSOLETE -// OBSOLETE So I'll go with the current status quo instead. It looks like this -// OBSOLETE target won't compile anyway. Perhaps it should be obsoleted? */ -// OBSOLETE -// OBSOLETE #undef TARGET_LONG_DOUBLE_FORMAT -// OBSOLETE #undef TARGET_LONG_DOUBLE_BIT diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt index 7d0c491..d0ffb34 100644 --- a/gdb/config/i386/x86-64linux.mt +++ b/gdb/config/i386/x86-64linux.mt @@ -1,5 +1,6 @@ # Target: AMD x86-64 running GNU/Linux TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o dwarf2cfi.o \ + i386-tdep.o i387-tdep.o \ solib.o solib-svr4.o solib-legacy.o GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM diff --git a/gdb/config/i386/xm-i386aix.h b/gdb/config/i386/xm-i386aix.h deleted file mode 100644 index 03cb86c..0000000 --- a/gdb/config/i386/xm-i386aix.h +++ /dev/null @@ -1,29 +0,0 @@ -// OBSOLETE /* Macro defintions for AIX PS/2 (i386) -// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com) -// OBSOLETE * Revision: 23-Oct-92 17:42:49 -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #include "i386/xm-i386v.h" -// OBSOLETE -// OBSOLETE #undef HAVE_TERMIO -// OBSOLETE #define HAVE_SGTTY diff --git a/gdb/config/i386/xm-i386m3.h b/gdb/config/i386/xm-i386m3.h deleted file mode 100644 index da44215..0000000 --- a/gdb/config/i386/xm-i386m3.h +++ /dev/null @@ -1,33 +0,0 @@ -// OBSOLETE /* Definitions to make GDB run on Mach 3 on an Intel 386 -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Do implement the attach and detach commands. */ -// OBSOLETE #define ATTACH_DETACH 1 -// OBSOLETE -// OBSOLETE /* Not needeed */ -// OBSOLETE #define KERNEL_U_ADDR 0 -// OBSOLETE -// OBSOLETE #ifndef EMULATOR_BASE -// OBSOLETE /* For EMULATOR_BASE and EMULATOR_END. -// OBSOLETE * OSF 1/MK has different values in some other place. -// OBSOLETE */ -// OBSOLETE #include -// OBSOLETE #endif /* EMULATOR_BASE */ diff --git a/gdb/config/i386/xm-i386mach.h b/gdb/config/i386/xm-i386mach.h deleted file mode 100644 index b36c79c..0000000 --- a/gdb/config/i386/xm-i386mach.h +++ /dev/null @@ -1,28 +0,0 @@ -// OBSOLETE /* Definitions to make GDB run on Mach on an Intel 386 -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1996, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE -// OBSOLETE #define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) -// OBSOLETE -// OBSOLETE /* only defines this if __STDC__!!! */ -// OBSOLETE extern int errno; diff --git a/gdb/config/i386/xm-i386mk.h b/gdb/config/i386/xm-i386mk.h deleted file mode 100644 index 4609604..0000000 --- a/gdb/config/i386/xm-i386mk.h +++ /dev/null @@ -1,26 +0,0 @@ -// OBSOLETE /* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386 -// OBSOLETE Copyright 1992, 1993, 1998 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO 1 -// OBSOLETE -// OBSOLETE #define EMULATOR_BASE 0xa0000000 -// OBSOLETE #define EMULATOR_END 0xa0040000 -// OBSOLETE -// OBSOLETE #include "i386/xm-i386m3.h" diff --git a/gdb/config/i960/mon960.mt b/gdb/config/i960/mon960.mt deleted file mode 100644 index c735d94..0000000 --- a/gdb/config/i960/mon960.mt +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Target: Intel 960 rom monitor -# OBSOLETE TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o -# OBSOLETE TM_FILE= tm-mon960.h -# OBSOLETE SIM_OBS = remote-sim.o -# OBSOLETE SIM = ../sim/i960/libsim.a diff --git a/gdb/config/i960/nindy960.mt b/gdb/config/i960/nindy960.mt deleted file mode 100644 index 5ed15a8..0000000 --- a/gdb/config/i960/nindy960.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Intel 80960, in an embedded system under the NINDY monitor -# OBSOLETE TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o -# OBSOLETE TM_FILE= tm-nindy960.h diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h deleted file mode 100644 index 91bdf91..0000000 --- a/gdb/config/i960/tm-i960.h +++ /dev/null @@ -1,345 +0,0 @@ -// OBSOLETE /* Parameters for target machine Intel 960, for GDB, the GNU debugger. -// OBSOLETE -// OBSOLETE Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free -// OBSOLETE Software Foundation, Inc. -// OBSOLETE -// OBSOLETE Contributed by Intel Corporation. -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Definitions to target GDB to any i960. */ -// OBSOLETE -// OBSOLETE #ifndef I80960 -// OBSOLETE #define I80960 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include "doublest.h" -// OBSOLETE -// OBSOLETE /* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol -// OBSOLETE information. In the i960, parameters can be stored as locals or as -// OBSOLETE args, depending on the type of the debug record. -// OBSOLETE -// OBSOLETE From empirical observation, gcc960 uses N_LSYM to indicate -// OBSOLETE arguments passed in registers and then copied immediately -// OBSOLETE to the frame, and N_PSYM to indicate arguments passed in a -// OBSOLETE g14-relative argument block. */ -// OBSOLETE -// OBSOLETE #define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG) -// OBSOLETE -// OBSOLETE /* Offset from address of function to start of its code. -// OBSOLETE Zero on most machines. */ -// OBSOLETE -// OBSOLETE #define FUNCTION_START_OFFSET 0 -// OBSOLETE -// OBSOLETE /* Advance ip across any function entry prologue instructions -// OBSOLETE to reach some "real" code. */ -// OBSOLETE -// OBSOLETE #define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip)) -// OBSOLETE extern CORE_ADDR i960_skip_prologue (); -// OBSOLETE -// OBSOLETE /* Immediately after a function call, return the saved ip. -// OBSOLETE Can't always go through the frames for this because on some machines -// OBSOLETE the new frame is not set up until the new function -// OBSOLETE executes some instructions. */ -// OBSOLETE -// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame)) -// OBSOLETE extern CORE_ADDR saved_pc_after_call (); -// OBSOLETE -// OBSOLETE /* Stack grows upward */ -// OBSOLETE -// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) > (rhs)) -// OBSOLETE -// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity -// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the -// OBSOLETE real way to know how big a register is. */ -// OBSOLETE -// OBSOLETE #define REGISTER_SIZE 4 -// OBSOLETE -// OBSOLETE /* Number of machine registers */ -// OBSOLETE #define NUM_REGS 40 -// OBSOLETE -// OBSOLETE /* Initializer for an array of names of registers. -// OBSOLETE There should be NUM_REGS strings in this initializer. */ -// OBSOLETE -// OBSOLETE #define REGISTER_NAMES { \ -// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ -// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ -// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ -// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ -// OBSOLETE /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Register numbers of various important registers (used to index -// OBSOLETE into arrays of register names and register values). */ -// OBSOLETE -// OBSOLETE #define R0_REGNUM 0 /* First local register */ -// OBSOLETE #define SP_REGNUM 1 /* Contains address of top of stack */ -// OBSOLETE #define RIP_REGNUM 2 /* Return instruction pointer (local r2) */ -// OBSOLETE #define R15_REGNUM 15 /* Last local register */ -// OBSOLETE #define G0_REGNUM 16 /* First global register */ -// OBSOLETE #define G13_REGNUM 29 /* g13 - holds struct return address */ -// OBSOLETE #define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */ -// OBSOLETE #define FP_REGNUM 31 /* Contains address of executing stack frame */ -// OBSOLETE #define PCW_REGNUM 32 /* process control word */ -// OBSOLETE #define ACW_REGNUM 33 /* arithmetic control word */ -// OBSOLETE #define TCW_REGNUM 34 /* trace control word */ -// OBSOLETE #define IP_REGNUM 35 /* instruction pointer */ -// OBSOLETE #define FP0_REGNUM 36 /* First floating point register */ -// OBSOLETE -// OBSOLETE /* Some registers have more than one name */ -// OBSOLETE -// OBSOLETE #define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */ -// OBSOLETE #define PFP_REGNUM R0_REGNUM /* Previous frame pointer */ -// OBSOLETE -// OBSOLETE /* Total amount of space needed to store our copies of the machine's -// OBSOLETE register state, the array `registers'. */ -// OBSOLETE #define REGISTER_BYTES ((36*4) + (4*10)) -// OBSOLETE -// OBSOLETE /* Index within `registers' of the first byte of the space for register N. */ -// OBSOLETE -// OBSOLETE #define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \ -// OBSOLETE (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) ) -// OBSOLETE -// OBSOLETE /* The i960 has register windows, sort of. */ -// OBSOLETE -// OBSOLETE extern void i960_get_saved_register (char *raw_buffer, -// OBSOLETE int *optimized, -// OBSOLETE CORE_ADDR *addrp, -// OBSOLETE struct frame_info *frame, -// OBSOLETE int regnum, -// OBSOLETE enum lval_type *lval); -// OBSOLETE -// OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ -// OBSOLETE i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval) -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the actual machine representation -// OBSOLETE for register N. On the i960, all regs are 4 bytes except for floating -// OBSOLETE point, which are 10. NINDY only sends us 8 byte values for these, -// OBSOLETE which is a pain, but VxWorks handles this correctly, so we must. */ -// OBSOLETE -// OBSOLETE #define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 ) -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the program's representation for register N. */ -// OBSOLETE -// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 ) -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ -// OBSOLETE -// OBSOLETE #define MAX_REGISTER_RAW_SIZE 10 -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ -// OBSOLETE -// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 -// OBSOLETE -// OBSOLETE #include "floatformat.h" -// OBSOLETE -// OBSOLETE #define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext -// OBSOLETE -// OBSOLETE /* Return the GDB type object for the "standard" data type -// OBSOLETE of data in register N. */ -// OBSOLETE -// OBSOLETE struct type *i960_register_type (int regnum); -// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N) -// OBSOLETE -// OBSOLETE /* Macros for understanding function return values... */ -// OBSOLETE -// OBSOLETE /* Does the specified function use the "struct returning" convention -// OBSOLETE or the "value returning" convention? The "value returning" convention -// OBSOLETE almost invariably returns the entire value in registers. The -// OBSOLETE "struct returning" convention often returns the entire value in -// OBSOLETE memory, and passes a pointer (out of or into the function) saying -// OBSOLETE where the value (is or should go). -// OBSOLETE -// OBSOLETE Since this sometimes depends on whether it was compiled with GCC, -// OBSOLETE this is also an argument. This is used in call_function to build a -// OBSOLETE stack, and in value_being_returned to print return values. -// OBSOLETE -// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit. -// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */ -// OBSOLETE -// OBSOLETE extern use_struct_convention_fn i960_use_struct_convention; -// OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type) -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE a function return value of type TYPE, and copy that, in virtual format, -// OBSOLETE into VALBUF. This is only called if USE_STRUCT_CONVENTION for this -// OBSOLETE type is 0. -// OBSOLETE -// OBSOLETE On the i960 we just take as many bytes as we need from G0 through G3. */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -// OBSOLETE memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE /* If USE_STRUCT_CONVENTION produces a 1, -// OBSOLETE extract from an array REGBUF containing the (raw) register state -// OBSOLETE the address in which a function should return its structure value, -// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). -// OBSOLETE -// OBSOLETE Address of where to put structure was passed in in global -// OBSOLETE register g13 on entry. God knows what's in g13 now. The -// OBSOLETE (..., 0) below is to make it appear to return a value, though -// OBSOLETE actually all it does is call error(). */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ -// OBSOLETE (error("Don't know where large structure is returned on i960"), 0) -// OBSOLETE -// OBSOLETE /* Write into appropriate registers a function return value -// OBSOLETE of type TYPE, given in virtual format, for "value returning" functions. -// OBSOLETE -// OBSOLETE For 'return' command: not (yet) implemented for i960. */ -// OBSOLETE -// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ -// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb") -// OBSOLETE -// OBSOLETE /* Store the address of the place in which to copy the structure the -// OBSOLETE subroutine will return. This is called from call_function. */ -// OBSOLETE -// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ -// OBSOLETE error ("Returning values from functions is not implemented in i960 gdb") -// OBSOLETE -// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame -// OBSOLETE (its caller). */ -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address -// OBSOLETE and produces the frame's chain-pointer. -// OBSOLETE -// OBSOLETE However, if FRAME_CHAIN_VALID returns zero, -// OBSOLETE it means the given frame is the outermost one and has no caller. */ -// OBSOLETE -// OBSOLETE /* We cache information about saved registers in the frame structure, -// OBSOLETE to save us from having to re-scan function prologues every time -// OBSOLETE a register in a non-current frame is accessed. */ -// OBSOLETE -// OBSOLETE #define EXTRA_FRAME_INFO \ -// OBSOLETE struct frame_saved_regs *fsr; \ -// OBSOLETE CORE_ADDR arg_pointer; -// OBSOLETE -// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized, -// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and -// OBSOLETE initialize a frame_saved_regs struct the first time it is called. -// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values -// OBSOLETE indicate real, cached values. */ -// OBSOLETE -// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ -// OBSOLETE ((fi)->fsr = 0, (fi)->arg_pointer = -1) -// OBSOLETE -// OBSOLETE /* On the i960, we get the chain pointer by reading the PFP saved -// OBSOLETE on the stack and clearing the status bits. */ -// OBSOLETE -// OBSOLETE #define FRAME_CHAIN(thisframe) \ -// OBSOLETE (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf) -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one -// OBSOLETE and has no caller. -// OBSOLETE -// OBSOLETE On the i960, each various target system type must define FRAME_CHAIN_VALID, -// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported -// OBSOLETE targets types. We leave it undefined here. */ -// OBSOLETE -// OBSOLETE -// OBSOLETE /* A macro that tells us whether the function invocation represented -// OBSOLETE by FI does not have a frame on the stack associated with it. If it -// OBSOLETE does not, FRAMELESS is set to 1, else 0. */ -// OBSOLETE -// OBSOLETE CORE_ADDR leafproc_return (CORE_ADDR ip); -// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ -// OBSOLETE (leafproc_return ((FI)->pc) != 0) -// OBSOLETE -// OBSOLETE /* Note that in the i960 architecture the return pointer is saved in the -// OBSOLETE *caller's* stack frame. -// OBSOLETE -// OBSOLETE Make sure to zero low-order bits because of bug in 960CA A-step part -// OBSOLETE (instruction addresses should always be word-aligned anyway). */ -// OBSOLETE -// OBSOLETE #define FRAME_SAVED_PC(frame) \ -// OBSOLETE ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3) -// OBSOLETE -// OBSOLETE /* On the i960, FRAME_ARGS_ADDRESS should return the value of -// OBSOLETE g14 as passed into the frame, if known. We need a function for this. -// OBSOLETE We cache this value in the frame info if we've already looked it up. */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ -// OBSOLETE (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0)) -// OBSOLETE extern CORE_ADDR frame_args_address (); /* i960-tdep.c */ -// OBSOLETE -// OBSOLETE /* This is the same except it should return 0 when -// OBSOLETE it does not really know where the args are, rather than guessing. -// OBSOLETE This value is not cached since it is only used infrequently. */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1)) -// OBSOLETE -// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame -// OBSOLETE -// OBSOLETE /* Set NUMARGS to the number of args passed to a frame. -// OBSOLETE Can return -1, meaning no way to tell. */ -// OBSOLETE -// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) -// OBSOLETE -// OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_SKIP 0 -// OBSOLETE -// OBSOLETE /* Produce the positions of the saved registers in a stack frame. */ -// OBSOLETE -// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \ -// OBSOLETE frame_find_saved_regs (frame_info_addr, &sr) -// OBSOLETE extern void frame_find_saved_regs (); /* See i960-tdep.c */ -// OBSOLETE -// OBSOLETE /* Things needed for making calls to functions in the inferior process */ -// OBSOLETE -// OBSOLETE /* Push an empty stack frame, to record the current ip, etc. -// OBSOLETE -// OBSOLETE Not (yet?) implemented for i960. */ -// OBSOLETE -// OBSOLETE #define PUSH_DUMMY_FRAME \ -// OBSOLETE error("Function calls into the inferior process are not supported on the i960") -// OBSOLETE -// OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. */ -// OBSOLETE -// OBSOLETE -// OBSOLETE void i960_pop_frame (void); -// OBSOLETE #define POP_FRAME \ -// OBSOLETE i960_pop_frame () -// OBSOLETE -// OBSOLETE -// OBSOLETE /* This sequence of words is the instructions -// OBSOLETE -// OBSOLETE callx 0x00000000 -// OBSOLETE fmark -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */ -// OBSOLETE -// OBSOLETE /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */ -// OBSOLETE -// OBSOLETE /* Indicate that we don't support calling inferior child functions. */ -// OBSOLETE -// OBSOLETE #undef CALL_DUMMY -// OBSOLETE -// OBSOLETE /* Insert the specified number of args and function address -// OBSOLETE into a call sequence of the above form stored at 'dummyname'. -// OBSOLETE -// OBSOLETE Ignore arg count on i960. */ -// OBSOLETE -// OBSOLETE /* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */ -// OBSOLETE -// OBSOLETE #undef FIX_CALL_DUMMY -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Interface definitions for kernel debugger KDB */ -// OBSOLETE /* (Not relevant to i960.) */ diff --git a/gdb/config/i960/tm-mon960.h b/gdb/config/i960/tm-mon960.h deleted file mode 100644 index dedce0e..0000000 --- a/gdb/config/i960/tm-mon960.h +++ /dev/null @@ -1,69 +0,0 @@ -// OBSOLETE /* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger. -// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE Contributed by Intel Corporation and Cygnus Support. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /***************************************************************************** -// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line. -// OBSOLETE ******************************************************************************/ -// OBSOLETE -// OBSOLETE #include "i960/tm-i960.h" -// OBSOLETE -// OBSOLETE /* forward declarations */ -// OBSOLETE struct frame_info; -// OBSOLETE -// OBSOLETE /* redefined from tm-i960.h */ -// OBSOLETE /* Number of machine registers */ -// OBSOLETE #undef NUM_REGS -// OBSOLETE #define NUM_REGS 40 -// OBSOLETE -// OBSOLETE /* Initializer for an array of names of registers. -// OBSOLETE There should be NUM_REGS strings in this initializer. */ -// OBSOLETE #undef REGISTER_NAMES -// OBSOLETE #define REGISTER_NAMES { \ -// OBSOLETE /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \ -// OBSOLETE /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\ -// OBSOLETE /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ -// OBSOLETE /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ -// OBSOLETE /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */ -// OBSOLETE -// OBSOLETE #define DEFAULT_PROMPT "(gdb960) " -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one -// OBSOLETE and has no caller. -// OBSOLETE -// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID, -// OBSOLETE since it differs between Nindy, Mon960 and VxWorks, the currently supported -// OBSOLETE target types. */ -// OBSOLETE -// OBSOLETE extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *); -// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe) -// OBSOLETE -// OBSOLETE /* Sequence of bytes for breakpoint instruction */ -// OBSOLETE -// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} -// OBSOLETE -// OBSOLETE /* Amount ip must be decremented by after a breakpoint. -// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 4 diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h deleted file mode 100644 index 6a6dca2..0000000 --- a/gdb/config/i960/tm-nindy960.h +++ /dev/null @@ -1,106 +0,0 @@ -// OBSOLETE /* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger. -// OBSOLETE Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE Contributed by Intel Corporation and Cygnus Support. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /***************************************************************************** -// OBSOLETE * Definitions to target GDB to an i960 debugged over a serial line. -// OBSOLETE ******************************************************************************/ -// OBSOLETE -// OBSOLETE #include "i960/tm-i960.h" -// OBSOLETE -// OBSOLETE /* forward declarations */ -// OBSOLETE struct frame_info; -// OBSOLETE -// OBSOLETE /* Override the standard gdb prompt when compiled for this target. */ -// OBSOLETE -// OBSOLETE #define DEFAULT_PROMPT "(gdb960) " -// OBSOLETE -// OBSOLETE /* Additional command line options accepted by nindy gdb's, for handling -// OBSOLETE the remote-nindy.c interface. These should really be target-specific -// OBSOLETE rather than architecture-specific. */ -// OBSOLETE -// OBSOLETE extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */ -// OBSOLETE extern int nindy_initial_brk; /* Send a BREAK to reset board first */ -// OBSOLETE extern char *nindy_ttyname; /* Name of serial port to talk to nindy */ -// OBSOLETE -// OBSOLETE #define ADDITIONAL_OPTIONS \ -// OBSOLETE {"O", no_argument, &nindy_old_protocol, 1}, \ -// OBSOLETE {"brk", no_argument, &nindy_initial_brk, 1}, \ -// OBSOLETE {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */ -// OBSOLETE -// OBSOLETE #define ADDITIONAL_OPTION_CASES \ -// OBSOLETE case 1004: /* -ser option: remote nindy auto-start */ \ -// OBSOLETE nindy_ttyname = optarg; \ -// OBSOLETE break; -// OBSOLETE -// OBSOLETE #define ADDITIONAL_OPTION_HELP \ -// OBSOLETE "\ -// OBSOLETE -O Use old protocol to talk to a Nindy target\n\ -// OBSOLETE -brk Send a break to a Nindy target to reset it.\n\ -// OBSOLETE -ser SERIAL Open remote Nindy session to SERIAL port.\n\ -// OBSOLETE " -// OBSOLETE -// OBSOLETE /* If specified on the command line, open tty for talking to nindy, -// OBSOLETE and download the executable file if one was specified. */ -// OBSOLETE -// OBSOLETE extern void nindy_open (char *name, int from_tty); -// OBSOLETE #define ADDITIONAL_OPTION_HANDLER \ -// OBSOLETE if (nindy_ttyname != NULL) \ -// OBSOLETE { \ -// OBSOLETE if (catch_command_errors (nindy_open, nindy_ttyname, \ -// OBSOLETE !batch, RETURN_MASK_ALL)) \ -// OBSOLETE { \ -// OBSOLETE if (execarg != NULL) \ -// OBSOLETE catch_command_errors (target_load, execarg, !batch, \ -// OBSOLETE RETURN_MASK_ALL); \ -// OBSOLETE } \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If configured for i960 target, we take control before main loop -// OBSOLETE and demand that we configure for a nindy target. */ -// OBSOLETE -// OBSOLETE #define BEFORE_MAIN_LOOP_HOOK \ -// OBSOLETE nindy_before_main_loop(); -// OBSOLETE -// OBSOLETE extern void -// OBSOLETE nindy_before_main_loop (); /* In remote-nindy.c */ -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one -// OBSOLETE and has no caller. -// OBSOLETE -// OBSOLETE On the i960, each various target system type defines FRAME_CHAIN_VALID, -// OBSOLETE since it differs between NINDY and VxWorks, the two currently supported -// OBSOLETE targets types. */ -// OBSOLETE -// OBSOLETE extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *); -// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe) -// OBSOLETE -// OBSOLETE extern int -// OBSOLETE nindy_frame_chain_valid (); /* See nindy-tdep.c */ -// OBSOLETE -// OBSOLETE /* Sequence of bytes for breakpoint instruction */ -// OBSOLETE -// OBSOLETE #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} -// OBSOLETE -// OBSOLETE /* Amount ip must be decremented by after a breakpoint. -// OBSOLETE * This is often the number of bytes in BREAKPOINT but not always. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 diff --git a/gdb/config/i960/tm-vx960.h b/gdb/config/i960/tm-vx960.h deleted file mode 100644 index 44ff627..0000000 --- a/gdb/config/i960/tm-vx960.h +++ /dev/null @@ -1,52 +0,0 @@ -// OBSOLETE /* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE Contributed by Cygnus Support. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "i960/tm-i960.h" -// OBSOLETE #include "config/tm-vxworks.h" -// OBSOLETE -// OBSOLETE /* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has -// OBSOLETE the real value. */ -// OBSOLETE #undef PC_REGNUM -// OBSOLETE #define PC_REGNUM RIP_REGNUM -// OBSOLETE -// OBSOLETE /* We have more complex, useful breakpoints on the target. -// OBSOLETE Amount ip must be decremented by after a breakpoint. */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 -// OBSOLETE -// OBSOLETE /* We are guaranteed to have a zero frame pointer at bottom of stack, too. */ -// OBSOLETE -// OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe) -// OBSOLETE -// OBSOLETE /* Breakpoint patching is handled at the target end in VxWorks. */ -// OBSOLETE /* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */ -// OBSOLETE -// OBSOLETE /* Number of registers in a ptrace_getregs call. */ -// OBSOLETE -// OBSOLETE #define VX_NUM_REGS (16 + 16 + 3) -// OBSOLETE -// OBSOLETE /* Number of registers in a ptrace_getfpregs call. */ -// OBSOLETE -// OBSOLETE /* @@ Can't use this -- the rdb library for the 960 target -// OBSOLETE doesn't support setting or retrieving FP regs. KR */ -// OBSOLETE -// OBSOLETE /* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */ diff --git a/gdb/config/i960/vxworks960.mt b/gdb/config/i960/vxworks960.mt deleted file mode 100644 index e7f04c4..0000000 --- a/gdb/config/i960/vxworks960.mt +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Target: VxWorks running on an Intel 960 -# OBSOLETE TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o -# OBSOLETE TM_FILE= tm-vx960.h -# OBSOLETE -# OBSOLETE # Define this for the vx-share routines, which don't see param.h. -# OBSOLETE MT_CFLAGS= -DI80960 diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index f38a760..70a30a8 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -109,8 +109,8 @@ struct value; extern void m32r_init_extra_frame_info (struct frame_info *fi); /* mvs_check INIT_EXTRA_FRAME_INFO */ #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) m32r_init_extra_frame_info (fi) -/* mvs_no_check INIT_FRAME_PC */ -#define INIT_FRAME_PC /* Not necessary */ +/* mvs_no_check DEPRECATED_INIT_FRAME_PC */ +#define DEPRECATED_INIT_FRAME_PC init_frame_pc_noop extern void m32r_frame_find_saved_regs (struct frame_info *fi, @@ -191,7 +191,7 @@ extern use_struct_convention_fn m32r_use_struct_convention; /* generic dummy frame stuff */ #define PUSH_DUMMY_FRAME generic_push_dummy_frame () -#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) /* target-specific dummy_frame stuff */ @@ -224,7 +224,7 @@ extern CORE_ADDR m32r_push_arguments (int nargs, deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) -#define USE_GENERIC_DUMMY_FRAMES 1 +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1 #define CALL_DUMMY {0} #define CALL_DUMMY_LENGTH (0) #define CALL_DUMMY_START_OFFSET (0) diff --git a/gdb/config/m68k/apollo68b.mh b/gdb/config/m68k/apollo68b.mh deleted file mode 100644 index 99d034b..0000000 --- a/gdb/config/m68k/apollo68b.mh +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Host: Apollo m68k, BSD mode. -# OBSOLETE -# OBSOLETE XM_FILE= xm-apollo68b.h -# OBSOLETE NAT_FILE= nm-apollo68b.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o diff --git a/gdb/config/m68k/apollo68b.mt b/gdb/config/m68k/apollo68b.mt deleted file mode 100644 index 11c0c02..0000000 --- a/gdb/config/m68k/apollo68b.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Apollo m68k in BSD mode -# OBSOLETE TDEPFILES= m68k-tdep.o dstread.o -# OBSOLETE TM_FILE= tm-apollo68b.h diff --git a/gdb/config/m68k/apollo68v.mh b/gdb/config/m68k/apollo68v.mh deleted file mode 100644 index 4ab84f0..0000000 --- a/gdb/config/m68k/apollo68v.mh +++ /dev/null @@ -1,10 +0,0 @@ -# OBSOLETE # Host: Apollo, System V mode (?) -# OBSOLETE -# OBSOLETE XM_FILE= xm-apollo68v.h -# OBSOLETE XM_CLIBS= -lPW -# OBSOLETE -# OBSOLETE NAT_FILE= nm-apollo68v.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o -# OBSOLETE -# OBSOLETE RANLIB=echo >/dev/null -# OBSOLETE CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE diff --git a/gdb/config/m68k/hp300bsd.mh b/gdb/config/m68k/hp300bsd.mh deleted file mode 100644 index 76aa9a5..0000000 --- a/gdb/config/m68k/hp300bsd.mh +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Host: Hewlett-Packard 9000 series 300, running BSD -# OBSOLETE -# OBSOLETE XM_FILE= xm-hp300bsd.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-hp300bsd.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o diff --git a/gdb/config/m68k/hp300bsd.mt b/gdb/config/m68k/hp300bsd.mt deleted file mode 100644 index c3225e9..0000000 --- a/gdb/config/m68k/hp300bsd.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Hewlett-Packard 9000 series 300, running BSD -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-hp300bsd.h diff --git a/gdb/config/m68k/hp300hpux.mh b/gdb/config/m68k/hp300hpux.mh deleted file mode 100644 index 410c03c..0000000 --- a/gdb/config/m68k/hp300hpux.mh +++ /dev/null @@ -1,8 +0,0 @@ -# OBSOLETE # Host: Hewlett-Packard 9000 series 300, running HPUX -# OBSOLETE # The following is true because gcc uses a different .o file format -# OBSOLETE # than the native HPUX compiler -# OBSOLETE -# OBSOLETE XM_FILE= xm-hp300hpux.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-hp300hpux.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o corelow.o core-aout.o diff --git a/gdb/config/m68k/hp300hpux.mt b/gdb/config/m68k/hp300hpux.mt deleted file mode 100644 index a1848af..0000000 --- a/gdb/config/m68k/hp300hpux.mt +++ /dev/null @@ -1,8 +0,0 @@ -# OBSOLETE # Target: Hewlett-Packard 9000 series 300, running HPUX -# OBSOLETE -# OBSOLETE #msg Note that GDB can only read symbols from programs that were -# OBSOLETE #msg compiled with GCC using GAS. -# OBSOLETE #msg -# OBSOLETE -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-hp300hpux.h diff --git a/gdb/config/m68k/linux.mt b/gdb/config/m68k/linux.mt index 7598fc5..4217133 100644 --- a/gdb/config/m68k/linux.mt +++ b/gdb/config/m68k/linux.mt @@ -1,3 +1,3 @@ # Target: Motorola m68k with a.out and ELF -TDEPFILES= m68k-tdep.o solib.o solib-svr4.o solib-legacy.o +TDEPFILES= m68k-tdep.o m68klinux-tdep.o solib.o solib-svr4.o solib-legacy.o TM_FILE= tm-linux.h diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h index 0bae116..4990bb0 100644 --- a/gdb/config/m68k/tm-linux.h +++ b/gdb/config/m68k/tm-linux.h @@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */ #include "regcache.h" +#include "m68k-tdep.h" /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 @@ -46,7 +47,7 @@ VALBUF); \ } \ else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \ - memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (A0_REGNUM), \ + memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM), \ TYPE_LENGTH (TYPE)); \ else \ memcpy (VALBUF, \ @@ -64,15 +65,15 @@ { \ char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; \ REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buffer); \ - deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \ - raw_buffer, TYPE_LENGTH (TYPE)); \ + deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \ + raw_buffer, TYPE_LENGTH (TYPE)); \ } \ else \ { \ if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \ - deprecated_write_register_bytes (REGISTER_BYTE (A0_REGNUM), VALBUF, \ - TYPE_LENGTH (TYPE)); \ - deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \ + deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM), VALBUF, \ + TYPE_LENGTH (TYPE)); \ + deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \ } \ } @@ -85,7 +86,7 @@ #undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ - (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (A0_REGNUM))) + (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM))) /* Offsets (in target ints) into jmp_buf. */ diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index 8b92281..523cc4a 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -22,12 +22,3 @@ #include "regcache.h" #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL - -/* Generic 68000 stuff, to be included by other tm-*.h files. */ - -/* D0_REGNM and A0_REGNUM must be defined here because they are - used by the monitor. */ - -#define D0_REGNUM 0 -#define A0_REGNUM 8 - diff --git a/gdb/config/m88k/delta88.mh b/gdb/config/m88k/delta88.mh deleted file mode 100644 index 3c079fe..0000000 --- a/gdb/config/m88k/delta88.mh +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Host: Motorola 88k running SVR3 -# OBSOLETE -# OBSOLETE XM_FILE= xm-delta88.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-m88k.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o corelow.o core-aout.o diff --git a/gdb/config/m88k/delta88.mt b/gdb/config/m88k/delta88.mt deleted file mode 100644 index 83d4ad1..0000000 --- a/gdb/config/m88k/delta88.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Motorola 88k running SVR3 -# OBSOLETE TDEPFILES= m88k-tdep.o -# OBSOLETE TM_FILE= tm-delta88.h diff --git a/gdb/config/m88k/delta88v4.mh b/gdb/config/m88k/delta88v4.mh deleted file mode 100644 index bc2abc5..0000000 --- a/gdb/config/m88k/delta88v4.mh +++ /dev/null @@ -1,8 +0,0 @@ -# OBSOLETE # Host: Motorola 88k running SVR4 -# OBSOLETE -# OBSOLETE XM_FILE= xm-delta88v4.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-delta88v4.h -# OBSOLETE NATDEPFILES= fork-child.o m88k-nat.o corelow.o core-regset.o \ -# OBSOLETE solib.o solib-svr4.o solib-legacy.o \ -# OBSOLETE procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gdb/config/m88k/delta88v4.mt b/gdb/config/m88k/delta88v4.mt deleted file mode 100644 index c8f9df2..0000000 --- a/gdb/config/m88k/delta88v4.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Motorola 88k running SVR4 -# OBSOLETE TDEPFILES= m88k-tdep.o -# OBSOLETE TM_FILE= tm-delta88v4.h diff --git a/gdb/config/m88k/m88k.mh b/gdb/config/m88k/m88k.mh deleted file mode 100644 index a09e7a1..0000000 --- a/gdb/config/m88k/m88k.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Motorola 88000 running DGUX -# OBSOLETE XM_FILE= xm-dgux.h -# OBSOLETE NAT_FILE= nm-m88k.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o diff --git a/gdb/config/m88k/m88k.mt b/gdb/config/m88k/m88k.mt deleted file mode 100644 index c4068e0..0000000 --- a/gdb/config/m88k/m88k.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Motorola 88k Binary Compatibility Standard -# OBSOLETE TDEPFILES= m88k-tdep.o remote-bug.o -# OBSOLETE TM_FILE= tm-m88k.h diff --git a/gdb/config/m88k/nm-delta88v4.h b/gdb/config/m88k/nm-delta88v4.h deleted file mode 100644 index 976cfa0..0000000 --- a/gdb/config/m88k/nm-delta88v4.h +++ /dev/null @@ -1,23 +0,0 @@ -// OBSOLETE /* Native machine description for Motorola Delta 88 box, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "m88k/nm-m88k.h" -// OBSOLETE #include "config/nm-sysv4.h" diff --git a/gdb/config/m88k/nm-m88k.h b/gdb/config/m88k/nm-m88k.h deleted file mode 100644 index 6521a2a..0000000 --- a/gdb/config/m88k/nm-m88k.h +++ /dev/null @@ -1,25 +0,0 @@ -// OBSOLETE /* Native support macros for m88k, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE (addr) = m88k_register_u_addr ((blockend),(regno)); diff --git a/gdb/config/m88k/tm-delta88.h b/gdb/config/m88k/tm-delta88.h deleted file mode 100644 index f63fca3..0000000 --- a/gdb/config/m88k/tm-delta88.h +++ /dev/null @@ -1,28 +0,0 @@ -// OBSOLETE /* Target machine description for Motorola Delta 88 box, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "m88k/tm-m88k.h" -// OBSOLETE -// OBSOLETE #define DELTA88 -// OBSOLETE -// OBSOLETE #define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigcode", (name))) -// OBSOLETE #define SIGTRAMP_FRAME_FIXUP(frame) (frame) += 0x20 -// OBSOLETE #define SIGTRAMP_SP_FIXUP(sp) (sp) = read_memory_integer((sp), 4) diff --git a/gdb/config/m88k/tm-delta88v4.h b/gdb/config/m88k/tm-delta88v4.h deleted file mode 100644 index e343a05..0000000 --- a/gdb/config/m88k/tm-delta88v4.h +++ /dev/null @@ -1,32 +0,0 @@ -// OBSOLETE /* Target machine description for Motorola Delta 88 box, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1998, 1999 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define DELTA88 -// OBSOLETE -// OBSOLETE #include "m88k/tm-m88k.h" -// OBSOLETE #include "config/tm-sysv4.h" -// OBSOLETE -// OBSOLETE /* If we don't define this, backtraces go on forever. */ -// OBSOLETE #define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi) -// OBSOLETE -// OBSOLETE #define IN_SIGTRAMP(pc, name) ((name) && (STREQ ("signalhandler", (name)) \ -// OBSOLETE || STREQ("sigacthandler", (name)))) -// OBSOLETE #define SIGTRAMP_SP_FIXUP(sp) (sp) = read_memory_integer((sp)+0xcd8, 4) diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h deleted file mode 100644 index 2f08f1a..0000000 --- a/gdb/config/m88k/tm-m88k.h +++ /dev/null @@ -1,587 +0,0 @@ -// OBSOLETE /* Target machine description for generic Motorola 88000, for GDB. -// OBSOLETE -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996, -// OBSOLETE 1998, 1999, 2000, 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "doublest.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* g++ support is not yet included. */ -// OBSOLETE -// OBSOLETE /* We cache information about saved registers in the frame structure, -// OBSOLETE to save us from having to re-scan function prologues every time -// OBSOLETE a register in a non-current frame is accessed. */ -// OBSOLETE -// OBSOLETE #define EXTRA_FRAME_INFO \ -// OBSOLETE struct frame_saved_regs *fsr; \ -// OBSOLETE CORE_ADDR locals_pointer; \ -// OBSOLETE CORE_ADDR args_pointer; -// OBSOLETE -// OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized, -// OBSOLETE so that FRAME_FIND_SAVED_REGS () will know to allocate and -// OBSOLETE initialize a frame_saved_regs struct the first time it is called. -// OBSOLETE Set the arg_pointer to -1, which is not valid; 0 and other values -// OBSOLETE indicate real, cached values. */ -// OBSOLETE -// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \ -// OBSOLETE init_extra_frame_info (fromleaf, fi) -// OBSOLETE extern void init_extra_frame_info (); -// OBSOLETE -// OBSOLETE /* Offset from address of function to start of its code. -// OBSOLETE Zero on most machines. */ -// OBSOLETE -// OBSOLETE #define FUNCTION_START_OFFSET 0 -// OBSOLETE -// OBSOLETE /* Advance PC across any function entry prologue instructions -// OBSOLETE to reach some "real" code. */ -// OBSOLETE -// OBSOLETE extern CORE_ADDR m88k_skip_prologue (CORE_ADDR); -// OBSOLETE #define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc)) -// OBSOLETE -// OBSOLETE /* The m88k kernel aligns all instructions on 4-byte boundaries. The -// OBSOLETE kernel also uses the least significant two bits for its own hocus -// OBSOLETE pocus. When gdb receives an address from the kernel, it needs to -// OBSOLETE preserve those right-most two bits, but gdb also needs to be careful -// OBSOLETE to realize that those two bits are not really a part of the address -// OBSOLETE of an instruction. Shrug. */ -// OBSOLETE -// OBSOLETE extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR); -// OBSOLETE #define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr) -// OBSOLETE -// OBSOLETE /* Immediately after a function call, return the saved pc. -// OBSOLETE Can't always go through the frames for this because on some machines -// OBSOLETE the new frame is not set up until the new function executes -// OBSOLETE some instructions. */ -// OBSOLETE -// OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ -// OBSOLETE (ADDR_BITS_REMOVE (read_register (SRP_REGNUM))) -// OBSOLETE -// OBSOLETE /* Stack grows downward. */ -// OBSOLETE -// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) -// OBSOLETE -// OBSOLETE /* Sequence of bytes for breakpoint instruction. */ -// OBSOLETE -// OBSOLETE /* instruction 0xF000D1FF is 'tb0 0,r0,511' -// OBSOLETE If Bit bit 0 of r0 is clear (always true), -// OBSOLETE initiate exception processing (trap). -// OBSOLETE */ -// OBSOLETE #define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF} -// OBSOLETE -// OBSOLETE /* Amount PC must be decremented by after a breakpoint. -// OBSOLETE This is often the number of bytes in BREAKPOINT -// OBSOLETE but not always. */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 -// OBSOLETE -// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity -// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the -// OBSOLETE real way to know how big a register is. */ -// OBSOLETE -// OBSOLETE #define REGISTER_SIZE 4 -// OBSOLETE -// OBSOLETE /* Number of machine registers */ -// OBSOLETE -// OBSOLETE #define GP_REGS (38) -// OBSOLETE #define FP_REGS (32) -// OBSOLETE #define NUM_REGS (GP_REGS + FP_REGS) -// OBSOLETE -// OBSOLETE /* Initializer for an array of names of registers. -// OBSOLETE There should be NUM_REGS strings in this initializer. */ -// OBSOLETE -// OBSOLETE #define REGISTER_NAMES {\ -// OBSOLETE "r0",\ -// OBSOLETE "r1",\ -// OBSOLETE "r2",\ -// OBSOLETE "r3",\ -// OBSOLETE "r4",\ -// OBSOLETE "r5",\ -// OBSOLETE "r6",\ -// OBSOLETE "r7",\ -// OBSOLETE "r8",\ -// OBSOLETE "r9",\ -// OBSOLETE "r10",\ -// OBSOLETE "r11",\ -// OBSOLETE "r12",\ -// OBSOLETE "r13",\ -// OBSOLETE "r14",\ -// OBSOLETE "r15",\ -// OBSOLETE "r16",\ -// OBSOLETE "r17",\ -// OBSOLETE "r18",\ -// OBSOLETE "r19",\ -// OBSOLETE "r20",\ -// OBSOLETE "r21",\ -// OBSOLETE "r22",\ -// OBSOLETE "r23",\ -// OBSOLETE "r24",\ -// OBSOLETE "r25",\ -// OBSOLETE "r26",\ -// OBSOLETE "r27",\ -// OBSOLETE "r28",\ -// OBSOLETE "r29",\ -// OBSOLETE "r30",\ -// OBSOLETE "r31",\ -// OBSOLETE "psr",\ -// OBSOLETE "fpsr",\ -// OBSOLETE "fpcr",\ -// OBSOLETE "sxip",\ -// OBSOLETE "snip",\ -// OBSOLETE "sfip",\ -// OBSOLETE "x0",\ -// OBSOLETE "x1",\ -// OBSOLETE "x2",\ -// OBSOLETE "x3",\ -// OBSOLETE "x4",\ -// OBSOLETE "x5",\ -// OBSOLETE "x6",\ -// OBSOLETE "x7",\ -// OBSOLETE "x8",\ -// OBSOLETE "x9",\ -// OBSOLETE "x10",\ -// OBSOLETE "x11",\ -// OBSOLETE "x12",\ -// OBSOLETE "x13",\ -// OBSOLETE "x14",\ -// OBSOLETE "x15",\ -// OBSOLETE "x16",\ -// OBSOLETE "x17",\ -// OBSOLETE "x18",\ -// OBSOLETE "x19",\ -// OBSOLETE "x20",\ -// OBSOLETE "x21",\ -// OBSOLETE "x22",\ -// OBSOLETE "x23",\ -// OBSOLETE "x24",\ -// OBSOLETE "x25",\ -// OBSOLETE "x26",\ -// OBSOLETE "x27",\ -// OBSOLETE "x28",\ -// OBSOLETE "x29",\ -// OBSOLETE "x30",\ -// OBSOLETE "x31",\ -// OBSOLETE "vbr",\ -// OBSOLETE "dmt0",\ -// OBSOLETE "dmd0",\ -// OBSOLETE "dma0",\ -// OBSOLETE "dmt1",\ -// OBSOLETE "dmd1",\ -// OBSOLETE "dma1",\ -// OBSOLETE "dmt2",\ -// OBSOLETE "dmd2",\ -// OBSOLETE "dma2",\ -// OBSOLETE "sr0",\ -// OBSOLETE "sr1",\ -// OBSOLETE "sr2",\ -// OBSOLETE "sr3",\ -// OBSOLETE "fpecr",\ -// OBSOLETE "fphs1",\ -// OBSOLETE "fpls1",\ -// OBSOLETE "fphs2",\ -// OBSOLETE "fpls2",\ -// OBSOLETE "fppt",\ -// OBSOLETE "fprh",\ -// OBSOLETE "fprl",\ -// OBSOLETE "fpit",\ -// OBSOLETE "fpsr",\ -// OBSOLETE "fpcr",\ -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Register numbers of various important registers. -// OBSOLETE Note that some of these values are "real" register numbers, -// OBSOLETE and correspond to the general registers of the machine, -// OBSOLETE and some are "phony" register numbers which are too large -// OBSOLETE to be actual register numbers as far as the user is concerned -// OBSOLETE but do serve to get the desired values when passed to read_register. */ -// OBSOLETE -// OBSOLETE #define R0_REGNUM 0 /* Contains the constant zero */ -// OBSOLETE #define SRP_REGNUM 1 /* Contains subroutine return pointer */ -// OBSOLETE #define RV_REGNUM 2 /* Contains simple return values */ -// OBSOLETE #define SRA_REGNUM 12 /* Contains address of struct return values */ -// OBSOLETE #define SP_REGNUM 31 /* Contains address of top of stack */ -// OBSOLETE -// OBSOLETE /* Instruction pointer notes... -// OBSOLETE -// OBSOLETE On the m88100: -// OBSOLETE -// OBSOLETE * cr04 = sxip. On exception, contains the excepting pc (probably). -// OBSOLETE On rte, is ignored. -// OBSOLETE -// OBSOLETE * cr05 = snip. On exception, contains the NPC (next pc). On rte, -// OBSOLETE pc is loaded from here. -// OBSOLETE -// OBSOLETE * cr06 = sfip. On exception, contains the NNPC (next next pc). On -// OBSOLETE rte, the NPC is loaded from here. -// OBSOLETE -// OBSOLETE * lower two bits of each are flag bits. Bit 1 is V means address -// OBSOLETE is valid. If address is not valid, bit 0 is ignored. Otherwise, -// OBSOLETE bit 0 is E and asks for an exception to be taken if this -// OBSOLETE instruction is executed. -// OBSOLETE -// OBSOLETE On the m88110: -// OBSOLETE -// OBSOLETE * cr04 = exip. On exception, contains the address of the excepting -// OBSOLETE pc (always). On rte, pc is loaded from here. Bit 0, aka the D -// OBSOLETE bit, is a flag saying that the offending instruction was in a -// OBSOLETE branch delay slot. If set, then cr05 contains the NPC. -// OBSOLETE -// OBSOLETE * cr05 = enip. On exception, if the instruction pointed to by cr04 -// OBSOLETE was in a delay slot as indicated by the bit 0 of cr04, aka the D -// OBSOLETE bit, the cr05 contains the NPC. Otherwise ignored. -// OBSOLETE -// OBSOLETE * cr06 is invalid */ -// OBSOLETE -// OBSOLETE /* Note that the Harris Unix kernels emulate the m88100's behavior on -// OBSOLETE the m88110. */ -// OBSOLETE -// OBSOLETE #define SXIP_REGNUM 35 /* On m88100, Contains Shadow Execute -// OBSOLETE Instruction Pointer. */ -// OBSOLETE #define SNIP_REGNUM 36 /* On m88100, Contains Shadow Next -// OBSOLETE Instruction Pointer. */ -// OBSOLETE #define SFIP_REGNUM 37 /* On m88100, Contains Shadow Fetched -// OBSOLETE Intruction pointer. */ -// OBSOLETE -// OBSOLETE #define EXIP_REGNUM 35 /* On m88110, Contains Exception -// OBSOLETE Executing Instruction Pointer. */ -// OBSOLETE #define ENIP_REGNUM 36 /* On m88110, Contains the Exception -// OBSOLETE Next Instruction Pointer. */ -// OBSOLETE -// OBSOLETE #define PC_REGNUM SXIP_REGNUM /* Program Counter */ -// OBSOLETE #define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */ -// OBSOLETE #define M88K_NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */ -// OBSOLETE -// OBSOLETE -// OBSOLETE #define PSR_REGNUM 32 /* Processor Status Register */ -// OBSOLETE #define FPSR_REGNUM 33 /* Floating Point Status Register */ -// OBSOLETE #define FPCR_REGNUM 34 /* Floating Point Control Register */ -// OBSOLETE #define XFP_REGNUM 38 /* First Extended Float Register */ -// OBSOLETE #define X0_REGNUM XFP_REGNUM /* Which also contains the constant zero */ -// OBSOLETE -// OBSOLETE /* This is rather a confusing lie. Our m88k port using a stack pointer value -// OBSOLETE for the frame address. Hence, the frame address and the frame pointer are -// OBSOLETE only indirectly related. The value of this macro is the register number -// OBSOLETE fetched by the machine "independent" portions of gdb when they want to know -// OBSOLETE about a frame address. Thus, we lie here and claim that FP_REGNUM is -// OBSOLETE SP_REGNUM. */ -// OBSOLETE #define FP_REGNUM SP_REGNUM /* Reg fetched to locate frame when pgm stops */ -// OBSOLETE #define ACTUAL_FP_REGNUM 30 -// OBSOLETE -// OBSOLETE /* PSR status bit definitions. */ -// OBSOLETE -// OBSOLETE #define PSR_MODE 0x80000000 -// OBSOLETE #define PSR_BYTE_ORDER 0x40000000 -// OBSOLETE #define PSR_SERIAL_MODE 0x20000000 -// OBSOLETE #define PSR_CARRY 0x10000000 -// OBSOLETE #define PSR_SFU_DISABLE 0x000003f0 -// OBSOLETE #define PSR_SFU1_DISABLE 0x00000008 -// OBSOLETE #define PSR_MXM 0x00000004 -// OBSOLETE #define PSR_IND 0x00000002 -// OBSOLETE #define PSR_SFRZ 0x00000001 -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE /* The following two comments come from the days prior to the m88110 -// OBSOLETE port. The m88110 handles the instruction pointers differently. I -// OBSOLETE do not know what any m88110 kernels do as the m88110 port I'm -// OBSOLETE working with is for an embedded system. rich@cygnus.com -// OBSOLETE 13-sept-93. */ -// OBSOLETE -// OBSOLETE /* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the -// OBSOLETE address of the next instr to be executed when a breakpoint occurs. -// OBSOLETE Because the kernel gets the next instr (SNIP_REGNUM), the instr in -// OBSOLETE SNIP needs to be put back into SFIP, and the instr in SXIP should -// OBSOLETE be shifted to SNIP */ -// OBSOLETE -// OBSOLETE /* Are you sitting down? It turns out that the 88K BCS (binary -// OBSOLETE compatibility standard) folks originally felt that the debugger -// OBSOLETE should be responsible for backing up the IPs, not the kernel (as is -// OBSOLETE usually done). Well, they have reversed their decision, and in -// OBSOLETE future releases our kernel will be handling the backing up of the -// OBSOLETE IPs. So, eventually, we won't need to do the SHIFT_INST_REGS -// OBSOLETE stuff. But, for now, since there are 88K systems out there that do -// OBSOLETE need the debugger to do the IP shifting, and since there will be -// OBSOLETE systems where the kernel does the shifting, the code is a little -// OBSOLETE more complex than perhaps it needs to be (we still go inside -// OBSOLETE SHIFT_INST_REGS, and if the shifting hasn't occurred then gdb goes -// OBSOLETE ahead and shifts). */ -// OBSOLETE -// OBSOLETE extern int target_is_m88110; -// OBSOLETE #define SHIFT_INST_REGS() \ -// OBSOLETE if (!target_is_m88110) \ -// OBSOLETE { \ -// OBSOLETE CORE_ADDR pc = read_register (PC_REGNUM); \ -// OBSOLETE CORE_ADDR npc = read_register (NPC_REGNUM); \ -// OBSOLETE if (pc != npc) \ -// OBSOLETE { \ -// OBSOLETE write_register (M88K_NNPC_REGNUM, npc); \ -// OBSOLETE write_register (NPC_REGNUM, pc); \ -// OBSOLETE } \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Storing the following registers is a no-op. */ -// OBSOLETE #define CANNOT_STORE_REGISTER(regno) (((regno) == R0_REGNUM) \ -// OBSOLETE || ((regno) == X0_REGNUM)) -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the actual machine representation -// OBSOLETE for register N. On the m88k, the general purpose registers are 4 -// OBSOLETE bytes and the 88110 extended registers are 10 bytes. */ -// OBSOLETE -// OBSOLETE #define REGISTER_RAW_SIZE(N) ((N) < XFP_REGNUM ? 4 : 10) -// OBSOLETE -// OBSOLETE /* Total amount of space needed to store our copies of the machine's -// OBSOLETE register state, the array `registers'. */ -// OBSOLETE -// OBSOLETE #define REGISTER_BYTES ((GP_REGS * REGISTER_RAW_SIZE(0)) \ -// OBSOLETE + (FP_REGS * REGISTER_RAW_SIZE(XFP_REGNUM))) -// OBSOLETE -// OBSOLETE /* Index within `registers' of the first byte of the space for -// OBSOLETE register N. */ -// OBSOLETE -// OBSOLETE #define REGISTER_BYTE(N) (((N) * REGISTER_RAW_SIZE(0)) \ -// OBSOLETE + ((N) >= XFP_REGNUM \ -// OBSOLETE ? (((N) - XFP_REGNUM) \ -// OBSOLETE * REGISTER_RAW_SIZE(XFP_REGNUM)) \ -// OBSOLETE : 0)) -// OBSOLETE -// OBSOLETE /* Number of bytes of storage in the program's representation for -// OBSOLETE register N. On the m88k, all registers are 4 bytes excepting the -// OBSOLETE m88110 extended registers which are 8 byte doubles. */ -// OBSOLETE -// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) ((N) < XFP_REGNUM ? 4 : 8) -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ -// OBSOLETE -// OBSOLETE #define MAX_REGISTER_RAW_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM)) -// OBSOLETE -// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. -// OBSOLETE Are FPS1, FPS2, FPR "virtual" regisers? */ -// OBSOLETE -// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM)) -// OBSOLETE -// OBSOLETE /* Return the GDB type object for the "standard" data type -// OBSOLETE of data in register N. */ -// OBSOLETE -// OBSOLETE struct type *m88k_register_type (int regnum); -// OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) m88k_register_type (N) -// OBSOLETE -// OBSOLETE /* The 88k call/return conventions call for "small" values to be returned -// OBSOLETE into consecutive registers starting from r2. */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -// OBSOLETE memcpy ((VALBUF), &(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF)) -// OBSOLETE -// OBSOLETE /* Write into appropriate registers a function return value -// OBSOLETE of type TYPE, given in virtual format. */ -// OBSOLETE -// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ -// OBSOLETE write_register_bytes (2*REGISTER_RAW_SIZE(0), (VALBUF), TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE /* In COFF, if PCC says a parameter is a short or a char, do not -// OBSOLETE change it to int (it seems the convention is to change it). */ -// OBSOLETE -// OBSOLETE #define BELIEVE_PCC_PROMOTION 1 -// OBSOLETE -// OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame -// OBSOLETE (its caller). */ -// OBSOLETE -// OBSOLETE /* FRAME_CHAIN takes a frame's nominal address -// OBSOLETE and produces the frame's chain-pointer. -// OBSOLETE -// OBSOLETE However, if FRAME_CHAIN_VALID returns zero, -// OBSOLETE it means the given frame is the outermost one and has no caller. */ -// OBSOLETE -// OBSOLETE extern CORE_ADDR frame_chain (); -// OBSOLETE extern int frame_chain_valid (); -// OBSOLETE extern int frameless_function_invocation (); -// OBSOLETE -// OBSOLETE #define FRAME_CHAIN(thisframe) \ -// OBSOLETE frame_chain (thisframe) -// OBSOLETE -// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(frame) \ -// OBSOLETE (frameless_function_invocation (frame)) -// OBSOLETE -// OBSOLETE /* Define other aspects of the stack frame. */ -// OBSOLETE -// OBSOLETE #define FRAME_SAVED_PC(FRAME) \ -// OBSOLETE frame_saved_pc (FRAME) -// OBSOLETE extern CORE_ADDR frame_saved_pc (); -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ -// OBSOLETE frame_args_address (fi) -// OBSOLETE extern CORE_ADDR frame_args_address (); -// OBSOLETE -// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) \ -// OBSOLETE frame_locals_address (fi) -// OBSOLETE extern CORE_ADDR frame_locals_address (); -// OBSOLETE -// OBSOLETE /* Return number of args passed to a frame. -// OBSOLETE Can return -1, meaning no way to tell. */ -// OBSOLETE -// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) -// OBSOLETE -// OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ -// OBSOLETE -// OBSOLETE #define FRAME_ARGS_SKIP 0 -// OBSOLETE -// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, -// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. -// OBSOLETE This includes special registers such as pc and fp saved in special -// OBSOLETE ways in the stack frame. sp is even more special: -// OBSOLETE the address we return for it IS the sp for the next frame. */ -// OBSOLETE -// OBSOLETE /* On the 88k, parameter registers get stored into the so called "homing" -// OBSOLETE area. This *always* happens when you compiled with GCC and use -g. -// OBSOLETE Also, (with GCC and -g) the saving of the parameter register values -// OBSOLETE always happens right within the function prologue code, so these register -// OBSOLETE values can generally be relied upon to be already copied into their -// OBSOLETE respective homing slots by the time you will normally try to look at -// OBSOLETE them (we hope). -// OBSOLETE -// OBSOLETE Note that homing area stack slots are always at *positive* offsets from -// OBSOLETE the frame pointer. Thus, the homing area stack slots for the parameter -// OBSOLETE registers (passed values) for a given function are actually part of the -// OBSOLETE frame area of the caller. This is unusual, but it should not present -// OBSOLETE any special problems for GDB. -// OBSOLETE -// OBSOLETE Note also that on the 88k, we are only interested in finding the -// OBSOLETE registers that might have been saved in memory. This is a subset of -// OBSOLETE the whole set of registers because the standard calling sequence allows -// OBSOLETE the called routine to clobber many registers. -// OBSOLETE -// OBSOLETE We could manage to locate values for all of the so called "preserved" -// OBSOLETE registers (some of which may get saved within any particular frame) but -// OBSOLETE that would require decoding all of the tdesc information. That would be -// OBSOLETE nice information for GDB to have, but it is not strictly manditory if we -// OBSOLETE can live without the ability to look at values within (or backup to) -// OBSOLETE previous frames. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE struct frame_saved_regs; -// OBSOLETE struct frame_info; -// OBSOLETE -// OBSOLETE void frame_find_saved_regs (struct frame_info *fi, -// OBSOLETE struct frame_saved_regs *fsr); -// OBSOLETE -// OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ -// OBSOLETE frame_find_saved_regs (frame_info, &frame_saved_regs) -// OBSOLETE -// OBSOLETE -// OBSOLETE #define POP_FRAME pop_frame () -// OBSOLETE extern void pop_frame (); -// OBSOLETE -// OBSOLETE /* Call function stuff contributed by Kevin Buettner of Motorola. */ -// OBSOLETE -// OBSOLETE #define CALL_DUMMY_LOCATION AFTER_TEXT_END -// OBSOLETE -// OBSOLETE extern void m88k_push_dummy_frame (); -// OBSOLETE #define PUSH_DUMMY_FRAME m88k_push_dummy_frame() -// OBSOLETE -// OBSOLETE #define CALL_DUMMY { \ -// OBSOLETE 0x67ff00c0, /* 0: subu #sp,#sp,0xc0 */ \ -// OBSOLETE 0x243f0004, /* 4: st #r1,#sp,0x4 */ \ -// OBSOLETE 0x245f0008, /* 8: st #r2,#sp,0x8 */ \ -// OBSOLETE 0x247f000c, /* c: st #r3,#sp,0xc */ \ -// OBSOLETE 0x249f0010, /* 10: st #r4,#sp,0x10 */ \ -// OBSOLETE 0x24bf0014, /* 14: st #r5,#sp,0x14 */ \ -// OBSOLETE 0x24df0018, /* 18: st #r6,#sp,0x18 */ \ -// OBSOLETE 0x24ff001c, /* 1c: st #r7,#sp,0x1c */ \ -// OBSOLETE 0x251f0020, /* 20: st #r8,#sp,0x20 */ \ -// OBSOLETE 0x253f0024, /* 24: st #r9,#sp,0x24 */ \ -// OBSOLETE 0x255f0028, /* 28: st #r10,#sp,0x28 */ \ -// OBSOLETE 0x257f002c, /* 2c: st #r11,#sp,0x2c */ \ -// OBSOLETE 0x259f0030, /* 30: st #r12,#sp,0x30 */ \ -// OBSOLETE 0x25bf0034, /* 34: st #r13,#sp,0x34 */ \ -// OBSOLETE 0x25df0038, /* 38: st #r14,#sp,0x38 */ \ -// OBSOLETE 0x25ff003c, /* 3c: st #r15,#sp,0x3c */ \ -// OBSOLETE 0x261f0040, /* 40: st #r16,#sp,0x40 */ \ -// OBSOLETE 0x263f0044, /* 44: st #r17,#sp,0x44 */ \ -// OBSOLETE 0x265f0048, /* 48: st #r18,#sp,0x48 */ \ -// OBSOLETE 0x267f004c, /* 4c: st #r19,#sp,0x4c */ \ -// OBSOLETE 0x269f0050, /* 50: st #r20,#sp,0x50 */ \ -// OBSOLETE 0x26bf0054, /* 54: st #r21,#sp,0x54 */ \ -// OBSOLETE 0x26df0058, /* 58: st #r22,#sp,0x58 */ \ -// OBSOLETE 0x26ff005c, /* 5c: st #r23,#sp,0x5c */ \ -// OBSOLETE 0x271f0060, /* 60: st #r24,#sp,0x60 */ \ -// OBSOLETE 0x273f0064, /* 64: st #r25,#sp,0x64 */ \ -// OBSOLETE 0x275f0068, /* 68: st #r26,#sp,0x68 */ \ -// OBSOLETE 0x277f006c, /* 6c: st #r27,#sp,0x6c */ \ -// OBSOLETE 0x279f0070, /* 70: st #r28,#sp,0x70 */ \ -// OBSOLETE 0x27bf0074, /* 74: st #r29,#sp,0x74 */ \ -// OBSOLETE 0x27df0078, /* 78: st #r30,#sp,0x78 */ \ -// OBSOLETE 0x63df0000, /* 7c: addu #r30,#sp,0x0 */ \ -// OBSOLETE 0x145f0000, /* 80: ld #r2,#sp,0x0 */ \ -// OBSOLETE 0x147f0004, /* 84: ld #r3,#sp,0x4 */ \ -// OBSOLETE 0x149f0008, /* 88: ld #r4,#sp,0x8 */ \ -// OBSOLETE 0x14bf000c, /* 8c: ld #r5,#sp,0xc */ \ -// OBSOLETE 0x14df0010, /* 90: ld #r6,#sp,0x10 */ \ -// OBSOLETE 0x14ff0014, /* 94: ld #r7,#sp,0x14 */ \ -// OBSOLETE 0x151f0018, /* 98: ld #r8,#sp,0x18 */ \ -// OBSOLETE 0x153f001c, /* 9c: ld #r9,#sp,0x1c */ \ -// OBSOLETE 0x5c200000, /* a0: or.u #r1,#r0,0x0 */ \ -// OBSOLETE 0x58210000, /* a4: or #r1,#r1,0x0 */ \ -// OBSOLETE 0xf400c801, /* a8: jsr #r1 */ \ -// OBSOLETE 0xf000d1ff /* ac: tb0 0x0,#r0,0x1ff */ \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define CALL_DUMMY_START_OFFSET 0x80 -// OBSOLETE #define CALL_DUMMY_LENGTH 0xb0 -// OBSOLETE -// OBSOLETE /* FIXME: byteswapping. */ -// OBSOLETE #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) \ -// OBSOLETE { \ -// OBSOLETE *(unsigned long *)((char *) (dummy) + 0xa0) |= \ -// OBSOLETE (((unsigned long) (fun)) >> 16); \ -// OBSOLETE *(unsigned long *)((char *) (dummy) + 0xa4) |= \ -// OBSOLETE (((unsigned long) (fun)) & 0xffff); \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Stack must be aligned on 64-bit boundaries when synthesizing -// OBSOLETE function calls. */ -// OBSOLETE -// OBSOLETE #define STACK_ALIGN(addr) (((addr) + 7) & -8) -// OBSOLETE -// OBSOLETE #define STORE_STRUCT_RETURN(addr, sp) \ -// OBSOLETE write_register (SRA_REGNUM, (addr)) -// OBSOLETE -// OBSOLETE #define NEED_TEXT_START_END 1 -// OBSOLETE -// OBSOLETE /* According to the MC88100 RISC Microprocessor User's Manual, section -// OBSOLETE 6.4.3.1.2: -// OBSOLETE -// OBSOLETE ... can be made to return to a particular instruction by placing a -// OBSOLETE valid instruction address in the SNIP and the next sequential -// OBSOLETE instruction address in the SFIP (with V bits set and E bits clear). -// OBSOLETE The rte resumes execution at the instruction pointed to by the -// OBSOLETE SNIP, then the SFIP. -// OBSOLETE -// OBSOLETE The E bit is the least significant bit (bit 0). The V (valid) bit is -// OBSOLETE bit 1. This is why we logical or 2 into the values we are writing -// OBSOLETE below. It turns out that SXIP plays no role when returning from an -// OBSOLETE exception so nothing special has to be done with it. We could even -// OBSOLETE (presumably) give it a totally bogus value. -// OBSOLETE -// OBSOLETE -- Kevin Buettner -// OBSOLETE */ -// OBSOLETE -// OBSOLETE extern void m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid); -// OBSOLETE #define TARGET_WRITE_PC(VAL, PID) m88k_target_write_pc (VAL, PID) diff --git a/gdb/config/m88k/xm-delta88.h b/gdb/config/m88k/xm-delta88.h deleted file mode 100644 index df2b8e6..0000000 --- a/gdb/config/m88k/xm-delta88.h +++ /dev/null @@ -1,44 +0,0 @@ -// OBSOLETE /* Host machine description for Motorola Delta 88 system, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #if !defined (USG) -// OBSOLETE #define USG 1 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO -// OBSOLETE -// OBSOLETE /*#define USIZE 2048 */ -// OBSOLETE /*#define NBPG NBPC */ -// OBSOLETE /* Might be defined in . I suspect this define was a relic -// OBSOLETE from before when BFD did core files. */ -// OBSOLETE /* #define UPAGES USIZE */ -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE -// OBSOLETE /* Since registers r0 through r31 are stored directly in the struct ptrace_user, -// OBSOLETE (for m88k BCS) -// OBSOLETE the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */ -// OBSOLETE -// OBSOLETE #define KERNEL_U_ADDR 0 diff --git a/gdb/config/m88k/xm-dgux.h b/gdb/config/m88k/xm-dgux.h deleted file mode 100644 index dc99f97..0000000 --- a/gdb/config/m88k/xm-dgux.h +++ /dev/null @@ -1,55 +0,0 @@ -// OBSOLETE /* Host-machine dependent parameters for Motorola 88000, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #if !defined (USG) -// OBSOLETE #define USG 1 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #ifdef __GNUC__ -// OBSOLETE #define memcpy __builtin_memcpy -// OBSOLETE /* gcc doesn't have this, at least not gcc 1.92. */ -// OBSOLETE /* #define memset __builtin_memset */ -// OBSOLETE #define strcmp __builtin_strcmp -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #define x_foff _x_x._x_offset -// OBSOLETE #define x_fname _x_name -// OBSOLETE #define USER ptrace_user -// OBSOLETE #define _BSD_WAIT_FLAVOR -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO -// OBSOLETE -// OBSOLETE #ifndef USIZE -// OBSOLETE #define USIZE 2048 -// OBSOLETE #endif -// OBSOLETE #define NBPG NBPC -// OBSOLETE #define UPAGES USIZE -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE -// OBSOLETE /* Since registers r0 through r31 are stored directly in the struct ptrace_user, -// OBSOLETE (for m88k BCS) -// OBSOLETE the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */ -// OBSOLETE -// OBSOLETE #define KERNEL_U_ADDR 0 diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h index c298a39..8875f79 100644 --- a/gdb/config/mips/tm-irix3.h +++ b/gdb/config/mips/tm-irix3.h @@ -23,7 +23,6 @@ /* Redefine register numbers for SGI. */ -#undef NUM_REGS #undef MIPS_REGISTER_NAMES #undef FP0_REGNUM #undef PC_REGNUM @@ -34,10 +33,6 @@ #undef FCRCS_REGNUM #undef FCRIR_REGNUM -/* Number of machine registers */ - -#define NUM_REGS 71 - /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h index ce9c226..26813ba 100644 --- a/gdb/config/mips/tm-irix6.h +++ b/gdb/config/mips/tm-irix6.h @@ -24,7 +24,6 @@ /* Redefine register numbers for SGI. */ -#undef NUM_REGS #undef MIPS_REGISTER_NAMES #undef FP0_REGNUM #undef PC_REGNUM @@ -35,10 +34,6 @@ #undef FCRCS_REGNUM #undef FCRIR_REGNUM -/* Number of machine registers */ - -#define NUM_REGS 71 - /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h index 60e9bee..c049c29 100644 --- a/gdb/config/mips/tm-linux.h +++ b/gdb/config/mips/tm-linux.h @@ -40,25 +40,6 @@ #include "config/tm-linux.h" -/* Use target_specific function to define link map offsets. */ - -extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void); -#define SVR4_FETCH_LINK_MAP_OFFSETS() \ - mips_linux_svr4_fetch_link_map_offsets () - -/* Details about jmp_buf. */ - -#define MIPS_LINUX_JB_ELEMENT_SIZE 4 -#define MIPS_LINUX_JB_PC 0 - -/* Figure out where the longjmp will land. Slurp the arguments 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 ADDR. This routine returns 1 on success. */ - -#define GET_LONGJMP_TARGET(ADDR) mips_linux_get_longjmp_target(ADDR) -extern int mips_linux_get_longjmp_target (CORE_ADDR *); - /* We do single stepping in software. */ #define SOFTWARE_SINGLE_STEP_P() 1 diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index ded8e10..e092d4a 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -39,14 +39,6 @@ struct value; #include "coff/sym.h" /* Needed for PDR below. */ #include "coff/symconst.h" -/* PC should be masked to remove possible MIPS16 flag */ -#if !defined (GDB_TARGET_MASK_DISAS_PC) -#define GDB_TARGET_MASK_DISAS_PC(addr) UNMAKE_MIPS16_ADDR(addr) -#endif -#if !defined (GDB_TARGET_UNMASK_DISAS_PC) -#define GDB_TARGET_UNMASK_DISAS_PC(addr) MAKE_MIPS16_ADDR(addr) -#endif - /* Return non-zero if PC points to an instruction which will cause a step to execute both the instruction at PC and an instruction at PC+4. */ extern int mips_step_skips_delay (CORE_ADDR); @@ -67,12 +59,6 @@ extern int mips_step_skips_delay (CORE_ADDR); #define MIPS_REGSIZE 4 #endif -/* Number of machine registers */ - -#ifndef NUM_REGS -#define NUM_REGS 90 -#endif - /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index 47bd7a0..b2d0385 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -107,7 +107,8 @@ struct value; extern void mn10200_init_extra_frame_info (struct frame_info *); #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10200_init_extra_frame_info (fi) -#define INIT_FRAME_PC(x,y) +#define DEPRECATED_INIT_FRAME_PC(x,y) (init_frame_pc_noop (x, y)) +#define INIT_FRAME_PC_FIRST(x,y) (init_frame_pc_noop (x, y)) extern void mn10200_frame_find_saved_regs (struct frame_info *, struct frame_saved_regs *); @@ -184,7 +185,7 @@ extern CORE_ADDR mn10200_skip_prologue (CORE_ADDR); extern void mn10200_pop_frame (struct frame_info *); #define POP_FRAME mn10200_pop_frame (get_current_frame ()) -#define USE_GENERIC_DUMMY_FRAMES 1 +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 1 #define CALL_DUMMY {0} #define CALL_DUMMY_START_OFFSET (0) #define CALL_DUMMY_BREAKPOINT_OFFSET (0) @@ -202,7 +203,7 @@ extern CORE_ADDR mn10200_push_arguments (int, struct value **, CORE_ADDR, #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \ (mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)) -#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP) #define REG_STRUCT_HAS_ADDR(gcc_p,TYPE) \ (TYPE_LENGTH (TYPE) > 8) @@ -210,10 +211,5 @@ extern CORE_ADDR mn10200_push_arguments (int, struct value **, CORE_ADDR, extern use_struct_convention_fn mn10200_use_struct_convention; #define USE_STRUCT_CONVENTION(GCC_P, TYPE) mn10200_use_struct_convention (GCC_P, TYPE) -/* Override the default get_saved_register function with - one that takes account of generic CALL_DUMMY frames. */ -#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ - generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) - /* Define this for Wingdb */ #define TARGET_MN10200 diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h index a2d4292..114acd8 100644 --- a/gdb/config/nm-linux.h +++ b/gdb/config/nm-linux.h @@ -71,4 +71,7 @@ extern void lin_thread_get_thread_signals (sigset_t *mask); /* Override child_pid_to_exec_file in 'inftarg.c'. */ #define CHILD_PID_TO_EXEC_FILE - +struct mem_attrib; +extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, + int write, struct mem_attrib *attrib, + struct target_ops *target); diff --git a/gdb/config/pa/hppa64.mt b/gdb/config/pa/hppa64.mt index d55da77..9e3e686 100644 --- a/gdb/config/pa/hppa64.mt +++ b/gdb/config/pa/hppa64.mt @@ -1,4 +1,4 @@ # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode -TDEPFILES= hppa-tdep.o +TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o TM_FILE= tm-hppa64.h TM_CLIBS= diff --git a/gdb/config/pa/hppahpux.mt b/gdb/config/pa/hppahpux.mt index dddb3f5..806e91c 100644 --- a/gdb/config/pa/hppahpux.mt +++ b/gdb/config/pa/hppahpux.mt @@ -1,3 +1,3 @@ # Target: HP PA-RISC running hpux -TDEPFILES= hppa-tdep.o +TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o TM_FILE= tm-hppah.h diff --git a/gdb/config/pa/nm-hppab.h b/gdb/config/pa/nm-hppab.h index 995e8e7..d9827dc 100644 --- a/gdb/config/pa/nm-hppab.h +++ b/gdb/config/pa/nm-hppab.h @@ -1,5 +1,5 @@ /* HPPA PA-RISC machine native support for BSD, for GDB. - Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -38,20 +38,6 @@ #define FIVE_ARG_PTRACE -/* This macro defines the register numbers (from REGISTER_NAMES) that - are effectively unavailable to the user through ptrace(). It allows - us to include the whole register set in REGISTER_NAMES (inorder to - better support remote debugging). If it is used in - fetch/store_inferior_registers() gdb will not complain about I/O errors - on fetching these registers. If all registers in REGISTER_NAMES - are available, then return false (0). */ - -#define CANNOT_STORE_REGISTER(regno) \ - ((regno) == 0) || \ - ((regno) == PCSQ_HEAD_REGNUM) || \ - ((regno) >= PCSQ_TAIL_REGNUM && (regno) < IPSW_REGNUM) || \ - ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM) - /* fetch_inferior_registers is in hppab-nat.c. */ #define FETCH_INFERIOR_REGISTERS diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index 7609d67..8387115 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -1,5 +1,5 @@ /* Native support for HPPA-RISC machine running HPUX, for GDB. - Copyright 1991, 1992, 1994, 1996, 1998, 1999, 2000 + Copyright 1991, 1992, 1994, 1996, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -48,25 +48,10 @@ user space will crap out HPUX. */ #define NEED_TEXT_START_END 1 -/* This macro defines the register numbers (from REGISTER_NAMES) that - are effectively unavailable to the user through ptrace(). It allows - us to include the whole register set in REGISTER_NAMES (inorder to - better support remote debugging). If it is used in - fetch/store_inferior_registers() gdb will not complain about I/O errors - on fetching these registers. If all registers in REGISTER_NAMES - are available, then return false (0). */ - -#define CANNOT_STORE_REGISTER(regno) \ - ((regno) == 0) || \ - ((regno) == PCSQ_HEAD_REGNUM) || \ - ((regno) >= PCSQ_TAIL_REGNUM && (regno) < IPSW_REGNUM) || \ - ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM) - /* In hppah-nat.c: */ #define FETCH_INFERIOR_REGISTERS #define CHILD_XFER_MEMORY -#define CHILD_POST_FOLLOW_INFERIOR_BY_CLONE -#define CHILD_POST_FOLLOW_VFORK +#define CHILD_FOLLOW_FORK /* While this is for use by threaded programs, it doesn't appear * to hurt non-threaded ones. This is used in infrun.c: */ @@ -81,22 +66,17 @@ extern int hppa_prepare_to_proceed (void); #define CHILD_REMOVE_FORK_CATCHPOINT #define CHILD_INSERT_VFORK_CATCHPOINT #define CHILD_REMOVE_VFORK_CATCHPOINT -#define CHILD_HAS_FORKED -#define CHILD_HAS_VFORKED -#define CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC #define CHILD_INSERT_EXEC_CATCHPOINT #define CHILD_REMOVE_EXEC_CATCHPOINT -#define CHILD_HAS_EXECD #define CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL -#define CHILD_HAS_SYSCALL_EVENT #define CHILD_POST_ATTACH #define CHILD_THREAD_ALIVE #define CHILD_PID_TO_STR +#define CHILD_WAIT +struct target_waitstatus; +extern ptid_t child_wait (ptid_t, struct target_waitstatus *); -#define REQUIRE_ATTACH(pid) hppa_require_attach(pid) extern int hppa_require_attach (int); - -#define REQUIRE_DETACH(pid,signal) hppa_require_detach(pid,signal) extern int hppa_require_detach (int, int); /* So we can cleanly use code in infptrace.c. */ diff --git a/gdb/config/pa/nm-hppao.h b/gdb/config/pa/nm-hppao.h index 6650a4b..6389b2c 100644 --- a/gdb/config/pa/nm-hppao.h +++ b/gdb/config/pa/nm-hppao.h @@ -1,5 +1,5 @@ /* HPPA PA-RISC machine native support for Lites, for GDB. - Copyright 1995 Free Software Foundation, Inc. + Copyright 1995, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -27,20 +27,6 @@ #define REGISTER_U_ADDR(addr, blockend, regno) \ { addr = (int)(blockend) + REGISTER_BYTE (regno);} -/* This macro defines the register numbers (from REGISTER_NAMES) that - are effectively unavailable to the user through ptrace(). It allows - us to include the whole register set in REGISTER_NAMES (inorder to - better support remote debugging). If it is used in - fetch/store_inferior_registers() gdb will not complain about I/O errors - on fetching these registers. If all registers in REGISTER_NAMES - are available, then return false (0). */ - -#define CANNOT_STORE_REGISTER(regno) \ - ((regno) == 0) || \ - ((regno) == PCSQ_HEAD_REGNUM) || \ - ((regno) >= PCSQ_TAIL_REGNUM && (regno) < IPSW_REGNUM) || \ - ((regno) > IPSW_REGNUM && (regno) < FP4_REGNUM) - /* fetch_inferior_registers is in hppab-nat.c. */ #define FETCH_INFERIOR_REGISTERS diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 319576d..ce35906 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -26,6 +26,12 @@ #define GDB_MULTI_ARCH 0 +/* NOTE: cagney/2002-11-24: This is a guess. */ +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 +#define CALL_DUMMY_LOCATION ON_STACK +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) +#define DEPRECATED_INIT_FRAME_PC(l,f) (init_frame_pc_default (l, f)) + /* Forward declarations of some types we use in prototypes */ struct frame_info; @@ -511,7 +517,7 @@ extern void hppa_pop_frame (void); we'll consider that to mean that we've reached the call dummy's end after its successful completion. */ #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ - (PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ + (DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ (read_memory_integer((pc), 4) == BREAKPOINT32)) /* diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h index 022e124..d94b381 100644 --- a/gdb/config/pa/tm-hppah.h +++ b/gdb/config/pa/tm-hppah.h @@ -21,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define HPUX_SNAP1 -#define HPUX_SNAP2 - /* The solib hooks are not really designed to have a list of hook and handler routines. So until we clean up those interfaces you either get SOM shared libraries or HP's unusual PA64 ELF shared @@ -39,7 +36,7 @@ /* Actually, for a PA running HPUX the kernel calls the signal handler without an intermediate trampoline. Luckily the kernel always sets the return pointer for the signal handler to point to _sigreturn. */ -#define IN_SIGTRAMP(pc, name) (name && STREQ ("_sigreturn", name)) +#define PC_IN_SIGTRAMP(pc, name) (name && STREQ ("_sigreturn", name)) /* For HPUX: diff --git a/gdb/config/powerpc/aix432.mh b/gdb/config/powerpc/aix432.mh index fc74eb7..fc7a8b1 100644 --- a/gdb/config/powerpc/aix432.mh +++ b/gdb/config/powerpc/aix432.mh @@ -3,7 +3,9 @@ XM_FILE= xm-aix.h NAT_FILE= nm-aix.h -NATDEPFILES= aix-thread.o fork-child.o infptrace.o inftarg.o corelow.o \ + +# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure. +NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \ rs6000-nat.o xcoffread.o xcoffsolib.o # When compiled with cc, for debugging, this argument should be passed. @@ -15,5 +17,3 @@ NATDEPFILES= aix-thread.o fork-child.o infptrace.o inftarg.o corelow.o \ # This switch may be needed for some vendor compilers. # MH_LDFLAGS = -Wl,-bbigtoc -# pthread debugging support -NAT_CLIBS = -lpthdebug diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h index 478e9bd..1bdd9eb 100644 --- a/gdb/config/rs6000/tm-rs6000.h +++ b/gdb/config/rs6000/tm-rs6000.h @@ -78,10 +78,15 @@ extern void aix_process_linenos (void); /* Define other aspects of the stack frame. */ -#define INIT_FRAME_PC_FIRST(fromleaf, prev) \ - prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ - prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); -#define INIT_FRAME_PC(fromleaf, prev) /* nothing */ +#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \ + (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ + prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()) +/* NOTE: cagney/2002-12-08: Add local declaration of + init_frame_pc_noop() because it isn't possible to include + "arch-utils.h" here. Not too bad as this entire file is going away + anyway. */ +extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev); +#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev)) /* Flag for machine-specific stuff in shared files. FIXME */ #define IBM6000_TARGET diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index 4c07f1f..0c3731f 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -100,6 +100,8 @@ #define CALL_DUMMY_BREAKPOINT_OFFSET_P 1 #undef CALL_DUMMY_LOCATION #define CALL_DUMMY_LOCATION AT_ENTRY_POINT +#undef DEPRECATED_PC_IN_CALL_DUMMY +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address) #undef CALL_DUMMY_STACK_ADJUST #define CALL_DUMMY_STACK_ADJUST 128 #undef SIZEOF_CALL_DUMMY_WORDS @@ -168,6 +170,8 @@ sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); /* Call dummy will be located on the stack. */ #undef CALL_DUMMY_LOCATION #define CALL_DUMMY_LOCATION ON_STACK +#undef DEPRECATED_PC_IN_CALL_DUMMY +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Insert the function address into the call dummy. */ #undef FIX_CALL_DUMMY diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index 6042ac6..f0a4572 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -519,10 +519,10 @@ extern void sparc_print_extra_frame_info (struct frame_info *); /* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */ -#define INIT_FRAME_PC(FROMLEAF, PREV) /* nothing */ -#define INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \ - (PREV)->pc = ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \ - (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ()); +#define DEPRECATED_INIT_FRAME_PC(FROMLEAF, PREV) (init_frame_pc_noop (FROMLEAF, PREV)) +#define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \ + ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \ + (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ()) /* Define other aspects of the stack frame. */ @@ -657,11 +657,12 @@ extern void sparc_print_extra_frame_info (struct frame_info *); /* Call dummy method (eg. on stack, at entry point, etc.) */ #define CALL_DUMMY_LOCATION ON_STACK +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) /* Method for detecting dummy frames. */ -#define PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \ - pc_in_call_dummy_on_stack (PC, SP, FRAME_ADDRESS) +#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \ + deprecated_pc_in_call_dummy_on_stack (PC, SP, FRAME_ADDRESS) #endif /* GDB_MULTI_ARCH */ diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index edc5664..86cc4a4 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -20,6 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* NOTE: cagney/2002-11-24: This is a guess. */ +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0 +#define CALL_DUMMY_LOCATION ON_STACK +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address) + #undef TARGET_INT_BIT #undef TARGET_LONG_BIT #undef TARGET_SHORT_BIT @@ -103,9 +108,8 @@ extern int z8k_saved_pc_after_call (struct frame_info *frame); #define REGISTER_VIRTUAL_TYPE(N) \ (REGISTER_VIRTUAL_SIZE(N) == 2? builtin_type_unsigned_int : builtin_type_long) -/*#define INIT_FRAME_PC(x,y) init_frame_pc(x,y) */ -/* Initializer for an array of names of registers. - Entries beyond the first NUM_REGS are ignored. */ +#define DEPRECATED_INIT_FRAME_PC(x,y) (init_frame_pc_noop (x, y)) +#define INIT_FRAME_PC_FIRST(x,y) (init_frame_pc_noop (x, y)) #define REGISTER_NAMES \ {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ diff --git a/gdb/configure b/gdb/configure index f96b8f9..b6e9acb 100755 --- a/gdb/configure +++ b/gdb/configure @@ -55,8 +55,6 @@ ac_help="$ac_help ac_help="$ac_help --with-itkconfig Directory containing itk configuration (itkConfig.sh)" ac_help="$ac_help - --with-tixconfig Directory containing tix configuration (tixConfig.sh)" -ac_help="$ac_help --with-x use the X Window System" ac_help="$ac_help --enable-sim Link gdb with simulator" @@ -587,7 +585,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:591: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:589: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -613,7 +611,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:617: checking for $ac_word" >&5 +echo "configure:615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -643,7 +641,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:647: checking for $ac_word" >&5 +echo "configure:645: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -694,7 +692,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:698: checking for $ac_word" >&5 +echo "configure:696: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -726,7 +724,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -737,12 +735,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 741 "configure" +#line 739 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -768,12 +766,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:777: checking whether we are using GNU C" >&5 +echo "configure:775: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -782,7 +780,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -801,7 +799,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:805: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:803: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -833,7 +831,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:837: checking how to run the C preprocessor" >&5 +echo "configure:835: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -848,13 +846,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -865,13 +863,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:875: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -882,13 +880,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -913,9 +911,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:917: checking for AIX" >&5 +echo "configure:915: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:941: checking for POSIXized ISC" >&5 +echo "configure:939: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -961,7 +959,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:965: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:963: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -978,7 +976,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -1015,7 +1013,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:1019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1086,7 +1084,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1090: checking host system type" >&5 +echo "configure:1088: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1107,7 +1105,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:1111: checking target system type" >&5 +echo "configure:1109: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1125,7 +1123,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1129: checking build system type" >&5 +echo "configure:1127: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1150,7 +1148,7 @@ test "$host_alias" != "$target_alias" && ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1154: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1179,7 +1177,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1183: checking for $ac_word" >&5 +echo "configure:1181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1207,12 +1205,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1211: checking for ANSI C header files" >&5 +echo "configure:1209: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1220,7 +1218,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1237,7 +1235,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1255,7 +1253,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1276,7 +1274,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1287,7 +1285,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1311,12 +1309,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1315: checking for working const" >&5 +echo "configure:1313: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1386,21 +1384,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1390: checking for inline" >&5 +echo "configure:1388: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1426,12 +1424,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1430: checking for off_t" >&5 +echo "configure:1428: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1459,12 +1457,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1463: checking for size_t" >&5 +echo "configure:1461: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1494,19 +1492,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1498: checking for working alloca.h" >&5 +echo "configure:1496: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1527,12 +1525,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1531: checking for alloca" >&5 +echo "configure:1529: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1592,12 +1590,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1596: checking whether alloca needs Cray hooks" >&5 +echo "configure:1594: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1626: checking for $ac_func" >&5 +echo "configure:1624: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1677,7 +1675,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1681: checking stack direction for C alloca" >&5 +echo "configure:1679: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1685,7 +1683,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1729,17 +1727,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1733: checking for $ac_hdr" >&5 +echo "configure:1731: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1768,12 +1766,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1772: checking for $ac_func" >&5 +echo "configure:1770: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1821,7 +1819,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1825: checking for working mmap" >&5 +echo "configure:1823: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1829,7 +1827,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -1997,17 +1995,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2001: checking for $ac_hdr" >&5 +echo "configure:1999: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2037,12 +2035,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2041: checking for $ac_func" >&5 +echo "configure:2039: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2094,12 +2092,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2098: checking for $ac_func" >&5 +echo "configure:2096: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2156,19 +2154,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2160: checking for LC_MESSAGES" >&5 +echo "configure:2158: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2189,7 +2187,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2193: checking whether NLS is requested" >&5 +echo "configure:2191: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2209,7 +2207,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2213: checking whether included gettext is requested" >&5 +echo "configure:2211: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2228,17 +2226,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2232: checking for libintl.h" >&5 +echo "configure:2230: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2255,19 +2253,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2259: checking for gettext in libc" >&5 +echo "configure:2257: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2283,7 +2281,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2287: checking for bindtextdomain in -lintl" >&5 +echo "configure:2285: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2291,7 +2289,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2318,19 +2316,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2322: checking for gettext in libintl" >&5 +echo "configure:2320: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2358,7 +2356,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2362: checking for $ac_word" >&5 +echo "configure:2360: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2392,12 +2390,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2396: checking for $ac_func" >&5 +echo "configure:2394: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2447,7 +2445,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2451: checking for $ac_word" >&5 +echo "configure:2449: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2483,7 +2481,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2487: checking for $ac_word" >&5 +echo "configure:2485: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2515,7 +2513,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2555,7 +2553,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2559: checking for $ac_word" >&5 +echo "configure:2557: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2589,7 +2587,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2593: checking for $ac_word" >&5 +echo "configure:2591: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2625,7 +2623,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2629: checking for $ac_word" >&5 +echo "configure:2627: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2715,7 +2713,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2719: checking for catalogs to be installed" >&5 +echo "configure:2717: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2743,17 +2741,17 @@ echo "configure:2719: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2747: checking for linux/version.h" >&5 +echo "configure:2745: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2882,7 +2880,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2886: checking for $ac_word" >&5 +echo "configure:2884: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2923,7 +2921,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2927: checking for a BSD compatible install" >&5 +echo "configure:2925: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2984,7 +2982,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2988: checking for $ac_word" >&5 +echo "configure:2986: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3016,7 +3014,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3020: checking for $ac_word" >&5 +echo "configure:3018: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3048,7 +3046,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3052: checking for $ac_word" >&5 +echo "configure:3050: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3083,7 +3081,7 @@ fi # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3087: checking for $ac_word" >&5 +echo "configure:3085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3115,7 +3113,7 @@ fi # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3119: checking for $ac_word" >&5 +echo "configure:3117: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3149,7 +3147,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3153: checking for $ac_word" >&5 +echo "configure:3151: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3183,7 +3181,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3187: checking for $ac_word" >&5 +echo "configure:3185: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3234,12 +3232,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3238: checking return type of signal handlers" >&5 +echo "configure:3236: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3256,7 +3254,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3276,12 +3274,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3280: checking for ANSI C header files" >&5 +echo "configure:3278: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3289,7 +3287,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3306,7 +3304,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3324,7 +3322,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3345,7 +3343,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3356,7 +3354,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3400,17 +3398,17 @@ for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3404: checking for $ac_hdr" >&5 +echo "configure:3402: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3437,12 +3435,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3441: checking whether stat file-mode macros are broken" >&5 +echo "configure:3439: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3494,12 +3492,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3498: checking for working const" >&5 +echo "configure:3496: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3569,21 +3567,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3573: checking for inline" >&5 +echo "configure:3571: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3613,12 +3611,12 @@ for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3617: checking for $ac_func" >&5 +echo "configure:3615: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3668,19 +3666,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3672: checking for working alloca.h" >&5 +echo "configure:3670: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3701,12 +3699,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3705: checking for alloca" >&5 +echo "configure:3703: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3766,12 +3764,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3770: checking whether alloca needs Cray hooks" >&5 +echo "configure:3768: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3800: checking for $ac_func" >&5 +echo "configure:3798: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3851,7 +3849,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3855: checking stack direction for C alloca" >&5 +echo "configure:3853: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3859,7 +3857,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3900,12 +3898,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3904: checking for pid_t" >&5 +echo "configure:3902: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3934,17 +3932,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3938: checking for vfork.h" >&5 +echo "configure:3936: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3969,18 +3967,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3973: checking for working vfork" >&5 +echo "configure:3971: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3979: checking for vfork" >&5 +echo "configure:3977: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -4025,7 +4023,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -4120,7 +4118,7 @@ main() { } } EOF -if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -4144,7 +4142,7 @@ fi if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4148: checking whether setpgrp takes no argument" >&5 +echo "configure:4146: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4152,7 +4150,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -4197,12 +4195,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4201: checking whether setpgrp takes no argument" >&5 +echo "configure:4199: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4216,7 +4214,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -4240,12 +4238,12 @@ fi # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:4244: checking for sigsetjmp" >&5 +echo "configure:4242: checking for sigsetjmp" >&5 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4254,7 +4252,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:4258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -4277,19 +4275,19 @@ fi # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:4281: checking for r_fs in struct reg" >&5 +echo "configure:4279: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:4293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -4309,19 +4307,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:4313: checking for r_gs in struct reg" >&5 +echo "configure:4311: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -4343,19 +4341,19 @@ fi # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:4347: checking for PTRACE_GETREGS" >&5 +echo "configure:4345: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:4359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -4377,19 +4375,19 @@ fi # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:4381: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:4379: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:4393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -4411,12 +4409,12 @@ fi # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:4415: checking for PT_GETDBREGS" >&5 +echo "configure:4413: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4424,7 +4422,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:4428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -4446,12 +4444,12 @@ fi # See if provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:4450: checking for PT_GETXMMREGS" >&5 +echo "configure:4448: checking for PT_GETXMMREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4459,7 +4457,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:4463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -4481,7 +4479,7 @@ fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:4485: checking for socketpair in -lsocket" >&5 +echo "configure:4483: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4489,7 +4487,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4530,12 +4528,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4534: checking for $ac_func" >&5 +echo "configure:4532: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4585,12 +4583,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4589: checking whether malloc must be declared" >&5 +echo "configure:4587: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4611,7 +4609,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4632,12 +4630,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4636: checking whether realloc must be declared" >&5 +echo "configure:4634: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4658,7 +4656,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4679,12 +4677,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4683: checking whether free must be declared" >&5 +echo "configure:4681: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4705,7 +4703,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4726,12 +4724,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4730: checking whether strerror must be declared" >&5 +echo "configure:4728: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4752,7 +4750,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4773,12 +4771,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4777: checking whether strdup must be declared" >&5 +echo "configure:4775: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4799,7 +4797,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4820,12 +4818,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4824: checking whether strstr must be declared" >&5 +echo "configure:4822: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4846,7 +4844,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4867,12 +4865,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:4871: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:4869: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4893,7 +4891,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:4897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -4919,9 +4917,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4923: checking for HPUX save_state structure" >&5 +echo "configure:4921: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4936,7 +4934,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -5006,12 +5004,12 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5010: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5008: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5042,12 +5040,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5046: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:5044: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -5078,12 +5076,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5082: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:5080: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -5114,12 +5112,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5118: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:5116: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -5150,12 +5148,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5154: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:5152: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -5186,12 +5184,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5190: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:5188: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -5222,12 +5220,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5226: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:5224: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -5258,12 +5256,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5262: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:5260: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -5294,12 +5292,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5298: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:5296: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -5330,12 +5328,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5334: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:5332: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -5366,12 +5364,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5370: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:5368: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -5402,12 +5400,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5406: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:5404: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -5438,12 +5436,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5442: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:5440: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -5474,12 +5472,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5478: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:5476: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -5515,7 +5513,7 @@ EOF if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:5519: checking whether prfpregset_t type is broken" >&5 +echo "configure:5517: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5523,7 +5521,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -5533,7 +5531,7 @@ else return 0; } EOF -if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -5558,12 +5556,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5562: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:5560: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5576,7 +5574,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -5600,19 +5598,19 @@ fi if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5604: checking for member l_addr in struct link_map" >&5 +echo "configure:5602: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -5634,12 +5632,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5638: checking for member lm_addr in struct link_map" >&5 +echo "configure:5636: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5647,7 +5645,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -5669,12 +5667,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:5673: checking for member som_addr in struct so_map" >&5 +echo "configure:5671: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_NLIST_H @@ -5685,7 +5683,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:5689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -5707,12 +5705,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:5711: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:5709: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5720,7 +5718,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -5746,7 +5744,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5750: checking for main in -lm" >&5 +echo "configure:5748: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5754,14 +5752,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5790,7 +5788,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:5794: checking for wctype in -lc" >&5 +echo "configure:5792: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5798,7 +5796,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5828,7 +5826,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:5832: checking for wctype in -lw" >&5 +echo "configure:5830: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5836,7 +5834,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5879,12 +5877,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:5883: checking for long long support in compiler" >&5 +echo "configure:5881: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -5916,7 +5914,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:5920: checking for long long support in printf" >&5 +echo "configure:5918: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5924,7 +5922,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -5962,19 +5960,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:5966: checking for long double support in compiler" >&5 +echo "configure:5964: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -5996,7 +5994,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:6000: checking for long double support in printf" >&5 +echo "configure:5998: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6004,7 +6002,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -6038,7 +6036,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:6042: checking for long double support in scanf" >&5 +echo "configure:6040: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6046,7 +6044,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -6082,17 +6080,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6086: checking for $ac_hdr" >&5 +echo "configure:6084: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6121,12 +6119,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6125: checking for $ac_func" >&5 +echo "configure:6123: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6174,7 +6172,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6178: checking for working mmap" >&5 +echo "configure:6176: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6182,7 +6180,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6348,7 +6346,7 @@ fi case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:6352: checking for -bbigtoc option" >&5 +echo "configure:6350: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6362,14 +6360,14 @@ else LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6392,7 +6390,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:6396: checking for HPUX/OSF thread support" >&5 +echo "configure:6394: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -6410,8 +6408,12 @@ EOF fi ;; solaris*) + # See if thread_db library is around for Solaris thread debugging. + # Note that we must explicitly test for version 1 of the library + # because version 0 (present on Solaris 2.4 or earlier) doesn't have + # the same API. echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:6415: checking for Solaris thread debugging library" >&5 +echo "configure:6417: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -6421,7 +6423,7 @@ EOF CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6425: checking for dlopen in -ldl" >&5 +echo "configure:6427: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6429,7 +6431,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6472,17 +6474,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:6476: checking for the ld -export-dynamic flag" >&5 +echo "configure:6478: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -6501,13 +6503,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:6505: checking if is old" >&5 +echo "configure:6507: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6518,7 +6520,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -6542,25 +6544,60 @@ EOF echo "$ac_t""no" 1>&6 fi ;; + aix*) + echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6 +echo "configure:6550: checking for AiX thread debugging library" >&5 + if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +#ifndef PTHDB_VERSION_3 + #error + #endif +; return 0; } +EOF +if { (eval echo configure:6564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_have_aix_thread_debug=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_have_aix_thread_debug=no +fi +rm -f conftest* +fi + + echo "$ac_t""$gdb_cv_have_aix_thread_debug" 1>&6 + if test $gdb_cv_have_aix_thread_debug = yes; then + CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" + CONFIG_LIB_OBS="${CONFIG_LIB_OBS} aix-thread.o" + CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" + fi + ;; esac fi if test "x$ac_cv_header_thread_db_h" = "xyes"; then echo $ac_n "checking whether has TD_NOTALLOC""... $ac_c" 1>&6 -echo "configure:6552: checking whether has TD_NOTALLOC" >&5 +echo "configure:6589: checking whether has TD_NOTALLOC" >&5 if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int i = TD_NOTALLOC; ; return 0; } EOF -if { (eval echo configure:6564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_thread_db_h_has_td_notalloc=yes else @@ -6583,6 +6620,36 @@ EOF fi +if test $host = $target; then + case $target in + *-linux*) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE" + cat > conftest.$ac_ext < +int main() { +pread64 (0, NULL, 0, 0); +; return 0; } +EOF +if { (eval echo configure:6637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE" + cat >> confdefs.h <<\EOF +#define HAVE_PREAD64 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + CFLAGS=$save_CFLAGS + ;; + esac +fi + # Check whether --enable-gdbcli or --disable-gdbcli was given. if test "${enable_gdbcli+set}" = set; then @@ -6774,7 +6841,7 @@ WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:6778: checking compiler warning flags" >&5 +echo "configure:6845: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -6784,14 +6851,14 @@ echo "configure:6778: checking compiler warning flags" >&5 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -6851,12 +6918,12 @@ fi if test $want_included_regex = false; then echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6855: checking for GNU regex" >&5 +echo "configure:6922: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6868,7 +6935,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6897,12 +6964,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:6901: checking for cygwin" >&5 +echo "configure:6968: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6944: checking for tgetent in -lncurses" >&5 +echo "configure:7011: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6948,7 +7015,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6978,7 +7045,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:6982: checking for tgetent in -lHcurses" >&5 +echo "configure:7049: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6986,7 +7053,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7016,7 +7083,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:7020: checking for tgetent in -ltermlib" >&5 +echo "configure:7087: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7024,7 +7091,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7054,7 +7121,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:7058: checking for tgetent in -ltermcap" >&5 +echo "configure:7125: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7062,7 +7129,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7092,7 +7159,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:7096: checking for tgetent in -lcurses" >&5 +echo "configure:7163: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7100,7 +7167,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7130,7 +7197,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:7134: checking for tgetent in -lterminfo" >&5 +echo "configure:7201: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7138,7 +7205,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7314,7 +7381,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:7318: checking for Tcl configuration" >&5 +echo "configure:7385: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7422,7 +7489,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:7426: checking for Tk configuration" >&5 +echo "configure:7493: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7531,7 +7598,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:7535: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:7602: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -7597,17 +7664,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:7601: checking for tclInt.h" >&5 +echo "configure:7668: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7667,7 +7734,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:7671: checking for Tk private headers" >&5 +echo "configure:7738: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -7733,17 +7800,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:7737: checking for tk.h" >&5 +echo "configure:7804: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7789,7 +7856,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7793: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:7860: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -7812,7 +7879,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7816: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:7883: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -7833,26 +7900,6 @@ fi #AC_SUBST(ITKLIB) - -echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7839: checking for Tix private headers. srcdir=${srcdir}" >&5 -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" - { echo "configure: error: Can't find Tix private headers" 1>&2; exit 1; } -fi -if test x"${ac_cv_c_tixh}" != x ; then - TIXHDIR="-I${ac_cv_c_tixh}" -fi - - # now look for Tk library stuff @@ -7887,7 +7934,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:7891: checking for Itcl configuration" >&5 +echo "configure:7938: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7990,7 +8037,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:7994: checking for Itk configuration" >&5 +echo "configure:8041: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8075,109 +8122,6 @@ fi ITK_DEPS="${ITK_LIB_FULL_PATH}" fi - # now look for Tix library stuff - -# -# 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 - # Check whether --with-tixconfig or --without-tixconfig was given. -if test "${with_tixconfig+set}" = set; then - withval="$with_tixconfig" - with_tixconfig=${withval} -fi - - echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:8097: checking for Tix configuration" >&5 - if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - - # 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 - { echo "configure: error: ${with_tixconfig} directory doesn't contain tixConfig.sh" 1>&2; exit 1; } - 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 - -fi - - if test x"${ac_cv_c_tixconfig}" = x ; then - TIXCONFIG="# no Tix configs found" - echo "configure: warning: Can't find Tix configuration definitions" 1>&2 - else - no_tix= - TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh - echo "$ac_t""found $TIXCONFIG" 1>&6 - fi -fi - - - if test -z "${no_tix}"; then - - if test -f "$TIXCONFIG" ; then - . $TIXCONFIG - fi - - - - - - - - - TIXLIB="${TIX_BUILD_LIB_SPEC}" - TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}" - fi - ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)" # Tcl/Tk 8.1 require -fwritable strings. I don't # know whether 8.2 will or not, but I bet it will. @@ -8190,7 +8134,7 @@ fi fi # Include some libraries that Tcl and Tk want. - TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' # Yes, the ordering seems wrong here. But it isn't. # TK_LIBS is the list of libraries that need to be linked # after Tcl/Tk. Note that this isn't put into LIBS. If it @@ -8232,14 +8176,12 @@ fi - - # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:8243: checking for X" >&5 +echo "configure:8185: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -8301,12 +8243,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8375,14 +8317,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -8674,7 +8616,7 @@ fi # ``gdbserver'' can only be built in a native configuration. if test x"${target}" = x"${host}"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:8678: checking whether gdbserver is supported on this host" >&5 +echo "configure:8620: checking whether gdbserver is supported on this host" >&5 if test x"${build_gdbserver}" = xyes ; then configdirs="${configdirs} gdbserver" SUBDIRS="${SUBDIRS} gdbserver" @@ -8736,7 +8678,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:8740: checking whether ln -s works" >&5 +echo "configure:8682: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8760,12 +8702,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:8764: checking for Cygwin environment" >&5 +echo "configure:8706: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -8793,19 +8735,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:8797: checking for mingw32 environment" >&5 +echo "configure:8739: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -8824,7 +8766,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:8828: checking for executable suffix" >&5 +echo "configure:8770: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8834,7 +8776,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:8838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:8780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -8876,7 +8818,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:8880: checking for iconv" >&5 +echo "configure:8822: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8884,7 +8826,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include @@ -8894,7 +8836,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -8906,7 +8848,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat > conftest.$ac_ext < #include @@ -8916,7 +8858,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:8920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -8937,13 +8879,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:8941: checking for iconv declaration" >&5 +echo "configure:8883: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -8962,7 +8904,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -9218,7 +9160,6 @@ s%@TCLHDIR@%$TCLHDIR%g s%@TKHDIR@%$TKHDIR%g s%@ITCLHDIR@%$ITCLHDIR%g s%@ITKHDIR@%$ITKHDIR%g -s%@TIXHDIR@%$TIXHDIR%g s%@ITCL_VERSION@%$ITCL_VERSION%g s%@ITCL_DEFS@%$ITCL_DEFS%g s%@ITCL_BUILD_INCLUDES@%$ITCL_BUILD_INCLUDES%g @@ -9229,8 +9170,6 @@ s%@ITK_DEFS@%$ITK_DEFS%g s%@ITK_BUILD_INCLUDES@%$ITK_BUILD_INCLUDES%g s%@ITK_BUILD_LIB_SPEC@%$ITK_BUILD_LIB_SPEC%g s%@ITK_LIB_SPEC@%$ITK_LIB_SPEC%g -s%@TIX_VERSION@%$TIX_VERSION%g -s%@TIX_BUILD_LIB_SPEC@%$TIX_BUILD_LIB_SPEC%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_LDFLAGS@%$X_LDFLAGS%g s%@X_LIBS@%$X_LIBS%g @@ -9240,8 +9179,6 @@ s%@ITCLLIB@%$ITCLLIB%g s%@ITCL_DEPS@%$ITCL_DEPS%g s%@ITKLIB@%$ITKLIB%g s%@ITK_DEPS@%$ITK_DEPS%g -s%@TIXLIB@%$TIXLIB%g -s%@TIX_DEPS@%$TIX_DEPS%g s%@GDBTKLIBS@%$GDBTKLIBS%g s%@GDBTK_CFLAGS@%$GDBTK_CFLAGS%g s%@GDBTK_SRC_DIR@%$GDBTK_SRC_DIR%g diff --git a/gdb/configure.in b/gdb/configure.in index 4c2e063..f91503a 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -532,12 +532,12 @@ aix*) ;; esac -dnl See if thread_db library is around for Solaris thread debugging. Note that -dnl we must explicitly test for version 1 of the library because version 0 -dnl (present on Solaris 2.4 or earlier) doesn't have the same API. -dnl Note that we only want this if we are both native (host == target), and -dnl not doing a canadian cross build (build == host). +dnl For certain native configurations, we need to check whether thread +dnl support can be built in or not. +dnl +dnl Note that we only want this if we are both native (host == target), +dnl and not doing a canadian cross build (build == host). if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in @@ -557,6 +557,10 @@ if test ${build} = ${host} -a ${host} = ${target} ; then fi ;; solaris*) + # See if thread_db library is around for Solaris thread debugging. + # Note that we must explicitly test for version 1 of the library + # because version 0 (present on Solaris 2.4 or earlier) doesn't have + # the same API. AC_MSG_CHECKING(for Solaris thread debugging library) if test -f /usr/lib/libthread_db.so.1 ; then AC_MSG_RESULT(yes) @@ -596,6 +600,22 @@ if test ${build} = ${host} -a ${host} = ${target} ; then AC_MSG_RESULT(no) fi ;; + aix*) + AC_MSG_CHECKING(for AiX thread debugging library) + AC_CACHE_VAL(gdb_cv_have_aix_thread_debug, + [AC_TRY_COMPILE([#include ], + [#ifndef PTHDB_VERSION_3 + #error + #endif], + gdb_cv_have_aix_thread_debug=yes, + gdb_cv_have_aix_thread_debug=no)]) + AC_MSG_RESULT($gdb_cv_have_aix_thread_debug) + if test $gdb_cv_have_aix_thread_debug = yes; then + CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" + CONFIG_LIB_OBS="${CONFIG_LIB_OBS} aix-thread.o" + CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" + fi + ;; esac AC_SUBST(CONFIG_LDFLAGS) fi @@ -617,6 +637,23 @@ if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then [Define if has the TD_NOTALLOC error code.]) fi +dnl linux-proc.c wants to use pread64, which may require special CFLAGS +dnl -D_BSD_SOURCE is normally assumed but we have to specify it because of +dnl -D_XOPEN_SOURCE=500. +if test $host = $target; then + case $target in + *-linux*) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE" + AC_TRY_LINK([#include ], + [pread64 (0, NULL, 0, 0);], + [ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE" + AC_DEFINE(HAVE_PREAD64)], []) + CFLAGS=$save_CFLAGS + ;; + esac +fi + dnl The CLI cannot be disabled yet, but may be in the future dnl Handle CLI sub-directory configury. @@ -1025,7 +1062,6 @@ if test "${enable_gdbtk}" = "yes"; then CY_AC_PATH_TKH CY_AC_PATH_ITCLH CY_AC_PATH_ITKH - CY_AC_PATH_TIXH # now look for Tk library stuff @@ -1061,14 +1097,6 @@ if test "${enable_gdbtk}" = "yes"; then ITK_DEPS="${ITK_LIB_FULL_PATH}" fi - # now look for Tix library stuff - CY_AC_PATH_TIXCONFIG - if test -z "${no_tix}"; then - CY_AC_LOAD_TIXCONFIG - TIXLIB="${TIX_BUILD_LIB_SPEC}" - TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}" - fi - ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)" # Tcl/Tk 8.1 require -fwritable strings. I don't # know whether 8.2 will or not, but I bet it will. @@ -1081,7 +1109,7 @@ if test "${enable_gdbtk}" = "yes"; then fi # Include some libraries that Tcl and Tk want. - TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' + TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' # Yes, the ordering seems wrong here. But it isn't. # TK_LIBS is the list of libraries that need to be linked # after Tcl/Tk. Note that this isn't put into LIBS. If it @@ -1119,8 +1147,6 @@ AC_SUBST(ITCLLIB) AC_SUBST(ITCL_DEPS) AC_SUBST(ITKLIB) AC_SUBST(ITK_DEPS) -AC_SUBST(TIXLIB) -AC_SUBST(TIX_DEPS) AC_SUBST(GDBTKLIBS) AC_SUBST(GDBTK_CFLAGS) AC_SUBST(GDBTK_SRC_DIR) diff --git a/gdb/corelow.c b/gdb/corelow.c index f7e3cf0..ff758b8 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -38,6 +38,7 @@ #include "gdbthread.h" #include "regcache.h" #include "symfile.h" +#include #ifndef O_BINARY #define O_BINARY 0 @@ -62,7 +63,7 @@ static int solib_add_stub (PTR); static struct core_fns *sniff_core_bfd (bfd *); -static boolean gdb_check_format (bfd *); +static int gdb_check_format (bfd *); static void core_open (char *, int); @@ -160,7 +161,7 @@ default_check_format (bfd *abfd) /* Attempt to recognize core file formats that BFD rejects. */ -static boolean +static int gdb_check_format (bfd *abfd) { struct core_fns *cf; @@ -364,8 +365,8 @@ core_open (char *filename, int from_tty) /* Now, set up the frame cache, and print the top of stack. */ flush_cached_frames (); select_frame (get_current_frame ()); - print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } else { @@ -509,16 +510,13 @@ init_core_ops (void) core_ops.to_open = core_open; core_ops.to_close = core_close; core_ops.to_attach = find_default_attach; - core_ops.to_require_attach = find_default_require_attach; core_ops.to_detach = core_detach; - core_ops.to_require_detach = find_default_require_detach; core_ops.to_fetch_registers = get_core_registers; core_ops.to_xfer_memory = xfer_memory; core_ops.to_files_info = core_files_info; core_ops.to_insert_breakpoint = ignore; core_ops.to_remove_breakpoint = ignore; core_ops.to_create_inferior = find_default_create_inferior; - core_ops.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior; core_ops.to_thread_alive = core_file_thread_alive; core_ops.to_stratum = core_stratum; core_ops.to_has_memory = 1; diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c index efaf89a..4341789 100644 --- a/gdb/cpu32bug-rom.c +++ b/gdb/cpu32bug-rom.c @@ -28,6 +28,8 @@ #include "serial.h" #include "regcache.h" +#include "m68k-tdep.h" + static void cpu32bug_open (char *args, int from_tty); static void @@ -53,12 +55,12 @@ cpu32bug_supply_register (char *regname, int regnamelen, char *val, int vallen) case 'D': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + D0_REGNUM; + regno = regname[1] - '0' + M68K_D0_REGNUM; break; case 'A': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + A0_REGNUM; + regno = regname[1] - '0' + M68K_A0_REGNUM; break; default: return; diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 046c08b..0d552b8 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -392,7 +392,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *); CORE_ADDR frame CORE_ADDR pc - int signal_handler_caller + enum frame_type type; CORE_ADDR return_pc int leaf_function @@ -405,8 +405,9 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, const char *); of the register PC. All other frames contain the content of the register PC in the next frame. - The variable signal_handler_caller is non-zero when the frame is - associated with the call of a signal handler. + The variable `type' indicates the frame's type: normal, SIGTRAMP + (associated with a signal handler), dummy (associated with a dummy + frame). The variable return_pc contains the address where execution should be resumed when the present frame has finished, the return address. @@ -680,29 +681,29 @@ cris_examine (CORE_ADDR ip, CORE_ADDR limit, struct frame_info *fi, if (have_fp) { - fi->saved_regs[FP_REGNUM] = FRAME_FP (fi); + fi->saved_regs[FP_REGNUM] = get_frame_base (fi); /* Calculate the addresses. */ for (regno = regsave; regno >= 0; regno--) { - fi->saved_regs[regno] = FRAME_FP (fi) - val; + fi->saved_regs[regno] = get_frame_base (fi) - val; val -= 4; } if (fi->extra_info->leaf_function) { /* Set the register SP to contain the stack pointer of the caller. */ - fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 4; + fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 4; } else { /* Set the register SP to contain the stack pointer of the caller. */ - fi->saved_regs[SP_REGNUM] = FRAME_FP (fi) + 8; + fi->saved_regs[SP_REGNUM] = get_frame_base (fi) + 8; /* Set the register SRP to contain the return address of the caller. */ - fi->saved_regs[SRP_REGNUM] = FRAME_FP (fi) + 4; + fi->saved_regs[SRP_REGNUM] = get_frame_base (fi) + 4; } } return ip; @@ -1140,7 +1141,7 @@ cris_abi_v2_reg_struct_has_addr (int gcc_p, struct type *type) int cris_frameless_function_invocation (struct frame_info *fi) { - if (fi->signal_handler_caller) + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) return 0; else return frameless_look_for_prologue (fi); @@ -1212,7 +1213,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info->return_pc = 0; fi->extra_info->leaf_function = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1253,13 +1254,13 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi) CORE_ADDR cris_frame_chain (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { return fi->frame; } else if (!inside_entry_file (fi->pc)) { - return read_memory_unsigned_integer (FRAME_FP (fi), 4); + return read_memory_unsigned_integer (get_frame_base (fi), 4); } else { @@ -1275,24 +1276,6 @@ cris_frame_saved_pc (struct frame_info *fi) return fi->extra_info->return_pc; } -/* Return the address of the argument block for the frame described - by struct frame_info. */ - -CORE_ADDR -cris_frame_args_address (struct frame_info *fi) -{ - return FRAME_FP (fi); -} - -/* Return the address of the locals block for the frame - described by struct frame_info. */ - -CORE_ADDR -cris_frame_locals_address (struct frame_info *fi) -{ - return FRAME_FP (fi); -} - /* Setup the function arguments for calling a function in the inferior. */ CORE_ADDR @@ -1529,7 +1512,7 @@ cris_pop_frame (void) register int regno; register int stack_offset = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* This happens when we hit a breakpoint set at the entry point, when returning from a dummy frame. */ @@ -4140,6 +4123,10 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->cris_version = cris_version; tdep->cris_mode = cris_mode; tdep->cris_abi = cris_abi; @@ -4263,10 +4250,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type); /* Use generic dummy frames. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); /* Where to execute the call in the memory segments. */ - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); /* Start execution at the beginning of dummy. */ @@ -4278,7 +4263,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Read all about dummy frames in blockframe.c. */ set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); /* Defined to 1 to indicate that the target supports inferior function calls. */ @@ -4330,8 +4315,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, cris_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, cris_frame_args_address); - set_gdbarch_frame_locals_address (gdbarch, cris_frame_locals_address); set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); diff --git a/gdb/cxux-nat.c b/gdb/cxux-nat.c deleted file mode 100644 index e8f35a3..0000000 --- a/gdb/cxux-nat.c +++ /dev/null @@ -1,537 +0,0 @@ -// OBSOLETE /* Native support for Motorola 88k running Harris CX/UX. -// OBSOLETE Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, -// OBSOLETE 2001 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include "bfd.h" -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "objfiles.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #ifndef USER /* added to support BCS ptrace_user */ -// OBSOLETE #define USER ptrace_user -// OBSOLETE #endif -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include "gdb_stat.h" -// OBSOLETE -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "setjmp.h" -// OBSOLETE #include "value.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* CX/UX provides them already, but as word offsets instead of char offsets */ -// OBSOLETE #define SXIP_OFFSET (PT_SXIP * 4) -// OBSOLETE #define SNIP_OFFSET (PT_SNIP * 4) -// OBSOLETE #define SFIP_OFFSET (PT_SFIP * 4) -// OBSOLETE #define PSR_OFFSET (PT_PSR * sizeof(int)) -// OBSOLETE #define FPSR_OFFSET (PT_FPSR * sizeof(int)) -// OBSOLETE #define FPCR_OFFSET (PT_FPCR * sizeof(int)) -// OBSOLETE -// OBSOLETE #define XREGADDR(r) (((char *)&u.pt_x0-(char *)&u) + \ -// OBSOLETE ((r)-X0_REGNUM)*sizeof(X_REGISTER_RAW_TYPE)) -// OBSOLETE -// OBSOLETE extern int have_symbol_file_p (); -// OBSOLETE -// OBSOLETE extern jmp_buf stack_jmp; -// OBSOLETE -// OBSOLETE extern int errno; -// OBSOLETE -// OBSOLETE void -// OBSOLETE fetch_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE register unsigned int regaddr; -// OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE register int i; -// OBSOLETE -// OBSOLETE struct USER u; -// OBSOLETE unsigned int offset; -// OBSOLETE -// OBSOLETE offset = (char *) &u.pt_r0 - (char *) &u; -// OBSOLETE regaddr = offset; /* byte offset to r0; */ -// OBSOLETE -// OBSOLETE /* offset = ptrace (3, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */ -// OBSOLETE for (regno = 0; regno < PC_REGNUM; regno++) -// OBSOLETE { -// OBSOLETE /*regaddr = register_addr (regno, offset); */ -// OBSOLETE /* 88k enhancement */ -// OBSOLETE -// OBSOLETE for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) -// OBSOLETE { -// OBSOLETE *(int *) &buf[i] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, 0); -// OBSOLETE regaddr += sizeof (int); -// OBSOLETE } -// OBSOLETE supply_register (regno, buf); -// OBSOLETE } -// OBSOLETE /* now load up registers 32-37; special pc registers */ -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) PSR_OFFSET, 0); -// OBSOLETE supply_register (PSR_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPSR_OFFSET, 0); -// OBSOLETE supply_register (FPSR_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPCR_OFFSET, 0); -// OBSOLETE supply_register (FPCR_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0); -// OBSOLETE supply_register (SXIP_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0); -// OBSOLETE supply_register (SNIP_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0); -// OBSOLETE supply_register (SFIP_REGNUM, buf); -// OBSOLETE -// OBSOLETE if (target_is_m88110) -// OBSOLETE { -// OBSOLETE for (regaddr = XREGADDR (X0_REGNUM), regno = X0_REGNUM; -// OBSOLETE regno < NUM_REGS; -// OBSOLETE regno++, regaddr += 16) -// OBSOLETE { -// OBSOLETE X_REGISTER_RAW_TYPE xval; -// OBSOLETE -// OBSOLETE *(int *) &xval.w1 = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, 0); -// OBSOLETE *(int *) &xval.w2 = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) (regaddr + 4), 0); -// OBSOLETE *(int *) &xval.w3 = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) (regaddr + 8), 0); -// OBSOLETE *(int *) &xval.w4 = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) (regaddr + 12), 0); -// OBSOLETE supply_register (regno, (void *) &xval); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store our register values back into the inferior. -// OBSOLETE If REGNO is -1, do this for all registers. -// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE store_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE register unsigned int regaddr; -// OBSOLETE char buf[80]; -// OBSOLETE -// OBSOLETE struct USER u; -// OBSOLETE -// OBSOLETE unsigned int offset = (char *) &u.pt_r0 - (char *) &u; -// OBSOLETE -// OBSOLETE regaddr = offset; -// OBSOLETE -// OBSOLETE /* Don't try to deal with EXIP_REGNUM or ENIP_REGNUM, because I think either -// OBSOLETE svr3 doesn't run on an 88110, or the kernel isolates the different (not -// OBSOLETE completely sure this is true, but seems to be. */ -// OBSOLETE if (regno >= 0) -// OBSOLETE { -// OBSOLETE /* regaddr = register_addr (regno, offset); */ -// OBSOLETE if (regno < PC_REGNUM) -// OBSOLETE { -// OBSOLETE regaddr = offset + regno * sizeof (int); -// OBSOLETE errno = 0; -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); -// OBSOLETE if (errno != 0) -// OBSOLETE { -// OBSOLETE sprintf (buf, "writing register number %d", regno); -// OBSOLETE perror_with_name (buf); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (regno == PSR_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == FPSR_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == FPCR_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == SXIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == SNIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == SFIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (regno)); -// OBSOLETE else if (target_is_m88110 && regno < NUM_REGS) -// OBSOLETE { -// OBSOLETE X_REGISTER_RAW_TYPE xval; -// OBSOLETE -// OBSOLETE read_register_bytes (REGISTER_BYTE (regno), (char *) &xval, -// OBSOLETE sizeof (X_REGISTER_RAW_TYPE)); -// OBSOLETE regaddr = XREGADDR (regno); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, xval.w1); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 4, xval.w2); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 8, xval.w3); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 12, xval.w4); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE printf_unfiltered ("Bad register number for store_inferior routine\n"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (regno = 0; regno < PC_REGNUM; regno++) -// OBSOLETE { -// OBSOLETE /* regaddr = register_addr (regno, offset); */ -// OBSOLETE errno = 0; -// OBSOLETE regaddr = offset + regno * sizeof (int); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); -// OBSOLETE if (errno != 0) -// OBSOLETE { -// OBSOLETE sprintf (buf, "writing register number %d", regno); -// OBSOLETE perror_with_name (buf); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (SFIP_REGNUM)); -// OBSOLETE if (target_is_m88110) -// OBSOLETE { -// OBSOLETE for (regno = X0_REGNUM; regno < NUM_REGS; regno++) -// OBSOLETE { -// OBSOLETE X_REGISTER_RAW_TYPE xval; -// OBSOLETE -// OBSOLETE read_register_bytes (REGISTER_BYTE (regno), (char *) &xval, -// OBSOLETE sizeof (X_REGISTER_RAW_TYPE)); -// OBSOLETE regaddr = XREGADDR (regno); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, xval.w1); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 4), xval.w2); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 8), xval.w3); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 12), xval.w4); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* blockend is the address of the end of the user structure */ -// OBSOLETE -// OBSOLETE m88k_register_u_addr (int blockend, int regnum) -// OBSOLETE { -// OBSOLETE struct USER u; -// OBSOLETE int ustart = blockend - sizeof (struct USER); -// OBSOLETE -// OBSOLETE if (regnum < PSR_REGNUM) -// OBSOLETE return (ustart + ((int) &u.pt_r0 - (int) &u) + -// OBSOLETE REGISTER_SIZE * regnum); -// OBSOLETE else if (regnum == PSR_REGNUM) -// OBSOLETE return (ustart + ((int) &u.pt_psr) - (int) &u); -// OBSOLETE else if (regnum == FPSR_REGNUM) -// OBSOLETE return (ustart + ((int) &u.pt_fpsr) - (int) &u); -// OBSOLETE else if (regnum == FPCR_REGNUM) -// OBSOLETE return (ustart + ((int) &u.pt_fpcr) - (int) &u); -// OBSOLETE else if (regnum == SXIP_REGNUM) -// OBSOLETE return (ustart + SXIP_OFFSET); -// OBSOLETE else if (regnum == SNIP_REGNUM) -// OBSOLETE return (ustart + SNIP_OFFSET); -// OBSOLETE else if (regnum == SFIP_REGNUM) -// OBSOLETE return (ustart + SFIP_OFFSET); -// OBSOLETE else if (target_is_m88110) -// OBSOLETE return (ustart + ((int) &u.pt_x0 - (int) &u) + /* Must be X register */ -// OBSOLETE sizeof (u.pt_x0) * (regnum - X0_REGNUM)); -// OBSOLETE else -// OBSOLETE return (blockend + REGISTER_SIZE * regnum); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #ifdef USE_PROC_FS -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* Prototypes for supply_gregset etc. */ -// OBSOLETE #include "gregset.h" -// OBSOLETE -// OBSOLETE /* Given a pointer to a general register set in /proc format (gregset_t *), -// OBSOLETE unpack the register contents and supply them as gdb's idea of the current -// OBSOLETE register values. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE supply_gregset (gregset_t *gregsetp) -// OBSOLETE { -// OBSOLETE register int regi; -// OBSOLETE register greg_t *regp = (greg_t *) gregsetp; -// OBSOLETE -// OBSOLETE for (regi = 0; regi <= SP_REGNUM; regi++) -// OBSOLETE supply_register (regi, (char *) (regp + regi)); -// OBSOLETE -// OBSOLETE supply_register (SXIP_REGNUM, (char *) (regp + R_XIP)); -// OBSOLETE supply_register (SNIP_REGNUM, (char *) (regp + R_NIP)); -// OBSOLETE supply_register (SFIP_REGNUM, (char *) (regp + R_FIP)); -// OBSOLETE supply_register (PSR_REGNUM, (char *) (regp + R_PSR)); -// OBSOLETE supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR)); -// OBSOLETE supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE fill_gregset (gregset_t *gregsetp, int regno) -// OBSOLETE { -// OBSOLETE int regi; -// OBSOLETE register greg_t *regp = (greg_t *) gregsetp; -// OBSOLETE -// OBSOLETE for (regi = 0; regi <= R_R31; regi++) -// OBSOLETE if ((regno == -1) || (regno == regi)) -// OBSOLETE *(regp + regi) = *(int *) ®isters[REGISTER_BYTE (regi)]; -// OBSOLETE -// OBSOLETE if ((regno == -1) || (regno == SXIP_REGNUM)) -// OBSOLETE *(regp + R_XIP) = *(int *) ®isters[REGISTER_BYTE (SXIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == SNIP_REGNUM)) -// OBSOLETE *(regp + R_NIP) = *(int *) ®isters[REGISTER_BYTE (SNIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == SFIP_REGNUM)) -// OBSOLETE *(regp + R_FIP) = *(int *) ®isters[REGISTER_BYTE (SFIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == PSR_REGNUM)) -// OBSOLETE *(regp + R_PSR) = *(int *) ®isters[REGISTER_BYTE (PSR_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == FPSR_REGNUM)) -// OBSOLETE *(regp + R_FPSR) = *(int *) ®isters[REGISTER_BYTE (FPSR_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == FPCR_REGNUM)) -// OBSOLETE *(regp + R_FPCR) = *(int *) ®isters[REGISTER_BYTE (FPCR_REGNUM)]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif /* USE_PROC_FS */ -// OBSOLETE -// OBSOLETE /* This support adds the equivalent of adb's % command. When -// OBSOLETE the `add-shared-symbol-files' command is given, this routine scans -// OBSOLETE the dynamic linker's link map and reads the minimal symbols -// OBSOLETE from each shared object file listed in the map. */ -// OBSOLETE -// OBSOLETE struct link_map -// OBSOLETE { -// OBSOLETE unsigned long l_addr; /* address at which object is mapped */ -// OBSOLETE char *l_name; /* full name of loaded object */ -// OBSOLETE void *l_ld; /* dynamic structure of object */ -// OBSOLETE struct link_map *l_next; /* next link object */ -// OBSOLETE struct link_map *l_prev; /* previous link object */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE #define LINKS_MAP_POINTER "_ld_tail" -// OBSOLETE #define LIBC_FILE "/usr/lib/libc.so.1" -// OBSOLETE #define SHARED_OFFSET 0xf0001000 -// OBSOLETE -// OBSOLETE #ifndef PATH_MAX -// OBSOLETE #define PATH_MAX 1023 /* maximum size of path name on OS */ -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE void -// OBSOLETE add_shared_symbol_files (void) -// OBSOLETE { -// OBSOLETE void *desc; -// OBSOLETE struct link_map *ld_map, *lm, lms; -// OBSOLETE struct minimal_symbol *minsym; -// OBSOLETE struct objfile *objfile; -// OBSOLETE char *path_name; -// OBSOLETE -// OBSOLETE if (ptid_equal (inferior_ptid, null_ptid)) -// OBSOLETE { -// OBSOLETE warning ("The program has not yet been started."); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE objfile = symbol_file_add (LIBC_FILE, 0, NULL, 0, OBJF_READNOW); -// OBSOLETE minsym = lookup_minimal_symbol (LINKS_MAP_POINTER, objfile); -// OBSOLETE -// OBSOLETE ld_map = (struct link_map *) -// OBSOLETE read_memory_integer (((int) SYMBOL_VALUE_ADDRESS (minsym) + SHARED_OFFSET), 4); -// OBSOLETE lm = ld_map; -// OBSOLETE while (lm) -// OBSOLETE { -// OBSOLETE int local_errno = 0; -// OBSOLETE -// OBSOLETE read_memory ((CORE_ADDR) lm, (char *) &lms, sizeof (struct link_map)); -// OBSOLETE if (lms.l_name) -// OBSOLETE { -// OBSOLETE if (target_read_string ((CORE_ADDR) lms.l_name, &path_name, -// OBSOLETE PATH_MAX, &local_errno)) -// OBSOLETE { -// OBSOLETE struct section_addr_info section_addrs; -// OBSOLETE memset (§ion_addrs, 0, sizeof (section_addrs)); -// OBSOLETE section_addrs.other[0].addr = lms.l_addr; -// OBSOLETE section_addrs.other[0].name = ".text"; -// OBSOLETE symbol_file_add (path_name, 1, §ion_addrs, 0, 0); -// OBSOLETE xfree (path_name); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE /* traverse links in reverse order so that we get the -// OBSOLETE the symbols the user actually gets. */ -// OBSOLETE lm = lms.l_prev; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Getting new symbols may change our opinion about what is -// OBSOLETE frameless. */ -// OBSOLETE reinit_frame_cache (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if defined(_ES_MP) -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE unsigned int -// OBSOLETE m88k_harris_core_register_addr (int regno, int reg_ptr) -// OBSOLETE { -// OBSOLETE unsigned int word_offset; -// OBSOLETE -// OBSOLETE switch (regno) -// OBSOLETE { -// OBSOLETE case PSR_REGNUM: -// OBSOLETE word_offset = R_EPSR; -// OBSOLETE break; -// OBSOLETE case FPSR_REGNUM: -// OBSOLETE word_offset = R_FPSR; -// OBSOLETE break; -// OBSOLETE case FPCR_REGNUM: -// OBSOLETE word_offset = R_FPCR; -// OBSOLETE break; -// OBSOLETE case SXIP_REGNUM: -// OBSOLETE word_offset = R_EXIP; -// OBSOLETE break; -// OBSOLETE case SNIP_REGNUM: -// OBSOLETE word_offset = R_ENIP; -// OBSOLETE break; -// OBSOLETE case SFIP_REGNUM: -// OBSOLETE word_offset = R_EFIP; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE if (regno <= FP_REGNUM) -// OBSOLETE word_offset = regno; -// OBSOLETE else -// OBSOLETE word_offset = ((regno - X0_REGNUM) * 4); -// OBSOLETE } -// OBSOLETE return (word_offset * 4); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif /* _ES_MP */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_m88k_nat (void) -// OBSOLETE { -// OBSOLETE #ifdef _ES_MP -// OBSOLETE /* Enable 88110 support, as we don't support the 88100 under ES/MP. */ -// OBSOLETE -// OBSOLETE target_is_m88110 = 1; -// OBSOLETE #elif defined(_CX_UX) -// OBSOLETE /* Determine whether we're running on an 88100 or an 88110. */ -// OBSOLETE target_is_m88110 = (sinfo (SYSMACHINE, 0) == SYS5800); -// OBSOLETE #endif /* _CX_UX */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE #ifdef _ES_MP -// OBSOLETE /* Given a pointer to a general register set in /proc format (gregset_t *), -// OBSOLETE unpack the register contents and supply them as gdb's idea of the current -// OBSOLETE register values. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE supply_gregset (gregset_t *gregsetp) -// OBSOLETE { -// OBSOLETE register int regi; -// OBSOLETE register greg_t *regp = (greg_t *) gregsetp; -// OBSOLETE -// OBSOLETE for (regi = 0; regi < R_R31; regi++) -// OBSOLETE { -// OBSOLETE supply_register (regi, (char *) (regp + regi)); -// OBSOLETE } -// OBSOLETE supply_register (PSR_REGNUM, (char *) (regp + R_EPSR)); -// OBSOLETE supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR)); -// OBSOLETE supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR)); -// OBSOLETE supply_register (SXIP_REGNUM, (char *) (regp + R_EXIP)); -// OBSOLETE supply_register (SNIP_REGNUM, (char *) (regp + R_ENIP)); -// OBSOLETE supply_register (SFIP_REGNUM, (char *) (regp + R_EFIP)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given a pointer to a floating point register set in /proc format -// OBSOLETE (fpregset_t *), unpack the register contents and supply them as gdb's -// OBSOLETE idea of the current floating point register values. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE supply_fpregset (fpregset_t *fpregsetp) -// OBSOLETE { -// OBSOLETE register int regi; -// OBSOLETE char *from; -// OBSOLETE -// OBSOLETE for (regi = FP0_REGNUM; regi <= FPLAST_REGNUM; regi++) -// OBSOLETE { -// OBSOLETE from = (char *) &((*fpregsetp)[regi - FP0_REGNUM]); -// OBSOLETE supply_register (regi, from); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif /* _ES_MP */ -// OBSOLETE -// OBSOLETE #ifdef _CX_UX -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE unsigned int -// OBSOLETE m88k_harris_core_register_addr (int regno, int reg_ptr) -// OBSOLETE { -// OBSOLETE unsigned int word_offset; -// OBSOLETE -// OBSOLETE switch (regno) -// OBSOLETE { -// OBSOLETE case PSR_REGNUM: -// OBSOLETE word_offset = R_PSR; -// OBSOLETE break; -// OBSOLETE case FPSR_REGNUM: -// OBSOLETE word_offset = R_FPSR; -// OBSOLETE break; -// OBSOLETE case FPCR_REGNUM: -// OBSOLETE word_offset = R_FPCR; -// OBSOLETE break; -// OBSOLETE case SXIP_REGNUM: -// OBSOLETE word_offset = R_XIP; -// OBSOLETE break; -// OBSOLETE case SNIP_REGNUM: -// OBSOLETE word_offset = R_NIP; -// OBSOLETE break; -// OBSOLETE case SFIP_REGNUM: -// OBSOLETE word_offset = R_FIP; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE if (regno <= FP_REGNUM) -// OBSOLETE word_offset = regno; -// OBSOLETE else -// OBSOLETE word_offset = ((regno - X0_REGNUM) * 4) + R_X0; -// OBSOLETE } -// OBSOLETE return (word_offset * 4); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif /* _CX_UX */ diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 1b2987a..14fd95a 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -114,7 +114,7 @@ d10v_frame_chain_valid (CORE_ADDR chain, struct frame_info *frame) { if (chain != 0 && frame != NULL) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return 1; /* Path back from a call dummy must be valid. */ return ((frame)->pc > IMEM_START && !inside_main_func (frame->pc)); @@ -512,7 +512,7 @@ d10v_extract_struct_value_address (char *regbuf) static CORE_ADDR d10v_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return d10v_make_iaddr (deprecated_read_register_dummy (frame->pc, frame->frame, PC_REGNUM)); @@ -547,7 +547,7 @@ do_d10v_pop_frame (struct frame_info *fi) int regnum; char raw_buffer[8]; - fp = FRAME_FP (fi); + fp = get_frame_base (fi); /* fill out fsr with the address of where each */ /* register was stored in the frame */ d10v_frame_init_saved_regs (fi); @@ -677,10 +677,10 @@ d10v_skip_prologue (CORE_ADDR pc) return pc; } -/* 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. - */ +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. */ static CORE_ADDR d10v_frame_chain (struct frame_info *fi) @@ -688,7 +688,7 @@ d10v_frame_chain (struct frame_info *fi) CORE_ADDR addr; /* A generic call dummy's frame is the same as caller's. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return fi->frame; d10v_frame_init_saved_regs (fi); @@ -699,7 +699,7 @@ d10v_frame_chain (struct frame_info *fi) { /* This is meant to halt the backtrace at "_start". Make sure we don't halt it at a generic dummy frame. */ - if (!PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0)) + if (!DEPRECATED_PC_IN_CALL_DUMMY (fi->extra_info->return_pc, 0, 0)) return (CORE_ADDR) 0; } @@ -911,13 +911,13 @@ d10v_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* If fi->pc is zero, but this is not the outermost frame, then let's snatch the return_pc from the callee, so that - PC_IN_CALL_DUMMY will work. */ + DEPRECATED_PC_IN_CALL_DUMMY will work. */ if (fi->pc == 0 && fi->level != 0 && fi->next != NULL) fi->pc = d10v_frame_saved_pc (fi->next); /* The call dummy doesn't save any registers on the stack, so we can return now. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { return; } @@ -1518,6 +1518,10 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + switch (info.bfd_arch_info->mach) { case bfd_mach_d10v_ts2: @@ -1592,19 +1596,15 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) "d10v_gdbarch_init: bad byte order for float format"); } - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_words (gdbarch, d10v_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (d10v_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_deprecated_extract_return_value (gdbarch, d10v_extract_return_value); @@ -1635,8 +1635,7 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, d10v_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, d10v_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, d10v_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); + set_gdbarch_saved_pc_after_call (gdbarch, d10v_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_stack_align (gdbarch, d10v_stack_align); diff --git a/gdb/d30v-tdep.c b/gdb/d30v-tdep.c deleted file mode 100644 index 0891370..0000000 --- a/gdb/d30v-tdep.c +++ /dev/null @@ -1,1365 +0,0 @@ -/* OBSOLETE /* Target-dependent code for Mitsubishi D30V, for GDB. */ -/* OBSOLETE */ -/* OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software */ -/* OBSOLETE Foundation, Inc. */ -/* OBSOLETE */ -/* OBSOLETE This file is part of GDB. */ -/* OBSOLETE */ -/* OBSOLETE This program is free software; you can redistribute it and/or modify */ -/* OBSOLETE it under the terms of the GNU General Public License as published by */ -/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */ -/* OBSOLETE (at your option) any later version. */ -/* OBSOLETE */ -/* OBSOLETE This program is distributed in the hope that it will be useful, */ -/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */ -/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ -/* OBSOLETE GNU General Public License for more details. */ -/* OBSOLETE */ -/* OBSOLETE You should have received a copy of the GNU General Public License */ -/* OBSOLETE along with this program; if not, write to the Free Software */ -/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */ -/* OBSOLETE Boston, MA 02111-1307, USA. */ */ -/* OBSOLETE */ -/* OBSOLETE /* Contributed by Martin Hunt, hunt@cygnus.com */ */ -/* OBSOLETE */ -/* OBSOLETE #include "defs.h" */ -/* OBSOLETE #include "frame.h" */ -/* OBSOLETE #include "obstack.h" */ -/* OBSOLETE #include "symtab.h" */ -/* OBSOLETE #include "gdbtypes.h" */ -/* OBSOLETE #include "gdbcmd.h" */ -/* OBSOLETE #include "gdbcore.h" */ -/* OBSOLETE #include "gdb_string.h" */ -/* OBSOLETE #include "value.h" */ -/* OBSOLETE #include "inferior.h" */ -/* OBSOLETE #include "dis-asm.h" */ -/* OBSOLETE #include "symfile.h" */ -/* OBSOLETE #include "objfiles.h" */ -/* OBSOLETE #include "regcache.h" */ -/* OBSOLETE */ -/* OBSOLETE #include "language.h" /* For local_hex_string() */ */ -/* OBSOLETE */ -/* OBSOLETE void d30v_frame_find_saved_regs (struct frame_info *fi, */ -/* OBSOLETE struct frame_saved_regs *fsr); */ -/* OBSOLETE void d30v_frame_find_saved_regs_offsets (struct frame_info *fi, */ -/* OBSOLETE struct frame_saved_regs *fsr); */ -/* OBSOLETE static void d30v_pop_dummy_frame (struct frame_info *fi); */ -/* OBSOLETE static void d30v_print_flags (void); */ -/* OBSOLETE static void print_flags_command (char *, int); */ -/* OBSOLETE */ -/* OBSOLETE /* the following defines assume: */ -/* OBSOLETE fp is r61, lr is r62, sp is r63, and ?? is r22 */ -/* OBSOLETE if that changes, they will need to be updated */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_MASK_ALL_BUT_RA 0x0ffc0fff /* throw away Ra, keep the rest */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_STW_SPM 0x054c0fc0 /* stw Ra, @(sp-) */ */ -/* OBSOLETE #define OP_STW_SP_R0 0x05400fc0 /* stw Ra, @(sp,r0) */ */ -/* OBSOLETE #define OP_STW_SP_IMM0 0x05480fc0 /* st Ra, @(sp, 0x0) */ */ -/* OBSOLETE #define OP_STW_R22P_R0 0x05440580 /* stw Ra, @(r22+,r0) */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_ST2W_SPM 0x056c0fc0 /* st2w Ra, @(sp-) */ */ -/* OBSOLETE #define OP_ST2W_SP_R0 0x05600fc0 /* st2w Ra, @(sp, r0) */ */ -/* OBSOLETE #define OP_ST2W_SP_IMM0 0x05680fc0 /* st2w Ra, @(sp, 0x0) */ */ -/* OBSOLETE #define OP_ST2W_R22P_R0 0x05640580 /* st2w Ra, @(r22+, r0) */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_MASK_OPCODE 0x0ffc0000 /* just the opcode, ign operands */ */ -/* OBSOLETE #define OP_NOP 0x00f00000 /* nop */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_MASK_ALL_BUT_IMM 0x0fffffc0 /* throw away imm, keep the rest */ */ -/* OBSOLETE #define OP_SUB_SP_IMM 0x082bffc0 /* sub sp,sp,imm */ */ -/* OBSOLETE #define OP_ADD_SP_IMM 0x080bffc0 /* add sp,sp,imm */ */ -/* OBSOLETE #define OP_ADD_R22_SP_IMM 0x08096fc0 /* add r22,sp,imm */ */ -/* OBSOLETE #define OP_STW_FP_SP_IMM 0x054bdfc0 /* stw fp,@(sp,imm) */ */ -/* OBSOLETE #define OP_OR_SP_R0_IMM 0x03abf000 /* or sp,r0,imm */ */ -/* OBSOLETE */ -/* OBSOLETE /* no mask */ */ -/* OBSOLETE #define OP_OR_FP_R0_SP 0x03a3d03f /* or fp,r0,sp */ */ -/* OBSOLETE #define OP_OR_FP_SP_R0 0x03a3dfc0 /* or fp,sp,r0 */ */ -/* OBSOLETE #define OP_OR_FP_IMM0_SP 0x03abd03f /* or fp,0x0,sp */ */ -/* OBSOLETE #define OP_STW_FP_R22P_R0 0x0547d580 /* stw fp,@(r22+,r0) */ */ -/* OBSOLETE #define OP_STW_LR_R22P_R0 0x0547e580 /* stw lr,@(r22+,r0) */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_MASK_OP_AND_RB 0x0ff80fc0 /* keep op and rb,throw away rest */ */ -/* OBSOLETE #define OP_STW_SP_IMM 0x05480fc0 /* stw Ra,@(sp,imm) */ */ -/* OBSOLETE #define OP_ST2W_SP_IMM 0x05680fc0 /* st2w Ra,@(sp,imm) */ */ -/* OBSOLETE #define OP_STW_FP_IMM 0x05480f40 /* stw Ra,@(fp,imm) */ */ -/* OBSOLETE #define OP_STW_FP_R0 0x05400f40 /* stw Ra,@(fp,r0) */ */ -/* OBSOLETE */ -/* OBSOLETE #define OP_MASK_FM_BIT 0x80000000 */ -/* OBSOLETE #define OP_MASK_CC_BITS 0x70000000 */ -/* OBSOLETE #define OP_MASK_SUB_INST 0x0fffffff */ -/* OBSOLETE */ -/* OBSOLETE #define EXTRACT_RA(op) (((op) >> 12) & 0x3f) */ -/* OBSOLETE #define EXTRACT_RB(op) (((op) >> 6) & 0x3f) */ -/* OBSOLETE #define EXTRACT_RC(op) (((op) & 0x3f) */ -/* OBSOLETE #define EXTRACT_UIMM6(op) ((op) & 0x3f) */ -/* OBSOLETE #define EXTRACT_IMM6(op) ((((int)EXTRACT_UIMM6(op)) << 26) >> 26) */ -/* OBSOLETE #define EXTRACT_IMM26(op) ((((op)&0x0ff00000) >> 2) | ((op)&0x0003ffff)) */ -/* OBSOLETE #define EXTRACT_IMM32(opl, opr) ((EXTRACT_UIMM6(opl) << 26)|EXTRACT_IMM26(opr)) */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE int */ -/* OBSOLETE d30v_frame_chain_valid (CORE_ADDR chain, struct frame_info *fi) */ -/* OBSOLETE { */ -/* OBSOLETE #if 0 */ -/* OBSOLETE return ((chain) != 0 && (fi) != 0 && (fi)->return_pc != 0); */ -/* OBSOLETE #else */ -/* OBSOLETE return ((chain) != 0 && (fi) != 0 && (fi)->frame <= chain); */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Discard from the stack the innermost frame, restoring all saved */ -/* OBSOLETE registers. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_pop_frame (void) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_info *frame = get_current_frame (); */ -/* OBSOLETE CORE_ADDR fp; */ -/* OBSOLETE int regnum; */ -/* OBSOLETE struct frame_saved_regs fsr; */ -/* OBSOLETE char raw_buffer[8]; */ -/* OBSOLETE */ -/* OBSOLETE fp = FRAME_FP (frame); */ -/* OBSOLETE if (frame->dummy) */ -/* OBSOLETE { */ -/* OBSOLETE d30v_pop_dummy_frame (frame); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* fill out fsr with the address of where each */ */ -/* OBSOLETE /* register was stored in the frame */ */ -/* OBSOLETE get_frame_saved_regs (frame, &fsr); */ -/* OBSOLETE */ -/* OBSOLETE /* now update the current registers with the old values */ */ -/* OBSOLETE for (regnum = A0_REGNUM; regnum < A0_REGNUM + 2; regnum++) */ -/* OBSOLETE { */ -/* OBSOLETE if (fsr.regs[regnum]) */ -/* OBSOLETE { */ -/* OBSOLETE read_memory (fsr.regs[regnum], raw_buffer, 8); */ -/* OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 8); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE for (regnum = 0; regnum < SP_REGNUM; regnum++) */ -/* OBSOLETE { */ -/* OBSOLETE if (fsr.regs[regnum]) */ -/* OBSOLETE { */ -/* OBSOLETE write_register (regnum, read_memory_unsigned_integer (fsr.regs[regnum], 4)); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE if (fsr.regs[PSW_REGNUM]) */ -/* OBSOLETE { */ -/* OBSOLETE write_register (PSW_REGNUM, read_memory_unsigned_integer (fsr.regs[PSW_REGNUM], 4)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE write_register (PC_REGNUM, read_register (LR_REGNUM)); */ -/* OBSOLETE write_register (SP_REGNUM, fp + frame->size); */ -/* OBSOLETE target_store_registers (-1); */ -/* OBSOLETE flush_cached_frames (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE check_prologue (unsigned long op) */ -/* OBSOLETE { */ -/* OBSOLETE /* add sp,sp,imm -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* add r22,sp,imm -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* or fp,r0,sp -- observed */ */ -/* OBSOLETE if (op == OP_OR_FP_R0_SP) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* nop */ */ -/* OBSOLETE if ((op & OP_MASK_OPCODE) == OP_NOP) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra,@(sp,r0) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_R0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra,@(sp,0x0) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_IMM0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* st2w Ra,@(sp,r0) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_R0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* st2w Ra,@(sp,0x0) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_IMM0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw fp, @(r22+,r0) -- observed */ */ -/* OBSOLETE if (op == OP_STW_FP_R22P_R0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw r62, @(r22+,r0) -- observed */ */ -/* OBSOLETE if (op == OP_STW_LR_R22P_R0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra, @(fp,r0) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_FP_R0) */ -/* OBSOLETE return 1; /* first arg */ */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra, @(fp,imm) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_OP_AND_RB) == OP_STW_FP_IMM) */ -/* OBSOLETE return 1; /* second and subsequent args */ */ -/* OBSOLETE */ -/* OBSOLETE /* stw fp,@(sp,imm) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_STW_FP_SP_IMM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* st2w Ra,@(r22+,r0) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_R22P_R0) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra, @(sp-) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SPM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* st2w Ra, @(sp-) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SPM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* sub.? sp,sp,imm */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_SUB_SP_IMM) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE d30v_skip_prologue (CORE_ADDR pc) */ -/* OBSOLETE { */ -/* OBSOLETE unsigned long op[2]; */ -/* OBSOLETE unsigned long opl, opr; /* left / right sub operations */ */ -/* OBSOLETE unsigned long fm0, fm1; /* left / right mode bits */ */ -/* OBSOLETE unsigned long cc0, cc1; */ -/* OBSOLETE unsigned long op1, op2; */ -/* OBSOLETE CORE_ADDR func_addr, func_end; */ -/* OBSOLETE struct symtab_and_line sal; */ -/* OBSOLETE */ -/* OBSOLETE /* If we have line debugging information, then the end of the */ */ -/* OBSOLETE /* prologue should the first assembly instruction of the first source line */ */ -/* OBSOLETE if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) */ -/* OBSOLETE { */ -/* OBSOLETE sal = find_pc_line (func_addr, 0); */ -/* OBSOLETE if (sal.end && sal.end < func_end) */ -/* OBSOLETE return sal.end; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (target_read_memory (pc, (char *) &op[0], 8)) */ -/* OBSOLETE return pc; /* Can't access it -- assume no prologue. */ */ -/* OBSOLETE */ -/* OBSOLETE while (1) */ -/* OBSOLETE { */ -/* OBSOLETE opl = (unsigned long) read_memory_integer (pc, 4); */ -/* OBSOLETE opr = (unsigned long) read_memory_integer (pc + 4, 4); */ -/* OBSOLETE */ -/* OBSOLETE fm0 = (opl & OP_MASK_FM_BIT); */ -/* OBSOLETE fm1 = (opr & OP_MASK_FM_BIT); */ -/* OBSOLETE */ -/* OBSOLETE cc0 = (opl & OP_MASK_CC_BITS); */ -/* OBSOLETE cc1 = (opr & OP_MASK_CC_BITS); */ -/* OBSOLETE */ -/* OBSOLETE opl = (opl & OP_MASK_SUB_INST); */ -/* OBSOLETE opr = (opr & OP_MASK_SUB_INST); */ -/* OBSOLETE */ -/* OBSOLETE if (fm0 && fm1) */ -/* OBSOLETE { */ -/* OBSOLETE /* long instruction (opl contains the opcode) */ */ -/* OBSOLETE if (((opl & OP_MASK_ALL_BUT_IMM) != OP_ADD_SP_IMM) && /* add sp,sp,imm */ */ -/* OBSOLETE ((opl & OP_MASK_ALL_BUT_IMM) != OP_ADD_R22_SP_IMM) && /* add r22,sp,imm */ */ -/* OBSOLETE ((opl & OP_MASK_OP_AND_RB) != OP_STW_SP_IMM) && /* stw Ra, @(sp,imm) */ */ -/* OBSOLETE ((opl & OP_MASK_OP_AND_RB) != OP_ST2W_SP_IMM)) /* st2w Ra, @(sp,imm) */ */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* short instructions */ */ -/* OBSOLETE if (fm0 && !fm1) */ -/* OBSOLETE { */ -/* OBSOLETE op1 = opr; */ -/* OBSOLETE op2 = opl; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE op1 = opl; */ -/* OBSOLETE op2 = opr; */ -/* OBSOLETE } */ -/* OBSOLETE if (check_prologue (op1)) */ -/* OBSOLETE { */ -/* OBSOLETE if (!check_prologue (op2)) */ -/* OBSOLETE { */ -/* OBSOLETE /* if the previous opcode was really part of the prologue */ */ -/* OBSOLETE /* and not just a NOP, then we want to break after both instructions */ */ -/* OBSOLETE if ((op1 & OP_MASK_OPCODE) != OP_NOP) */ -/* OBSOLETE pc += 8; */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE pc += 8; */ -/* OBSOLETE } */ -/* OBSOLETE return pc; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static int end_of_stack; */ -/* OBSOLETE */ -/* OBSOLETE /* Given a GDB frame, determine the address of the calling function's frame. */ -/* OBSOLETE This will be used to create a new GDB frame struct, and then */ -/* OBSOLETE INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. */ -/* OBSOLETE */ */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE d30v_frame_chain (struct frame_info *frame) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_saved_regs fsr; */ -/* OBSOLETE */ -/* OBSOLETE d30v_frame_find_saved_regs (frame, &fsr); */ -/* OBSOLETE */ -/* OBSOLETE if (end_of_stack) */ -/* OBSOLETE return (CORE_ADDR) 0; */ -/* OBSOLETE */ -/* OBSOLETE if (frame->return_pc == IMEM_START) */ -/* OBSOLETE return (CORE_ADDR) 0; */ -/* OBSOLETE */ -/* OBSOLETE if (!fsr.regs[FP_REGNUM]) */ -/* OBSOLETE { */ -/* OBSOLETE if (!fsr.regs[SP_REGNUM] || fsr.regs[SP_REGNUM] == STACK_START) */ -/* OBSOLETE return (CORE_ADDR) 0; */ -/* OBSOLETE */ -/* OBSOLETE return fsr.regs[SP_REGNUM]; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (!read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4)) */ -/* OBSOLETE return (CORE_ADDR) 0; */ -/* OBSOLETE */ -/* OBSOLETE return read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static int next_addr, uses_frame; */ -/* OBSOLETE static int frame_size; */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE prologue_find_regs (unsigned long op, struct frame_saved_regs *fsr, */ -/* OBSOLETE CORE_ADDR addr) */ -/* OBSOLETE { */ -/* OBSOLETE int n; */ -/* OBSOLETE int offset; */ -/* OBSOLETE */ -/* OBSOLETE /* add sp,sp,imm -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE offset = EXTRACT_IMM6 (op); */ -/* OBSOLETE /*next_addr += offset; */ */ -/* OBSOLETE frame_size += -offset; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* add r22,sp,imm -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE offset = EXTRACT_IMM6 (op); */ -/* OBSOLETE next_addr = (offset - frame_size); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra, @(fp, offset) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_OP_AND_RB) == OP_STW_FP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE offset = EXTRACT_IMM6 (op); */ -/* OBSOLETE fsr->regs[n] = (offset - frame_size); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra, @(fp, r0) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_FP_R0) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = (-frame_size); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* or fp,0,sp -- observed */ */ -/* OBSOLETE if ((op == OP_OR_FP_R0_SP) || */ -/* OBSOLETE (op == OP_OR_FP_SP_R0) || */ -/* OBSOLETE (op == OP_OR_FP_IMM0_SP)) */ -/* OBSOLETE { */ -/* OBSOLETE uses_frame = 1; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* nop */ */ -/* OBSOLETE if ((op & OP_MASK_OPCODE) == OP_NOP) */ -/* OBSOLETE return 1; */ -/* OBSOLETE */ -/* OBSOLETE /* stw Ra,@(r22+,r0) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_R22P_R0) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = next_addr; */ -/* OBSOLETE next_addr += 4; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE #if 0 /* subsumed in pattern above */ */ -/* OBSOLETE /* stw fp,@(r22+,r0) -- observed */ */ -/* OBSOLETE if (op == OP_STW_FP_R22P_R0) */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[FP_REGNUM] = next_addr; /* XXX */ */ -/* OBSOLETE next_addr += 4; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* stw r62,@(r22+,r0) -- observed */ */ -/* OBSOLETE if (op == OP_STW_LR_R22P_R0) */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[LR_REGNUM] = next_addr; */ -/* OBSOLETE next_addr += 4; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE /* st2w Ra,@(r22+,r0) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_R22P_R0) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = next_addr; */ -/* OBSOLETE fsr->regs[n + 1] = next_addr + 4; */ -/* OBSOLETE next_addr += 8; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* stw rn, @(sp-) */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SPM) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = next_addr; */ -/* OBSOLETE next_addr -= 4; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* st2w Ra, @(sp-) */ */ -/* OBSOLETE else if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SPM) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = next_addr; */ -/* OBSOLETE fsr->regs[n + 1] = next_addr + 4; */ -/* OBSOLETE next_addr -= 8; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* sub sp,sp,imm */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_SUB_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE offset = EXTRACT_IMM6 (op); */ -/* OBSOLETE frame_size += -offset; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* st rn, @(sp,0) -- observed */ */ -/* OBSOLETE if (((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_R0) || */ -/* OBSOLETE ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_IMM0)) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = (-frame_size); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* st2w rn, @(sp,0) */ */ -/* OBSOLETE if (((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_R0) || */ -/* OBSOLETE ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_IMM0)) */ -/* OBSOLETE { */ -/* OBSOLETE n = EXTRACT_RA (op); */ -/* OBSOLETE fsr->regs[n] = (-frame_size); */ -/* OBSOLETE fsr->regs[n + 1] = (-frame_size) + 4; */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* stw fp,@(sp,imm) -- observed */ */ -/* OBSOLETE if ((op & OP_MASK_ALL_BUT_IMM) == OP_STW_FP_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE offset = EXTRACT_IMM6 (op); */ -/* OBSOLETE fsr->regs[FP_REGNUM] = (offset - frame_size); */ -/* OBSOLETE return 1; */ -/* OBSOLETE } */ -/* OBSOLETE return 0; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, the */ -/* OBSOLETE addresses of the saved registers of frame described by FRAME_INFO. */ -/* OBSOLETE This includes special registers such as pc and fp saved in special */ -/* OBSOLETE ways in the stack frame. sp is even more special: the address we */ -/* OBSOLETE return for it IS the sp for the next frame. */ */ -/* OBSOLETE void */ -/* OBSOLETE d30v_frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR fp, pc; */ -/* OBSOLETE unsigned long opl, opr; */ -/* OBSOLETE unsigned long op1, op2; */ -/* OBSOLETE unsigned long fm0, fm1; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE fp = fi->frame; */ -/* OBSOLETE memset (fsr, 0, sizeof (*fsr)); */ -/* OBSOLETE next_addr = 0; */ -/* OBSOLETE frame_size = 0; */ -/* OBSOLETE end_of_stack = 0; */ -/* OBSOLETE */ -/* OBSOLETE uses_frame = 0; */ -/* OBSOLETE */ -/* OBSOLETE d30v_frame_find_saved_regs_offsets (fi, fsr); */ -/* OBSOLETE */ -/* OBSOLETE fi->size = frame_size; */ -/* OBSOLETE */ -/* OBSOLETE if (!fp) */ -/* OBSOLETE fp = read_register (SP_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < NUM_REGS - 1; i++) */ -/* OBSOLETE if (fsr->regs[i]) */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[i] = fsr->regs[i] + fp + frame_size; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (fsr->regs[LR_REGNUM]) */ -/* OBSOLETE fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4); */ -/* OBSOLETE else */ -/* OBSOLETE fi->return_pc = read_register (LR_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* the SP is not normally (ever?) saved, but check anyway */ */ -/* OBSOLETE if (!fsr->regs[SP_REGNUM]) */ -/* OBSOLETE { */ -/* OBSOLETE /* if the FP was saved, that means the current FP is valid, */ */ -/* OBSOLETE /* otherwise, it isn't being used, so we use the SP instead */ */ -/* OBSOLETE if (uses_frame) */ -/* OBSOLETE fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[SP_REGNUM] = fp + fi->size; */ -/* OBSOLETE fi->frameless = 1; */ -/* OBSOLETE fsr->regs[FP_REGNUM] = 0; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_frame_find_saved_regs_offsets (struct frame_info *fi, */ -/* OBSOLETE struct frame_saved_regs *fsr) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR fp, pc; */ -/* OBSOLETE unsigned long opl, opr; */ -/* OBSOLETE unsigned long op1, op2; */ -/* OBSOLETE unsigned long fm0, fm1; */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE fp = fi->frame; */ -/* OBSOLETE memset (fsr, 0, sizeof (*fsr)); */ -/* OBSOLETE next_addr = 0; */ -/* OBSOLETE frame_size = 0; */ -/* OBSOLETE end_of_stack = 0; */ -/* OBSOLETE */ -/* OBSOLETE pc = get_pc_function_start (fi->pc); */ -/* OBSOLETE */ -/* OBSOLETE uses_frame = 0; */ -/* OBSOLETE while (pc < fi->pc) */ -/* OBSOLETE { */ -/* OBSOLETE opl = (unsigned long) read_memory_integer (pc, 4); */ -/* OBSOLETE opr = (unsigned long) read_memory_integer (pc + 4, 4); */ -/* OBSOLETE */ -/* OBSOLETE fm0 = (opl & OP_MASK_FM_BIT); */ -/* OBSOLETE fm1 = (opr & OP_MASK_FM_BIT); */ -/* OBSOLETE */ -/* OBSOLETE opl = (opl & OP_MASK_SUB_INST); */ -/* OBSOLETE opr = (opr & OP_MASK_SUB_INST); */ -/* OBSOLETE */ -/* OBSOLETE if (fm0 && fm1) */ -/* OBSOLETE { */ -/* OBSOLETE /* long instruction */ */ -/* OBSOLETE if ((opl & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE /* add sp,sp,n */ */ -/* OBSOLETE long offset = EXTRACT_IMM32 (opl, opr); */ -/* OBSOLETE frame_size += -offset; */ -/* OBSOLETE } */ -/* OBSOLETE else if ((opl & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE /* add r22,sp,offset */ */ -/* OBSOLETE long offset = EXTRACT_IMM32 (opl, opr); */ -/* OBSOLETE next_addr = (offset - frame_size); */ -/* OBSOLETE } */ -/* OBSOLETE else if ((opl & OP_MASK_OP_AND_RB) == OP_STW_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE /* st Ra, @(sp,imm) */ */ -/* OBSOLETE long offset = EXTRACT_IMM32 (opl, opr); */ -/* OBSOLETE short n = EXTRACT_RA (opl); */ -/* OBSOLETE fsr->regs[n] = (offset - frame_size); */ -/* OBSOLETE } */ -/* OBSOLETE else if ((opl & OP_MASK_OP_AND_RB) == OP_ST2W_SP_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE /* st2w Ra, @(sp,offset) */ */ -/* OBSOLETE long offset = EXTRACT_IMM32 (opl, opr); */ -/* OBSOLETE short n = EXTRACT_RA (opl); */ -/* OBSOLETE fsr->regs[n] = (offset - frame_size); */ -/* OBSOLETE fsr->regs[n + 1] = (offset - frame_size) + 4; */ -/* OBSOLETE } */ -/* OBSOLETE else if ((opl & OP_MASK_ALL_BUT_IMM) == OP_OR_SP_R0_IMM) */ -/* OBSOLETE { */ -/* OBSOLETE end_of_stack = 1; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* short instructions */ */ -/* OBSOLETE if (fm0 && !fm1) */ -/* OBSOLETE { */ -/* OBSOLETE op2 = opl; */ -/* OBSOLETE op1 = opr; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE op1 = opl; */ -/* OBSOLETE op2 = opr; */ -/* OBSOLETE } */ -/* OBSOLETE if (!prologue_find_regs (op1, fsr, pc) || !prologue_find_regs (op2, fsr, pc)) */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE pc += 8; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE #if 0 */ -/* OBSOLETE fi->size = frame_size; */ -/* OBSOLETE */ -/* OBSOLETE if (!fp) */ -/* OBSOLETE fp = read_register (SP_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < NUM_REGS - 1; i++) */ -/* OBSOLETE if (fsr->regs[i]) */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[i] = fsr->regs[i] + fp + frame_size; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE if (fsr->regs[LR_REGNUM]) */ -/* OBSOLETE fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4); */ -/* OBSOLETE else */ -/* OBSOLETE fi->return_pc = read_register (LR_REGNUM); */ -/* OBSOLETE */ -/* OBSOLETE /* the SP is not normally (ever?) saved, but check anyway */ */ -/* OBSOLETE if (!fsr->regs[SP_REGNUM]) */ -/* OBSOLETE { */ -/* OBSOLETE /* if the FP was saved, that means the current FP is valid, */ */ -/* OBSOLETE /* otherwise, it isn't being used, so we use the SP instead */ */ -/* OBSOLETE if (uses_frame) */ -/* OBSOLETE fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size; */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE fsr->regs[SP_REGNUM] = fp + fi->size; */ -/* OBSOLETE fi->frameless = 1; */ -/* OBSOLETE fsr->regs[FP_REGNUM] = 0; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi) */ -/* OBSOLETE { */ -/* OBSOLETE struct frame_saved_regs dummy; */ -/* OBSOLETE */ -/* OBSOLETE if (fi->next && (fi->pc == 0)) */ -/* OBSOLETE fi->pc = fi->next->return_pc; */ -/* OBSOLETE */ -/* OBSOLETE d30v_frame_find_saved_regs_offsets (fi, &dummy); */ -/* OBSOLETE */ -/* OBSOLETE if (uses_frame == 0) */ -/* OBSOLETE fi->frameless = 1; */ -/* OBSOLETE else */ -/* OBSOLETE fi->frameless = 0; */ -/* OBSOLETE */ -/* OBSOLETE if ((fi->next == 0) && (uses_frame == 0)) */ -/* OBSOLETE /* innermost frame and it's "frameless", */ -/* OBSOLETE so the fi->frame field is wrong, fix it! */ */ -/* OBSOLETE fi->frame = read_sp (); */ -/* OBSOLETE */ -/* OBSOLETE if (dummy.regs[LR_REGNUM]) */ -/* OBSOLETE { */ -/* OBSOLETE /* it was saved, grab it! */ */ -/* OBSOLETE dummy.regs[LR_REGNUM] += (fi->frame + frame_size); */ -/* OBSOLETE fi->return_pc = read_memory_unsigned_integer (dummy.regs[LR_REGNUM], 4); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE fi->return_pc = read_register (LR_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_init_frame_pc (int fromleaf, struct frame_info *prev) */ -/* OBSOLETE { */ -/* OBSOLETE /* default value, put here so we can breakpoint on it and */ -/* OBSOLETE see if the default value is really the right thing to use */ */ -/* OBSOLETE prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \ */ -/* OBSOLETE prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void d30v_print_register (int regnum, int tabular); */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE d30v_print_register (int regnum, int tabular) */ -/* OBSOLETE { */ -/* OBSOLETE if (regnum < A0_REGNUM) */ -/* OBSOLETE { */ -/* OBSOLETE if (tabular) */ -/* OBSOLETE printf_filtered ("%08lx", (long) read_register (regnum)); */ -/* OBSOLETE else */ -/* OBSOLETE printf_filtered ("0x%lx %ld", */ -/* OBSOLETE (long) read_register (regnum), */ -/* OBSOLETE (long) read_register (regnum)); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE char regbuf[MAX_REGISTER_RAW_SIZE]; */ -/* OBSOLETE */ -/* OBSOLETE frame_register_read (selected_frame, regnum, regbuf); */ -/* OBSOLETE */ -/* OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0, */ -/* OBSOLETE gdb_stdout, 'x', 1, 0, Val_pretty_default); */ -/* OBSOLETE */ -/* OBSOLETE if (!tabular) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered (" "); */ -/* OBSOLETE val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0, */ -/* OBSOLETE gdb_stdout, 'd', 1, 0, Val_pretty_default); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE d30v_print_flags (void) */ -/* OBSOLETE { */ -/* OBSOLETE long psw = read_register (PSW_REGNUM); */ -/* OBSOLETE printf_filtered ("flags #1"); */ -/* OBSOLETE printf_filtered (" (sm) %d", (psw & PSW_SM) != 0); */ -/* OBSOLETE printf_filtered (" (ea) %d", (psw & PSW_EA) != 0); */ -/* OBSOLETE printf_filtered (" (db) %d", (psw & PSW_DB) != 0); */ -/* OBSOLETE printf_filtered (" (ds) %d", (psw & PSW_DS) != 0); */ -/* OBSOLETE printf_filtered (" (ie) %d", (psw & PSW_IE) != 0); */ -/* OBSOLETE printf_filtered (" (rp) %d", (psw & PSW_RP) != 0); */ -/* OBSOLETE printf_filtered (" (md) %d\n", (psw & PSW_MD) != 0); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("flags #2"); */ -/* OBSOLETE printf_filtered (" (f0) %d", (psw & PSW_F0) != 0); */ -/* OBSOLETE printf_filtered (" (f1) %d", (psw & PSW_F1) != 0); */ -/* OBSOLETE printf_filtered (" (f2) %d", (psw & PSW_F2) != 0); */ -/* OBSOLETE printf_filtered (" (f3) %d", (psw & PSW_F3) != 0); */ -/* OBSOLETE printf_filtered (" (s) %d", (psw & PSW_S) != 0); */ -/* OBSOLETE printf_filtered (" (v) %d", (psw & PSW_V) != 0); */ -/* OBSOLETE printf_filtered (" (va) %d", (psw & PSW_VA) != 0); */ -/* OBSOLETE printf_filtered (" (c) %d\n", (psw & PSW_C) != 0); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE print_flags_command (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE d30v_print_flags (); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_do_registers_info (int regnum, int fpregs) */ -/* OBSOLETE { */ -/* OBSOLETE long long num1, num2; */ -/* OBSOLETE long psw; */ -/* OBSOLETE */ -/* OBSOLETE if (regnum != -1) */ -/* OBSOLETE { */ -/* OBSOLETE if (REGISTER_NAME (0) == NULL || REGISTER_NAME (0)[0] == '\000') */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("%s ", REGISTER_NAME (regnum)); */ -/* OBSOLETE d30v_print_register (regnum, 0); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE return; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Have to print all the registers. Format them nicely. */ */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("PC="); */ -/* OBSOLETE print_address (read_pc (), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" PSW="); */ -/* OBSOLETE d30v_print_register (PSW_REGNUM, 1); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" BPC="); */ -/* OBSOLETE print_address (read_register (BPC_REGNUM), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" BPSW="); */ -/* OBSOLETE d30v_print_register (BPSW_REGNUM, 1); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("DPC="); */ -/* OBSOLETE print_address (read_register (DPC_REGNUM), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" DPSW="); */ -/* OBSOLETE d30v_print_register (DPSW_REGNUM, 1); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" IBA="); */ -/* OBSOLETE print_address (read_register (IBA_REGNUM), gdb_stdout); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("RPT_C="); */ -/* OBSOLETE d30v_print_register (RPT_C_REGNUM, 1); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" RPT_S="); */ -/* OBSOLETE print_address (read_register (RPT_S_REGNUM), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" RPT_E="); */ -/* OBSOLETE print_address (read_register (RPT_E_REGNUM), gdb_stdout); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("MOD_S="); */ -/* OBSOLETE print_address (read_register (MOD_S_REGNUM), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" MOD_E="); */ -/* OBSOLETE print_address (read_register (MOD_E_REGNUM), gdb_stdout); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("EIT_VB="); */ -/* OBSOLETE print_address (read_register (EIT_VB_REGNUM), gdb_stdout); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" INT_S="); */ -/* OBSOLETE d30v_print_register (INT_S_REGNUM, 1); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered (" INT_M="); */ -/* OBSOLETE d30v_print_register (INT_M_REGNUM, 1); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE */ -/* OBSOLETE d30v_print_flags (); */ -/* OBSOLETE for (regnum = 0; regnum <= 63;) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("R%d-R%d ", regnum, regnum + 7); */ -/* OBSOLETE if (regnum < 10) */ -/* OBSOLETE printf_filtered (" "); */ -/* OBSOLETE if (regnum + 7 < 10) */ -/* OBSOLETE printf_filtered (" "); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < 8; i++) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered (" "); */ -/* OBSOLETE d30v_print_register (regnum++, 1); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("A0-A1 "); */ -/* OBSOLETE */ -/* OBSOLETE d30v_print_register (A0_REGNUM, 1); */ -/* OBSOLETE printf_filtered (" "); */ -/* OBSOLETE d30v_print_register (A1_REGNUM, 1); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE d30v_fix_call_dummy (char *dummyname, CORE_ADDR start_sp, CORE_ADDR fun, */ -/* OBSOLETE int nargs, struct value **args, */ -/* OBSOLETE struct type *type, int gcc_p) */ -/* OBSOLETE { */ -/* OBSOLETE int regnum; */ -/* OBSOLETE CORE_ADDR sp; */ -/* OBSOLETE char buffer[MAX_REGISTER_RAW_SIZE]; */ -/* OBSOLETE struct frame_info *frame = get_current_frame (); */ -/* OBSOLETE frame->dummy = start_sp; */ -/* OBSOLETE /*start_sp |= DMEM_START; */ */ -/* OBSOLETE */ -/* OBSOLETE sp = start_sp; */ -/* OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++) */ -/* OBSOLETE { */ -/* OBSOLETE sp -= REGISTER_RAW_SIZE (regnum); */ -/* OBSOLETE store_address (buffer, REGISTER_RAW_SIZE (regnum), read_register (regnum)); */ -/* OBSOLETE write_memory (sp, buffer, REGISTER_RAW_SIZE (regnum)); */ -/* OBSOLETE } */ -/* OBSOLETE write_register (SP_REGNUM, (LONGEST) sp); */ -/* OBSOLETE /* now we need to load LR with the return address */ */ -/* OBSOLETE write_register (LR_REGNUM, (LONGEST) d30v_call_dummy_address ()); */ -/* OBSOLETE return sp; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE d30v_pop_dummy_frame (struct frame_info *fi) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR sp = fi->dummy; */ -/* OBSOLETE int regnum; */ -/* OBSOLETE */ -/* OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++) */ -/* OBSOLETE { */ -/* OBSOLETE sp -= REGISTER_RAW_SIZE (regnum); */ -/* OBSOLETE write_register (regnum, read_memory_unsigned_integer (sp, REGISTER_RAW_SIZE (regnum))); */ -/* OBSOLETE } */ -/* OBSOLETE flush_cached_frames (); /* needed? */ */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE d30v_push_arguments (int nargs, struct value **args, CORE_ADDR sp, */ -/* OBSOLETE int struct_return, CORE_ADDR struct_addr) */ -/* OBSOLETE { */ -/* OBSOLETE int i, len, index = 0, regnum = 2; */ -/* OBSOLETE char buffer[4], *contents; */ -/* OBSOLETE LONGEST val; */ -/* OBSOLETE CORE_ADDR ptrs[10]; */ -/* OBSOLETE */ -/* OBSOLETE #if 0 */ -/* OBSOLETE /* Pass 1. Put all large args on stack */ */ -/* OBSOLETE for (i = 0; i < nargs; i++) */ -/* OBSOLETE { */ -/* OBSOLETE struct value *arg = args[i]; */ -/* OBSOLETE struct type *arg_type = check_typedef (VALUE_TYPE (arg)); */ -/* OBSOLETE len = TYPE_LENGTH (arg_type); */ -/* OBSOLETE contents = VALUE_CONTENTS (arg); */ -/* OBSOLETE val = extract_signed_integer (contents, len); */ -/* OBSOLETE if (len > 4) */ -/* OBSOLETE { */ -/* OBSOLETE /* put on stack and pass pointers */ */ -/* OBSOLETE sp -= len; */ -/* OBSOLETE write_memory (sp, contents, len); */ -/* OBSOLETE ptrs[index++] = sp; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE #endif */ -/* OBSOLETE index = 0; */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < nargs; i++) */ -/* OBSOLETE { */ -/* OBSOLETE struct value *arg = args[i]; */ -/* OBSOLETE struct type *arg_type = check_typedef (VALUE_TYPE (arg)); */ -/* OBSOLETE len = TYPE_LENGTH (arg_type); */ -/* OBSOLETE contents = VALUE_CONTENTS (arg); */ -/* OBSOLETE if (len > 4) */ -/* OBSOLETE { */ -/* OBSOLETE /* we need multiple registers */ */ -/* OBSOLETE int ndx; */ -/* OBSOLETE */ -/* OBSOLETE for (ndx = 0; len > 0; ndx += 8, len -= 8) */ -/* OBSOLETE { */ -/* OBSOLETE if (regnum & 1) */ -/* OBSOLETE regnum++; /* all args > 4 bytes start in even register */ */ -/* OBSOLETE */ -/* OBSOLETE if (regnum < 18) */ -/* OBSOLETE { */ -/* OBSOLETE val = extract_signed_integer (&contents[ndx], 4); */ -/* OBSOLETE write_register (regnum++, val); */ -/* OBSOLETE */ -/* OBSOLETE if (len >= 8) */ -/* OBSOLETE val = extract_signed_integer (&contents[ndx + 4], 4); */ -/* OBSOLETE else */ -/* OBSOLETE val = extract_signed_integer (&contents[ndx + 4], len - 4); */ -/* OBSOLETE write_register (regnum++, val); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* no more registers available. put it on the stack */ */ -/* OBSOLETE */ -/* OBSOLETE /* all args > 4 bytes are padded to a multiple of 8 bytes */ -/* OBSOLETE and start on an 8 byte boundary */ */ -/* OBSOLETE if (sp & 7) */ -/* OBSOLETE sp -= (sp & 7); /* align it */ */ -/* OBSOLETE */ -/* OBSOLETE sp -= ((len + 7) & ~7); /* allocate space */ */ -/* OBSOLETE write_memory (sp, &contents[ndx], len); */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (regnum < 18) */ -/* OBSOLETE { */ -/* OBSOLETE val = extract_signed_integer (contents, len); */ -/* OBSOLETE write_register (regnum++, val); */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* all args are padded to a multiple of 4 bytes (at least) */ */ -/* OBSOLETE sp -= ((len + 3) & ~3); */ -/* OBSOLETE write_memory (sp, contents, len); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE if (sp & 7) */ -/* OBSOLETE /* stack pointer is not on an 8 byte boundary -- align it */ */ -/* OBSOLETE sp -= (sp & 7); */ -/* OBSOLETE return sp; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE */ -/* OBSOLETE /* pick an out-of-the-way place to set the return value */ */ -/* OBSOLETE /* for an inferior function call. The link register is set to this */ */ -/* OBSOLETE /* value and a momentary breakpoint is set there. When the breakpoint */ */ -/* OBSOLETE /* is hit, the dummy frame is popped and the previous environment is */ */ -/* OBSOLETE /* restored. */ */ -/* OBSOLETE */ -/* OBSOLETE CORE_ADDR */ -/* OBSOLETE d30v_call_dummy_address (void) */ -/* OBSOLETE { */ -/* OBSOLETE CORE_ADDR entry; */ -/* OBSOLETE struct minimal_symbol *sym; */ -/* OBSOLETE */ -/* OBSOLETE entry = entry_point_address (); */ -/* OBSOLETE */ -/* OBSOLETE if (entry != 0) */ -/* OBSOLETE return entry; */ -/* OBSOLETE */ -/* OBSOLETE sym = lookup_minimal_symbol ("_start", NULL, symfile_objfile); */ -/* OBSOLETE */ -/* OBSOLETE if (!sym || MSYMBOL_TYPE (sym) != mst_text) */ -/* OBSOLETE return 0; */ -/* OBSOLETE else */ -/* OBSOLETE return SYMBOL_VALUE_ADDRESS (sym); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Given a return value in `regbuf' with a type `valtype', */ -/* OBSOLETE extract and copy its value into `valbuf'. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_extract_return_value (struct type *valtype, char regbuf[REGISTER_BYTES], */ -/* OBSOLETE char *valbuf) */ -/* OBSOLETE { */ -/* OBSOLETE memcpy (valbuf, regbuf + REGISTER_BYTE (2), TYPE_LENGTH (valtype)); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* The following code implements access to, and display of, the D30V's */ -/* OBSOLETE instruction trace buffer. The buffer consists of 64K or more */ -/* OBSOLETE 4-byte words of data, of which each words includes an 8-bit count, */ -/* OBSOLETE an 8-bit segment number, and a 16-bit instruction address. */ -/* OBSOLETE */ -/* OBSOLETE In theory, the trace buffer is continuously capturing instruction */ -/* OBSOLETE data that the CPU presents on its "debug bus", but in practice, the */ -/* OBSOLETE ROMified GDB stub only enables tracing when it continues or steps */ -/* OBSOLETE the program, and stops tracing when the program stops; so it */ -/* OBSOLETE actually works for GDB to read the buffer counter out of memory and */ -/* OBSOLETE then read each trace word. The counter records where the tracing */ -/* OBSOLETE stops, but there is no record of where it started, so we remember */ -/* OBSOLETE the PC when we resumed and then search backwards in the trace */ -/* OBSOLETE buffer for a word that includes that address. This is not perfect, */ -/* OBSOLETE because you will miss trace data if the resumption PC is the target */ -/* OBSOLETE of a branch. (The value of the buffer counter is semi-random, any */ -/* OBSOLETE trace data from a previous program stop is gone.) */ */ -/* OBSOLETE */ -/* OBSOLETE /* The address of the last word recorded in the trace buffer. */ */ -/* OBSOLETE */ -/* OBSOLETE #define DBBC_ADDR (0xd80000) */ -/* OBSOLETE */ -/* OBSOLETE /* The base of the trace buffer, at least for the "Board_0". */ */ -/* OBSOLETE */ -/* OBSOLETE #define TRACE_BUFFER_BASE (0xf40000) */ -/* OBSOLETE */ -/* OBSOLETE static void trace_command (char *, int); */ -/* OBSOLETE */ -/* OBSOLETE static void untrace_command (char *, int); */ -/* OBSOLETE */ -/* OBSOLETE static void trace_info (char *, int); */ -/* OBSOLETE */ -/* OBSOLETE static void tdisassemble_command (char *, int); */ -/* OBSOLETE */ -/* OBSOLETE static void display_trace (int, int); */ -/* OBSOLETE */ -/* OBSOLETE /* True when instruction traces are being collected. */ */ -/* OBSOLETE */ -/* OBSOLETE static int tracing; */ -/* OBSOLETE */ -/* OBSOLETE /* Remembered PC. */ */ -/* OBSOLETE */ -/* OBSOLETE static CORE_ADDR last_pc; */ -/* OBSOLETE */ -/* OBSOLETE /* True when trace output should be displayed whenever program stops. */ */ -/* OBSOLETE */ -/* OBSOLETE static int trace_display; */ -/* OBSOLETE */ -/* OBSOLETE /* True when trace listing should include source lines. */ */ -/* OBSOLETE */ -/* OBSOLETE static int default_trace_show_source = 1; */ -/* OBSOLETE */ -/* OBSOLETE struct trace_buffer */ -/* OBSOLETE { */ -/* OBSOLETE int size; */ -/* OBSOLETE short *counts; */ -/* OBSOLETE CORE_ADDR *addrs; */ -/* OBSOLETE } */ -/* OBSOLETE trace_data; */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE trace_command (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE /* Clear the host-side trace buffer, allocating space if needed. */ */ -/* OBSOLETE trace_data.size = 0; */ -/* OBSOLETE if (trace_data.counts == NULL) */ -/* OBSOLETE trace_data.counts = (short *) xmalloc (65536 * sizeof (short)); */ -/* OBSOLETE if (trace_data.addrs == NULL) */ -/* OBSOLETE trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof (CORE_ADDR)); */ -/* OBSOLETE */ -/* OBSOLETE tracing = 1; */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("Tracing is now on.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE untrace_command (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE tracing = 0; */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("Tracing is now off.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE trace_info (char *args, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE int i; */ -/* OBSOLETE */ -/* OBSOLETE if (trace_data.size) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("%d entries in trace buffer:\n", trace_data.size); */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < trace_data.size; ++i) */ -/* OBSOLETE { */ -/* OBSOLETE printf_filtered ("%d: %d instruction%s at 0x%s\n", */ -/* OBSOLETE i, trace_data.counts[i], */ -/* OBSOLETE (trace_data.counts[i] == 1 ? "" : "s"), */ -/* OBSOLETE paddr_nz (trace_data.addrs[i])); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE printf_filtered ("No entries in trace buffer.\n"); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("Tracing is currently %s.\n", (tracing ? "on" : "off")); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Print the instruction at address MEMADDR in debugged memory, */ -/* OBSOLETE on STREAM. Returns length of the instruction, in bytes. */ */ -/* OBSOLETE */ -/* OBSOLETE static int */ -/* OBSOLETE print_insn (CORE_ADDR memaddr, struct ui_file *stream) */ -/* OBSOLETE { */ -/* OBSOLETE /* If there's no disassembler, something is very wrong. */ */ -/* OBSOLETE if (tm_print_insn == NULL) */ -/* OBSOLETE internal_error (__FILE__, __LINE__, */ -/* OBSOLETE "print_insn: no disassembler"); */ -/* OBSOLETE */ -/* OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) */ -/* OBSOLETE tm_print_insn_info.endian = BFD_ENDIAN_BIG; */ -/* OBSOLETE else */ -/* OBSOLETE tm_print_insn_info.endian = BFD_ENDIAN_LITTLE; */ -/* OBSOLETE return TARGET_PRINT_INSN (memaddr, &tm_print_insn_info); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_eva_prepare_to_trace (void) */ -/* OBSOLETE { */ -/* OBSOLETE if (!tracing) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE last_pc = read_register (PC_REGNUM); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Collect trace data from the target board and format it into a form */ -/* OBSOLETE more useful for display. */ */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE d30v_eva_get_trace_data (void) */ -/* OBSOLETE { */ -/* OBSOLETE int count, i, j, oldsize; */ -/* OBSOLETE int trace_addr, trace_seg, trace_cnt, next_cnt; */ -/* OBSOLETE unsigned int last_trace, trace_word, next_word; */ -/* OBSOLETE unsigned int *tmpspace; */ -/* OBSOLETE */ -/* OBSOLETE if (!tracing) */ -/* OBSOLETE return; */ -/* OBSOLETE */ -/* OBSOLETE tmpspace = xmalloc (65536 * sizeof (unsigned int)); */ -/* OBSOLETE */ -/* OBSOLETE last_trace = read_memory_unsigned_integer (DBBC_ADDR, 2) << 2; */ -/* OBSOLETE */ -/* OBSOLETE /* Collect buffer contents from the target, stopping when we reach */ -/* OBSOLETE the word recorded when execution resumed. */ */ -/* OBSOLETE */ -/* OBSOLETE count = 0; */ -/* OBSOLETE while (last_trace > 0) */ -/* OBSOLETE { */ -/* OBSOLETE QUIT; */ -/* OBSOLETE trace_word = */ -/* OBSOLETE read_memory_unsigned_integer (TRACE_BUFFER_BASE + last_trace, 4); */ -/* OBSOLETE trace_addr = trace_word & 0xffff; */ -/* OBSOLETE last_trace -= 4; */ -/* OBSOLETE /* Ignore an apparently nonsensical entry. */ */ -/* OBSOLETE if (trace_addr == 0xffd5) */ -/* OBSOLETE continue; */ -/* OBSOLETE tmpspace[count++] = trace_word; */ -/* OBSOLETE if (trace_addr == last_pc) */ -/* OBSOLETE break; */ -/* OBSOLETE if (count > 65535) */ -/* OBSOLETE break; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE /* Move the data to the host-side trace buffer, adjusting counts to */ -/* OBSOLETE include the last instruction executed and transforming the address */ -/* OBSOLETE into something that GDB likes. */ */ -/* OBSOLETE */ -/* OBSOLETE for (i = 0; i < count; ++i) */ -/* OBSOLETE { */ -/* OBSOLETE trace_word = tmpspace[i]; */ -/* OBSOLETE next_word = ((i == 0) ? 0 : tmpspace[i - 1]); */ -/* OBSOLETE trace_addr = trace_word & 0xffff; */ -/* OBSOLETE next_cnt = (next_word >> 24) & 0xff; */ -/* OBSOLETE j = trace_data.size + count - i - 1; */ -/* OBSOLETE trace_data.addrs[j] = (trace_addr << 2) + 0x1000000; */ -/* OBSOLETE trace_data.counts[j] = next_cnt + 1; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE oldsize = trace_data.size; */ -/* OBSOLETE trace_data.size += count; */ -/* OBSOLETE */ -/* OBSOLETE xfree (tmpspace); */ -/* OBSOLETE */ -/* OBSOLETE if (trace_display) */ -/* OBSOLETE display_trace (oldsize, trace_data.size); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE tdisassemble_command (char *arg, int from_tty) */ -/* OBSOLETE { */ -/* OBSOLETE int i, count; */ -/* OBSOLETE CORE_ADDR low, high; */ -/* OBSOLETE char *space_index; */ -/* OBSOLETE */ -/* OBSOLETE if (!arg) */ -/* OBSOLETE { */ -/* OBSOLETE low = 0; */ -/* OBSOLETE high = trace_data.size; */ -/* OBSOLETE } */ -/* OBSOLETE else if (!(space_index = (char *) strchr (arg, ' '))) */ -/* OBSOLETE { */ -/* OBSOLETE low = parse_and_eval_address (arg); */ -/* OBSOLETE high = low + 5; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE /* Two arguments. */ */ -/* OBSOLETE *space_index = '\0'; */ -/* OBSOLETE low = parse_and_eval_address (arg); */ -/* OBSOLETE high = parse_and_eval_address (space_index + 1); */ -/* OBSOLETE if (high < low) */ -/* OBSOLETE high = low; */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("Dump of trace from %s to %s:\n", */ -/* OBSOLETE paddr_u (low), */ -/* OBSOLETE paddr_u (high)); */ -/* OBSOLETE */ -/* OBSOLETE display_trace (low, high); */ -/* OBSOLETE */ -/* OBSOLETE printf_filtered ("End of trace dump.\n"); */ -/* OBSOLETE gdb_flush (gdb_stdout); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE static void */ -/* OBSOLETE display_trace (int low, int high) */ -/* OBSOLETE { */ -/* OBSOLETE int i, count, trace_show_source, first, suppress; */ -/* OBSOLETE CORE_ADDR next_address; */ -/* OBSOLETE */ -/* OBSOLETE trace_show_source = default_trace_show_source; */ -/* OBSOLETE if (!have_full_symbols () && !have_partial_symbols ()) */ -/* OBSOLETE { */ -/* OBSOLETE trace_show_source = 0; */ -/* OBSOLETE printf_filtered ("No symbol table is loaded. Use the \"file\" command.\n"); */ -/* OBSOLETE printf_filtered ("Trace will not display any source.\n"); */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE first = 1; */ -/* OBSOLETE suppress = 0; */ -/* OBSOLETE for (i = low; i < high; ++i) */ -/* OBSOLETE { */ -/* OBSOLETE next_address = trace_data.addrs[i]; */ -/* OBSOLETE count = trace_data.counts[i]; */ -/* OBSOLETE while (count-- > 0) */ -/* OBSOLETE { */ -/* OBSOLETE QUIT; */ -/* OBSOLETE if (trace_show_source) */ -/* OBSOLETE { */ -/* OBSOLETE struct symtab_and_line sal, sal_prev; */ -/* OBSOLETE */ -/* OBSOLETE sal_prev = find_pc_line (next_address - 4, 0); */ -/* OBSOLETE sal = find_pc_line (next_address, 0); */ -/* OBSOLETE */ -/* OBSOLETE if (sal.symtab) */ -/* OBSOLETE { */ -/* OBSOLETE if (first || sal.line != sal_prev.line) */ -/* OBSOLETE print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); */ -/* OBSOLETE suppress = 0; */ -/* OBSOLETE } */ -/* OBSOLETE else */ -/* OBSOLETE { */ -/* OBSOLETE if (!suppress) */ -/* OBSOLETE /* FIXME-32x64--assumes sal.pc fits in long. */ */ -/* OBSOLETE printf_filtered ("No source file for address %s.\n", */ -/* OBSOLETE local_hex_string ((unsigned long) sal.pc)); */ -/* OBSOLETE suppress = 1; */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE first = 0; */ -/* OBSOLETE print_address (next_address, gdb_stdout); */ -/* OBSOLETE printf_filtered (":"); */ -/* OBSOLETE printf_filtered ("\t"); */ -/* OBSOLETE wrap_here (" "); */ -/* OBSOLETE next_address = next_address + print_insn (next_address, gdb_stdout); */ -/* OBSOLETE printf_filtered ("\n"); */ -/* OBSOLETE gdb_flush (gdb_stdout); */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE } */ -/* OBSOLETE */ -/* OBSOLETE extern void (*target_resume_hook) (void); */ -/* OBSOLETE extern void (*target_wait_loop_hook) (void); */ -/* OBSOLETE */ -/* OBSOLETE void */ -/* OBSOLETE _initialize_d30v_tdep (void) */ -/* OBSOLETE { */ -/* OBSOLETE tm_print_insn = print_insn_d30v; */ -/* OBSOLETE */ -/* OBSOLETE target_resume_hook = d30v_eva_prepare_to_trace; */ -/* OBSOLETE target_wait_loop_hook = d30v_eva_get_trace_data; */ -/* OBSOLETE */ -/* OBSOLETE add_info ("flags", print_flags_command, "Print d30v flags."); */ -/* OBSOLETE */ -/* OBSOLETE add_com ("trace", class_support, trace_command, */ -/* OBSOLETE "Enable tracing of instruction execution."); */ -/* OBSOLETE */ -/* OBSOLETE add_com ("untrace", class_support, untrace_command, */ -/* OBSOLETE "Disable tracing of instruction execution."); */ -/* OBSOLETE */ -/* OBSOLETE add_com ("tdisassemble", class_vars, tdisassemble_command, */ -/* OBSOLETE "Disassemble the trace buffer.\n\ */ -/* OBSOLETE Two optional arguments specify a range of trace buffer entries\n\ */ -/* OBSOLETE as reported by info trace (NOT addresses!)."); */ -/* OBSOLETE */ -/* OBSOLETE add_info ("trace", trace_info, */ -/* OBSOLETE "Display info about the trace data buffer."); */ -/* OBSOLETE */ -/* OBSOLETE add_show_from_set (add_set_cmd ("tracedisplay", no_class, */ -/* OBSOLETE var_integer, (char *) &trace_display, */ -/* OBSOLETE "Set automatic display of trace.\n", &setlist), */ -/* OBSOLETE &showlist); */ -/* OBSOLETE add_show_from_set (add_set_cmd ("tracesource", no_class, */ -/* OBSOLETE var_integer, (char *) &default_trace_show_source, */ -/* OBSOLETE "Set display of source code with trace.\n", &setlist), */ -/* OBSOLETE &showlist); */ -/* OBSOLETE */ -/* OBSOLETE } */ diff --git a/gdb/dbug-rom.c b/gdb/dbug-rom.c index bd20184..aadab6f 100644 --- a/gdb/dbug-rom.c +++ b/gdb/dbug-rom.c @@ -32,6 +32,8 @@ #include "serial.h" #include "regcache.h" +#include "m68k-tdep.h" + static void dbug_open (char *args, int from_tty); static void @@ -57,12 +59,12 @@ dbug_supply_register (char *regname, int regnamelen, char *val, int vallen) case 'D': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + D0_REGNUM; + regno = regname[1] - '0' + M68K_D0_REGNUM; break; case 'A': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + A0_REGNUM; + regno = regname[1] - '0' + M68K_A0_REGNUM; break; default: return; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 4c80ed8..39a53ca 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -167,36 +167,27 @@ static int has_line_numbers; /* Complaints about the symbols we have encountered. */ -struct deprecated_complaint lbrac_complaint = -{"bad block start address patched", 0, 0}; - -struct deprecated_complaint string_table_offset_complaint = -{"bad string table offset in symbol %d", 0, 0}; - -struct deprecated_complaint unknown_symtype_complaint = -{"unknown symbol type %s", 0, 0}; - -struct deprecated_complaint unknown_symchar_complaint = -{"unknown symbol descriptor `%c'", 0, 0}; - -struct deprecated_complaint lbrac_rbrac_complaint = -{"block start larger than block end", 0, 0}; - -struct deprecated_complaint lbrac_unmatched_complaint = -{"unmatched N_LBRAC before symtab pos %d", 0, 0}; - -struct deprecated_complaint lbrac_mismatch_complaint = -{"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0}; +static void +unknown_symtype_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "unknown symbol type %s", arg1); +} -struct deprecated_complaint repeated_header_complaint = -{"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0}; +static void +lbrac_mismatch_complaint (int arg1) +{ + complaint (&symfile_complaints, + "N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", arg1); +} -struct deprecated_complaint unclaimed_bincl_complaint = -{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0}; +static void +repeated_header_complaint (const char *arg1, int arg2) +{ + complaint (&symfile_complaints, + "\"repeated\" header file %s not previously seen, at symtab pos %d", + arg1, arg2); +} -struct deprecated_complaint discarding_local_symbols_complaint = -{"misplaced N_LBRAC entry; discarding local symbols which have no enclosing block", 0, 0}; - /* find_text_range --- find start and end of loadable code sections The find_text_range function finds the shortest address range that @@ -367,7 +358,7 @@ add_old_header_file (char *name, int instance) add_this_object_header_file (i); return; } - complain (&repeated_header_complaint, name, symnum); + repeated_header_complaint (name, symnum); } /* Add to this file a "new" header file: definitions for its types follow. @@ -1022,7 +1013,7 @@ find_corresponding_bincl_psymtab (char *name, int instance) && STREQ (name, bincl->name)) return bincl->pst; - complain (&repeated_header_complaint, name, symnum); + repeated_header_complaint (name, symnum); return (struct partial_symtab *) 0; } @@ -1059,7 +1050,8 @@ set_namestring (struct objfile *objfile, struct internal_nlist nlist) if (((unsigned) nlist.n_strx + file_string_table_offset) >= DBX_STRINGTAB_SIZE (objfile)) { - complain (&string_table_offset_complaint, symnum); + complaint (&symfile_complaints, "bad string table offset in symbol %d", + symnum); namestring = ""; } else @@ -1256,6 +1248,14 @@ find_stab_function_addr (char *namestring, char *filename, } #endif /* SOFUN_ADDRESS_MAYBE_MISSING */ +static void +function_outside_compilation_unit_complaint (const char *arg1) +{ + complaint (&symfile_complaints, + "function `%s' appears to be defined outside of all compilation units", + arg1); +} + /* Setup partial_symtab's describing each source file for which debugging information is available. */ @@ -1360,9 +1360,6 @@ read_dbx_symtab (struct objfile *objfile) switch (nlist.n_type) { - static struct deprecated_complaint function_outside_compilation_unit = { - "function `%s' appears to be defined outside of all compilation units", 0, 0 - }; char *p; /* * Standard, external, non-debugger, symbols @@ -1613,7 +1610,9 @@ read_dbx_symtab (struct objfile *objfile) { /* FIXME: we should not get here without a PST to work on. Attempt to recover. */ - complain (&unclaimed_bincl_complaint, namestring, symnum); + complaint (&symfile_complaints, + "N_BINCL %s not in entries for any file, at symtab pos %d", + namestring, symnum); continue; } add_bincl_to_list (pst, namestring, nlist.n_value); @@ -1887,7 +1886,7 @@ read_dbx_symtab (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -1952,7 +1951,7 @@ read_dbx_symtab (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -2047,7 +2046,8 @@ read_dbx_symtab (struct objfile *objfile) time searching to the end of every string looking for a backslash. */ - complain (&unknown_symchar_complaint, p[1]); + complaint (&symfile_complaints, "unknown symbol descriptor `%c'", + p[1]); /* Ignore it; perhaps it is an extension that we don't know about. */ @@ -2161,8 +2161,7 @@ read_dbx_symtab (struct objfile *objfile) default: /* If we haven't found it yet, ignore it. It's probably some new type we don't know about yet. */ - complain (&unknown_symtype_complaint, - local_hex_string (nlist.n_type)); + unknown_symtype_complaint (local_hex_string (nlist.n_type)); continue; } } @@ -2773,6 +2772,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, { /* This N_FUN marks the end of a function. This closes off the current block. */ + + if (context_stack_depth <= 0) + { + lbrac_mismatch_complaint (symnum); + break; + } + record_line (current_subfile, 0, function_start_offset + valu); within_function = 0; new = pop_context (); @@ -2819,7 +2825,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address) { /* Patch current LBRAC pc value to match last handy pc value */ - complain (&lbrac_complaint); + complaint (&symfile_complaints, "bad block start address patched"); valu = last_pc_address; } #endif @@ -2842,9 +2848,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, N_SO, the linker did not relocate them (sigh). */ valu += last_source_start_addr; + if (context_stack_depth <= 0) + { + lbrac_mismatch_complaint (symnum); + break; + } + new = pop_context (); if (desc != new->depth) - complain (&lbrac_mismatch_complaint, symnum); + lbrac_mismatch_complaint (symnum); /* Some compilers put the variable decls inside of an LBRAC/RBRAC block. This macro should be nonzero if this @@ -2869,7 +2881,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, symbols within an LBRAC/RBRAC block; this complaint might also help sort out problems in which VARIABLES_INSIDE_BLOCK is incorrectly defined. */ - complain (&discarding_local_symbols_complaint); + complaint (&symfile_complaints, + "misplaced N_LBRAC entry; discarding local symbols which have no enclosing block"); } local_symbols = new->locals; } @@ -2889,7 +2902,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, compilers? Is this ever harmful?). */ if (new->start_addr > valu) { - complain (&lbrac_rbrac_complaint); + complaint (&symfile_complaints, + "block start larger than block end"); new->start_addr = valu; } /* Make a block for the local symbols within. */ @@ -3113,7 +3127,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, case N_NBBSS: case N_NBSTS: case N_NBLCS: - complain (&unknown_symtype_complaint, local_hex_string (type)); + unknown_symtype_complaint (local_hex_string (type)); /* FALLTHROUGH */ /* The following symbol types don't need the address field relocated, @@ -3225,7 +3239,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, if (context_stack_depth > 1) { - complain (&lbrac_unmatched_complaint, symnum); + complaint (&symfile_complaints, + "unmatched N_LBRAC before symtab pos %d", symnum); break; } diff --git a/gdb/defs.h b/gdb/defs.h index eded238..413c415 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -572,10 +572,16 @@ extern int source_full_path_of (char *, char **); extern void mod_path (char *, char **); +extern void add_path (char *, char **, int); + extern void directory_command (char *, int); +extern char *source_path; + extern void init_source_path (void); +extern void init_last_source_visited (void); + extern char *symtab_to_filename (struct symtab *); /* From exec.c */ @@ -614,10 +620,6 @@ enum lval_type struct frame_info; -/* From readline (but not in any readline .h files). */ - -extern char *tilde_expand (char *); - /* Control types for commands */ enum misc_command_type diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 7f05283..9e3e6b4 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,42 @@ +2002-12-20 Kazu Hirata + + * agentexpr.texi: Fix typos. + * annotate.texi: Likewise. + * fdl.texi: Likewise. + +2002-12-10 Andrew Cagney + + * gdbint.texinfo (Algorithms): Replace INIT_FRAME_PC with + DEPRECATED_INIT_FRAME_PC. + +2002-12-01 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + PC_IN_CALL_DUMMY. + +2002-11-28 Andrew Cagney + + * gdbint.texinfo (Host Definition): Delete documentation on + USE_GENERIC_DUMMY_FRAMES. + +2002-11-26 Elena Zannoni + + Fix PR gdb/723 and PR gdb/245. + * Makefile.in (install-info): Run the install-info command as part + of the post install steps only. + (uninstall-info): New target. + (uninstall): New target. + +2002-11-22 Elena Zannoni + + * Makefile.in (install): Make install do some real work. + +2002-11-19 Andrew Cagney + + Fix POSIX problem reported by Paul Eggert. + * Makefile.in (GDBvn.texi): Use `sed q' instead of `head -1'. + Fix PR gdb/527. + 2002-10-26 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Delete diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index ba0031a..b17cce8 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -134,7 +134,7 @@ STABS_DOC_FILES = \ #### Host, target, and site specific Makefile fragments come in here. ### -all install: +all: info: $(INFO_DEPS) dvi: gdb.dvi gdbint.dvi stabs.dvi refcard.dvi @@ -156,6 +156,7 @@ install-info: $(INFO_DEPS) else : ; fi; \ done; \ done + $(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ @@ -164,6 +165,22 @@ install-info: $(INFO_DEPS) done; \ else : ; fi +uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + $(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + install-html: html for i in *.html ; do \ $(INSTALL_DATA) $$i $(htmldir)/$$i ; \ @@ -218,7 +235,7 @@ refcard.ps : refcard.dvi # File to record current GDB version number (copied from main dir version.in) GDBvn.texi : ${gdbdir}/version.in - echo "@set GDBVN `head -1 $(srcdir)/../version.in`" > ./GDBvn.new + echo "@set GDBVN `sed q $(srcdir)/../version.in`" > ./GDBvn.new mv GDBvn.new GDBvn.texi # Updated atomically @@ -432,3 +449,6 @@ distclean: clean maintainer-clean realclean: distclean rm -f GDBvn.texi *.info* *.dvi *.ps *.html *.pdf +install: install-info + +uninstall: uninstall-info diff --git a/gdb/doc/agentexpr.texi b/gdb/doc/agentexpr.texi index 5418667..0135391 100644 --- a/gdb/doc/agentexpr.texi +++ b/gdb/doc/agentexpr.texi @@ -397,7 +397,7 @@ Thus, an offset of zero denotes the beginning of the expression. The @var{offset} is stored as a sixteen-bit unsigned value, stored immediately following the @code{if_goto} bytecode. It is always stored -most signficant byte first, regardless of the target's normal +most significant byte first, regardless of the target's normal endianness. The offset is not guaranteed to fall at any particular alignment within the bytecode stream; thus, on machines where fetching a 16-bit on an unaligned address raises an exception, you should fetch the @@ -431,7 +431,7 @@ registers are numbered following GDB's conventions. The register number @var{n} is encoded as a 16-bit unsigned integer immediately following the @code{reg} bytecode. It is always stored most -signficant byte first, regardless of the target's normal endianness. +significant byte first, regardless of the target's normal endianness. The register number is not guaranteed to fall at any particular alignment within the bytecode stream; thus, on machines where fetching a 16-bit on an unaligned address raises an exception, you should fetch the diff --git a/gdb/doc/annotate.texi b/gdb/doc/annotate.texi index 59d599b..fc26924 100644 --- a/gdb/doc/annotate.texi +++ b/gdb/doc/annotate.texi @@ -247,17 +247,17 @@ or a repeated element @smallexample @samp{,} @var{whitespace} ; @r{omitted for the first element} @var{the-value} -^Z^Zelt-rep @var{number-of-repititions} +^Z^Zelt-rep @var{number-of-repetitions} @var{repetition-string} ^Z^Zelt-rep-end @end smallexample In both cases, @var{the-value} is the output for the value of the element and @var{whitespace} can contain spaces, tabs, and newlines. In -the repeated case, @var{number-of-repititons} is the number of +the repeated case, @var{number-of-repetitions} is the number of consecutive array elements which contain that value, and @var{repetition-string} is a string which is designed to convey to the -user that repitition is being depicted. +user that repetition is being depicted. @findex array-section-end Once all the array elements have been output, the array annotation is diff --git a/gdb/doc/fdl.texi b/gdb/doc/fdl.texi index f4726b9..142a8e1 100644 --- a/gdb/doc/fdl.texi +++ b/gdb/doc/fdl.texi @@ -197,9 +197,9 @@ J. Preserve the network location, if any, given in the Document for You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.@* -K. In any section entitled ``Acknowledgements'' or ``Dedications'', +K. In any section entitled ``Acknowledgments'' or ``Dedications'', preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements + substance and tone of each of the contributor acknowledgments and/or dedications given therein.@* L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers @@ -257,7 +257,7 @@ Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled ``History'' in the various original documents, forming one section entitled -``History''; likewise combine any sections entitled ``Acknowledgements'', +``History''; likewise combine any sections entitled ``Acknowledgments'', and any sections entitled ``Dedications.'' You must delete all sections entitled ``Endorsements.'' @sp 1 diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 0cdbc05..26fd523 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -253,9 +253,9 @@ your frames are nonstandard.) @cindex frame chain Given a @value{GDBN} frame, define @code{FRAME_CHAIN} to determine the -address of the calling function's frame. This will be used to create -a new @value{GDBN} frame struct, and then @code{INIT_EXTRA_FRAME_INFO} -and @code{INIT_FRAME_PC} will be called for the new frame. +address of the calling function's frame. This will be used to create a +new @value{GDBN} frame struct, and then @code{INIT_EXTRA_FRAME_INFO} and +@code{DEPRECATED_INIT_FRAME_PC} will be called for the new frame. @section Breakpoint Handling @@ -2245,11 +2245,6 @@ of functions to indicate that they never return. The default is already set correctly if compiling with GCC. This will almost never need to be defined. -@item USE_GENERIC_DUMMY_FRAMES -@cindex generic dummy frames -Define this to 1 if the target is using the generic inferior function -call code. See @code{blockframe.c} for more information. - @item USE_MMALLOC @findex mmalloc @value{GDBN} will use the @code{mmalloc} library for memory allocation @@ -3458,8 +3453,8 @@ If additional information about the frame is required this should be stored in @code{frame->extra_info}. Space for @code{frame->extra_info} is allocated using @code{frame_obstack_alloc}. -@item INIT_FRAME_PC (@var{fromleaf}, @var{prev}) -@findex INIT_FRAME_PC +@item DEPRECATED_INIT_FRAME_PC (@var{fromleaf}, @var{prev}) +@findex DEPRECATED_INIT_FRAME_PC This is a C statement that sets the pc of the frame pointed to by @var{prev}. [By default...] @@ -3680,10 +3675,6 @@ them. @findex PCC_SOL_BROKEN (Used only in the Convex target.) -@item PC_IN_CALL_DUMMY -@findex PC_IN_CALL_DUMMY -See @file{inferior.h}. - @item PC_IN_SIGTRAMP (@var{pc}, @var{name}) @findex PC_IN_SIGTRAMP @cindex sigtramp diff --git a/gdb/doublest.c b/gdb/doublest.c index 6e96d78..49e3689 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -172,12 +172,14 @@ convert_floatformat_to_doublest (const struct floatformat *fmt, special_exponent = exponent == 0 || exponent == fmt->exp_nan; -/* Don't bias NaNs. Use minimum exponent for denorms. For simplicity, - we don't check for zero as the exponent doesn't matter. */ + /* Don't bias NaNs. Use minimum exponent for denorms. For simplicity, + we don't check for zero as the exponent doesn't matter. Note the cast + to int; exp_bias is unsigned, so it's important to make sure the + operation is done in signed arithmetic. */ if (!special_exponent) exponent -= fmt->exp_bias; else if (exponent == 0) - exponent = 1 - fmt->exp_bias; + exponent = 1 - (int) fmt->exp_bias; /* Build the result algebraically. Might go infinite, underflow, etc; who cares. */ diff --git a/gdb/dst.h b/gdb/dst.h deleted file mode 100644 index 89ad9ec..0000000 --- a/gdb/dst.h +++ /dev/null @@ -1,1671 +0,0 @@ -// OBSOLETE /* */ -// OBSOLETE /* Apollo object module DST (debug symbol table) description */ -// OBSOLETE -// OBSOLETE #ifndef apollo_dst_h -// OBSOLETE #define apollo_dst_h -// OBSOLETE -// OBSOLETE #if defined(apollo) && !defined(__GNUC__) -// OBSOLETE #define ALIGNED1 __attribute( (aligned(1)) ) -// OBSOLETE #else -// OBSOLETE /* Remove attribute directives from non-Apollo code: */ -// OBSOLETE #define ALIGNED1 /* nil */ -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Identification of this version of the debug symbol table. Producers of the -// OBSOLETE debug symbol table must write these values into the version number field of -// OBSOLETE the compilation unit record in .blocks . -// OBSOLETE */ -// OBSOLETE #define dst_version_major 1 -// OBSOLETE #define dst_version_minor 3 -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Enumeration of debug record types appearing in .blocks and .symbols ... -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_typ_pad, /* 0 */ -// OBSOLETE dst_typ_comp_unit, /* 1 */ -// OBSOLETE dst_typ_section_tab, /* 2 */ -// OBSOLETE dst_typ_file_tab, /* 3 */ -// OBSOLETE dst_typ_block, /* 4 */ -// OBSOLETE dst_typ_5, -// OBSOLETE dst_typ_var, -// OBSOLETE dst_typ_pointer, /* 7 */ -// OBSOLETE dst_typ_array, /* 8 */ -// OBSOLETE dst_typ_subrange, /* 9 */ -// OBSOLETE dst_typ_set, /* 10 */ -// OBSOLETE dst_typ_implicit_enum, /* 11 */ -// OBSOLETE dst_typ_explicit_enum, /* 12 */ -// OBSOLETE dst_typ_short_rec, /* 13 */ -// OBSOLETE dst_typ_old_record, -// OBSOLETE dst_typ_short_union, /* 15 */ -// OBSOLETE dst_typ_old_union, -// OBSOLETE dst_typ_file, /* 17 */ -// OBSOLETE dst_typ_offset, /* 18 */ -// OBSOLETE dst_typ_alias, /* 19 */ -// OBSOLETE dst_typ_signature, /* 20 */ -// OBSOLETE dst_typ_21, -// OBSOLETE dst_typ_old_label, /* 22 */ -// OBSOLETE dst_typ_scope, /* 23 */ -// OBSOLETE dst_typ_end_scope, /* 24 */ -// OBSOLETE dst_typ_25, -// OBSOLETE dst_typ_26, -// OBSOLETE dst_typ_string_tab, /* 27 */ -// OBSOLETE dst_typ_global_name_tab, /* 28 */ -// OBSOLETE dst_typ_forward, /* 29 */ -// OBSOLETE dst_typ_aux_size, /* 30 */ -// OBSOLETE dst_typ_aux_align, /* 31 */ -// OBSOLETE dst_typ_aux_field_size, /* 32 */ -// OBSOLETE dst_typ_aux_field_off, /* 33 */ -// OBSOLETE dst_typ_aux_field_align, /* 34 */ -// OBSOLETE dst_typ_aux_qual, /* 35 */ -// OBSOLETE dst_typ_aux_var_bound, /* 36 */ -// OBSOLETE dst_typ_extension, /* 37 */ -// OBSOLETE dst_typ_string, /* 38 */ -// OBSOLETE dst_typ_old_entry, -// OBSOLETE dst_typ_const, /* 40 */ -// OBSOLETE dst_typ_reference, /* 41 */ -// OBSOLETE dst_typ_record, /* 42 */ -// OBSOLETE dst_typ_union, /* 43 */ -// OBSOLETE dst_typ_aux_type_deriv, /* 44 */ -// OBSOLETE dst_typ_locpool, /* 45 */ -// OBSOLETE dst_typ_variable, /* 46 */ -// OBSOLETE dst_typ_label, /* 47 */ -// OBSOLETE dst_typ_entry, /* 48 */ -// OBSOLETE dst_typ_aux_lifetime, /* 49 */ -// OBSOLETE dst_typ_aux_ptr_base, /* 50 */ -// OBSOLETE dst_typ_aux_src_range, /* 51 */ -// OBSOLETE dst_typ_aux_reg_val, /* 52 */ -// OBSOLETE dst_typ_aux_unit_names, /* 53 */ -// OBSOLETE dst_typ_aux_sect_info, /* 54 */ -// OBSOLETE dst_typ_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_rec_type_t; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Dummy bounds for variably dimensioned arrays: -// OBSOLETE */ -// OBSOLETE #define dst_dummy_array_size 100 -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Reference to another item in the symbol table. -// OBSOLETE ** -// OBSOLETE ** The value of a dst_rel_offset_t is the relative offset from the start of the -// OBSOLETE ** referencing record to the start of the referenced record, string, etc. -// OBSOLETE ** -// OBSOLETE ** The value of a NIL dst_rel_offset_t is zero. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef long dst_rel_offset_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* FIXME: Here and many places we make assumptions about sizes of host -// OBSOLETE data types, structure layout, etc. Only needs to be fixed if we care -// OBSOLETE about cross-debugging, though. */ -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Section-relative reference. -// OBSOLETE ** -// OBSOLETE ** The section index field is an index into the local compilation unit's -// OBSOLETE ** section table (see dst_rec_section_tab_t)--NOT into the object module -// OBSOLETE ** section table! -// OBSOLETE ** -// OBSOLETE ** The sect_offset field is the offset in bytes into the section. -// OBSOLETE ** -// OBSOLETE ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate -// OBSOLETE ** at one. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short sect_index; -// OBSOLETE unsigned long sect_offset ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_sect_ref_t; -// OBSOLETE -// OBSOLETE #define dst_sect_index_nil 0 -// OBSOLETE #define dst_sect_index_origin 1 -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Source location descriptor. -// OBSOLETE ** -// OBSOLETE ** The file_index field is an index into the local compilation unit's -// OBSOLETE ** file table (see dst_rec_file_tab_t). -// OBSOLETE ** -// OBSOLETE ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate -// OBSOLETE ** at one. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE boolean reserved:1; /* reserved for future use */ -// OBSOLETE int file_index:11; /* index into .blocks source file list */ -// OBSOLETE int line_number:20; /* source line number */ -// OBSOLETE } -// OBSOLETE dst_src_loc_t; -// OBSOLETE -// OBSOLETE #define dst_file_index_nil 0 -// OBSOLETE #define dst_file_index_origin 1 -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** Standard (primitive) type codes. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_non_std_type, -// OBSOLETE dst_int8_type, /* 8 bit integer */ -// OBSOLETE dst_int16_type, /* 16 bit integer */ -// OBSOLETE dst_int32_type, /* 32 bit integer */ -// OBSOLETE dst_uint8_type, /* 8 bit unsigned integer */ -// OBSOLETE dst_uint16_type, /* 16 bit unsigned integer */ -// OBSOLETE dst_uint32_type, /* 32 bit unsigned integer */ -// OBSOLETE dst_real32_type, /* single precision ieee floatining point */ -// OBSOLETE dst_real64_type, /* double precision ieee floatining point */ -// OBSOLETE dst_complex_type, /* single precision complex */ -// OBSOLETE dst_dcomplex_type, /* double precision complex */ -// OBSOLETE dst_bool8_type, /* boolean =logical*1 */ -// OBSOLETE dst_bool16_type, /* boolean =logical*2 */ -// OBSOLETE dst_bool32_type, /* boolean =logical*4 */ -// OBSOLETE dst_char_type, /* 8 bit ascii character */ -// OBSOLETE dst_string_type, /* string of 8 bit ascii characters */ -// OBSOLETE dst_ptr_type, /* univ_pointer */ -// OBSOLETE dst_set_type, /* generic 256 bit set */ -// OBSOLETE dst_proc_type, /* generic procedure (signature not specified) */ -// OBSOLETE dst_func_type, /* generic function (signature not specified) */ -// OBSOLETE dst_void_type, /* c void type */ -// OBSOLETE dst_uchar_type, /* c unsigned char */ -// OBSOLETE dst_std_type_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_std_type_t; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** General data type descriptor -// OBSOLETE ** -// OBSOLETE ** If the user_defined_type bit is clear, then the type is a standard type, and -// OBSOLETE ** the remaining bits contain the dst_std_type_t of the type. If the bit is -// OBSOLETE ** set, then the type is defined in a separate dst record, which is referenced -// OBSOLETE ** by the remaining bits as a dst_rel_offset_t. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef union -// OBSOLETE { -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE boolean user_defined_type:1; /* tag field */ -// OBSOLETE int must_be_zero:23; /* 23 bits of pad */ -// OBSOLETE dst_std_type_t dtc:8; /* 8 bit primitive data */ -// OBSOLETE } -// OBSOLETE std_type; -// OBSOLETE -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE boolean user_defined_type:1; /* tag field */ -// OBSOLETE int doffset:31; /* offset to type record */ -// OBSOLETE } -// OBSOLETE user_type; -// OBSOLETE } -// OBSOLETE dst_type_t ALIGNED1; -// OBSOLETE -// OBSOLETE /* The user_type.doffset field is a 31-bit signed value. Some versions of C -// OBSOLETE do not support signed bit fields. The following macro will extract that -// OBSOLETE field as a signed value: -// OBSOLETE */ -// OBSOLETE #define dst_user_type_offset(type_rec) \ -// OBSOLETE ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 ) -// OBSOLETE -// OBSOLETE -// OBSOLETE /*================================================*/ -// OBSOLETE /*========== RECORDS IN .blocks SECTION ==========*/ -// OBSOLETE /*================================================*/ -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE COMPILATION UNIT record -// OBSOLETE ----------------------- -// OBSOLETE This must be the first record in each .blocks section. -// OBSOLETE Provides a set of information describing the output of a single compilation -// OBSOLETE and pointers to additional information for the compilation unit. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_pc_code_locs, /* ranges in loc strings are pc ranges */ -// OBSOLETE dst_comp_unit_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_comp_unit_flag_t; -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_lang_unk, /* unknown language */ -// OBSOLETE dst_lang_pas, /* Pascal */ -// OBSOLETE dst_lang_ftn, /* FORTRAN */ -// OBSOLETE dst_lang_c, /* C */ -// OBSOLETE dst_lang_mod2, /* Modula-2 */ -// OBSOLETE dst_lang_asm_m68k, /* 68K assembly language */ -// OBSOLETE dst_lang_asm_a88k, /* AT assembly language */ -// OBSOLETE dst_lang_ada, /* Ada */ -// OBSOLETE dst_lang_cxx, /* C++ */ -// OBSOLETE dst_lang_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_lang_type_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE unsigned char major_part; /* = dst_version_major */ -// OBSOLETE unsigned char minor_part; /* = dst_version_minor */ -// OBSOLETE } -// OBSOLETE version; /* version of dst */ -// OBSOLETE unsigned short flags; /* mask of dst_comp_unit_flag_t */ -// OBSOLETE unsigned short lang_type; /* source language */ -// OBSOLETE unsigned short number_of_blocks; /* number of blocks records */ -// OBSOLETE dst_rel_offset_t root_block_offset; /* offset to root block (module?) */ -// OBSOLETE dst_rel_offset_t section_table /* offset to section table record */ ; -// OBSOLETE dst_rel_offset_t file_table; /* offset to file table record */ -// OBSOLETE unsigned long data_size; /* total size of .blocks data */ -// OBSOLETE } -// OBSOLETE dst_rec_comp_unit_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*-------------------- -// OBSOLETE SECTION TABLE record -// OBSOLETE -------------------- -// OBSOLETE There must be one section table associated with each compilation unit. -// OBSOLETE Other debug records refer to sections via their index in this table. The -// OBSOLETE section base addresses in the table are virtual addresses of the sections, -// OBSOLETE relocated by the linker. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short number_of_sections; /* size of array: */ -// OBSOLETE unsigned long section_base[dst_dummy_array_size] ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_section_tab_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------- -// OBSOLETE FILE TABLE record -// OBSOLETE ----------------- -// OBSOLETE There must be one file table associated with each compilation unit describing -// OBSOLETE the source (and include) files used by each compilation unit. Other debug -// OBSOLETE records refer to files via their index in this table. The first entry is the -// OBSOLETE primary source file. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE long dtm; /* time last modified (time_$clock_t) */ -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string for source file */ -// OBSOLETE } -// OBSOLETE dst_file_desc_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short number_of_files; /* size of array: */ -// OBSOLETE dst_file_desc_t files[dst_dummy_array_size] ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_file_tab_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------- -// OBSOLETE NAME TABLE record -// OBSOLETE ----------------- -// OBSOLETE A name table record may appear as an auxiliary record to the file table, -// OBSOLETE providing additional qualification of the file indexes for languages that -// OBSOLETE need it (i.e. Ada). Name table entries parallel file table entries of the -// OBSOLETE same file index. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short number_of_names; /* size of array: */ -// OBSOLETE dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_name_tab_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*-------------- -// OBSOLETE BLOCK record -// OBSOLETE -------------- -// OBSOLETE Describes a lexical program block--a procedure, function, module, etc. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Block types. These may be used in any way desired by the compiler writers. -// OBSOLETE The debugger uses them only to give a description to the user of the type of -// OBSOLETE a block. The debugger makes no other assumptions about the meaning of any -// OBSOLETE of these. For example, the fact that a block is executable (e.g., program) -// OBSOLETE or not (e.g., module) is expressed in block attributes (see below), not -// OBSOLETE guessed at from the block type. -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_block_module, /* some pascal = modula = ada types */ -// OBSOLETE dst_block_program, -// OBSOLETE dst_block_procedure, -// OBSOLETE dst_block_function, /* C function */ -// OBSOLETE dst_block_subroutine, /* some fortran block types */ -// OBSOLETE dst_block_block_data, -// OBSOLETE dst_block_stmt_function, -// OBSOLETE dst_block_package, /* a few particular to Ada */ -// OBSOLETE dst_block_package_body, -// OBSOLETE dst_block_subunit, -// OBSOLETE dst_block_task, -// OBSOLETE dst_block_file, /* a C outer scope? */ -// OBSOLETE dst_block_class, /* C++ or Simula */ -// OBSOLETE dst_block_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_block_type_t; -// OBSOLETE -// OBSOLETE /* Block attributes. This is the information used by the debugger to represent -// OBSOLETE the semantics of blocks. -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_block_main_entry, /* the block's entry point is a main entry into -// OBSOLETE the compilation unit */ -// OBSOLETE dst_block_executable, /* the block has an entry point */ -// OBSOLETE dst_block_attr_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_block_attr_t; -// OBSOLETE -// OBSOLETE /* Code range. Each block has associated with it one or more code ranges. An -// OBSOLETE individual code range is identified by a range of source (possibly nil) and -// OBSOLETE a range of executable code. For example, a block which has its executable -// OBSOLETE code spread over multiple sections will have one code range per section. -// OBSOLETE */ -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned long code_size; /* size of executable code (in bytes ) */ -// OBSOLETE dst_sect_ref_t code_start; /* starting address of executable code */ -// OBSOLETE dst_sect_ref_t lines_start; /* start of line number tables */ -// OBSOLETE } -// OBSOLETE dst_code_range_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_block_type_t block_type:8; -// OBSOLETE unsigned short flags:8; /* mask of dst_block_attr_t flags */ -// OBSOLETE dst_rel_offset_t sibling_block_off; /* offset to next sibling block */ -// OBSOLETE dst_rel_offset_t child_block_off; /* offset to first contained block */ -// OBSOLETE dst_rel_offset_t noffset; /* offset to block name string */ -// OBSOLETE dst_sect_ref_t symbols_start; /* start of debug symbols */ -// OBSOLETE unsigned short n_of_code_ranges; /* size of array... */ -// OBSOLETE dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_block_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*-------------------------- -// OBSOLETE AUX SECT INFO TABLE record -// OBSOLETE -------------------------- -// OBSOLETE Appears as an auxiliary to a block record. Expands code range information -// OBSOLETE by providing references into additional, language-dependent sections for -// OBSOLETE information related to specific code ranges of the block. Sect info table -// OBSOLETE entries parallel code range array entries of the same index. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned char tag; /* currently can only be zero */ -// OBSOLETE unsigned char number_of_refs; /* size of array: */ -// OBSOLETE dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_sect_info_tab_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*=================================================*/ -// OBSOLETE /*========== RECORDS IN .symbols SECTION ==========*/ -// OBSOLETE /*=================================================*/ -// OBSOLETE -// OBSOLETE /*----------------- -// OBSOLETE CONSTANT record -// OBSOLETE ----------------- -// OBSOLETE Describes a symbolic constant. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE float r; /* real part */ -// OBSOLETE float i; /* imaginary part */ -// OBSOLETE } -// OBSOLETE dst_complex_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE double dr; /* real part */ -// OBSOLETE double di; /* imaginary part */ -// OBSOLETE } -// OBSOLETE dst_double_complex_t; -// OBSOLETE -// OBSOLETE /* The following record provides a way of describing constant values with -// OBSOLETE non-standard type and no limit on size. -// OBSOLETE */ -// OBSOLETE typedef union -// OBSOLETE { -// OBSOLETE char char_data[dst_dummy_array_size]; -// OBSOLETE short int_data[dst_dummy_array_size]; -// OBSOLETE long long_data[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE dst_big_kon_t; -// OBSOLETE -// OBSOLETE /* Representation of the value of a general constant. -// OBSOLETE */ -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short length; /* size of constant value (bytes) */ -// OBSOLETE -// OBSOLETE union -// OBSOLETE { -// OBSOLETE unsigned short kon_int8; -// OBSOLETE short kon_int16; -// OBSOLETE long kon_int32 ALIGNED1; -// OBSOLETE float kon_real ALIGNED1; -// OBSOLETE double kon_dbl ALIGNED1; -// OBSOLETE dst_complex_t kon_cplx ALIGNED1; -// OBSOLETE dst_double_complex_t kon_dcplx ALIGNED1; -// OBSOLETE char kon_char; -// OBSOLETE dst_big_kon_t kon ALIGNED1; -// OBSOLETE } -// OBSOLETE val; /* value data of constant */ -// OBSOLETE } -// OBSOLETE dst_const_t ALIGNED1; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of const definition */ -// OBSOLETE dst_type_t type_desc; /* type of this (manifest) constant */ -// OBSOLETE dst_const_t value; -// OBSOLETE } -// OBSOLETE dst_rec_const_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*---------------- -// OBSOLETE VARIABLE record -// OBSOLETE ---------------- -// OBSOLETE Describes a program variable. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Variable attributes. These define certain variable semantics to the -// OBSOLETE debugger. -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_var_attr_read_only, /* is read-only (a program literal) */ -// OBSOLETE dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */ -// OBSOLETE dst_var_attr_global, /* is a global definition or reference */ -// OBSOLETE dst_var_attr_compiler_gen, /* is compiler-generated */ -// OBSOLETE dst_var_attr_static, /* has static location */ -// OBSOLETE dst_var_attr_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_var_attr_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_rel_offset_t loffset; /* offset to loc string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of variable definition */ -// OBSOLETE dst_type_t type_desc; /* type descriptor */ -// OBSOLETE unsigned short attributes; /* mask of dst_var_attr_t flags */ -// OBSOLETE } -// OBSOLETE dst_rec_variable_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*---------------- -// OBSOLETE old VAR record -// OBSOLETE ----------------- -// OBSOLETE Used by older compilers to describe a variable -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_var_loc_unknown, /* Actually defined as "unknown" */ -// OBSOLETE dst_var_loc_abs, /* Absolute address */ -// OBSOLETE dst_var_loc_sect_off, /* Absolute address as a section offset */ -// OBSOLETE dst_var_loc_ind_sect_off, /* An indexed section offset ???? */ -// OBSOLETE dst_var_loc_reg, /* register */ -// OBSOLETE dst_var_loc_reg_rel, /* register relative - usually fp */ -// OBSOLETE dst_var_loc_ind_reg_rel, /* Indexed register relative */ -// OBSOLETE dst_var_loc_ftn_ptr_based, /* Fortran pointer based */ -// OBSOLETE dst_var_loc_pc_rel, /* PC relative. Really. */ -// OBSOLETE dst_var_loc_external, /* External */ -// OBSOLETE dst_var_loc_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_var_loc_t; -// OBSOLETE -// OBSOLETE /* Locations come in two versions. The short, and the long. The difference -// OBSOLETE * between the short and the long is the addition of a statement number -// OBSOLETE * field to the start andend of the range of the long, and and unkown -// OBSOLETE * purpose field in the middle. Also, loc_type and loc_index aren't -// OBSOLETE * bitfields in the long version. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short loc_type:4; -// OBSOLETE unsigned short loc_index:12; -// OBSOLETE long location; -// OBSOLETE short start_line; /* start_line and end_line? */ -// OBSOLETE short end_line; /* I'm guessing here. */ -// OBSOLETE } -// OBSOLETE dst_var_loc_short_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short loc_type; -// OBSOLETE unsigned short loc_index; -// OBSOLETE long location; -// OBSOLETE short unknown; /* Always 0003 or 3b3c. Why? */ -// OBSOLETE short start_statement; -// OBSOLETE short start_line; -// OBSOLETE short end_statement; -// OBSOLETE short end_line; -// OBSOLETE } -// OBSOLETE dst_var_loc_long_t; -// OBSOLETE -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of description */ -// OBSOLETE dst_type_t type_desc; /* Type description */ -// OBSOLETE unsigned short attributes; /* mask of dst_var_attr_t flags */ -// OBSOLETE unsigned short no_of_locs:15; /* Number of locations */ -// OBSOLETE unsigned short short_locs:1; /* True if short locations. */ -// OBSOLETE union -// OBSOLETE { -// OBSOLETE dst_var_loc_short_t shorts[dst_dummy_array_size]; -// OBSOLETE dst_var_loc_long_t longs[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE locs; -// OBSOLETE } -// OBSOLETE dst_rec_var_t; -// OBSOLETE -// OBSOLETE /*---------------- -// OBSOLETE old LABEL record -// OBSOLETE ----------------- -// OBSOLETE Used by older compilers to describe a label -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of description */ -// OBSOLETE char location[12]; /* location string */ -// OBSOLETE } -// OBSOLETE dst_rec_old_label_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*---------------- -// OBSOLETE POINTER record -// OBSOLETE ---------------- -// OBSOLETE Describes a pointer type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to the name string for this type */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_type_t type_desc; /* base type of this pointer */ -// OBSOLETE } -// OBSOLETE dst_rec_pointer_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------- -// OBSOLETE ARRAY record -// OBSOLETE ------------- -// OBSOLETE Describes an array type. -// OBSOLETE -// OBSOLETE Multidimensional arrays are described with a number of dst_rec_array_t -// OBSOLETE records, one per array dimension, each linked to the next through the -// OBSOLETE elem_type_desc.doffset field. Each record must have its multi_dim flag -// OBSOLETE set. -// OBSOLETE -// OBSOLETE If column_major is true (as with FORTRAN arrays) then the last array bound in -// OBSOLETE the declaration is the first array index in memory, which is the opposite of -// OBSOLETE the usual case (as with Pascal and C arrays). -// OBSOLETE -// OBSOLETE Variable array bounds are described by auxiliary records; if aux_var_bound -// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are -// OBSOLETE ignored by the debugger. -// OBSOLETE -// OBSOLETE span_comp identifies one of the language-dependent ways in which the distance -// OBSOLETE between successive array elements (span) is calculated. -// OBSOLETE dst_use_span_field -- the span is the value of span field. -// OBSOLETE dst_compute_from_prev -- the span is the size of the previous dimension. -// OBSOLETE dst_compute_from_next -- the span is the size of the next dimension. -// OBSOLETE In the latter two cases, the span field contains an amount of padding to add -// OBSOLETE to the size of the appropriate dimension to calculate the span. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_use_span_field, -// OBSOLETE dst_compute_from_prev, -// OBSOLETE dst_compute_from_next, -// OBSOLETE dst_span_comp_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_span_comp_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_type_t elem_type_desc; /* array element type */ -// OBSOLETE dst_type_t indx_type_desc; /* array index type */ -// OBSOLETE long lo_bound; /* lower bound of index */ -// OBSOLETE long hi_bound; /* upper bound of index */ -// OBSOLETE unsigned long span; /* see above */ -// OBSOLETE unsigned long size; /* total array size (bytes) */ -// OBSOLETE boolean multi_dim:1; -// OBSOLETE boolean is_packed:1; /* true if packed array */ -// OBSOLETE boolean is_signed:1; /* true if packed elements are signed */ -// OBSOLETE dst_span_comp_t span_comp:2; /* how to compute span */ -// OBSOLETE boolean column_major:1; -// OBSOLETE unsigned short reserved:2; /* must be zero */ -// OBSOLETE unsigned short elem_size:8; /* element size if packed (bits) */ -// OBSOLETE } -// OBSOLETE dst_rec_array_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------- -// OBSOLETE SUBRANGE record -// OBSOLETE ----------------- -// OBSOLETE Describes a subrange type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Variable subrange bounds are described by auxiliary records; if aux_var_bound -// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are -// OBSOLETE ignored by the debugger. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of subrange definition */ -// OBSOLETE dst_type_t type_desc; /* parent type */ -// OBSOLETE long lo_bound; /* lower bound of subrange */ -// OBSOLETE long hi_bound; /* upper bound of subrange */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE } -// OBSOLETE dst_rec_subrange_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*--------------- -// OBSOLETE STRING record -// OBSOLETE --------------- -// OBSOLETE Describes a string type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Variable subrange bounds are described by auxiliary records; if aux_var_bound -// OBSOLETE records are present, the lo_bound and hi_bound fields of this record are -// OBSOLETE ignored by the debugger. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of string definition */ -// OBSOLETE dst_type_t elem_type_desc; /* element type */ -// OBSOLETE dst_type_t indx_type_desc; /* index type */ -// OBSOLETE long lo_bound; /* lower bound */ -// OBSOLETE long hi_bound; /* upper bound */ -// OBSOLETE unsigned long size; /* total string size (bytes) if fixed */ -// OBSOLETE } -// OBSOLETE dst_rec_string_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*--------------- -// OBSOLETE SET record -// OBSOLETE --------------- -// OBSOLETE Describes a set type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_type_t type_desc; /* element type */ -// OBSOLETE unsigned short nbits; /* number of bits in set */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE } -// OBSOLETE dst_rec_set_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------------- -// OBSOLETE IMPLICIT ENUMERATION record -// OBSOLETE ----------------------------- -// OBSOLETE Describes an enumeration type with implicit element values = 0, 1, 2, ... -// OBSOLETE (Pascal-style). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE unsigned short nelems; /* number of elements in enumeration */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE /* offsets to name strings of elements 0, 1, 2, ... */ -// OBSOLETE dst_rel_offset_t elem_noffsets[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE dst_rec_implicit_enum_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------------- -// OBSOLETE EXPLICIT ENUMERATION record -// OBSOLETE ----------------------------- -// OBSOLETE Describes an enumeration type with explicitly assigned element values -// OBSOLETE (C-style). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to element name string */ -// OBSOLETE long value; /* element value */ -// OBSOLETE } -// OBSOLETE dst_enum_elem_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE unsigned short nelems; /* number of elements in enumeration */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE /* name/value pairs, one describing each enumeration value: */ -// OBSOLETE dst_enum_elem_t elems[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE dst_rec_explicit_enum_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE RECORD / UNION record -// OBSOLETE ----------------------- -// OBSOLETE Describes a record (struct) or union. -// OBSOLETE -// OBSOLETE If the record is larger than 2**16 bytes then an attached aux record -// OBSOLETE specifies its size. Also, if the record is stored in short form then -// OBSOLETE attached records specify field offsets larger than 2**16 bytes. -// OBSOLETE -// OBSOLETE Whether the fields[] array or sfields[] array is used is selected by -// OBSOLETE the dst_rec_type_t of the overall dst record. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* -// OBSOLETE Record field descriptor, short form. This form handles only fields which -// OBSOLETE are an even number of bytes long, located some number of bytes from the -// OBSOLETE start of the record. -// OBSOLETE */ -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to field name string */ -// OBSOLETE dst_type_t type_desc; /* field type */ -// OBSOLETE unsigned short foffset; /* field offset from start of record (bytes) */ -// OBSOLETE } -// OBSOLETE dst_short_field_t ALIGNED1; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_type_t type_desc; /* field type */ -// OBSOLETE unsigned short foffset; /* byte offset */ -// OBSOLETE unsigned short is_packed:1; /* True if field is packed */ -// OBSOLETE unsigned short bit_offset:6; /* Bit offset */ -// OBSOLETE unsigned short size:6; /* Size in bits */ -// OBSOLETE unsigned short sign:1; /* True if signed */ -// OBSOLETE unsigned short pad:2; /* Padding. Must be 0 */ -// OBSOLETE } -// OBSOLETE dst_old_field_t ALIGNED1; -// OBSOLETE -// OBSOLETE /* Tag enumeration for long record field descriptor: -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_field_byte, -// OBSOLETE dst_field_bit, -// OBSOLETE dst_field_loc, -// OBSOLETE dst_field_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_field_format_t; -// OBSOLETE -// OBSOLETE /* -// OBSOLETE Record field descriptor, long form. The format of the field information -// OBSOLETE is identified by the format_tag, which contains one of the above values. -// OBSOLETE The field_byte variant is equivalent to the short form of field descriptor. -// OBSOLETE The field_bit variant handles fields which are any number of bits long, -// OBSOLETE located some number of bits from the start of the record. The field_loc -// OBSOLETE variant allows the location of the field to be described by a general loc -// OBSOLETE string. -// OBSOLETE */ -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name of field */ -// OBSOLETE dst_type_t type_desc; /* type of field */ -// OBSOLETE union -// OBSOLETE { -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_byte */ -// OBSOLETE unsigned long offset:30; /* offset of field in bytes */ -// OBSOLETE } -// OBSOLETE field_byte ALIGNED1; -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_bit */ -// OBSOLETE unsigned long nbits:6; /* bit size of field */ -// OBSOLETE unsigned long is_signed:1; /* signed/unsigned attribute */ -// OBSOLETE unsigned long bit_offset:3; /* bit offset from byte boundary */ -// OBSOLETE int pad:4; /* must be zero */ -// OBSOLETE unsigned short byte_offset; /* offset of byte boundary */ -// OBSOLETE } -// OBSOLETE field_bit ALIGNED1; -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE dst_field_format_t format_tag:2; /* dst_field_loc */ -// OBSOLETE int loffset:30; /* dst_rel_offset_t to loc string */ -// OBSOLETE } -// OBSOLETE field_loc ALIGNED1; -// OBSOLETE } -// OBSOLETE f ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_field_t; -// OBSOLETE -// OBSOLETE /* The field_loc.loffset field is a 30-bit signed value. Some versions of C do -// OBSOLETE not support signed bit fields. The following macro will extract that field -// OBSOLETE as a signed value: -// OBSOLETE */ -// OBSOLETE #define dst_field_loffset(field_rec) \ -// OBSOLETE ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 ) -// OBSOLETE -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to record name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line where this record is defined */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE unsigned short nfields; /* number of fields in this record */ -// OBSOLETE union -// OBSOLETE { -// OBSOLETE dst_field_t fields[dst_dummy_array_size]; -// OBSOLETE dst_short_field_t sfields[dst_dummy_array_size]; -// OBSOLETE dst_old_field_t ofields[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE f; /* array of fields */ -// OBSOLETE } -// OBSOLETE dst_rec_record_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------- -// OBSOLETE FILE record -// OBSOLETE ------------- -// OBSOLETE Describes a file type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line where type was defined */ -// OBSOLETE dst_type_t type_desc; /* file element type */ -// OBSOLETE } -// OBSOLETE dst_rec_file_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*--------------- -// OBSOLETE OFFSET record -// OBSOLETE --------------- -// OBSOLETE Describes a Pascal offset type. -// OBSOLETE (This type, an undocumented Domain Pascal extension, is currently not -// OBSOLETE supported by the debugger) -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to the name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_type_t area_type_desc; /* area type */ -// OBSOLETE dst_type_t base_type_desc; /* base type */ -// OBSOLETE long lo_bound; /* low bound of the offset range */ -// OBSOLETE long hi_bound; /* high bound of the offset range */ -// OBSOLETE long bias; /* bias */ -// OBSOLETE unsigned short scale; /* scale factor */ -// OBSOLETE unsigned short size; /* storage size (bytes) */ -// OBSOLETE } -// OBSOLETE dst_rec_offset_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*-------------- -// OBSOLETE ALIAS record -// OBSOLETE -------------- -// OBSOLETE Describes a type alias (e.g., typedef). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_type_t type_desc; /* parent type */ -// OBSOLETE } -// OBSOLETE dst_rec_alias_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------------ -// OBSOLETE SIGNATURE record -// OBSOLETE ------------------ -// OBSOLETE Describes a procedure/function type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Enumeration of argument semantics. Note that most are mutually -// OBSOLETE exclusive. -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_arg_attr_val, /* passed by value */ -// OBSOLETE dst_arg_attr_ref, /* passed by reference */ -// OBSOLETE dst_arg_attr_name, /* passed by name */ -// OBSOLETE dst_arg_attr_in, /* readable in the callee */ -// OBSOLETE dst_arg_attr_out, /* writable in the callee */ -// OBSOLETE dst_arg_attr_hidden, /* not visible in the caller */ -// OBSOLETE dst_arg_attr_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_arg_attr_t; -// OBSOLETE -// OBSOLETE /* Argument descriptor. Actually points to a variable record for most of the -// OBSOLETE information. -// OBSOLETE */ -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t var_offset; /* offset to variable record */ -// OBSOLETE unsigned short attributes; /* a mask of dst_arg_attr_t flags */ -// OBSOLETE } -// OBSOLETE dst_arg_t ALIGNED1; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to name string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of function definition */ -// OBSOLETE dst_rel_offset_t result; /* offset to function result variable record */ -// OBSOLETE unsigned short nargs; /* number of arguments */ -// OBSOLETE dst_arg_t args[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE dst_rec_signature_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*-------------- -// OBSOLETE SCOPE record -// OBSOLETE -------------- -// OBSOLETE Obsolete. Use the new ENTRY type instead. -// OBSOLETE Old compilers may put this in as the first entry in a function, -// OBSOLETE terminated by an end of scope entry. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* Name offset */ -// OBSOLETE dst_src_loc_t start_line; /* Starting line */ -// OBSOLETE dst_src_loc_t end_line; /* Ending line */ -// OBSOLETE } -// OBSOLETE dst_rec_scope_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*-------------- -// OBSOLETE ENTRY record -// OBSOLETE -------------- -// OBSOLETE Describes a procedure/function entry point. An entry record is to a -// OBSOLETE signature record roughly as a variable record is to a type descriptor record. -// OBSOLETE -// OBSOLETE The entry_number field is keyed to the entry numbers in .lines -- the -// OBSOLETE debugger locates the code location of an entry by searching the line -// OBSOLETE number table for an entry numbered with the value of entry_number. The -// OBSOLETE main entry is numbered zero. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to entry name string */ -// OBSOLETE dst_rel_offset_t loffset; /* where to jump to call this entry */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE dst_rel_offset_t sig_desc; /* offset to signature descriptor */ -// OBSOLETE unsigned int entry_number:8; -// OBSOLETE int pad:8; /* must be zero */ -// OBSOLETE } -// OBSOLETE dst_rec_entry_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE Old format ENTRY record -// OBSOLETE ----------------------- -// OBSOLETE Supposedly obsolete but still used by some compilers. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* Offset to entry name string */ -// OBSOLETE dst_src_loc_t src_loc; /* Location in source */ -// OBSOLETE dst_rel_offset_t sig_desc; /* Signature description */ -// OBSOLETE char unknown[36]; -// OBSOLETE } -// OBSOLETE dst_rec_old_entry_t ALIGNED1; -// OBSOLETE -// OBSOLETE /*-------------- -// OBSOLETE LABEL record -// OBSOLETE -------------- -// OBSOLETE Describes a program label. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t noffset; /* offset to label string */ -// OBSOLETE dst_rel_offset_t loffset; /* offset to loc string */ -// OBSOLETE dst_src_loc_t src_loc; /* file/line of definition */ -// OBSOLETE } -// OBSOLETE dst_rec_label_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE AUXILIARY SIZE record -// OBSOLETE ----------------------- -// OBSOLETE May appear in the auxiliary record list of any type or variable record to -// OBSOLETE modify the default size of the type or variable. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned long size; /* size (bytes) */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_size_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE AUXILIARY ALIGN record -// OBSOLETE ----------------------- -// OBSOLETE May appear in the auxiliary record list of any type or variable record to -// OBSOLETE modify the default alignment of the type or variable. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short alignment; /* # of low order zero bits */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_align_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------------- -// OBSOLETE AUXILIARY FIELD SIZE record -// OBSOLETE ----------------------------- -// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to -// OBSOLETE modify the default size of a field. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short field_no; /* field number */ -// OBSOLETE unsigned long size; /* size (bits) */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_field_size_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------------- -// OBSOLETE AUXILIARY FIELD OFFSET record -// OBSOLETE ----------------------------- -// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to -// OBSOLETE specify a field offset larger than 2**16. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short field_no; /* field number */ -// OBSOLETE unsigned long foffset; /* offset */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_field_off_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------------- -// OBSOLETE AUXILIARY FIELD ALIGN record -// OBSOLETE ----------------------------- -// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to -// OBSOLETE modify the default alignment of a field. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short field_no; /* field number */ -// OBSOLETE unsigned short alignment; /* number of low order zero bits */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_field_align_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*---------------------------- -// OBSOLETE AUXILIARY VAR BOUND record -// OBSOLETE ---------------------------- -// OBSOLETE May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING -// OBSOLETE record to describe a variable bound for the range of the type. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_low_bound, /* the low bound is variable */ -// OBSOLETE dst_high_bound, /* the high bound is variable */ -// OBSOLETE dst_var_bound_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_var_bound_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short which; /* which bound */ -// OBSOLETE dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_var_bound_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*---------------------------------- -// OBSOLETE AUXILIARY TYPE DERIVATION record -// OBSOLETE ---------------------------------- -// OBSOLETE May appear in the auxiliary record list of any RECORD/UNION record to denote -// OBSOLETE class inheritance of that type from a parent type. -// OBSOLETE -// OBSOLETE Inheritance implies that it is possible to convert the inheritor type to the -// OBSOLETE inherited type, retaining those fields which were inherited. To allow this, -// OBSOLETE orig_field_no, a field number into the record type, is provided. If -// OBSOLETE orig_is_pointer is false, then the start of the inherited record is located -// OBSOLETE at the location of the field indexed by orig_field_no. If orig_is_pointer -// OBSOLETE is true, then it is located at the address contained in the field indexed -// OBSOLETE by orig_field_no (assumed to be a pointer). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_type_t parent_type; /* reference to inherited type */ -// OBSOLETE unsigned short orig_field_no; -// OBSOLETE boolean orig_is_pointer:1; -// OBSOLETE int unused:15; /* must be zero */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_type_deriv_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------------------------------ -// OBSOLETE AUXILIARY VARIABLE LIFETIME record -// OBSOLETE ------------------------------------ -// OBSOLETE May appear in the auxiliary record list of a VARIABLE record to add location -// OBSOLETE information for an additional variable lifetime. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t loffset; -// OBSOLETE } -// OBSOLETE dst_rec_aux_lifetime_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------------------------- -// OBSOLETE AUXILIARY POINTER BASE record -// OBSOLETE ------------------------------- -// OBSOLETE May appear in the auxiliary record list of a VARIABLE record to provide a -// OBSOLETE pointer base to substitute for references to any such bases in the location -// OBSOLETE string of the variable. A pointer base is another VARIABLE record. When -// OBSOLETE the variable is evaluated by the debugger, it uses the current value of the -// OBSOLETE pointer base variable in computing its location. -// OBSOLETE -// OBSOLETE This is useful for representing FORTRAN pointer-based variables. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t voffset; -// OBSOLETE } -// OBSOLETE dst_rec_aux_ptr_base_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*--------------------------------- -// OBSOLETE AUXILIARY REGISTER VALUE record -// OBSOLETE --------------------------------- -// OBSOLETE May appear in the auxiliary record list of an ENTRY record to specify -// OBSOLETE a register that must be set to a specific value before jumping to the entry -// OBSOLETE point in a debugger "call". The debugger must set the debuggee register, -// OBSOLETE specified by the register code, to the value of the *address* to which the -// OBSOLETE location string resolves. If the address is register-relative, then the -// OBSOLETE call cannot be made unless the current stack frame is the lexical parent -// OBSOLETE of the entry. An example of this is when a (Pascal) nested procedure -// OBSOLETE contains references to its parent's variables, which it accesses through -// OBSOLETE a static link register. The static link register must be set to some -// OBSOLETE address relative to the parent's stack base register. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short reg; /* identifies register to set (isp enum) */ -// OBSOLETE dst_rel_offset_t loffset; /* references a location string */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_reg_val_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*==========================================================*/ -// OBSOLETE /*========== RECORDS USED IN .blocks AND .symbols ==========*/ -// OBSOLETE /*==========================================================*/ -// OBSOLETE -// OBSOLETE /*--------------------- -// OBSOLETE STRING TABLE record -// OBSOLETE --------------------- -// OBSOLETE A string table record contains any number of null-terminated, variable length -// OBSOLETE strings. The length field gives the size in bytes of the text field, which -// OBSOLETE can be any size. -// OBSOLETE -// OBSOLETE The global name table shares this format. This record appears in the -// OBSOLETE .blocks section. Each string in the table identifies a global defined in -// OBSOLETE the current compilation unit. -// OBSOLETE -// OBSOLETE The loc pool record shares this format as well. Loc strings are described -// OBSOLETE elsewhere. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned long length; -// OBSOLETE char text[dst_dummy_array_size]; -// OBSOLETE } -// OBSOLETE dst_rec_string_tab_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*----------------------- -// OBSOLETE AUXILIARY QUAL record -// OBSOLETE ----------------------- -// OBSOLETE May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record -// OBSOLETE to provide it with a fully-qualified, language-dependent name. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t lang_qual_name; -// OBSOLETE } -// OBSOLETE dst_rec_aux_qual_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*---------------- -// OBSOLETE FORWARD record -// OBSOLETE ---------------- -// OBSOLETE Reference to a record somewhere else. This allows identical definitions in -// OBSOLETE different scopes to share data. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rel_offset_t rec_off; -// OBSOLETE } -// OBSOLETE dst_rec_forward_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------------------------- -// OBSOLETE AUXILIARY SOURCE RANGE record -// OBSOLETE ------------------------------- -// OBSOLETE May appear in the auxiliary record list of any BLOCK record to specify a -// OBSOLETE range of source lines over which the block is active. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_src_loc_t first_line; /* first source line */ -// OBSOLETE dst_src_loc_t last_line; /* last source line */ -// OBSOLETE } -// OBSOLETE dst_rec_aux_src_range_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*------------------ -// OBSOLETE EXTENSION record -// OBSOLETE ------------------ -// OBSOLETE Provision for "foreign" records, such as might be generated by a non-Apollo -// OBSOLETE compiler. Apollo software will ignore these. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE unsigned short rec_size; /* record size (bytes) */ -// OBSOLETE unsigned short ext_type; /* defined by whoever generates it */ -// OBSOLETE unsigned short ext_data; /* place-holder for arbitrary amount of data */ -// OBSOLETE } -// OBSOLETE dst_rec_extension_t ALIGNED1; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records. -// OBSOLETE ** -// OBSOLETE ** This record ties together all previous .blocks and .symbols records -// OBSOLETE ** together in a union with a common header. The rec_type field of the -// OBSOLETE ** header identifies the record type. The rec_flags field currently only -// OBSOLETE ** defines auxiliary record lists. -// OBSOLETE ** -// OBSOLETE ** If a record carries with it a non-null auxiliary record list, its -// OBSOLETE ** dst_flag_has_aux_recs flag is set, and each of the records that follow -// OBSOLETE ** it are treated as its auxiliary records, until the end of the compilation -// OBSOLETE ** unit or scope is reached, or until an auxiliary record with its -// OBSOLETE ** dst_flag_last_aux_rec flag set is reached. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_flag_has_aux_recs, -// OBSOLETE dst_flag_last_aux_rec, -// OBSOLETE dst_rec_flag_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_rec_flags_t; -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE dst_rec_type_t rec_type:8; /* record type */ -// OBSOLETE int rec_flags:8; /* mask of dst_rec_flags_t */ -// OBSOLETE union /* switched on rec_type field above */ -// OBSOLETE { -// OBSOLETE /* dst_typ_pad requires no additional fields */ -// OBSOLETE dst_rec_comp_unit_t comp_unit_; -// OBSOLETE dst_rec_section_tab_t section_tab_; -// OBSOLETE dst_rec_file_tab_t file_tab_; -// OBSOLETE dst_rec_block_t block_; -// OBSOLETE dst_rec_var_t var_; -// OBSOLETE dst_rec_pointer_t pointer_; -// OBSOLETE dst_rec_array_t array_; -// OBSOLETE dst_rec_subrange_t subrange_; -// OBSOLETE dst_rec_set_t set_; -// OBSOLETE dst_rec_implicit_enum_t implicit_enum_; -// OBSOLETE dst_rec_explicit_enum_t explicit_enum_; -// OBSOLETE /* dst_typ_short_{rec,union} are represented by 'rec' (below) */ -// OBSOLETE dst_rec_file_t file_; -// OBSOLETE dst_rec_offset_t offset_; -// OBSOLETE dst_rec_alias_t alias_; -// OBSOLETE dst_rec_signature_t signature_; -// OBSOLETE dst_rec_old_label_t old_label_; -// OBSOLETE dst_rec_scope_t scope_; -// OBSOLETE /* dst_typ_end_scope requires no additional fields */ -// OBSOLETE dst_rec_string_tab_t string_tab_; -// OBSOLETE /* dst_typ_global_name_tab is represented by 'string_tab' (above) */ -// OBSOLETE dst_rec_forward_t forward_; -// OBSOLETE dst_rec_aux_size_t aux_size_; -// OBSOLETE dst_rec_aux_align_t aux_align_; -// OBSOLETE dst_rec_aux_field_size_t aux_field_size_; -// OBSOLETE dst_rec_aux_field_off_t aux_field_off_; -// OBSOLETE dst_rec_aux_field_align_t aux_field_align_; -// OBSOLETE dst_rec_aux_qual_t aux_qual_; -// OBSOLETE dst_rec_aux_var_bound_t aux_var_bound_; -// OBSOLETE dst_rec_extension_t extension_; -// OBSOLETE dst_rec_string_t string_; -// OBSOLETE dst_rec_const_t const_; -// OBSOLETE /* dst_typ_reference is represented by 'pointer' (above) */ -// OBSOLETE dst_rec_record_t record_; -// OBSOLETE /* dst_typ_union is represented by 'record' (above) */ -// OBSOLETE dst_rec_aux_type_deriv_t aux_type_deriv_; -// OBSOLETE /* dst_typ_locpool is represented by 'string_tab' (above) */ -// OBSOLETE dst_rec_variable_t variable_; -// OBSOLETE dst_rec_label_t label_; -// OBSOLETE dst_rec_entry_t entry_; -// OBSOLETE dst_rec_aux_lifetime_t aux_lifetime_; -// OBSOLETE dst_rec_aux_ptr_base_t aux_ptr_base_; -// OBSOLETE dst_rec_aux_src_range_t aux_src_range_; -// OBSOLETE dst_rec_aux_reg_val_t aux_reg_val_; -// OBSOLETE dst_rec_name_tab_t aux_unit_names_; -// OBSOLETE dst_rec_sect_info_tab_t aux_sect_info_; -// OBSOLETE } -// OBSOLETE rec_data ALIGNED1; -// OBSOLETE } -// OBSOLETE dst_rec_t, *dst_rec_ptr_t; -// OBSOLETE -// OBSOLETE -// OBSOLETE /*===============================================*/ -// OBSOLETE /*========== .lines SECTION DEFINITIONS =========*/ -// OBSOLETE /*===============================================*/ -// OBSOLETE /* -// OBSOLETE The .lines section contains a sequence of line number tables. There is no -// OBSOLETE record structure within the section. The start of the table for a routine -// OBSOLETE is pointed to by the block record, and the end of the table is signaled by -// OBSOLETE an escape code. -// OBSOLETE -// OBSOLETE A line number table is a sequence of bytes. The default entry contains a line -// OBSOLETE number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4 -// OBSOLETE bits. Special cases, including when one or both of the values is too large -// OBSOLETE to fit in 4 bits and other special cases are handled through escape entries. -// OBSOLETE Escape entries are identified by the value 0x8 in the high 4 bits. The low 4 -// OBSOLETE bits are occupied by a function code. Some escape entries are followed by -// OBSOLETE additional arguments, which may be bytes, words, or longwords. This data is -// OBSOLETE not aligned. -// OBSOLETE -// OBSOLETE The initial PC offset, file number and line number are zero. Normally, the -// OBSOLETE table begins with a dst_ln_file escape which establishes the initial file -// OBSOLETE and line number. All PC deltas are unsigned (thus the table is ordered by -// OBSOLETE increasing PC); line number deltas are signed. The table ends with a -// OBSOLETE dst_ln_end escape, which is followed by a final table entry whose PC delta -// OBSOLETE gives the code size of the last statement. -// OBSOLETE -// OBSOLETE Escape Semantic -// OBSOLETE --------- ------------------------------------------------------------ -// OBSOLETE file Changes file state. The current source file remains constant -// OBSOLETE until another file escape. Though the line number state is -// OBSOLETE also updated by a file escape, a file escape does NOT -// OBSOLETE constitute a line table entry. -// OBSOLETE -// OBSOLETE statement Alters the statement number of the next table entry. By -// OBSOLETE default, all table entries refer to the first statement on a -// OBSOLETE line. Statement number one is the second statement, and so on. -// OBSOLETE -// OBSOLETE entry Identifies the next table entry as the position of an entry -// OBSOLETE point for the current block. The PC position should follow -// OBSOLETE any procedure prologue code. An argument specifies the entry -// OBSOLETE number, which is keyed to the entry number of the corresponding -// OBSOLETE .symbols ENTRY record. -// OBSOLETE -// OBSOLETE exit Identifies the next table entry as the last position within -// OBSOLETE the current block before a procedure epiloge and subsequent -// OBSOLETE procedure exit. -// OBSOLETE -// OBSOLETE gap By default, the executable code corresponding to a table entry -// OBSOLETE is assumed to extend to the beginning of the next table entry. -// OBSOLETE If this is not the case--there is a "hole" in the table--then -// OBSOLETE a gap escape should follow the first table entry to specify -// OBSOLETE where the code for that entry ends. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #define dst_ln_escape_flag -8 -// OBSOLETE -// OBSOLETE /* -// OBSOLETE Escape function codes: -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_ln_pad, /* pad byte */ -// OBSOLETE dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */ -// OBSOLETE dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */ -// OBSOLETE dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */ -// OBSOLETE dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ -// OBSOLETE dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */ -// OBSOLETE dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */ -// OBSOLETE dst_ln_ln_off, /* statement escape, stmt # = next byte */ -// OBSOLETE dst_ln_entry, /* entry escape, next byte is entry number */ -// OBSOLETE dst_ln_exit, /* exit escape */ -// OBSOLETE dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */ -// OBSOLETE dst_ln_escape_11, /* reserved */ -// OBSOLETE dst_ln_escape_12, /* reserved */ -// OBSOLETE dst_ln_escape_13, /* reserved */ -// OBSOLETE dst_ln_nxt_byte, /* next byte contains the real escape code */ -// OBSOLETE dst_ln_end, /* end escape, final entry follows */ -// OBSOLETE dst_ln_escape_END_OF_ENUM -// OBSOLETE } -// OBSOLETE dst_ln_escape_t; -// OBSOLETE -// OBSOLETE /* -// OBSOLETE Line number table entry -// OBSOLETE */ -// OBSOLETE typedef union -// OBSOLETE { -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE unsigned int ln_delta:4; /* 4 bit line number delta */ -// OBSOLETE unsigned int pc_delta:4; /* 4 bit pc delta */ -// OBSOLETE } -// OBSOLETE delta; -// OBSOLETE -// OBSOLETE struct -// OBSOLETE { -// OBSOLETE unsigned int esc_flag:4; /* alias for ln_delta */ -// OBSOLETE dst_ln_escape_t esc_code:4; /* escape function code */ -// OBSOLETE } -// OBSOLETE esc; -// OBSOLETE -// OBSOLETE char sdata; /* signed data byte */ -// OBSOLETE unsigned char udata; /* unsigned data byte */ -// OBSOLETE } -// OBSOLETE dst_ln_entry_t, -// OBSOLETE *dst_ln_entry_ptr_t, -// OBSOLETE dst_ln_table_t[dst_dummy_array_size]; -// OBSOLETE -// OBSOLETE /* The following macro will extract the ln_delta field as a signed value: -// OBSOLETE */ -// OBSOLETE #define dst_ln_ln_delta(ln_rec) \ -// OBSOLETE ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 ) -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE typedef struct dst_sec_struct -// OBSOLETE { -// OBSOLETE char *buffer; -// OBSOLETE long position; -// OBSOLETE long size; -// OBSOLETE long base; -// OBSOLETE } -// OBSOLETE dst_sec; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Macros for access to the data */ -// OBSOLETE -// OBSOLETE #define DST_comp_unit(x) ((x)->rec_data.comp_unit_) -// OBSOLETE #define DST_section_tab(x) ((x)->rec_data.section_tab_) -// OBSOLETE #define DST_file_tab(x) ((x)->rec_data.file_tab_) -// OBSOLETE #define DST_block(x) ((x)->rec_data.block_) -// OBSOLETE #define DST_var(x) ((x)->rec_data.var_) -// OBSOLETE #define DST_pointer(x) ((x)->rec_data.pointer_) -// OBSOLETE #define DST_array(x) ((x)->rec_data.array_) -// OBSOLETE #define DST_subrange(x) ((x)->rec_data.subrange_) -// OBSOLETE #define DST_set(x) ((x)->rec_data.set_) -// OBSOLETE #define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_) -// OBSOLETE #define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_) -// OBSOLETE #define DST_short_rec(x) ((x)->rec_data.record_) -// OBSOLETE #define DST_short_union(x) ((x)->rec_data.record_) -// OBSOLETE #define DST_file(x) ((x)->rec_data.file_) -// OBSOLETE #define DST_offset(x) ((x)->rec_data.offset_) -// OBSOLETE #define DST_alias(x) ((x)->rec_data.alias_) -// OBSOLETE #define DST_signature(x) ((x)->rec_data.signature_) -// OBSOLETE #define DST_old_label(x) ((x)->rec_data.old_label_) -// OBSOLETE #define DST_scope(x) ((x)->rec_data.scope_) -// OBSOLETE #define DST_string_tab(x) ((x)->rec_data.string_tab_) -// OBSOLETE #define DST_global_name_tab(x) ((x)->rec_data.string_tab_) -// OBSOLETE #define DST_forward(x) ((x)->rec_data.forward_) -// OBSOLETE #define DST_aux_size(x) ((x)->rec_data.aux_size_) -// OBSOLETE #define DST_aux_align(x) ((x)->rec_data.aux_align_) -// OBSOLETE #define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_) -// OBSOLETE #define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_) -// OBSOLETE #define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_) -// OBSOLETE #define DST_aux_qual(x) ((x)->rec_data.aux_qual_) -// OBSOLETE #define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_) -// OBSOLETE #define DST_extension(x) ((x)->rec_data.extension_) -// OBSOLETE #define DST_string(x) ((x)->rec_data.string_) -// OBSOLETE #define DST_const(x) ((x)->rec_data.const_) -// OBSOLETE #define DST_reference(x) ((x)->rec_data.pointer_) -// OBSOLETE #define DST_record(x) ((x)->rec_data.record_) -// OBSOLETE #define DST_union(x) ((x)->rec_data.record_) -// OBSOLETE #define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_) -// OBSOLETE #define DST_locpool(x) ((x)->rec_data.string_tab_) -// OBSOLETE #define DST_variable(x) ((x)->rec_data.variable_) -// OBSOLETE #define DST_label(x) ((x)->rec_data.label_) -// OBSOLETE #define DST_entry(x) ((x)->rec_data.entry_) -// OBSOLETE #define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_) -// OBSOLETE #define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_) -// OBSOLETE #define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_) -// OBSOLETE #define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_) -// OBSOLETE #define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_) -// OBSOLETE #define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_) -// OBSOLETE -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Type codes for loc strings. I'm not entirely certain about all of -// OBSOLETE * these, but they seem to work. -// OBSOLETE * troy@cbme.unsw.EDU.AU -// OBSOLETE * If you find a variable whose location can't be decoded, you should -// OBSOLETE * find out it's code using "dstdump -s filename". It will record an -// OBSOLETE * entry for the variable, and give a text representation of what -// OBSOLETE * the locstring means. Before that explaination there will be a -// OBSOLETE * number. In the LOCSTRING table, that number will appear before -// OBSOLETE * the start of the location string. Location string codes are -// OBSOLETE * five bit codes with a 3 bit argument. Check the high 5 bits of -// OBSOLETE * the one byte code, and figure out where it goes in here. -// OBSOLETE * Then figure out exactly what the meaning is and code it in -// OBSOLETE * dstread.c -// OBSOLETE * -// OBSOLETE * Note that ranged locs mean that the variable is in different locations -// OBSOLETE * depending on the current PC. We ignore these because (a) gcc can't handle -// OBSOLETE * them, and (b), If you don't use high levels of optimisation they won't -// OBSOLETE * occur. -// OBSOLETE */ -// OBSOLETE typedef enum -// OBSOLETE { -// OBSOLETE dst_lsc_end, /* End of string */ -// OBSOLETE dst_lsc_indirect, /* Indirect through previous. Arg == 6 */ -// OBSOLETE /* Or register ax (x=arg) */ -// OBSOLETE dst_lsc_dreg, /* register dx (x=arg) */ -// OBSOLETE dst_lsc_03, -// OBSOLETE dst_lsc_section, /* Section (arg+1) */ -// OBSOLETE dst_lsc_05, -// OBSOLETE dst_lsc_06, -// OBSOLETE dst_lsc_add, /* Add (arg+1)*2 */ -// OBSOLETE dst_lsc_sub, /* Subtract (arg+1)*2 */ -// OBSOLETE dst_lsc_09, -// OBSOLETE dst_lsc_0a, -// OBSOLETE dst_lsc_sec_byte, /* Section of next byte+1 */ -// OBSOLETE dst_lsc_add_byte, /* Add next byte (arg == 5) or next word -// OBSOLETE * (arg == 6) -// OBSOLETE */ -// OBSOLETE dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next -// OBSOLETE * word (arg == 6 ?) -// OBSOLETE */ -// OBSOLETE dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0 */ -// OBSOLETE dst_lsc_0f, -// OBSOLETE dst_lsc_ranged, /* location is pc dependent */ -// OBSOLETE dst_lsc_11, -// OBSOLETE dst_lsc_12, -// OBSOLETE dst_lsc_13, -// OBSOLETE dst_lsc_14, -// OBSOLETE dst_lsc_15, -// OBSOLETE dst_lsc_16, -// OBSOLETE dst_lsc_17, -// OBSOLETE dst_lsc_18, -// OBSOLETE dst_lsc_19, -// OBSOLETE dst_lsc_1a, -// OBSOLETE dst_lsc_1b, -// OBSOLETE dst_lsc_1c, -// OBSOLETE dst_lsc_1d, -// OBSOLETE dst_lsc_1e, -// OBSOLETE dst_lsc_1f -// OBSOLETE } -// OBSOLETE dst_loc_string_code_t; -// OBSOLETE -// OBSOLETE /* If the following occurs after an addition/subtraction, that addition -// OBSOLETE * or subtraction should be multiplied by 256. It's a complete byte, not -// OBSOLETE * a code. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #define dst_multiply_256 ((char) 0x73) -// OBSOLETE -// OBSOLETE typedef struct -// OBSOLETE { -// OBSOLETE char code:5; -// OBSOLETE char arg:3; -// OBSOLETE } -// OBSOLETE dst_loc_header_t ALIGNED1; -// OBSOLETE -// OBSOLETE typedef union -// OBSOLETE { -// OBSOLETE dst_loc_header_t header; -// OBSOLETE char data; -// OBSOLETE } -// OBSOLETE dst_loc_entry_t ALIGNED1; -// OBSOLETE -// OBSOLETE #undef ALIGNED1 -// OBSOLETE #endif /* apollo_dst_h */ diff --git a/gdb/dstread.c b/gdb/dstread.c deleted file mode 100644 index 8692c98..0000000 --- a/gdb/dstread.c +++ /dev/null @@ -1,1598 +0,0 @@ -// OBSOLETE /* Read apollo DST symbol tables and convert to internal format, for GDB. -// OBSOLETE Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au). -// OBSOLETE Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "gdbtypes.h" -// OBSOLETE #include "breakpoint.h" -// OBSOLETE #include "bfd.h" -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "objfiles.h" -// OBSOLETE #include "buildsym.h" -// OBSOLETE #include "gdb_obstack.h" -// OBSOLETE -// OBSOLETE #include "gdb_string.h" -// OBSOLETE -// OBSOLETE #include "dst.h" -// OBSOLETE -// OBSOLETE CORE_ADDR cur_src_start_addr, cur_src_end_addr; -// OBSOLETE dst_sec blocks_info, lines_info, symbols_info; -// OBSOLETE -// OBSOLETE /* Vector of line number information. */ -// OBSOLETE -// OBSOLETE static struct linetable *line_vector; -// OBSOLETE -// OBSOLETE /* Index of next entry to go in line_vector_index. */ -// OBSOLETE -// OBSOLETE static int line_vector_index; -// OBSOLETE -// OBSOLETE /* Last line number recorded in the line vector. */ -// OBSOLETE -// OBSOLETE static int prev_line_number; -// OBSOLETE -// OBSOLETE /* Number of elements allocated for line_vector currently. */ -// OBSOLETE -// OBSOLETE static int line_vector_length; -// OBSOLETE -// OBSOLETE static int init_dst_sections (int); -// OBSOLETE -// OBSOLETE static void read_dst_symtab (struct objfile *); -// OBSOLETE -// OBSOLETE static void find_dst_sections (bfd *, sec_ptr, PTR); -// OBSOLETE -// OBSOLETE static void dst_symfile_init (struct objfile *); -// OBSOLETE -// OBSOLETE static void dst_new_init (struct objfile *); -// OBSOLETE -// OBSOLETE static void dst_symfile_read (struct objfile *, int); -// OBSOLETE -// OBSOLETE static void dst_symfile_finish (struct objfile *); -// OBSOLETE -// OBSOLETE static void dst_end_symtab (struct objfile *); -// OBSOLETE -// OBSOLETE static void complete_symtab (char *, CORE_ADDR, unsigned int); -// OBSOLETE -// OBSOLETE static void dst_start_symtab (void); -// OBSOLETE -// OBSOLETE static void dst_record_line (int, CORE_ADDR); -// OBSOLETE -// OBSOLETE /* Manage the vector of line numbers. */ -// OBSOLETE /* FIXME: Use record_line instead. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_record_line (int line, CORE_ADDR pc) -// OBSOLETE { -// OBSOLETE struct linetable_entry *e; -// OBSOLETE /* Make sure line vector is big enough. */ -// OBSOLETE -// OBSOLETE if (line_vector_index + 2 >= line_vector_length) -// OBSOLETE { -// OBSOLETE line_vector_length *= 2; -// OBSOLETE line_vector = (struct linetable *) -// OBSOLETE xrealloc ((char *) line_vector, sizeof (struct linetable) -// OBSOLETE + (line_vector_length -// OBSOLETE * sizeof (struct linetable_entry))); -// OBSOLETE } -// OBSOLETE -// OBSOLETE e = line_vector->item + line_vector_index++; -// OBSOLETE e->line = line; -// OBSOLETE e->pc = pc; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Start a new symtab for a new source file. -// OBSOLETE It indicates the start of data for one original source file. */ -// OBSOLETE /* FIXME: use start_symtab, like coffread.c now does. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_start_symtab (void) -// OBSOLETE { -// OBSOLETE /* Initialize the source file line number information for this file. */ -// OBSOLETE -// OBSOLETE if (line_vector) /* Unlikely, but maybe possible? */ -// OBSOLETE xfree (line_vector); -// OBSOLETE line_vector_index = 0; -// OBSOLETE line_vector_length = 1000; -// OBSOLETE prev_line_number = -2; /* Force first line number to be explicit */ -// OBSOLETE line_vector = (struct linetable *) -// OBSOLETE xmalloc (sizeof (struct linetable) -// OBSOLETE + line_vector_length * sizeof (struct linetable_entry)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Save the vital information from when starting to read a file, -// OBSOLETE for use when closing off the current file. -// OBSOLETE NAME is the file name the symbols came from, START_ADDR is the first -// OBSOLETE text address for the file, and SIZE is the number of bytes of text. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size) -// OBSOLETE { -// OBSOLETE last_source_file = savestring (name, strlen (name)); -// OBSOLETE cur_src_start_addr = start_addr; -// OBSOLETE cur_src_end_addr = start_addr + size; -// OBSOLETE -// OBSOLETE if (current_objfile->ei.entry_point >= cur_src_start_addr && -// OBSOLETE current_objfile->ei.entry_point < cur_src_end_addr) -// OBSOLETE { -// OBSOLETE current_objfile->ei.entry_file_lowpc = cur_src_start_addr; -// OBSOLETE current_objfile->ei.entry_file_highpc = cur_src_end_addr; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Finish the symbol definitions for one main source file, -// OBSOLETE close off all the lexical contexts for that file -// OBSOLETE (creating struct block's for them), then make the -// OBSOLETE struct symtab for that file and put it in the list of all such. */ -// OBSOLETE /* FIXME: Use end_symtab, like coffread.c now does. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_end_symtab (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE register struct symtab *symtab; -// OBSOLETE register struct blockvector *blockvector; -// OBSOLETE register struct linetable *lv; -// OBSOLETE -// OBSOLETE /* Create the blockvector that points to all the file's blocks. */ -// OBSOLETE -// OBSOLETE blockvector = make_blockvector (objfile); -// OBSOLETE -// OBSOLETE /* Now create the symtab object for this source file. */ -// OBSOLETE symtab = allocate_symtab (last_source_file, objfile); -// OBSOLETE -// OBSOLETE /* Fill in its components. */ -// OBSOLETE symtab->blockvector = blockvector; -// OBSOLETE symtab->free_code = free_linetable; -// OBSOLETE symtab->free_ptr = 0; -// OBSOLETE symtab->filename = last_source_file; -// OBSOLETE symtab->dirname = NULL; -// OBSOLETE symtab->debugformat = obsavestring ("Apollo DST", 10, -// OBSOLETE &objfile->symbol_obstack); -// OBSOLETE lv = line_vector; -// OBSOLETE lv->nitems = line_vector_index; -// OBSOLETE symtab->linetable = (struct linetable *) -// OBSOLETE xrealloc ((char *) lv, (sizeof (struct linetable) -// OBSOLETE + lv->nitems * sizeof (struct linetable_entry))); -// OBSOLETE -// OBSOLETE free_named_symtabs (symtab->filename); -// OBSOLETE -// OBSOLETE /* Reinitialize for beginning of new file. */ -// OBSOLETE line_vector = 0; -// OBSOLETE line_vector_length = -1; -// OBSOLETE last_source_file = NULL; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* dst_symfile_init () -// OBSOLETE is the dst-specific initialization routine for reading symbols. -// OBSOLETE -// OBSOLETE We will only be called if this is a DST or DST-like file. -// OBSOLETE BFD handles figuring out the format of the file, and code in symtab.c -// OBSOLETE uses BFD's determination to vector to us. -// OBSOLETE -// OBSOLETE The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_symfile_init (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE asection *section; -// OBSOLETE bfd *abfd = objfile->obfd; -// OBSOLETE -// OBSOLETE init_entry_point_info (objfile); -// OBSOLETE -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* This function is called for every section; it finds the outer limits -// OBSOLETE of the line table (minimum and maximum file offset) so that the -// OBSOLETE mainline code can read the whole thing for efficiency. */ -// OBSOLETE -// OBSOLETE /* ARGSUSED */ -// OBSOLETE static void -// OBSOLETE find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo) -// OBSOLETE { -// OBSOLETE int size, count; -// OBSOLETE long base; -// OBSOLETE file_ptr offset, maxoff; -// OBSOLETE dst_sec *section; -// OBSOLETE -// OBSOLETE /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ -// OBSOLETE size = asect->_raw_size; -// OBSOLETE offset = asect->filepos; -// OBSOLETE base = asect->vma; -// OBSOLETE /* End of warning */ -// OBSOLETE -// OBSOLETE section = NULL; -// OBSOLETE if (!strcmp (asect->name, ".blocks")) -// OBSOLETE section = &blocks_info; -// OBSOLETE else if (!strcmp (asect->name, ".lines")) -// OBSOLETE section = &lines_info; -// OBSOLETE else if (!strcmp (asect->name, ".symbols")) -// OBSOLETE section = &symbols_info; -// OBSOLETE if (!section) -// OBSOLETE return; -// OBSOLETE section->size = size; -// OBSOLETE section->position = offset; -// OBSOLETE section->base = base; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* The BFD for this file -- only good while we're actively reading -// OBSOLETE symbols into a psymtab or a symtab. */ -// OBSOLETE -// OBSOLETE static bfd *symfile_bfd; -// OBSOLETE -// OBSOLETE /* Read a symbol file, after initialization by dst_symfile_init. */ -// OBSOLETE /* FIXME! Addr and Mainline are not used yet -- this will not work for -// OBSOLETE shared libraries or add_file! */ -// OBSOLETE -// OBSOLETE /* ARGSUSED */ -// OBSOLETE static void -// OBSOLETE dst_symfile_read (struct objfile *objfile, int mainline) -// OBSOLETE { -// OBSOLETE bfd *abfd = objfile->obfd; -// OBSOLETE char *name = bfd_get_filename (abfd); -// OBSOLETE int desc; -// OBSOLETE register int val; -// OBSOLETE int num_symbols; -// OBSOLETE int symtab_offset; -// OBSOLETE int stringtab_offset; -// OBSOLETE -// OBSOLETE symfile_bfd = abfd; /* Kludge for swap routines */ -// OBSOLETE -// OBSOLETE /* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */ -// OBSOLETE desc = fileno ((FILE *) (abfd->iostream)); /* File descriptor */ -// OBSOLETE -// OBSOLETE /* Read the line number table, all at once. */ -// OBSOLETE bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL); -// OBSOLETE -// OBSOLETE val = init_dst_sections (desc); -// OBSOLETE if (val < 0) -// OBSOLETE error ("\"%s\": error reading debugging symbol tables\n", name); -// OBSOLETE -// OBSOLETE init_minimal_symbol_collection (); -// OBSOLETE make_cleanup_discard_minimal_symbols (); -// OBSOLETE -// OBSOLETE /* Now that the executable file is positioned at symbol table, -// OBSOLETE process it and define symbols accordingly. */ -// OBSOLETE -// OBSOLETE read_dst_symtab (objfile); -// OBSOLETE -// OBSOLETE /* Sort symbols alphabetically within each block. */ -// OBSOLETE -// OBSOLETE { -// OBSOLETE struct symtab *s; -// OBSOLETE for (s = objfile->symtabs; s != NULL; s = s->next) -// OBSOLETE { -// OBSOLETE sort_symtab_syms (s); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Install any minimal symbols that have been collected as the current -// OBSOLETE minimal symbols for this objfile. */ -// OBSOLETE -// OBSOLETE install_minimal_symbols (objfile); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_new_init (struct objfile *ignore) -// OBSOLETE { -// OBSOLETE /* Nothin' to do */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Perform any local cleanups required when we are done with a particular -// OBSOLETE objfile. I.E, we are in the process of discarding all symbol information -// OBSOLETE for an objfile, freeing up all memory held for it, and unlinking the -// OBSOLETE objfile struct from the global list of known objfiles. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE dst_symfile_finish (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE /* Nothing to do */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Get the next line number from the DST. Returns 0 when we hit an -// OBSOLETE * end directive or cannot continue for any other reason. -// OBSOLETE * -// OBSOLETE * Note that ordinary pc deltas are multiplied by two. Apparently -// OBSOLETE * this is what was really intended. -// OBSOLETE */ -// OBSOLETE static int -// OBSOLETE get_dst_line (signed char **buffer, long *pc) -// OBSOLETE { -// OBSOLETE static last_pc = 0; -// OBSOLETE static long last_line = 0; -// OBSOLETE static int last_file = 0; -// OBSOLETE dst_ln_entry_ptr_t entry; -// OBSOLETE int size; -// OBSOLETE dst_src_loc_t *src_loc; -// OBSOLETE -// OBSOLETE if (*pc != -1) -// OBSOLETE { -// OBSOLETE last_pc = *pc; -// OBSOLETE *pc = -1; -// OBSOLETE } -// OBSOLETE entry = (dst_ln_entry_ptr_t) * buffer; -// OBSOLETE -// OBSOLETE while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag) -// OBSOLETE { -// OBSOLETE switch (entry->esc.esc_code) -// OBSOLETE { -// OBSOLETE case dst_ln_pad: -// OBSOLETE size = 1; /* pad byte */ -// OBSOLETE break; -// OBSOLETE case dst_ln_file: -// OBSOLETE /* file escape. Next 4 bytes are a dst_src_loc_t */ -// OBSOLETE size = 5; -// OBSOLETE src_loc = (dst_src_loc_t *) (*buffer + 1); -// OBSOLETE last_line = src_loc->line_number; -// OBSOLETE last_file = src_loc->file_index; -// OBSOLETE break; -// OBSOLETE case dst_ln_dln1_dpc1: -// OBSOLETE /* 1 byte line delta, 1 byte pc delta */ -// OBSOLETE last_line += (*buffer)[1]; -// OBSOLETE last_pc += 2 * (unsigned char) (*buffer)[2]; -// OBSOLETE dst_record_line (last_line, last_pc); -// OBSOLETE size = 3; -// OBSOLETE break; -// OBSOLETE case dst_ln_dln2_dpc2: -// OBSOLETE /* 2 bytes line delta, 2 bytes pc delta */ -// OBSOLETE last_line += *(short *) (*buffer + 1); -// OBSOLETE last_pc += 2 * (*(short *) (*buffer + 3)); -// OBSOLETE size = 5; -// OBSOLETE dst_record_line (last_line, last_pc); -// OBSOLETE break; -// OBSOLETE case dst_ln_ln4_pc4: -// OBSOLETE /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */ -// OBSOLETE last_line = *(unsigned long *) (*buffer + 1); -// OBSOLETE last_pc = *(unsigned long *) (*buffer + 5); -// OBSOLETE size = 9; -// OBSOLETE dst_record_line (last_line, last_pc); -// OBSOLETE break; -// OBSOLETE case dst_ln_dln1_dpc0: -// OBSOLETE /* 1 byte line delta, pc delta = 0 */ -// OBSOLETE size = 2; -// OBSOLETE last_line += (*buffer)[1]; -// OBSOLETE break; -// OBSOLETE case dst_ln_ln_off_1: -// OBSOLETE /* statement escape, stmt # = 1 (2nd stmt on line) */ -// OBSOLETE size = 1; -// OBSOLETE break; -// OBSOLETE case dst_ln_ln_off: -// OBSOLETE /* statement escape, stmt # = next byte */ -// OBSOLETE size = 2; -// OBSOLETE break; -// OBSOLETE case dst_ln_entry: -// OBSOLETE /* entry escape, next byte is entry number */ -// OBSOLETE size = 2; -// OBSOLETE break; -// OBSOLETE case dst_ln_exit: -// OBSOLETE /* exit escape */ -// OBSOLETE size = 1; -// OBSOLETE break; -// OBSOLETE case dst_ln_stmt_end: -// OBSOLETE /* gap escape, 4 bytes pc delta */ -// OBSOLETE size = 5; -// OBSOLETE /* last_pc += 2 * (*(long *) (*buffer + 1)); */ -// OBSOLETE /* Apparently this isn't supposed to actually modify -// OBSOLETE * the pc value. Totally weird. -// OBSOLETE */ -// OBSOLETE break; -// OBSOLETE case dst_ln_escape_11: -// OBSOLETE case dst_ln_escape_12: -// OBSOLETE case dst_ln_escape_13: -// OBSOLETE size = 1; -// OBSOLETE break; -// OBSOLETE case dst_ln_nxt_byte: -// OBSOLETE /* This shouldn't happen. If it does, we're SOL */ -// OBSOLETE return 0; -// OBSOLETE break; -// OBSOLETE case dst_ln_end: -// OBSOLETE /* end escape, final entry follows */ -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE *buffer += (size < 0) ? -size : size; -// OBSOLETE entry = (dst_ln_entry_ptr_t) * buffer; -// OBSOLETE } -// OBSOLETE last_line += dst_ln_ln_delta (*entry); -// OBSOLETE last_pc += entry->delta.pc_delta * 2; -// OBSOLETE (*buffer)++; -// OBSOLETE dst_record_line (last_line, last_pc); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE enter_all_lines (char *buffer, long address) -// OBSOLETE { -// OBSOLETE if (buffer) -// OBSOLETE while (get_dst_line (&buffer, &address)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry) -// OBSOLETE { -// OBSOLETE int size; -// OBSOLETE dst_rec_ptr_t entry; -// OBSOLETE static int last_type; -// OBSOLETE int ar_size; -// OBSOLETE static unsigned lu3; -// OBSOLETE -// OBSOLETE entry = (dst_rec_ptr_t) buffer; -// OBSOLETE switch (entry->rec_type) -// OBSOLETE { -// OBSOLETE case dst_typ_pad: -// OBSOLETE size = 0; -// OBSOLETE break; -// OBSOLETE case dst_typ_comp_unit: -// OBSOLETE size = sizeof (DST_comp_unit (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_section_tab: -// OBSOLETE size = sizeof (DST_section_tab (entry)) -// OBSOLETE + ((int) DST_section_tab (entry).number_of_sections -// OBSOLETE - dst_dummy_array_size) * sizeof (long); -// OBSOLETE break; -// OBSOLETE case dst_typ_file_tab: -// OBSOLETE size = sizeof (DST_file_tab (entry)) -// OBSOLETE + ((int) DST_file_tab (entry).number_of_files -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_file_desc_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_block: -// OBSOLETE size = sizeof (DST_block (entry)) -// OBSOLETE + ((int) DST_block (entry).n_of_code_ranges -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_code_range_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_5: -// OBSOLETE size = -1; -// OBSOLETE break; -// OBSOLETE case dst_typ_var: -// OBSOLETE size = sizeof (DST_var (entry)) - -// OBSOLETE sizeof (dst_var_loc_long_t) * dst_dummy_array_size + -// OBSOLETE DST_var (entry).no_of_locs * -// OBSOLETE (DST_var (entry).short_locs ? -// OBSOLETE sizeof (dst_var_loc_short_t) : -// OBSOLETE sizeof (dst_var_loc_long_t)); -// OBSOLETE break; -// OBSOLETE case dst_typ_pointer: -// OBSOLETE size = sizeof (DST_pointer (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_array: -// OBSOLETE size = sizeof (DST_array (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_subrange: -// OBSOLETE size = sizeof (DST_subrange (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_set: -// OBSOLETE size = sizeof (DST_set (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_implicit_enum: -// OBSOLETE size = sizeof (DST_implicit_enum (entry)) -// OBSOLETE + ((int) DST_implicit_enum (entry).nelems -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_rel_offset_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_explicit_enum: -// OBSOLETE size = sizeof (DST_explicit_enum (entry)) -// OBSOLETE + ((int) DST_explicit_enum (entry).nelems -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_enum_elem_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_short_rec: -// OBSOLETE size = sizeof (DST_short_rec (entry)) -// OBSOLETE + DST_short_rec (entry).nfields * sizeof (dst_short_field_t) -// OBSOLETE - dst_dummy_array_size * sizeof (dst_field_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_short_union: -// OBSOLETE size = sizeof (DST_short_union (entry)) -// OBSOLETE + DST_short_union (entry).nfields * sizeof (dst_short_field_t) -// OBSOLETE - dst_dummy_array_size * sizeof (dst_field_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_file: -// OBSOLETE size = sizeof (DST_file (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_offset: -// OBSOLETE size = sizeof (DST_offset (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_alias: -// OBSOLETE size = sizeof (DST_alias (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_signature: -// OBSOLETE size = sizeof (DST_signature (entry)) + -// OBSOLETE ((int) DST_signature (entry).nargs - -// OBSOLETE dst_dummy_array_size) * sizeof (dst_arg_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_21: -// OBSOLETE size = -1; -// OBSOLETE break; -// OBSOLETE case dst_typ_old_label: -// OBSOLETE size = sizeof (DST_old_label (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_scope: -// OBSOLETE size = sizeof (DST_scope (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_end_scope: -// OBSOLETE size = 0; -// OBSOLETE break; -// OBSOLETE case dst_typ_25: -// OBSOLETE case dst_typ_26: -// OBSOLETE size = -1; -// OBSOLETE break; -// OBSOLETE case dst_typ_string_tab: -// OBSOLETE case dst_typ_global_name_tab: -// OBSOLETE size = sizeof (DST_string_tab (entry)) -// OBSOLETE + DST_string_tab (entry).length -// OBSOLETE - dst_dummy_array_size; -// OBSOLETE break; -// OBSOLETE case dst_typ_forward: -// OBSOLETE size = sizeof (DST_forward (entry)); -// OBSOLETE get_dst_entry ((char *) entry + DST_forward (entry).rec_off, &entry); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_size: -// OBSOLETE size = sizeof (DST_aux_size (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_align: -// OBSOLETE size = sizeof (DST_aux_align (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_field_size: -// OBSOLETE size = sizeof (DST_aux_field_size (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_field_off: -// OBSOLETE size = sizeof (DST_aux_field_off (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_field_align: -// OBSOLETE size = sizeof (DST_aux_field_align (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_qual: -// OBSOLETE size = sizeof (DST_aux_qual (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_var_bound: -// OBSOLETE size = sizeof (DST_aux_var_bound (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_extension: -// OBSOLETE size = DST_extension (entry).rec_size; -// OBSOLETE break; -// OBSOLETE case dst_typ_string: -// OBSOLETE size = sizeof (DST_string (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_old_entry: -// OBSOLETE size = 48; /* Obsolete entry type */ -// OBSOLETE break; -// OBSOLETE case dst_typ_const: -// OBSOLETE size = sizeof (DST_const (entry)) -// OBSOLETE + DST_const (entry).value.length -// OBSOLETE - sizeof (DST_const (entry).value.val); -// OBSOLETE break; -// OBSOLETE case dst_typ_reference: -// OBSOLETE size = sizeof (DST_reference (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_old_record: -// OBSOLETE case dst_typ_old_union: -// OBSOLETE case dst_typ_record: -// OBSOLETE case dst_typ_union: -// OBSOLETE size = sizeof (DST_record (entry)) -// OBSOLETE + ((int) DST_record (entry).nfields -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_field_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_type_deriv: -// OBSOLETE size = sizeof (DST_aux_type_deriv (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_locpool: -// OBSOLETE size = sizeof (DST_locpool (entry)) -// OBSOLETE + ((int) DST_locpool (entry).length - -// OBSOLETE dst_dummy_array_size); -// OBSOLETE break; -// OBSOLETE case dst_typ_variable: -// OBSOLETE size = sizeof (DST_variable (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_label: -// OBSOLETE size = sizeof (DST_label (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_entry: -// OBSOLETE size = sizeof (DST_entry (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_lifetime: -// OBSOLETE size = sizeof (DST_aux_lifetime (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_ptr_base: -// OBSOLETE size = sizeof (DST_aux_ptr_base (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_src_range: -// OBSOLETE size = sizeof (DST_aux_src_range (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_reg_val: -// OBSOLETE size = sizeof (DST_aux_reg_val (entry)); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_unit_names: -// OBSOLETE size = sizeof (DST_aux_unit_names (entry)) -// OBSOLETE + ((int) DST_aux_unit_names (entry).number_of_names -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_rel_offset_t); -// OBSOLETE break; -// OBSOLETE case dst_typ_aux_sect_info: -// OBSOLETE size = sizeof (DST_aux_sect_info (entry)) -// OBSOLETE + ((int) DST_aux_sect_info (entry).number_of_refs -// OBSOLETE - dst_dummy_array_size) * sizeof (dst_sect_ref_t); -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE size = -1; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE if (size == -1) -// OBSOLETE { -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n", -// OBSOLETE (int) entry->rec_type, -// OBSOLETE last_type); -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Last unknown_3 value: %d\n", lu3); -// OBSOLETE size = 0; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE last_type = entry->rec_type; -// OBSOLETE if (size & 1) /* Align on a word boundary */ -// OBSOLETE size++; -// OBSOLETE size += 2; -// OBSOLETE *ret_entry = entry; -// OBSOLETE return size; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table) -// OBSOLETE { -// OBSOLETE if (*buffer - table->buffer >= table->size) -// OBSOLETE { -// OBSOLETE *entry = NULL; -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE *buffer += get_dst_entry (*buffer, entry); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info) -// OBSOLETE #define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info) -// OBSOLETE #define DST_OFFSET(a, b) ((char *) (a) + (b)) -// OBSOLETE -// OBSOLETE static dst_rec_ptr_t section_table = NULL; -// OBSOLETE -// OBSOLETE char * -// OBSOLETE get_sec_ref (dst_sect_ref_t *ref) -// OBSOLETE { -// OBSOLETE dst_sec *section = NULL; -// OBSOLETE long offset; -// OBSOLETE -// OBSOLETE if (!section_table || !ref->sect_index) -// OBSOLETE return NULL; -// OBSOLETE offset = DST_section_tab (section_table).section_base[ref->sect_index - 1] -// OBSOLETE + ref->sect_offset; -// OBSOLETE if (offset >= blocks_info.base && -// OBSOLETE offset < blocks_info.base + blocks_info.size) -// OBSOLETE section = &blocks_info; -// OBSOLETE else if (offset >= symbols_info.base && -// OBSOLETE offset < symbols_info.base + symbols_info.size) -// OBSOLETE section = &symbols_info; -// OBSOLETE else if (offset >= lines_info.base && -// OBSOLETE offset < lines_info.base + lines_info.size) -// OBSOLETE section = &lines_info; -// OBSOLETE if (!section) -// OBSOLETE return NULL; -// OBSOLETE return section->buffer + (offset - section->base); -// OBSOLETE } -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE dst_get_addr (int section, long offset) -// OBSOLETE { -// OBSOLETE if (!section_table || !section) -// OBSOLETE return 0; -// OBSOLETE return DST_section_tab (section_table).section_base[section - 1] + offset; -// OBSOLETE } -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE dst_sym_addr (dst_sect_ref_t *ref) -// OBSOLETE { -// OBSOLETE if (!section_table || !ref->sect_index) -// OBSOLETE return 0; -// OBSOLETE return DST_section_tab (section_table).section_base[ref->sect_index - 1] -// OBSOLETE + ref->sect_offset; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct symbol * -// OBSOLETE create_new_symbol (struct objfile *objfile, char *name) -// OBSOLETE { -// OBSOLETE struct symbol *sym = (struct symbol *) -// OBSOLETE obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol)); -// OBSOLETE memset (sym, 0, sizeof (struct symbol)); -// OBSOLETE SYMBOL_NAME (sym) = obsavestring (name, strlen (name), -// OBSOLETE &objfile->symbol_obstack); -// OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; -// OBSOLETE -// OBSOLETE SYMBOL_CLASS (sym) = LOC_BLOCK; -// OBSOLETE return sym; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t); -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE decode_type_desc (struct objfile *objfile, dst_type_t *type_desc, -// OBSOLETE dst_rec_ptr_t base) -// OBSOLETE { -// OBSOLETE struct type *type; -// OBSOLETE dst_rec_ptr_t entry; -// OBSOLETE if (type_desc->std_type.user_defined_type) -// OBSOLETE { -// OBSOLETE entry = (dst_rec_ptr_t) DST_OFFSET (base, -// OBSOLETE dst_user_type_offset (*type_desc)); -// OBSOLETE type = decode_dst_type (objfile, entry); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE switch (type_desc->std_type.dtc) -// OBSOLETE { -// OBSOLETE case dst_int8_type: -// OBSOLETE type = builtin_type_signed_char; -// OBSOLETE break; -// OBSOLETE case dst_int16_type: -// OBSOLETE type = builtin_type_short; -// OBSOLETE break; -// OBSOLETE case dst_int32_type: -// OBSOLETE type = builtin_type_long; -// OBSOLETE break; -// OBSOLETE case dst_uint8_type: -// OBSOLETE type = builtin_type_unsigned_char; -// OBSOLETE break; -// OBSOLETE case dst_uint16_type: -// OBSOLETE type = builtin_type_unsigned_short; -// OBSOLETE break; -// OBSOLETE case dst_uint32_type: -// OBSOLETE type = builtin_type_unsigned_long; -// OBSOLETE break; -// OBSOLETE case dst_real32_type: -// OBSOLETE type = builtin_type_float; -// OBSOLETE break; -// OBSOLETE case dst_real64_type: -// OBSOLETE type = builtin_type_double; -// OBSOLETE break; -// OBSOLETE case dst_complex_type: -// OBSOLETE type = builtin_type_complex; -// OBSOLETE break; -// OBSOLETE case dst_dcomplex_type: -// OBSOLETE type = builtin_type_double_complex; -// OBSOLETE break; -// OBSOLETE case dst_bool8_type: -// OBSOLETE type = builtin_type_char; -// OBSOLETE break; -// OBSOLETE case dst_bool16_type: -// OBSOLETE type = builtin_type_short; -// OBSOLETE break; -// OBSOLETE case dst_bool32_type: -// OBSOLETE type = builtin_type_long; -// OBSOLETE break; -// OBSOLETE case dst_char_type: -// OBSOLETE type = builtin_type_char; -// OBSOLETE break; -// OBSOLETE /* The next few are more complex. I will take care -// OBSOLETE * of them properly at a later point. -// OBSOLETE */ -// OBSOLETE case dst_string_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE case dst_ptr_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE case dst_set_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE case dst_proc_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE case dst_func_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE /* Back tto some ordinary ones */ -// OBSOLETE case dst_void_type: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE case dst_uchar_type: -// OBSOLETE type = builtin_type_unsigned_char; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE type = builtin_type_void; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE return type; -// OBSOLETE } -// OBSOLETE -// OBSOLETE struct structure_list -// OBSOLETE { -// OBSOLETE struct structure_list *next; -// OBSOLETE struct type *type; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static struct structure_list *struct_list = NULL; -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE find_dst_structure (char *name) -// OBSOLETE { -// OBSOLETE struct structure_list *element; -// OBSOLETE -// OBSOLETE for (element = struct_list; element; element = element->next) -// OBSOLETE if (!strcmp (name, TYPE_NAME (element->type))) -// OBSOLETE return element->type; -// OBSOLETE return NULL; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code, -// OBSOLETE int version) -// OBSOLETE { -// OBSOLETE struct type *type, *child_type; -// OBSOLETE char *struct_name; -// OBSOLETE char *name, *field_name; -// OBSOLETE int i; -// OBSOLETE int fieldoffset, fieldsize; -// OBSOLETE dst_type_t type_desc; -// OBSOLETE struct structure_list *element; -// OBSOLETE -// OBSOLETE struct_name = DST_OFFSET (entry, DST_record (entry).noffset); -// OBSOLETE name = concat ((code == TYPE_CODE_UNION) ? "union " : "struct ", -// OBSOLETE struct_name, NULL); -// OBSOLETE type = find_dst_structure (name); -// OBSOLETE if (type) -// OBSOLETE { -// OBSOLETE xfree (name); -// OBSOLETE return type; -// OBSOLETE } -// OBSOLETE type = alloc_type (objfile); -// OBSOLETE TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack, -// OBSOLETE name, strlen (name)); -// OBSOLETE xfree (name); -// OBSOLETE TYPE_CODE (type) = code; -// OBSOLETE TYPE_LENGTH (type) = DST_record (entry).size; -// OBSOLETE TYPE_NFIELDS (type) = DST_record (entry).nfields; -// OBSOLETE TYPE_FIELDS (type) = (struct field *) -// OBSOLETE obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * -// OBSOLETE DST_record (entry).nfields); -// OBSOLETE fieldoffset = fieldsize = 0; -// OBSOLETE INIT_CPLUS_SPECIFIC (type); -// OBSOLETE element = (struct structure_list *) -// OBSOLETE xmalloc (sizeof (struct structure_list)); -// OBSOLETE element->type = type; -// OBSOLETE element->next = struct_list; -// OBSOLETE struct_list = element; -// OBSOLETE for (i = 0; i < DST_record (entry).nfields; i++) -// OBSOLETE { -// OBSOLETE switch (version) -// OBSOLETE { -// OBSOLETE case 2: -// OBSOLETE field_name = DST_OFFSET (entry, -// OBSOLETE DST_record (entry).f.ofields[i].noffset); -// OBSOLETE fieldoffset = DST_record (entry).f.ofields[i].foffset * 8 + -// OBSOLETE DST_record (entry).f.ofields[i].bit_offset; -// OBSOLETE fieldsize = DST_record (entry).f.ofields[i].size; -// OBSOLETE type_desc = DST_record (entry).f.ofields[i].type_desc; -// OBSOLETE break; -// OBSOLETE case 1: -// OBSOLETE field_name = DST_OFFSET (entry, -// OBSOLETE DST_record (entry).f.fields[i].noffset); -// OBSOLETE type_desc = DST_record (entry).f.fields[i].type_desc; -// OBSOLETE switch (DST_record (entry).f.fields[i].f.field_loc.format_tag) -// OBSOLETE { -// OBSOLETE case dst_field_byte: -// OBSOLETE fieldoffset = DST_record (entry).f. -// OBSOLETE fields[i].f.field_byte.offset * 8; -// OBSOLETE fieldsize = -1; -// OBSOLETE break; -// OBSOLETE case dst_field_bit: -// OBSOLETE fieldoffset = DST_record (entry).f. -// OBSOLETE fields[i].f.field_bit.byte_offset * 8 + -// OBSOLETE DST_record (entry).f. -// OBSOLETE fields[i].f.field_bit.bit_offset; -// OBSOLETE fieldsize = DST_record (entry).f. -// OBSOLETE fields[i].f.field_bit.nbits; -// OBSOLETE break; -// OBSOLETE case dst_field_loc: -// OBSOLETE fieldoffset += fieldsize; -// OBSOLETE fieldsize = -1; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case 0: -// OBSOLETE field_name = DST_OFFSET (entry, -// OBSOLETE DST_record (entry).f.sfields[i].noffset); -// OBSOLETE fieldoffset = DST_record (entry).f.sfields[i].foffset; -// OBSOLETE type_desc = DST_record (entry).f.sfields[i].type_desc; -// OBSOLETE if (i < DST_record (entry).nfields - 1) -// OBSOLETE fieldsize = DST_record (entry).f.sfields[i + 1].foffset; -// OBSOLETE else -// OBSOLETE fieldsize = DST_record (entry).size; -// OBSOLETE fieldsize -= fieldoffset; -// OBSOLETE fieldoffset *= 8; -// OBSOLETE fieldsize *= 8; -// OBSOLETE } -// OBSOLETE TYPE_FIELDS (type)[i].name = -// OBSOLETE obstack_copy0 (&objfile->symbol_obstack, -// OBSOLETE field_name, strlen (field_name)); -// OBSOLETE TYPE_FIELDS (type)[i].type = decode_type_desc (objfile, -// OBSOLETE &type_desc, -// OBSOLETE entry); -// OBSOLETE if (fieldsize == -1) -// OBSOLETE fieldsize = TYPE_LENGTH (TYPE_FIELDS (type)[i].type) * -// OBSOLETE 8; -// OBSOLETE TYPE_FIELDS (type)[i].bitsize = fieldsize; -// OBSOLETE TYPE_FIELDS (type)[i].bitpos = fieldoffset; -// OBSOLETE } -// OBSOLETE return type; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct type * -// OBSOLETE decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry) -// OBSOLETE { -// OBSOLETE struct type *child_type, *type, *range_type, *index_type; -// OBSOLETE -// OBSOLETE switch (entry->rec_type) -// OBSOLETE { -// OBSOLETE case dst_typ_var: -// OBSOLETE return decode_type_desc (objfile, -// OBSOLETE &DST_var (entry).type_desc, -// OBSOLETE entry); -// OBSOLETE break; -// OBSOLETE case dst_typ_variable: -// OBSOLETE return decode_type_desc (objfile, -// OBSOLETE &DST_variable (entry).type_desc, -// OBSOLETE entry); -// OBSOLETE break; -// OBSOLETE case dst_typ_short_rec: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 0); -// OBSOLETE case dst_typ_short_union: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 0); -// OBSOLETE case dst_typ_union: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 1); -// OBSOLETE case dst_typ_record: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 1); -// OBSOLETE case dst_typ_old_union: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 2); -// OBSOLETE case dst_typ_old_record: -// OBSOLETE return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 2); -// OBSOLETE case dst_typ_pointer: -// OBSOLETE return make_pointer_type ( -// OBSOLETE decode_type_desc (objfile, -// OBSOLETE &DST_pointer (entry).type_desc, -// OBSOLETE entry), -// OBSOLETE NULL); -// OBSOLETE case dst_typ_array: -// OBSOLETE child_type = decode_type_desc (objfile, -// OBSOLETE &DST_pointer (entry).type_desc, -// OBSOLETE entry); -// OBSOLETE index_type = lookup_fundamental_type (objfile, -// OBSOLETE FT_INTEGER); -// OBSOLETE range_type = create_range_type ((struct type *) NULL, -// OBSOLETE index_type, DST_array (entry).lo_bound, -// OBSOLETE DST_array (entry).hi_bound); -// OBSOLETE return create_array_type ((struct type *) NULL, child_type, -// OBSOLETE range_type); -// OBSOLETE case dst_typ_alias: -// OBSOLETE return decode_type_desc (objfile, -// OBSOLETE &DST_alias (entry).type_desc, -// OBSOLETE entry); -// OBSOLETE default: -// OBSOLETE return builtin_type_int; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE struct symbol_list -// OBSOLETE { -// OBSOLETE struct symbol_list *next; -// OBSOLETE struct symbol *symbol; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static struct symbol_list *dst_global_symbols = NULL; -// OBSOLETE static int total_globals = 0; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE decode_dst_locstring (char *locstr, struct symbol *sym) -// OBSOLETE { -// OBSOLETE dst_loc_entry_t *entry, *next_entry; -// OBSOLETE CORE_ADDR temp; -// OBSOLETE int count = 0; -// OBSOLETE -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE if (count++ == 100) -// OBSOLETE { -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Error reading locstring\n"); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE entry = (dst_loc_entry_t *) locstr; -// OBSOLETE next_entry = (dst_loc_entry_t *) (locstr + 1); -// OBSOLETE switch (entry->header.code) -// OBSOLETE { -// OBSOLETE case dst_lsc_end: /* End of string */ -// OBSOLETE return; -// OBSOLETE case dst_lsc_indirect: /* Indirect through previous. Arg == 6 */ -// OBSOLETE /* Or register ax x == arg */ -// OBSOLETE if (entry->header.arg < 6) -// OBSOLETE { -// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; -// OBSOLETE SYMBOL_VALUE (sym) = entry->header.arg + 8; -// OBSOLETE } -// OBSOLETE /* We predict indirects */ -// OBSOLETE locstr++; -// OBSOLETE break; -// OBSOLETE case dst_lsc_dreg: -// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; -// OBSOLETE SYMBOL_VALUE (sym) = entry->header.arg; -// OBSOLETE locstr++; -// OBSOLETE break; -// OBSOLETE case dst_lsc_section: /* Section (arg+1) */ -// OBSOLETE SYMBOL_VALUE (sym) = dst_get_addr (entry->header.arg + 1, 0); -// OBSOLETE locstr++; -// OBSOLETE break; -// OBSOLETE case dst_lsc_sec_byte: /* Section (next_byte+1) */ -// OBSOLETE SYMBOL_VALUE (sym) = dst_get_addr (locstr[1] + 1, 0); -// OBSOLETE locstr += 2; -// OBSOLETE break; -// OBSOLETE case dst_lsc_add: /* Add (arg+1)*2 */ -// OBSOLETE case dst_lsc_sub: /* Subtract (arg+1)*2 */ -// OBSOLETE temp = (entry->header.arg + 1) * 2; -// OBSOLETE locstr++; -// OBSOLETE if (*locstr == dst_multiply_256) -// OBSOLETE { -// OBSOLETE temp <<= 8; -// OBSOLETE locstr++; -// OBSOLETE } -// OBSOLETE switch (entry->header.code) -// OBSOLETE { -// OBSOLETE case dst_lsc_add: -// OBSOLETE if (SYMBOL_CLASS (sym) == LOC_LOCAL) -// OBSOLETE SYMBOL_CLASS (sym) = LOC_ARG; -// OBSOLETE SYMBOL_VALUE (sym) += temp; -// OBSOLETE break; -// OBSOLETE case dst_lsc_sub: -// OBSOLETE SYMBOL_VALUE (sym) -= temp; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case dst_lsc_add_byte: -// OBSOLETE case dst_lsc_sub_byte: -// OBSOLETE switch (entry->header.arg & 0x03) -// OBSOLETE { -// OBSOLETE case 1: -// OBSOLETE temp = (unsigned char) locstr[1]; -// OBSOLETE locstr += 2; -// OBSOLETE break; -// OBSOLETE case 2: -// OBSOLETE temp = *(unsigned short *) (locstr + 1); -// OBSOLETE locstr += 3; -// OBSOLETE break; -// OBSOLETE case 3: -// OBSOLETE temp = *(unsigned long *) (locstr + 1); -// OBSOLETE locstr += 5; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE if (*locstr == dst_multiply_256) -// OBSOLETE { -// OBSOLETE temp <<= 8; -// OBSOLETE locstr++; -// OBSOLETE } -// OBSOLETE switch (entry->header.code) -// OBSOLETE { -// OBSOLETE case dst_lsc_add_byte: -// OBSOLETE if (SYMBOL_CLASS (sym) == LOC_LOCAL) -// OBSOLETE SYMBOL_CLASS (sym) = LOC_ARG; -// OBSOLETE SYMBOL_VALUE (sym) += temp; -// OBSOLETE break; -// OBSOLETE case dst_lsc_sub_byte: -// OBSOLETE SYMBOL_VALUE (sym) -= temp; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0 */ -// OBSOLETE if (next_entry->header.code != dst_lsc_indirect) -// OBSOLETE { -// OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE SYMBOL_CLASS (sym) = LOC_LOCAL; -// OBSOLETE locstr++; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct symbol_list * -// OBSOLETE process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name, -// OBSOLETE int *nsyms_ret) -// OBSOLETE { -// OBSOLETE struct symbol_list *list = NULL, *element; -// OBSOLETE struct symbol *sym; -// OBSOLETE char *symname; -// OBSOLETE int nsyms = 0; -// OBSOLETE char *location; -// OBSOLETE long line; -// OBSOLETE dst_type_t symtype; -// OBSOLETE struct type *type; -// OBSOLETE dst_var_attr_t attr; -// OBSOLETE dst_var_loc_t loc_type; -// OBSOLETE unsigned loc_index; -// OBSOLETE long loc_value; -// OBSOLETE -// OBSOLETE if (!entry) -// OBSOLETE { -// OBSOLETE *nsyms_ret = 0; -// OBSOLETE return NULL; -// OBSOLETE } -// OBSOLETE location = (char *) entry; -// OBSOLETE while (NEXT_SYM (&location, &entry) && -// OBSOLETE entry->rec_type != dst_typ_end_scope) -// OBSOLETE { -// OBSOLETE if (entry->rec_type == dst_typ_var) -// OBSOLETE { -// OBSOLETE if (DST_var (entry).short_locs) -// OBSOLETE { -// OBSOLETE loc_type = DST_var (entry).locs.shorts[0].loc_type; -// OBSOLETE loc_index = DST_var (entry).locs.shorts[0].loc_index; -// OBSOLETE loc_value = DST_var (entry).locs.shorts[0].location; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE loc_type = DST_var (entry).locs.longs[0].loc_type; -// OBSOLETE loc_index = DST_var (entry).locs.longs[0].loc_index; -// OBSOLETE loc_value = DST_var (entry).locs.longs[0].location; -// OBSOLETE } -// OBSOLETE if (loc_type == dst_var_loc_external) -// OBSOLETE continue; -// OBSOLETE symname = DST_OFFSET (entry, DST_var (entry).noffset); -// OBSOLETE line = DST_var (entry).src_loc.line_number; -// OBSOLETE symtype = DST_var (entry).type_desc; -// OBSOLETE attr = DST_var (entry).attributes; -// OBSOLETE } -// OBSOLETE else if (entry->rec_type == dst_typ_variable) -// OBSOLETE { -// OBSOLETE symname = DST_OFFSET (entry, -// OBSOLETE DST_variable (entry).noffset); -// OBSOLETE line = DST_variable (entry).src_loc.line_number; -// OBSOLETE symtype = DST_variable (entry).type_desc; -// OBSOLETE attr = DST_variable (entry).attributes; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE if (symname && name && !strcmp (symname, name)) -// OBSOLETE /* It's the function return value */ -// OBSOLETE continue; -// OBSOLETE sym = create_new_symbol (objfile, symname); -// OBSOLETE -// OBSOLETE if ((attr & (1 << dst_var_attr_global)) || -// OBSOLETE (attr & (1 << dst_var_attr_static))) -// OBSOLETE SYMBOL_CLASS (sym) = LOC_STATIC; -// OBSOLETE else -// OBSOLETE SYMBOL_CLASS (sym) = LOC_LOCAL; -// OBSOLETE SYMBOL_LINE (sym) = line; -// OBSOLETE SYMBOL_TYPE (sym) = decode_type_desc (objfile, &symtype, -// OBSOLETE entry); -// OBSOLETE SYMBOL_VALUE (sym) = 0; -// OBSOLETE switch (entry->rec_type) -// OBSOLETE { -// OBSOLETE case dst_typ_var: -// OBSOLETE switch (loc_type) -// OBSOLETE { -// OBSOLETE case dst_var_loc_abs: -// OBSOLETE SYMBOL_VALUE_ADDRESS (sym) = loc_value; -// OBSOLETE break; -// OBSOLETE case dst_var_loc_sect_off: -// OBSOLETE case dst_var_loc_ind_sect_off: /* What is this? */ -// OBSOLETE SYMBOL_VALUE_ADDRESS (sym) = dst_get_addr ( -// OBSOLETE loc_index, -// OBSOLETE loc_value); -// OBSOLETE break; -// OBSOLETE case dst_var_loc_ind_reg_rel: /* What is this? */ -// OBSOLETE case dst_var_loc_reg_rel: -// OBSOLETE /* If it isn't fp relative, specify the -// OBSOLETE * register it's relative to. -// OBSOLETE */ -// OBSOLETE if (loc_index) -// OBSOLETE { -// OBSOLETE sym->aux_value.basereg = loc_index; -// OBSOLETE } -// OBSOLETE SYMBOL_VALUE (sym) = loc_value; -// OBSOLETE if (loc_value > 0 && -// OBSOLETE SYMBOL_CLASS (sym) == LOC_BASEREG) -// OBSOLETE SYMBOL_CLASS (sym) = LOC_BASEREG_ARG; -// OBSOLETE break; -// OBSOLETE case dst_var_loc_reg: -// OBSOLETE SYMBOL_VALUE (sym) = loc_index; -// OBSOLETE SYMBOL_CLASS (sym) = LOC_REGISTER; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case dst_typ_variable: -// OBSOLETE /* External variable..... don't try to interpret -// OBSOLETE * its nonexistant locstring. -// OBSOLETE */ -// OBSOLETE if (DST_variable (entry).loffset == -1) -// OBSOLETE continue; -// OBSOLETE decode_dst_locstring (DST_OFFSET (entry, -// OBSOLETE DST_variable (entry).loffset), -// OBSOLETE sym); -// OBSOLETE } -// OBSOLETE element = (struct symbol_list *) -// OBSOLETE xmalloc (sizeof (struct symbol_list)); -// OBSOLETE -// OBSOLETE if (attr & (1 << dst_var_attr_global)) -// OBSOLETE { -// OBSOLETE element->next = dst_global_symbols; -// OBSOLETE dst_global_symbols = element; -// OBSOLETE total_globals++; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE element->next = list; -// OBSOLETE list = element; -// OBSOLETE nsyms++; -// OBSOLETE } -// OBSOLETE element->symbol = sym; -// OBSOLETE } -// OBSOLETE *nsyms_ret = nsyms; -// OBSOLETE return list; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE static struct symbol * -// OBSOLETE process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name, -// OBSOLETE CORE_ADDR address) -// OBSOLETE { -// OBSOLETE struct symbol *sym; -// OBSOLETE struct type *type, *ftype; -// OBSOLETE dst_rec_ptr_t sym_entry, typ_entry; -// OBSOLETE char *location; -// OBSOLETE struct symbol_list *element; -// OBSOLETE -// OBSOLETE type = builtin_type_int; -// OBSOLETE sym = create_new_symbol (objfile, name); -// OBSOLETE SYMBOL_CLASS (sym) = LOC_BLOCK; -// OBSOLETE -// OBSOLETE if (entry) -// OBSOLETE { -// OBSOLETE location = (char *) entry; -// OBSOLETE do -// OBSOLETE { -// OBSOLETE NEXT_SYM (&location, &sym_entry); -// OBSOLETE } -// OBSOLETE while (sym_entry && sym_entry->rec_type != dst_typ_signature); -// OBSOLETE -// OBSOLETE if (sym_entry) -// OBSOLETE { -// OBSOLETE SYMBOL_LINE (sym) = -// OBSOLETE DST_signature (sym_entry).src_loc.line_number; -// OBSOLETE if (DST_signature (sym_entry).result) -// OBSOLETE { -// OBSOLETE typ_entry = (dst_rec_ptr_t) -// OBSOLETE DST_OFFSET (sym_entry, -// OBSOLETE DST_signature (sym_entry).result); -// OBSOLETE type = decode_dst_type (objfile, typ_entry); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (!type->function_type) -// OBSOLETE { -// OBSOLETE ftype = alloc_type (objfile); -// OBSOLETE type->function_type = ftype; -// OBSOLETE TYPE_TARGET_TYPE (ftype) = type; -// OBSOLETE TYPE_CODE (ftype) = TYPE_CODE_FUNC; -// OBSOLETE } -// OBSOLETE SYMBOL_TYPE (sym) = type->function_type; -// OBSOLETE -// OBSOLETE /* Now add ourselves to the global symbols list */ -// OBSOLETE element = (struct symbol_list *) -// OBSOLETE xmalloc (sizeof (struct symbol_list)); -// OBSOLETE -// OBSOLETE element->next = dst_global_symbols; -// OBSOLETE dst_global_symbols = element; -// OBSOLETE total_globals++; -// OBSOLETE element->symbol = sym; -// OBSOLETE -// OBSOLETE return sym; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct block * -// OBSOLETE process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry) -// OBSOLETE { -// OBSOLETE struct block *block; -// OBSOLETE struct symbol *function = NULL; -// OBSOLETE CORE_ADDR address; -// OBSOLETE long size; -// OBSOLETE char *name; -// OBSOLETE dst_rec_ptr_t child_entry, symbol_entry; -// OBSOLETE struct block *child_block; -// OBSOLETE int total_symbols = 0; -// OBSOLETE char fake_name[20]; -// OBSOLETE static long fake_seq = 0; -// OBSOLETE struct symbol_list *symlist, *nextsym; -// OBSOLETE int symnum; -// OBSOLETE -// OBSOLETE if (DST_block (entry).noffset) -// OBSOLETE name = DST_OFFSET (entry, DST_block (entry).noffset); -// OBSOLETE else -// OBSOLETE name = NULL; -// OBSOLETE if (DST_block (entry).n_of_code_ranges) -// OBSOLETE { -// OBSOLETE address = dst_sym_addr ( -// OBSOLETE &DST_block (entry).code_ranges[0].code_start); -// OBSOLETE size = DST_block (entry).code_ranges[0].code_size; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE address = -1; -// OBSOLETE size = 0; -// OBSOLETE } -// OBSOLETE symbol_entry = (dst_rec_ptr_t) get_sec_ref (&DST_block (entry).symbols_start); -// OBSOLETE switch (DST_block (entry).block_type) -// OBSOLETE { -// OBSOLETE /* These are all really functions. Even the "program" type. -// OBSOLETE * This is because the Apollo OS was written in Pascal, and -// OBSOLETE * in Pascal, the main procedure is described as the Program. -// OBSOLETE * Cute, huh? -// OBSOLETE */ -// OBSOLETE case dst_block_procedure: -// OBSOLETE case dst_block_function: -// OBSOLETE case dst_block_subroutine: -// OBSOLETE case dst_block_program: -// OBSOLETE prim_record_minimal_symbol (name, address, mst_text, objfile); -// OBSOLETE function = process_dst_function ( -// OBSOLETE objfile, -// OBSOLETE symbol_entry, -// OBSOLETE name, -// OBSOLETE address); -// OBSOLETE enter_all_lines (get_sec_ref (&DST_block (entry).code_ranges[0].lines_start), address); -// OBSOLETE break; -// OBSOLETE case dst_block_block_data: -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE /* GDB has to call it something, and the module name -// OBSOLETE * won't cut it -// OBSOLETE */ -// OBSOLETE sprintf (fake_name, "block_%08lx", fake_seq++); -// OBSOLETE function = process_dst_function ( -// OBSOLETE objfile, NULL, fake_name, address); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE symlist = process_dst_symbols (objfile, symbol_entry, -// OBSOLETE name, &total_symbols); -// OBSOLETE block = (struct block *) -// OBSOLETE obstack_alloc (&objfile->symbol_obstack, -// OBSOLETE sizeof (struct block) + -// OBSOLETE (total_symbols - 1) * sizeof (struct symbol *)); -// OBSOLETE -// OBSOLETE symnum = 0; -// OBSOLETE while (symlist) -// OBSOLETE { -// OBSOLETE nextsym = symlist->next; -// OBSOLETE -// OBSOLETE block->sym[symnum] = symlist->symbol; -// OBSOLETE -// OBSOLETE xfree (symlist); -// OBSOLETE symlist = nextsym; -// OBSOLETE symnum++; -// OBSOLETE } -// OBSOLETE BLOCK_NSYMS (block) = total_symbols; -// OBSOLETE BLOCK_HASHTABLE (block) = 0; -// OBSOLETE BLOCK_START (block) = address; -// OBSOLETE BLOCK_END (block) = address + size; -// OBSOLETE BLOCK_SUPERBLOCK (block) = 0; -// OBSOLETE if (function) -// OBSOLETE { -// OBSOLETE SYMBOL_BLOCK_VALUE (function) = block; -// OBSOLETE BLOCK_FUNCTION (block) = function; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE BLOCK_FUNCTION (block) = 0; -// OBSOLETE -// OBSOLETE if (DST_block (entry).child_block_off) -// OBSOLETE { -// OBSOLETE child_entry = (dst_rec_ptr_t) DST_OFFSET (entry, -// OBSOLETE DST_block (entry).child_block_off); -// OBSOLETE while (child_entry) -// OBSOLETE { -// OBSOLETE child_block = process_dst_block (objfile, child_entry); -// OBSOLETE if (child_block) -// OBSOLETE { -// OBSOLETE if (BLOCK_START (child_block) < -// OBSOLETE BLOCK_START (block) || -// OBSOLETE BLOCK_START (block) == -1) -// OBSOLETE BLOCK_START (block) = -// OBSOLETE BLOCK_START (child_block); -// OBSOLETE if (BLOCK_END (child_block) > -// OBSOLETE BLOCK_END (block) || -// OBSOLETE BLOCK_END (block) == -1) -// OBSOLETE BLOCK_END (block) = -// OBSOLETE BLOCK_END (child_block); -// OBSOLETE BLOCK_SUPERBLOCK (child_block) = block; -// OBSOLETE } -// OBSOLETE if (DST_block (child_entry).sibling_block_off) -// OBSOLETE child_entry = (dst_rec_ptr_t) DST_OFFSET ( -// OBSOLETE child_entry, -// OBSOLETE DST_block (child_entry).sibling_block_off); -// OBSOLETE else -// OBSOLETE child_entry = NULL; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE record_pending_block (objfile, block, NULL); -// OBSOLETE return block; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE static void -// OBSOLETE read_dst_symtab (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE char *buffer; -// OBSOLETE dst_rec_ptr_t entry, file_table, root_block; -// OBSOLETE char *source_file; -// OBSOLETE struct block *block, *global_block; -// OBSOLETE int symnum; -// OBSOLETE struct symbol_list *nextsym; -// OBSOLETE int module_num = 0; -// OBSOLETE struct structure_list *element; -// OBSOLETE -// OBSOLETE current_objfile = objfile; -// OBSOLETE buffer = blocks_info.buffer; -// OBSOLETE while (NEXT_BLK (&buffer, &entry)) -// OBSOLETE { -// OBSOLETE if (entry->rec_type == dst_typ_comp_unit) -// OBSOLETE { -// OBSOLETE file_table = (dst_rec_ptr_t) DST_OFFSET (entry, -// OBSOLETE DST_comp_unit (entry).file_table); -// OBSOLETE section_table = (dst_rec_ptr_t) DST_OFFSET (entry, -// OBSOLETE DST_comp_unit (entry).section_table); -// OBSOLETE root_block = (dst_rec_ptr_t) DST_OFFSET (entry, -// OBSOLETE DST_comp_unit (entry).root_block_offset); -// OBSOLETE source_file = DST_OFFSET (file_table, -// OBSOLETE DST_file_tab (file_table).files[0].noffset); -// OBSOLETE /* Point buffer to the start of the next comp_unit */ -// OBSOLETE buffer = DST_OFFSET (entry, -// OBSOLETE DST_comp_unit (entry).data_size); -// OBSOLETE dst_start_symtab (); -// OBSOLETE -// OBSOLETE block = process_dst_block (objfile, root_block); -// OBSOLETE -// OBSOLETE global_block = (struct block *) -// OBSOLETE obstack_alloc (&objfile->symbol_obstack, -// OBSOLETE sizeof (struct block) + -// OBSOLETE (total_globals - 1) * -// OBSOLETE sizeof (struct symbol *)); -// OBSOLETE BLOCK_NSYMS (global_block) = total_globals; -// OBSOLETE BLOCK_HASHTABLE (global_block) = 0; -// OBSOLETE for (symnum = 0; symnum < total_globals; symnum++) -// OBSOLETE { -// OBSOLETE nextsym = dst_global_symbols->next; -// OBSOLETE -// OBSOLETE global_block->sym[symnum] = -// OBSOLETE dst_global_symbols->symbol; -// OBSOLETE -// OBSOLETE xfree (dst_global_symbols); -// OBSOLETE dst_global_symbols = nextsym; -// OBSOLETE } -// OBSOLETE dst_global_symbols = NULL; -// OBSOLETE total_globals = 0; -// OBSOLETE BLOCK_FUNCTION (global_block) = 0; -// OBSOLETE BLOCK_START (global_block) = BLOCK_START (block); -// OBSOLETE BLOCK_END (global_block) = BLOCK_END (block); -// OBSOLETE BLOCK_SUPERBLOCK (global_block) = 0; -// OBSOLETE BLOCK_SUPERBLOCK (block) = global_block; -// OBSOLETE record_pending_block (objfile, global_block, NULL); -// OBSOLETE -// OBSOLETE complete_symtab (source_file, -// OBSOLETE BLOCK_START (block), -// OBSOLETE BLOCK_END (block) - BLOCK_START (block)); -// OBSOLETE module_num++; -// OBSOLETE dst_end_symtab (objfile); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE if (module_num) -// OBSOLETE prim_record_minimal_symbol ("", -// OBSOLETE BLOCK_END (block), mst_text, objfile); -// OBSOLETE /* One more faked symbol to make sure nothing can ever run off the -// OBSOLETE * end of the symbol table. This one represents the end of the -// OBSOLETE * text space. It used to be (CORE_ADDR) -1 (effectively the highest -// OBSOLETE * int possible), but some parts of gdb treated it as a signed -// OBSOLETE * number and failed comparisons. We could equally use 7fffffff, -// OBSOLETE * but no functions are ever mapped to an address higher than -// OBSOLETE * 40000000 -// OBSOLETE */ -// OBSOLETE prim_record_minimal_symbol ("", -// OBSOLETE (CORE_ADDR) 0x40000000, -// OBSOLETE mst_text, objfile); -// OBSOLETE while (struct_list) -// OBSOLETE { -// OBSOLETE element = struct_list; -// OBSOLETE struct_list = element->next; -// OBSOLETE xfree (element); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Support for line number handling */ -// OBSOLETE static char *linetab = NULL; -// OBSOLETE static long linetab_offset; -// OBSOLETE static unsigned long linetab_size; -// OBSOLETE -// OBSOLETE /* Read in all the line numbers for fast lookups later. Leave them in -// OBSOLETE external (unswapped) format in memory; we'll swap them as we enter -// OBSOLETE them into GDB's data structures. */ -// OBSOLETE static int -// OBSOLETE init_one_section (int chan, dst_sec *secinfo) -// OBSOLETE { -// OBSOLETE if (secinfo->size == 0 -// OBSOLETE || lseek (chan, secinfo->position, 0) == -1 -// OBSOLETE || (secinfo->buffer = xmalloc (secinfo->size)) == NULL -// OBSOLETE || myread (chan, secinfo->buffer, secinfo->size) == -1) -// OBSOLETE return 0; -// OBSOLETE else -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE init_dst_sections (int chan) -// OBSOLETE { -// OBSOLETE -// OBSOLETE if (!init_one_section (chan, &blocks_info) || -// OBSOLETE !init_one_section (chan, &lines_info) || -// OBSOLETE !init_one_section (chan, &symbols_info)) -// OBSOLETE return -1; -// OBSOLETE else -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Fake up support for relocating symbol addresses. FIXME. */ -// OBSOLETE -// OBSOLETE struct section_offsets dst_symfile_faker = -// OBSOLETE {0}; -// OBSOLETE -// OBSOLETE void -// OBSOLETE dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs) -// OBSOLETE { -// OBSOLETE objfile->num_sections = 1; -// OBSOLETE objfile->section_offsets = &dst_symfile_faker; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Register our ability to parse symbols for DST BFD files */ -// OBSOLETE -// OBSOLETE static struct sym_fns dst_sym_fns = -// OBSOLETE { -// OBSOLETE /* FIXME: Can this be integrated with coffread.c? If not, should it be -// OBSOLETE a separate flavour like ecoff? */ -// OBSOLETE (enum bfd_flavour) -2, -// OBSOLETE -// OBSOLETE dst_new_init, /* sym_new_init: init anything gbl to entire symtab */ -// OBSOLETE dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */ -// OBSOLETE dst_symfile_read, /* sym_read: read a symbol file into symtab */ -// OBSOLETE dst_symfile_finish, /* sym_finish: finished with file, cleanup */ -// OBSOLETE dst_symfile_offsets, /* sym_offsets: xlate external to internal form */ -// OBSOLETE NULL /* next: pointer to next struct sym_fns */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_dstread (void) -// OBSOLETE { -// OBSOLETE add_symtab_fns (&dst_sym_fns); -// OBSOLETE } diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index ddc4db8..fab10c0 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -37,10 +37,13 @@ struct dummy_frame { struct dummy_frame *next; + /* These values belong to the caller (the previous frame, the frame + that this unwinds back to). */ CORE_ADDR pc; CORE_ADDR fp; CORE_ADDR sp; CORE_ADDR top; + struct frame_id id; struct regcache *regcache; /* Address range of the call dummy code. Look for PC in the range @@ -54,7 +57,7 @@ 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 and - FP/SP. Unlike PC_IN_CALL_DUMMY, this function doesn't need to + FP/SP. Unlike pc_in_dummy_frame(), this function doesn't need to adjust for DECR_PC_AFTER_BREAK. This is because it is only legal to call this function after the PC has been adjusted. */ @@ -104,7 +107,7 @@ struct dummy_frame * cached_find_dummy_frame (struct frame_info *frame, void **cache) { if ((*cache) == NULL) - (*cache) = find_dummy_frame (frame->pc, frame->frame); + (*cache) = find_dummy_frame (get_frame_pc (frame), get_frame_base (frame)); return (*cache); } @@ -137,6 +140,24 @@ deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp) int generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp) { + return pc_in_dummy_frame (pc); +} + +/* Return non-zero if the PC falls in a dummy frame. + + The code below which allows DECR_PC_AFTER_BREAK is for infrun.c, + which may give the function a PC without that subtracted out. + + FIXME: cagney/2002-11-23: This is silly. Surely "infrun.c" can + figure out what the real PC (as in the resume address) is BEFORE + calling this function (Oh, and I'm not even sure that this function + is called with an decremented PC, the call to pc_in_call_dummy() in + that file is conditional on !CALL_DUMMY_BREAKPOINT_OFFSET_P yet + generic dummy targets set CALL_DUMMY_BREAKPOINT_OFFSET. True?). */ + +int +pc_in_dummy_frame (CORE_ADDR pc) +{ struct dummy_frame *dummyframe; for (dummyframe = dummy_frame_stack; dummyframe != NULL; @@ -187,7 +208,7 @@ void generic_push_dummy_frame (void) { struct dummy_frame *dummy_frame; - CORE_ADDR fp = (get_current_frame ())->frame; + CORE_ADDR fp = get_frame_base (get_current_frame ()); /* check to see if there are stale dummy frames, perhaps left over from when a longjump took us out of a @@ -212,6 +233,7 @@ generic_push_dummy_frame (void) dummy_frame->sp = read_sp (); dummy_frame->top = 0; dummy_frame->fp = fp; + dummy_frame->id = get_frame_id (get_current_frame ()); regcache_cpy (dummy_frame->regcache, current_regcache); dummy_frame->next = dummy_frame_stack; dummy_frame_stack = dummy_frame; @@ -239,8 +261,9 @@ void generic_pop_current_frame (void (*popper) (struct frame_info * frame)) { struct frame_info *frame = get_current_frame (); - - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (get_frame_type (frame) == DUMMY_FRAME) + /* NOTE: cagney/2002-22-23: Does this ever occure? Surely a dummy + frame will have already been poped by the "infrun.c" code. */ generic_pop_dummy_frame (); else (*popper) (frame); @@ -308,3 +331,30 @@ dummy_frame_register_unwind (struct frame_info *frame, void **cache, } } +CORE_ADDR +dummy_frame_pc_unwind (struct frame_info *frame, + void **cache) +{ + struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache); + /* Oops! In a dummy-frame but can't find the stack dummy. Pretend + that the frame doesn't unwind. Should this function instead + return a has-no-caller indication? */ + if (dummy == NULL) + return 0; + return dummy->pc; +} + + +struct frame_id +dummy_frame_id_unwind (struct frame_info *frame, + void **cache) +{ + struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache); + /* Oops! In a dummy-frame but can't find the stack dummy. Pretend + that the frame doesn't unwind. Should this function instead + return a has-no-caller indication? */ + if (dummy == NULL) + return null_frame_id; + return dummy->id; +} + diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h index bd4e199..cfa2709 100644 --- a/gdb/dummy-frame.h +++ b/gdb/dummy-frame.h @@ -54,6 +54,43 @@ extern void dummy_frame_register_unwind (struct frame_info *frame, int *realnump, void *valuep); +/* Assuming that FRAME is a dummy, return the resume address for the + previous frame. */ + +extern CORE_ADDR dummy_frame_pc_unwind (struct frame_info *frame, + void **unwind_cache); + +/* Assuming that FRAME is a dummy, return the ID of the calling frame + (the frame that the dummy has the saved state of). */ + +extern struct frame_id dummy_frame_id_unwind (struct frame_info *frame, + void **unwind_cache); + +/* Does the PC fall in a dummy frame? + + This function is used by "frame.c" when creating a new `struct + frame_info'. + + Note that there is also very similar code in breakpoint.c (where + the bpstat stop reason is computed). It is looking for a PC + falling on a dummy_frame breakpoint. Perhaphs this, and that code + should be combined? + + Architecture dependant code, that has access to a frame, should not + use this function. Instead (get_frame_type() == DUMMY_FRAME) + should be used. + + Hmm, but what about threads? When the dummy-frame code tries to + relocate a dummy frame's saved registers it definitly needs to + differentiate between threads (otherwize it will do things like + clean-up the wrong threads frames). However, when just trying to + identify a dummy-frame that shouldn't matter. The wost that can + happen is that a thread is marked as sitting in a dummy frame when, + in reality, its corrupted its stack, to the point that a PC is + pointing into a dummy frame. */ + +extern int pc_in_dummy_frame (CORE_ADDR pc); + /* Return the regcache that belongs to the dummy-frame identifed by PC and FP, or NULL if no such frame exists. */ /* FIXME: cagney/2002-11-08: The function only exists because of diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c index feb8e12..c8834e9 100644 --- a/gdb/dve3900-rom.c +++ b/gdb/dve3900-rom.c @@ -113,7 +113,7 @@ static int ethernet = 0; different names than GDB does, and don't support all the registers either. */ -static char *r3900_regnames[NUM_REGS] = +static char *r3900_regnames[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", @@ -456,8 +456,15 @@ fetch_bitmapped_register (int regno, struct bit_field *bf) { unsigned long val; unsigned char regbuf[MAX_REGISTER_RAW_SIZE]; + char *regname = NULL; - monitor_printf ("x%s\r", r3900_regnames[regno]); + if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0])) + internal_error (__FILE__, __LINE__, + "fetch_bitmapped_register: regno out of bounds"); + else + regname = r3900_regnames[regno]; + + monitor_printf ("x%s\r", regname); val = fetch_fields (bf); monitor_printf (".\r"); monitor_expect_prompt (NULL, 0); @@ -501,9 +508,16 @@ static void store_bitmapped_register (int regno, struct bit_field *bf) { unsigned long oldval, newval; + char *regname = NULL; + + if (regno >= sizeof (r3900_regnames) / sizeof (r3900_regnames[0])) + internal_error (__FILE__, __LINE__, + "fetch_bitmapped_register: regno out of bounds"); + else + regname = r3900_regnames[regno]; /* Fetch the current value of the register. */ - monitor_printf ("x%s\r", r3900_regnames[regno]); + monitor_printf ("x%s\r", regname); oldval = fetch_fields (bf); newval = read_register (regno); diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 30c2db7..75c3c4d 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -1746,13 +1746,19 @@ cfi_frame_chain (struct frame_info *fi) } /* Sets the pc of the frame. */ -void +CORE_ADDR cfi_init_frame_pc (int fromleaf, struct frame_info *fi) { - if (fi->next) - get_reg ((char *) &(fi->pc), UNWIND_CONTEXT (fi->next), PC_REGNUM); + if (get_next_frame (fi)) + { + CORE_ADDR pc; + /* FIXME: cagney/2002-12-04: This is straight wrong. It's + assuming that the PC is CORE_ADDR (a host quantity) in size. */ + get_reg ((void *)&pc, UNWIND_CONTEXT (get_next_frame (fi)), PC_REGNUM); + return pc; + } else - fi->pc = read_pc (); + return read_pc (); } /* Initialize unwind context informations of the frame. */ diff --git a/gdb/dwarf2cfi.h b/gdb/dwarf2cfi.h index a1cc39c..2c8be97 100644 --- a/gdb/dwarf2cfi.h +++ b/gdb/dwarf2cfi.h @@ -67,7 +67,7 @@ void cfi_pop_frame (struct frame_info *); CORE_ADDR cfi_frame_chain (struct frame_info *fi); /* Sets the pc of the frame. */ -void cfi_init_frame_pc (int fromleaf, struct frame_info *fi); +CORE_ADDR cfi_init_frame_pc (int fromleaf, struct frame_info *fi); /* Initialize unwind context informations of the frame. */ void cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 1b6bb58..8f26ac4 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -561,138 +561,63 @@ struct field_info /* Various complaints about symbol reading that don't abort the process */ -static struct deprecated_complaint dwarf2_const_ignored = -{ - "type qualifier 'const' ignored", 0, 0 -}; -static struct deprecated_complaint dwarf2_volatile_ignored = -{ - "type qualifier 'volatile' ignored", 0, 0 -}; -static struct deprecated_complaint dwarf2_non_const_array_bound_ignored = -{ - "non-constant array bounds form '%s' ignored", 0, 0 -}; -static struct deprecated_complaint dwarf2_missing_line_number_section = -{ - "missing .debug_line section", 0, 0 -}; -static struct deprecated_complaint dwarf2_statement_list_fits_in_line_number_section = -{ - "statement list doesn't fit in .debug_line section", 0, 0 -}; -static struct deprecated_complaint dwarf2_mangled_line_number_section = -{ - "mangled .debug_line section", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_die_ref_attr = -{ - "unsupported die ref attribute form: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_stack_op = -{ - "unsupported stack op: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_complex_location_expr = -{ - "location expression too complex", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_tag = -{ - "unsupported tag: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_at_encoding = -{ - "unsupported DW_AT_encoding: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_at_frame_base = -{ - "unsupported DW_AT_frame_base for function '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_unexpected_tag = -{ - "unexepected tag in read_type_die: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_missing_at_frame_base = -{ - "DW_AT_frame_base missing for DW_OP_fbreg", 0, 0 -}; -static struct deprecated_complaint dwarf2_bad_static_member_name = -{ - "unrecognized static data member name '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_accessibility = -{ - "unsupported accessibility %d", 0, 0 -}; -static struct deprecated_complaint dwarf2_bad_member_name_complaint = -{ - "cannot extract member name from '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_missing_member_fn_type_complaint = -{ - "member function type missing for '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_vtbl_not_found_complaint = -{ - "virtual function table pointer not found when defining class '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_absolute_sibling_complaint = -{ - "ignoring absolute DW_AT_sibling", 0, 0 -}; -static struct deprecated_complaint dwarf2_const_value_length_mismatch = -{ - "const value length mismatch for '%s', got %d, expected %d", 0, 0 -}; -static struct deprecated_complaint dwarf2_unsupported_const_value_attr = -{ - "unsupported const value attribute form: '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_misplaced_line_number = -{ - "misplaced first line number at 0x%lx for '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_line_header_too_long = -{ - "line number info header doesn't fit in `.debug_line' section", 0, 0 -}; -static struct deprecated_complaint dwarf2_missing_macinfo_section = -{ - "missing .debug_macinfo section", 0, 0 -}; -static struct deprecated_complaint dwarf2_macros_too_long = +static void +dwarf2_non_const_array_bound_ignored_complaint (const char *arg1) { - "macro info runs off end of `.debug_macinfo' section", 0, 0 -}; -static struct deprecated_complaint dwarf2_macros_not_terminated = + complaint (&symfile_complaints, "non-constant array bounds form '%s' ignored", + arg1); +} + +static void +dwarf2_statement_list_fits_in_line_number_section_complaint (void) { - "no terminating 0-type entry for macros in `.debug_macinfo' section", 0, 0 -}; -static struct deprecated_complaint dwarf2_macro_outside_file = + complaint (&symfile_complaints, + "statement list doesn't fit in .debug_line section"); +} + +static void +dwarf2_complex_location_expr_complaint (void) { - "debug info gives macro %s outside of any file: %s", 0, 0 -}; -static struct deprecated_complaint dwarf2_macro_unmatched_end_file = + complaint (&symfile_complaints, "location expression too complex"); +} + +static void +dwarf2_unsupported_at_frame_base_complaint (const char *arg1) { - "macro debug info has an unmatched `close_file' directive", 0, 0 -}; -static struct deprecated_complaint dwarf2_macro_malformed_definition = + complaint (&symfile_complaints, + "unsupported DW_AT_frame_base for function '%s'", arg1); +} + +static void +dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, + int arg3) { - "macro debug info contains a malformed macro definition:\n`%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_macro_spaces_in_definition = + complaint (&symfile_complaints, + "const value length mismatch for '%s', got %d, expected %d", arg1, + arg2, arg3); +} + +static void +dwarf2_macros_too_long_complaint (void) { - "macro definition contains spaces in formal argument list:\n`%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_invalid_attrib_class = + complaint (&symfile_complaints, + "macro info runs off end of `.debug_macinfo' section"); +} + +static void +dwarf2_macro_malformed_definition_complaint (const char *arg1) { - "invalid attribute class or form for '%s' in '%s'", 0, 0 -}; -static struct deprecated_complaint dwarf2_invalid_pointer_size = + complaint (&symfile_complaints, + "macro debug info contains a malformed macro definition:\n`%s'", + arg1); +} + +static void +dwarf2_invalid_attrib_class_complaint (const char *arg1, const char *arg2) { - "invalid pointer size %d", 0, 0 -}; + complaint (&symfile_complaints, + "invalid attribute class or form for '%s' in '%s'", arg1, arg2); +} /* local function prototypes */ @@ -2131,17 +2056,17 @@ read_func_scope (struct die_info *die, struct objfile *objfile, } else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); addr = 0; } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_frame_base", name); + dwarf2_invalid_attrib_class_complaint ("DW_AT_frame_base", name); addr = 0; } if (isderef) - complain (&dwarf2_unsupported_at_frame_base, name); + dwarf2_unsupported_at_frame_base_complaint (name); else if (isreg) frame_base_reg = addr; else if (offreg) @@ -2150,7 +2075,7 @@ read_func_scope (struct die_info *die, struct objfile *objfile, frame_base_offset = addr; } else - complain (&dwarf2_unsupported_at_frame_base, name); + dwarf2_unsupported_at_frame_base_complaint (name); } new = push_context (0, lowpc); @@ -2302,8 +2227,11 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, new_field->virtuality = DW_UNSND (attr); fp = &new_field->field; - if (die->tag == DW_TAG_member) + + if (die->tag == DW_TAG_member && ! die_is_declaration (die)) { + /* Data member other than a C++ static data member. */ + /* Get type of field. */ fp->type = die_type (die, objfile, cu_header); @@ -2388,8 +2316,15 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, fip->non_public_fields = 1; } } - else if (die->tag == DW_TAG_variable) + else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable) { + /* C++ static member. */ + + /* NOTE: carlton/2002-11-05: It should be a DW_TAG_member that + is a declaration, but all versions of G++ as of this writing + (so through at least 3.2.1) incorrectly generate + DW_TAG_variable tags. */ + char *physname; /* C++ static member. @@ -2490,8 +2425,8 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type, default: /* Unknown accessibility. Complain and treat it as public. */ { - complain (&dwarf2_unsupported_accessibility, - fip->fields->accessibility); + complaint (&symfile_complaints, "unsupported accessibility %d", + fip->fields->accessibility); } break; } @@ -2598,7 +2533,8 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, fnp->voffset = VOFFSET_STATIC; } else - complain (&dwarf2_missing_member_fn_type_complaint, physname); + complaint (&symfile_complaints, "member function type missing for '%s'", + physname); /* Get fcontext from DW_AT_containing_type if present. */ if (dwarf_attr (die, DW_AT_containing_type) != NULL) @@ -2638,12 +2574,12 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, } else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_vtable_elem_location", - fieldname); + dwarf2_invalid_attrib_class_complaint ("DW_AT_vtable_elem_location", + fieldname); } } } @@ -2777,13 +2713,14 @@ read_structure_scope (struct die_info *die, struct objfile *objfile, while (child_die && child_die->tag) { - if (child_die->tag == DW_TAG_member) - { - dwarf2_add_field (&fi, child_die, objfile, cu_header); - } - else if (child_die->tag == DW_TAG_variable) + if (child_die->tag == DW_TAG_member + || child_die->tag == DW_TAG_variable) { - /* C++ static member. */ + /* NOTE: carlton/2002-11-05: A C++ static data member + should be a DW_TAG_member that is a declaration, but + all versions of G++ as of this writing (so through at + least 3.2.1) incorrectly generate DW_TAG_variable + tags for them instead. */ dwarf2_add_field (&fi, child_die, objfile, cu_header); } else if (child_die->tag == DW_TAG_subprogram) @@ -2843,8 +2780,10 @@ read_structure_scope (struct die_info *die, struct objfile *objfile, /* Complain if virtual function table field not found. */ if (i < TYPE_N_BASECLASSES (t)) - complain (&dwarf2_vtbl_not_found_complaint, - TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : ""); + complaint (&symfile_complaints, + "virtual function table pointer not found when defining class '%s'", + TYPE_TAG_NAME (type) ? TYPE_TAG_NAME (type) : + ""); } else { @@ -3045,8 +2984,8 @@ read_array_type (struct die_info *die, struct objfile *objfile, } else { - complain (&dwarf2_non_const_array_bound_ignored, - dwarf_form_name (attr->form)); + dwarf2_non_const_array_bound_ignored_complaint + (dwarf_form_name (attr->form)); #ifdef FORTRAN_HACK die->type = lookup_pointer_type (element_type); return; @@ -3081,8 +3020,8 @@ read_array_type (struct die_info *die, struct objfile *objfile, } else { - complain (&dwarf2_non_const_array_bound_ignored, - dwarf_form_name (attr->form)); + dwarf2_non_const_array_bound_ignored_complaint + (dwarf_form_name (attr->form)); #ifdef FORTRAN_HACK die->type = lookup_pointer_type (element_type); return; @@ -3149,12 +3088,12 @@ read_common_block (struct die_info *die, struct objfile *objfile, } else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_location", - "common block member"); + dwarf2_invalid_attrib_class_complaint ("DW_AT_location", + "common block member"); } } if (die->has_children) @@ -3279,7 +3218,7 @@ read_tag_pointer_type (struct die_info *die, struct objfile *objfile, } else if (TYPE_LENGTH (type) != byte_size) { - complain (&dwarf2_invalid_pointer_size, byte_size); + complaint (&symfile_complaints, "invalid pointer size %d", byte_size); } else { /* Should we also complain about unhandled address classes? */ @@ -3578,8 +3517,8 @@ read_base_type (struct die_info *die, struct objfile *objfile) type_flags |= TYPE_FLAG_UNSIGNED; break; default: - complain (&dwarf2_unsupported_at_encoding, - dwarf_type_encoding_name (encoding)); + complaint (&symfile_complaints, "unsupported DW_AT_encoding: '%s'", + dwarf_type_encoding_name (encoding)); break; } type = init_type (code, size, type_flags, DW_STRING (attr), objfile); @@ -3895,12 +3834,12 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, } else if (attr.form == DW_FORM_data4 || attr.form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_location", - "partial symbol information"); + dwarf2_invalid_attrib_class_complaint ("DW_AT_location", + "partial symbol information"); } break; case DW_AT_language: @@ -3924,7 +3863,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, /* Ignore absolute siblings, they might point outside of the current compile unit. */ if (attr.form == DW_FORM_ref_addr) - complain (&dwarf2_absolute_sibling_complaint); + complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling"); else part_die->sibling = dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr); @@ -4636,7 +4575,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, if (dwarf_line_buffer == NULL) { - complain (&dwarf2_missing_line_number_section); + complaint (&symfile_complaints, "missing .debug_line section"); return 0; } @@ -4644,7 +4583,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, could be 12 bytes long, but we're just going to fudge that. */ if (offset + 4 >= dwarf_line_size) { - complain (&dwarf2_statement_list_fits_in_line_number_section); + dwarf2_statement_list_fits_in_line_number_section_complaint (); return 0; } @@ -4660,7 +4599,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, line_ptr += bytes_read; if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size) { - complain (&dwarf2_statement_list_fits_in_line_number_section); + dwarf2_statement_list_fits_in_line_number_section_complaint (); return 0; } lh->statement_program_end = line_ptr + lh->total_length; @@ -4715,7 +4654,8 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, lh->statement_program_start = line_ptr; if (line_ptr > dwarf_line_buffer + dwarf_line_size) - complain (&dwarf2_line_header_too_long); + complaint (&symfile_complaints, + "line number info header doesn't fit in `.debug_line' section"); discard_cleanups (back_to); return lh; @@ -4760,8 +4700,9 @@ check_cu_functions (CORE_ADDR address) if (fn->seen_line) return address; if (address != fn->lowpc) - complain (&dwarf2_misplaced_line_number, - (unsigned long) address, fn->name); + complaint (&symfile_complaints, + "misplaced first line number at 0x%lx for '%s'", + (unsigned long) address, fn->name); fn->seen_line = 1; return fn->lowpc; } @@ -4864,7 +4805,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, } break; default: - complain (&dwarf2_mangled_line_number_section); + complaint (&symfile_complaints, + "mangled .debug_line section"); return; } break; @@ -5088,12 +5030,12 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_location", - "external variable"); + dwarf2_invalid_attrib_class_complaint ("DW_AT_location", + "external variable"); } add_symbol_to_list (sym, &global_symbols); if (is_thread_local) @@ -5134,12 +5076,12 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) { - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); } else { - complain (&dwarf2_invalid_attrib_class, "DW_AT_location", - "external variable"); + dwarf2_invalid_attrib_class_complaint ("DW_AT_location", + "external variable"); addr = 0; } add_symbol_to_list (sym, list_in_scope); @@ -5211,7 +5153,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, if (isderef) { if (basereg != frame_base_reg) - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); SYMBOL_CLASS (sym) = LOC_REF_ARG; } else @@ -5347,7 +5289,8 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, trash data, but since we must specifically ignore things we don't recognize, there is nothing else we should do at this point. */ - complain (&dwarf2_unsupported_tag, dwarf_tag_name (die->tag)); + complaint (&symfile_complaints, "unsupported tag: '%s'", + dwarf_tag_name (die->tag)); break; } } @@ -5367,8 +5310,10 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, { case DW_FORM_addr: if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != cu_header->addr_size) - complain (&dwarf2_const_value_length_mismatch, SYMBOL_NAME (sym), - cu_header->addr_size, TYPE_LENGTH (SYMBOL_TYPE (sym))); + dwarf2_const_value_length_mismatch_complaint (SYMBOL_NAME (sym), + cu_header->addr_size, + TYPE_LENGTH (SYMBOL_TYPE + (sym))); SYMBOL_VALUE_BYTES (sym) = (char *) obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size); store_address (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size, @@ -5381,8 +5326,10 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, case DW_FORM_block: blk = DW_BLOCK (attr); if (TYPE_LENGTH (SYMBOL_TYPE (sym)) != blk->size) - complain (&dwarf2_const_value_length_mismatch, SYMBOL_NAME (sym), - blk->size, TYPE_LENGTH (SYMBOL_TYPE (sym))); + dwarf2_const_value_length_mismatch_complaint (SYMBOL_NAME (sym), + blk->size, + TYPE_LENGTH (SYMBOL_TYPE + (sym))); SYMBOL_VALUE_BYTES (sym) = (char *) obstack_alloc (&objfile->symbol_obstack, blk->size); memcpy (SYMBOL_VALUE_BYTES (sym), blk->data, blk->size); @@ -5418,8 +5365,9 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, break; default: - complain (&dwarf2_unsupported_const_value_attr, - dwarf_form_name (attr->form)); + complaint (&symfile_complaints, + "unsupported const value attribute form: '%s'", + dwarf_form_name (attr->form)); SYMBOL_VALUE (sym) = 0; SYMBOL_CLASS (sym) = LOC_CONST; break; @@ -5602,7 +5550,8 @@ read_type_die (struct die_info *die, struct objfile *objfile, read_base_type (die, objfile); break; default: - complain (&dwarf2_unexpected_tag, dwarf_tag_name (die->tag)); + complaint (&symfile_complaints, "unexepected tag in read_type_die: '%s'", + dwarf_tag_name (die->tag)); break; } } @@ -6730,7 +6679,9 @@ dwarf2_get_ref_die_offset (struct attribute *attr) result = cu_header_offset + DW_UNSND (attr); break; default: - complain (&dwarf2_unsupported_die_ref_attr, dwarf_form_name (attr->form)); + complaint (&symfile_complaints, + "unsupported die ref attribute form: '%s'", + dwarf_form_name (attr->form)); } return result; } @@ -6966,7 +6917,8 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile, } else { - complain (&dwarf2_missing_at_frame_base); + complaint (&symfile_complaints, + "DW_AT_frame_base missing for DW_OP_fbreg"); islocal = 1; } break; @@ -7043,7 +6995,7 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile, /* If we're not the last op, then we definitely can't encode this using GDB's address_class enum. */ if (i < size) - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); break; case DW_OP_GNU_push_tls_address: @@ -7053,11 +7005,12 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile, /* Nothing should follow this operator, so the top of stack would be returned. */ if (i < size) - complain (&dwarf2_complex_location_expr); + dwarf2_complex_location_expr_complaint (); break; default: - complain (&dwarf2_unsupported_stack_op, dwarf_stack_op_name (op)); + complaint (&symfile_complaints, "unsupported stack op: '%s'", + dwarf_stack_op_name (op)); return (stack[stacki]); } } @@ -7190,7 +7143,9 @@ consume_improper_spaces (const char *p, const char *body) { if (*p == ' ') { - complain (&dwarf2_macro_spaces_in_definition, body); + complaint (&symfile_complaints, + "macro definition contains spaces in formal argument list:\n`%s'", + body); while (*p == ' ') p++; @@ -7248,7 +7203,7 @@ parse_macro_definition (struct macro_source_file *file, int line, replacement = body + name_len + 1; else { - complain (&dwarf2_macro_malformed_definition, body); + dwarf2_macro_malformed_definition_complaint (body); replacement = body + name_len; } @@ -7278,8 +7233,7 @@ parse_macro_definition (struct macro_source_file *file, int line, p++; if (! *p || p == arg_start) - complain (&dwarf2_macro_malformed_definition, - body); + dwarf2_macro_malformed_definition_complaint (body); else { /* Make sure argv has room for the new argument. */ @@ -7315,18 +7269,18 @@ parse_macro_definition (struct macro_source_file *file, int line, else if (*p == '\0') { /* Complain, but do define it. */ - complain (&dwarf2_macro_malformed_definition, body); + dwarf2_macro_malformed_definition_complaint (body); macro_define_function (file, line, name, argc, (const char **) argv, p); } else /* Just complain. */ - complain (&dwarf2_macro_malformed_definition, body); + dwarf2_macro_malformed_definition_complaint (body); } else /* Just complain. */ - complain (&dwarf2_macro_malformed_definition, body); + dwarf2_macro_malformed_definition_complaint (body); xfree (name); { @@ -7338,7 +7292,7 @@ parse_macro_definition (struct macro_source_file *file, int line, xfree (argv); } else - complain (&dwarf2_macro_malformed_definition, body); + dwarf2_macro_malformed_definition_complaint (body); } @@ -7353,7 +7307,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, if (dwarf_macinfo_buffer == NULL) { - complain (&dwarf2_missing_macinfo_section); + complaint (&symfile_complaints, "missing .debug_macinfo section"); return; } @@ -7367,7 +7321,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* Do we at least have room for a macinfo type byte? */ if (mac_ptr >= mac_end) { - complain (&dwarf2_macros_too_long); + dwarf2_macros_too_long_complaint (); return; } @@ -7394,11 +7348,12 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) - complain (&dwarf2_macro_outside_file, - macinfo_type == DW_MACINFO_define ? "definition" : - macinfo_type == DW_MACINFO_undef ? "undefinition" : - "something-or-other", - body); + complaint (&symfile_complaints, + "debug info gives macro %s outside of any file: %s", + macinfo_type == + DW_MACINFO_define ? "definition" : macinfo_type == + DW_MACINFO_undef ? "undefinition" : + "something-or-other", body); else { if (macinfo_type == DW_MACINFO_define) @@ -7427,7 +7382,8 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, case DW_MACINFO_end_file: if (! current_file) - complain (&dwarf2_macro_unmatched_end_file); + complaint (&symfile_complaints, + "macro debug info has an unmatched `close_file' directive"); else { current_file = current_file->included_by; @@ -7443,7 +7399,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* Do we at least have room for a macinfo type byte? */ if (mac_ptr >= mac_end) { - complain (&dwarf2_macros_too_long); + dwarf2_macros_too_long_complaint (); return; } @@ -7451,7 +7407,8 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, a look-ahead. */ next_type = read_1_byte (abfd, mac_ptr); if (next_type != 0) - complain (&dwarf2_macros_not_terminated); + complaint (&symfile_complaints, + "no terminating 0-type entry for macros in `.debug_macinfo' section"); return; } diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index a54e684..8050f0b 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -62,115 +62,37 @@ /* Complaints that can be issued during DWARF debug info reading. */ -struct deprecated_complaint no_bfd_get_N = -{ - "DIE @ 0x%x \"%s\", no bfd support for %d byte data object", 0, 0 -}; - -struct deprecated_complaint malformed_die = -{ - "DIE @ 0x%x \"%s\", malformed DIE, bad length (%d bytes)", 0, 0 -}; - -struct deprecated_complaint bad_die_ref = -{ - "DIE @ 0x%x \"%s\", reference to DIE (0x%x) outside compilation unit", 0, 0 -}; - -struct deprecated_complaint unknown_attribute_form = -{ - "DIE @ 0x%x \"%s\", unknown attribute form (0x%x)", 0, 0 -}; - -struct deprecated_complaint unknown_attribute_length = -{ - "DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes", 0, 0 -}; - -struct deprecated_complaint unexpected_fund_type = -{ - "DIE @ 0x%x \"%s\", unexpected fundamental type 0x%x", 0, 0 -}; - -struct deprecated_complaint unknown_type_modifier = -{ - "DIE @ 0x%x \"%s\", unknown type modifier %u", 0, 0 -}; - -struct deprecated_complaint volatile_ignored = -{ - "DIE @ 0x%x \"%s\", type modifier 'volatile' ignored", 0, 0 -}; - -struct deprecated_complaint const_ignored = -{ - "DIE @ 0x%x \"%s\", type modifier 'const' ignored", 0, 0 -}; - -struct deprecated_complaint botched_modified_type = -{ - "DIE @ 0x%x \"%s\", botched modified type decoding (mtype 0x%x)", 0, 0 -}; - -struct deprecated_complaint op_deref2 = -{ - "DIE @ 0x%x \"%s\", OP_DEREF2 address 0x%x not handled", 0, 0 -}; - -struct deprecated_complaint op_deref4 = -{ - "DIE @ 0x%x \"%s\", OP_DEREF4 address 0x%x not handled", 0, 0 -}; - -struct deprecated_complaint basereg_not_handled = -{ - "DIE @ 0x%x \"%s\", BASEREG %d not handled", 0, 0 -}; - -struct deprecated_complaint dup_user_type_allocation = -{ - "DIE @ 0x%x \"%s\", internal error: duplicate user type allocation", 0, 0 -}; - -struct deprecated_complaint dup_user_type_definition = -{ - "DIE @ 0x%x \"%s\", internal error: duplicate user type definition", 0, 0 -}; - -struct deprecated_complaint missing_tag = -{ - "DIE @ 0x%x \"%s\", missing class, structure, or union tag", 0, 0 -}; - -struct deprecated_complaint bad_array_element_type = -{ - "DIE @ 0x%x \"%s\", bad array element type attribute 0x%x", 0, 0 -}; - -struct deprecated_complaint subscript_data_items = -{ - "DIE @ 0x%x \"%s\", can't decode subscript data items", 0, 0 -}; - -struct deprecated_complaint unhandled_array_subscript_format = +static void +bad_die_ref_complaint (int arg1, const char *arg2, int arg3) { - "DIE @ 0x%x \"%s\", array subscript format 0x%x not handled yet", 0, 0 -}; + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", reference to DIE (0x%x) outside compilation unit", + arg1, arg2, arg3); +} -struct deprecated_complaint unknown_array_subscript_format = +static void +unknown_attribute_form_complaint (int arg1, const char *arg2, int arg3) { - "DIE @ 0x%x \"%s\", unknown array subscript format %x", 0, 0 -}; + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", unknown attribute form (0x%x)", arg1, arg2, + arg3); +} -struct deprecated_complaint not_row_major = +static void +dup_user_type_definition_complaint (int arg1, const char *arg2) { - "DIE @ 0x%x \"%s\", array not row major; not handled correctly", 0, 0 -}; + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", internal error: duplicate user type definition", + arg1, arg2); +} -struct deprecated_complaint missing_at_name = +static void +bad_array_element_type_complaint (int arg1, const char *arg2, int arg3) { - "DIE @ 0x%x, AT_name tag missing", 0, 0 -}; + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", bad array element type attribute 0x%x", arg1, + arg2, arg3); +} typedef unsigned int DIE_REF; /* Reference to a DIE */ @@ -786,7 +708,7 @@ lookup_utype (DIE_REF die_ref) utypeidx = (die_ref - dbroff) / 4; if ((utypeidx < 0) || (utypeidx >= numutypes)) { - complain (&bad_die_ref, DIE_ID, DIE_NAME); + bad_die_ref_complaint (DIE_ID, DIE_NAME, die_ref); } else { @@ -828,12 +750,14 @@ alloc_utype (DIE_REF die_ref, struct type *utypep) if ((utypeidx < 0) || (utypeidx >= numutypes)) { utypep = dwarf_fundamental_type (current_objfile, FT_INTEGER); - complain (&bad_die_ref, DIE_ID, DIE_NAME); + bad_die_ref_complaint (DIE_ID, DIE_NAME, die_ref); } else if (*typep != NULL) { utypep = *typep; - complain (&dup_user_type_allocation, DIE_ID, DIE_NAME); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", internal error: duplicate user type allocation", + DIE_ID, DIE_NAME); } else { @@ -978,7 +902,9 @@ struct_type (struct dieinfo *dip, char *thisdie, char *enddie, default: /* Should never happen */ TYPE_CODE (type) = TYPE_CODE_UNDEF; - complain (&missing_tag, DIE_ID, DIE_NAME); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", missing class, structure, or union tag", + DIE_ID, DIE_NAME); break; } /* Some compilers try to be helpful by inventing "fake" names for @@ -1191,7 +1117,7 @@ decode_array_element_type (char *scan) scan += SIZEOF_ATTRIBUTE; if ((nbytes = attribute_size (attribute)) == -1) { - complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute); + bad_array_element_type_complaint (DIE_ID, DIE_NAME, attribute); typep = dwarf_fundamental_type (current_objfile, FT_INTEGER); } else @@ -1218,7 +1144,7 @@ decode_array_element_type (char *scan) typep = decode_mod_u_d_type (scan); break; default: - complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute); + bad_array_element_type_complaint (DIE_ID, DIE_NAME, attribute); typep = dwarf_fundamental_type (current_objfile, FT_INTEGER); break; } @@ -1306,7 +1232,9 @@ decode_subscript_data_item (char *scan, char *end) if (nexttype == NULL) { /* Munged subscript data or other problem, fake it. */ - complain (&subscript_data_items, DIE_ID, DIE_NAME); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", can't decode subscript data items", + DIE_ID, DIE_NAME); nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER); } rangetype = create_range_type ((struct type *) NULL, indextype, @@ -1320,13 +1248,17 @@ decode_subscript_data_item (char *scan, char *end) case FMT_UT_C_X: case FMT_UT_X_C: case FMT_UT_X_X: - complain (&unhandled_array_subscript_format, DIE_ID, DIE_NAME, format); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", array subscript format 0x%x not handled yet", + DIE_ID, DIE_NAME, format); nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER); rangetype = create_range_type ((struct type *) NULL, nexttype, 0, 0); typep = create_array_type ((struct type *) NULL, nexttype, rangetype); break; default: - complain (&unknown_array_subscript_format, DIE_ID, DIE_NAME, format); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", unknown array subscript format %x", DIE_ID, + DIE_NAME, format); nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER); rangetype = create_range_type ((struct type *) NULL, nexttype, 0, 0); typep = create_array_type ((struct type *) NULL, nexttype, rangetype); @@ -1364,7 +1296,9 @@ dwarf_read_array_type (struct dieinfo *dip) if (dip->at_ordering != ORD_row_major) { /* FIXME: Can gdb even handle column major arrays? */ - complain (¬_row_major, DIE_ID, DIE_NAME); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", array not row major; not handled correctly", + DIE_ID, DIE_NAME); } if ((sub = dip->at_subscr_data) != NULL) { @@ -1394,7 +1328,7 @@ dwarf_read_array_type (struct dieinfo *dip) { /* Double ick! Not only is a type already in our slot, but someone has decorated it. Complain and leave it alone. */ - complain (&dup_user_type_definition, DIE_ID, DIE_NAME); + dup_user_type_definition_complaint (DIE_ID, DIE_NAME); } } } @@ -1492,7 +1426,7 @@ read_tag_string_type (struct dieinfo *dip) is a blank one. If not, complain and leave it alone. */ if (TYPE_CODE (utype) != TYPE_CODE_UNDEF) { - complain (&dup_user_type_definition, DIE_ID, DIE_NAME); + dup_user_type_definition_complaint (DIE_ID, DIE_NAME); return; } } @@ -1558,7 +1492,7 @@ read_subroutine_type (struct dieinfo *dip, char *thisdie, char *enddie) } else { - complain (&dup_user_type_definition, DIE_ID, DIE_NAME); + dup_user_type_definition_complaint (DIE_ID, DIE_NAME); } } @@ -1774,7 +1708,8 @@ read_func_scope (struct dieinfo *dip, char *thisdie, char *enddie, FIXME: Add code to handle AT_abstract_origin tags properly. */ if (dip->at_name == NULL) { - complain (&missing_at_name, DIE_ID); + complaint (&symfile_complaints, "DIE @ 0x%x, AT_name tag missing", + DIE_ID); return; } @@ -2208,10 +2143,14 @@ locval (struct dieinfo *dip) break; case OP_DEREF2: /* pop, deref and push 2 bytes (as a long) */ - complain (&op_deref2, DIE_ID, DIE_NAME, stack[stacki]); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", OP_DEREF2 address 0x%lx not handled", + DIE_ID, DIE_NAME, stack[stacki]); break; case OP_DEREF4: /* pop, deref and push 4 bytes (as a long) */ - complain (&op_deref4, DIE_ID, DIE_NAME, stack[stacki]); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", OP_DEREF4 address 0x%lx not handled", + DIE_ID, DIE_NAME, stack[stacki]); break; case OP_ADD: /* pop top 2 items, add, push result */ stack[stacki - 1] += stack[stacki]; @@ -2660,8 +2599,8 @@ scan_partial_symbols (char *thisdie, char *enddie, struct objfile *objfile) temp = dbbase + di.at_sibling - dbroff; if ((temp < thisdie) || (temp >= enddie)) { - complain (&bad_die_ref, DIE_ID, DIE_NAME, - di.at_sibling); + bad_die_ref_complaint (DIE_ID, DIE_NAME, + di.at_sibling); } else { @@ -3179,7 +3118,9 @@ decode_modified_type (char *modifiers, unsigned int modcount, int mtype) } break; default: - complain (&botched_modified_type, DIE_ID, DIE_NAME, mtype); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", botched modified type decoding (mtype 0x%x)", + DIE_ID, DIE_NAME, mtype); typep = dwarf_fundamental_type (current_objfile, FT_INTEGER); break; } @@ -3197,16 +3138,22 @@ decode_modified_type (char *modifiers, unsigned int modcount, int mtype) typep = lookup_reference_type (typep); break; case MOD_const: - complain (&const_ignored, DIE_ID, DIE_NAME); /* FIXME */ + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", type modifier 'const' ignored", DIE_ID, + DIE_NAME); /* FIXME */ break; case MOD_volatile: - complain (&volatile_ignored, DIE_ID, DIE_NAME); /* FIXME */ + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", type modifier 'volatile' ignored", + DIE_ID, DIE_NAME); /* FIXME */ break; default: if (!(MOD_lo_user <= (unsigned char) modifier && (unsigned char) modifier <= MOD_hi_user)) { - complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", unknown type modifier %u", DIE_ID, + DIE_NAME, modifier); } break; } @@ -3348,7 +3295,9 @@ decode_fund_type (unsigned int fundtype) typep = dwarf_fundamental_type (current_objfile, FT_INTEGER); if (!(FT_lo_user <= fundtype && fundtype <= FT_hi_user)) { - complain (&unexpected_fund_type, DIE_ID, DIE_NAME, fundtype); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", unexpected fundamental type 0x%x", + DIE_ID, DIE_NAME, fundtype); } } @@ -3446,7 +3395,9 @@ basicdieinfo (struct dieinfo *dip, char *diep, struct objfile *objfile) if ((dip->die_length < SIZEOF_DIE_LENGTH) || ((diep + dip->die_length) > (dbbase + dbsize))) { - complain (&malformed_die, DIE_ID, DIE_NAME, dip->die_length); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", malformed DIE, bad length (%ld bytes)", + DIE_ID, DIE_NAME, dip->die_length); dip->die_length = 0; } else if (dip->die_length < (SIZEOF_DIE_LENGTH + SIZEOF_DIE_TAG)) @@ -3512,7 +3463,9 @@ completedieinfo (struct dieinfo *dip, struct objfile *objfile) diep += SIZEOF_ATTRIBUTE; if ((nbytes = attribute_size (attr)) == -1) { - complain (&unknown_attribute_length, DIE_ID, DIE_NAME); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes", + DIE_ID, DIE_NAME); diep = end; continue; } @@ -3669,7 +3622,7 @@ completedieinfo (struct dieinfo *dip, struct objfile *objfile) diep += strlen (diep) + 1; break; default: - complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form); + unknown_attribute_form_complaint (DIE_ID, DIE_NAME, form); diep = end; break; } @@ -3726,7 +3679,9 @@ target_to_host (char *from, int nbytes, int signextend, /* FIXME: Unused */ rtnval = bfd_get_8 (objfile->obfd, (bfd_byte *) from); break; default: - complain (&no_bfd_get_N, DIE_ID, DIE_NAME, nbytes); + complaint (&symfile_complaints, + "DIE @ 0x%x \"%s\", no bfd support for %d byte data object", + DIE_ID, DIE_NAME, nbytes); rtnval = 0; break; } @@ -3781,7 +3736,7 @@ attribute_size (unsigned int attr) nbytes = TARGET_FT_POINTER_SIZE (objfile); break; default: - complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form); + unknown_attribute_form_complaint (DIE_ID, DIE_NAME, form); nbytes = -1; break; } diff --git a/gdb/elfread.c b/gdb/elfread.c index a29a71b..ba8fc49 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -52,20 +52,6 @@ struct elfinfo asection *mdebugsect; /* Section pointer for .mdebug section */ }; -/* Various things we might complain about... */ - -struct deprecated_complaint section_info_complaint = -{"elf/stab section information %s without a preceding file symbol", 0, 0}; - -struct deprecated_complaint section_info_dup_complaint = -{"duplicated elf/stab section information for %s", 0, 0}; - -struct deprecated_complaint stab_info_mismatch_complaint = -{"elf/stab section information missing for %s", 0, 0}; - -struct deprecated_complaint stab_info_questionable_complaint = -{"elf/stab section information questionable for %s", 0, 0}; - static void free_elfinfo (void *); /* We are called once per section from elf_symfile_read. We @@ -415,8 +401,9 @@ elf_symtab_read (struct objfile *objfile, int dynamic) sizeof (*sectinfo)); if (filesym == NULL) { - complain (§ion_info_complaint, - sym->name); + complaint (&symfile_complaints, + "elf/stab section information %s without a preceding file symbol", + sym->name); } else { @@ -428,8 +415,9 @@ elf_symtab_read (struct objfile *objfile, int dynamic) { if (sectinfo->sections[index] != 0) { - complain (§ion_info_dup_complaint, - sectinfo->filename); + complaint (&symfile_complaints, + "duplicated elf/stab section information for %s", + sectinfo->filename); } } else @@ -740,7 +728,8 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst) if (maybe == 0 && questionable != 0) { - complain (&stab_info_questionable_complaint, filename); + complaint (&symfile_complaints, + "elf/stab section information questionable for %s", filename); maybe = questionable; } @@ -757,7 +746,8 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst) /* We were unable to find any offsets for this file. Complain. */ if (dbx->stab_section_info) /* If there *is* any info, */ - complain (&stab_info_mismatch_complaint, filename); + complaint (&symfile_complaints, + "elf/stab section information missing for %s", filename); } /* Register that we are able to handle ELF object file formats. */ diff --git a/gdb/eval.c b/gdb/eval.c index c80bfcc..67afcd1 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -443,7 +443,7 @@ evaluate_subexp_standard (struct type *expect_type, case OP_REGISTER: { int regno = longest_to_int (exp->elts[pc + 1].longconst); - struct value *val = value_of_register (regno, selected_frame); + struct value *val = value_of_register (regno, deprecated_selected_frame); (*pos) += 2; if (val == NULL) error ("Value of register %s not available.", diff --git a/gdb/exec.c b/gdb/exec.c index 3a3e888..16b7e5f 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -36,6 +36,7 @@ #endif #include +#include #include "gdb_string.h" #include "gdbcore.h" @@ -481,10 +482,10 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct mem_attrib *attrib, struct target_ops *target) { - boolean res; + int res; struct section_table *p; CORE_ADDR nextsectaddr, memend; - boolean (*xfer_fn) (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type); + int (*xfer_fn) (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type); asection *section = NULL; if (len <= 0) @@ -544,6 +545,7 @@ void print_section_info (struct target_ops *t, bfd *abfd) { struct section_table *p; + char *fmt = TARGET_ADDR_BIT <= 32 ? "08l" : "016l"; printf_filtered ("\t`%s', ", bfd_get_filename (abfd)); wrap_here (" "); @@ -556,12 +558,11 @@ print_section_info (struct target_ops *t, bfd *abfd) } for (p = t->to_sections; p < t->to_sections_end; p++) { - /* FIXME-32x64 need a print_address_numeric with field width */ - printf_filtered ("\t%s", local_hex_string_custom ((unsigned long) p->addr, "08l")); - printf_filtered (" - %s", local_hex_string_custom ((unsigned long) p->endaddr, "08l")); + printf_filtered ("\t%s", local_hex_string_custom (p->addr, fmt)); + printf_filtered (" - %s", local_hex_string_custom (p->endaddr, fmt)); if (info_verbose) printf_filtered (" @ %s", - local_hex_string_custom ((unsigned long) p->the_bfd_section->filepos, "08l")); + local_hex_string_custom (p->the_bfd_section->filepos, "08l")); printf_filtered (" is %s", bfd_section_name (p->bfd, p->the_bfd_section)); if (p->bfd != abfd) { @@ -714,14 +715,11 @@ Specify the filename of the executable file."; exec_ops.to_open = exec_open; exec_ops.to_close = exec_close; exec_ops.to_attach = find_default_attach; - exec_ops.to_require_attach = find_default_require_attach; - exec_ops.to_require_detach = find_default_require_detach; exec_ops.to_xfer_memory = xfer_memory; exec_ops.to_files_info = exec_files_info; exec_ops.to_insert_breakpoint = ignore; exec_ops.to_remove_breakpoint = ignore; exec_ops.to_create_inferior = find_default_create_inferior; - exec_ops.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior; exec_ops.to_stratum = file_stratum; exec_ops.to_has_memory = 1; exec_ops.to_make_corefile_notes = exec_make_note_section; diff --git a/gdb/expprint.c b/gdb/expprint.c index edaa6f9..31b82c0 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -28,6 +28,8 @@ #include "language.h" #include "parser-defs.h" #include "frame.h" /* For frame_map_regnum_to_name. */ +#include "target.h" +#include "gdb_string.h" #ifdef HAVE_CTYPE_H #include @@ -178,6 +180,51 @@ print_subexp (register struct expression *exp, register int *pos, fprintf_unfiltered (stream, "B''"); return; + case OP_OBJC_NSSTRING: /* Objective-C Foundation Class NSString constant. */ + nargs = longest_to_int (exp->elts[pc + 1].longconst); + (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1); + fputs_filtered ("@\"", stream); + LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0); + fputs_filtered ("\"", stream); + return; + + case OP_OBJC_MSGCALL: + { /* Objective C message (method) call. */ + char *selector; + (*pos) += 3; + nargs = longest_to_int (exp->elts[pc + 2].longconst); + fprintf_unfiltered (stream, "["); + print_subexp (exp, pos, stream, PREC_SUFFIX); + if (0 == target_read_string (exp->elts[pc + 1].longconst, + &selector, 1024, NULL)) + { + error ("bad selector"); + return; + } + if (nargs) + { + char *s, *nextS; + s = alloca (strlen (selector) + 1); + strcpy (s, selector); + for (tem = 0; tem < nargs; tem++) + { + nextS = strchr (s, ':'); + *nextS = '\0'; + fprintf_unfiltered (stream, " %s: ", s); + s = nextS + 1; + print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); + } + } + else + { + fprintf_unfiltered (stream, " %s", selector); + } + fprintf_unfiltered (stream, "]"); + /* "selector" was malloc'd by target_read_string. Free it. */ + free (selector); + return; + } + case OP_ARRAY: (*pos) += 3; nargs = longest_to_int (exp->elts[pc + 2].longconst); @@ -392,6 +439,13 @@ print_subexp (register struct expression *exp, register int *pos, fputs_filtered ("this", stream); return; + /* Objective-C ops */ + + case OP_OBJC_SELF: + ++(*pos); + fputs_filtered ("self", stream); /* The ObjC equivalent of "this". */ + return; + /* Modula-2 ops */ case MULTI_SUBSCRIPT: @@ -685,6 +739,8 @@ op_name (int opcode) return "STRUCTOP_PTR"; case OP_THIS: return "OP_THIS"; + case OP_OBJC_SELF: + return "OP_OBJC_SELF"; case OP_SCOPE: return "OP_SCOPE"; case OP_TYPE: diff --git a/gdb/expression.h b/gdb/expression.h index 23463b0..8532922 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -181,11 +181,11 @@ enum exp_opcode making three exp_elements. */ OP_FUNCALL, - /* OP_MSGCALL is followed by a string in the next exp_element and then an + /* OP_OBJC_MSGCALL is followed by a string in the next exp_element and then an integer. The string is the selector string. The integer is the number of arguments to the message call. That many plus one values are used, the first one being the object pointer. This is an Objective C message */ - OP_MSGCALL, + OP_OBJC_MSGCALL, /* This is EXACTLY like OP_FUNCALL but is semantically different. In F77, array subscript expressions, substring expressions @@ -283,12 +283,12 @@ enum exp_opcode It just comes in a tight (OP_THIS, OP_THIS) pair. */ OP_THIS, - /* Objective-C: OP_SELF is just a placeholder for the class instance - variable. It just comes in a tight (OP_SELF, OP_SELF) pair. */ - OP_SELF, + /* Objective-C: OP_OBJC_SELF is just a placeholder for the class instance + variable. It just comes in a tight (OP_OBJC_SELF, OP_OBJC_SELF) pair. */ + OP_OBJC_SELF, /* Objective C: "@selector" pseudo-operator */ - OP_SELECTOR, + OP_OBJC_SELECTOR, /* OP_SCOPE surrounds a type name, a block, and a field name. The type name and block are encoded as one element, but the field @@ -321,7 +321,7 @@ enum exp_opcode OP_EXPRSTRING, /* An Objective C Foundation Class NSString constant */ - OP_NSSTRING, + OP_OBJC_NSSTRING, }; union exp_element diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 6c2a0aa..211da70 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -75,7 +75,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound) switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type)) { case BOUND_BY_VALUE_ON_STACK: - current_frame_addr = selected_frame->frame; + current_frame_addr = get_frame_base (deprecated_selected_frame); if (current_frame_addr > 0) { *lower_bound = @@ -99,7 +99,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound) break; case BOUND_BY_REF_ON_STACK: - current_frame_addr = selected_frame->frame; + current_frame_addr = get_frame_base (deprecated_selected_frame); if (current_frame_addr > 0) { ptr_to_lower_bound = @@ -133,7 +133,7 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound) switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type)) { case BOUND_BY_VALUE_ON_STACK: - current_frame_addr = selected_frame->frame; + current_frame_addr = get_frame_base (deprecated_selected_frame); if (current_frame_addr > 0) { *upper_bound = @@ -162,7 +162,7 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound) break; case BOUND_BY_REF_ON_STACK: - current_frame_addr = selected_frame->frame; + current_frame_addr = get_frame_base (deprecated_selected_frame); if (current_frame_addr > 0) { ptr_to_upper_bound = @@ -588,7 +588,7 @@ info_common_command (char *comname, int from_tty) first make sure that it is visible and if so, let us display its contents */ - fi = selected_frame; + fi = deprecated_selected_frame; if (fi == NULL) error ("No frame selected"); @@ -596,7 +596,7 @@ info_common_command (char *comname, int from_tty) /* The following is generally ripped off from stack.c's routine print_frame_info() */ - func = find_pc_function (fi->pc); + func = find_pc_function (get_frame_pc (fi)); if (func) { /* In certain pathological cases, the symtabs give the wrong @@ -613,7 +613,7 @@ info_common_command (char *comname, int from_tty) be any minimal symbols in the middle of a function. FIXME: (Not necessarily true. What about text labels) */ - struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc); + struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi)); if (msymbol != NULL && (SYMBOL_VALUE_ADDRESS (msymbol) @@ -625,7 +625,7 @@ info_common_command (char *comname, int from_tty) else { register struct minimal_symbol *msymbol = - lookup_minimal_symbol_by_pc (fi->pc); + lookup_minimal_symbol_by_pc (get_frame_pc (fi)); if (msymbol != NULL) funname = SYMBOL_NAME (msymbol); @@ -680,7 +680,7 @@ there_is_a_visible_common_named (char *comname) if (comname == NULL) error ("Cannot deal with NULL common name!"); - fi = selected_frame; + fi = deprecated_selected_frame; if (fi == NULL) error ("No frame selected"); diff --git a/gdb/findvar.c b/gdb/findvar.c index 6f38b6f..3eff930 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -304,7 +304,7 @@ value_of_register (int regnum, struct frame_info *frame) /* Builtin registers lie completly outside of the range of normal registers. Catch them early so that the target never sees them. */ if (regnum >= NUM_REGS + NUM_PSEUDO_REGS) - return value_of_builtin_reg (regnum, selected_frame); + return value_of_builtin_reg (regnum, deprecated_selected_frame); get_saved_register (raw_buffer, &optim, &addr, frame, regnum, &lval); @@ -419,7 +419,7 @@ symbol_read_needs_frame (const struct symbol *sym) and a stack frame id, read the value of the variable and return a (pointer to a) struct value containing the value. If the variable cannot be found, return a zero pointer. - If FRAME is NULL, use the selected_frame. */ + If FRAME is NULL, use the deprecated_selected_frame. */ struct value * read_var_value (const struct symbol *var, struct frame_info *frame) @@ -436,7 +436,7 @@ read_var_value (const struct symbol *var, struct frame_info *frame) len = TYPE_LENGTH (type); if (frame == NULL) - frame = selected_frame; + frame = deprecated_selected_frame; switch (SYMBOL_CLASS (var)) { @@ -787,7 +787,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) for some good purpose. */ { VALUE_LVAL (v) = lval_reg_frame_relative; - VALUE_FRAME (v) = FRAME_FP (frame); + VALUE_FRAME (v) = get_frame_base (frame); VALUE_FRAME_REGNUM (v) = regnum; } else if (mem_stor) diff --git a/gdb/fork-child.c b/gdb/fork-child.c index aacd53c..0b14a94 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -379,131 +379,6 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, #endif } -/* An inferior Unix process CHILD_PID has been created by a call to - fork() (or variants like vfork). It is presently stopped, and waiting - to be resumed. clone_and_follow_inferior will fork the debugger, - and that clone will "follow" (attach to) CHILD_PID. The original copy - of the debugger will not touch CHILD_PID again. - - Also, the original debugger will set FOLLOWED_CHILD FALSE, while the - clone will set it TRUE. - */ -void -clone_and_follow_inferior (int child_pid, int *followed_child) -{ - int debugger_pid; - int status; - char pid_spelling[100]; /* Arbitrary but sufficient length. */ - - /* This semaphore is used to coordinate the two debuggers' handoff - of CHILD_PID. The original debugger will detach from CHILD_PID, - and then the clone debugger will attach to it. (It must be done - this way because on some targets, only one process at a time can - trace another. Thus, the original debugger must relinquish its - tracing rights before the clone can pick them up.) - */ -#define SEM_TALK (1) -#define SEM_LISTEN (0) - int handoff_semaphore[2]; /* Original "talks" to [1], clone "listens" to [0] */ - int talk_value = 99; - int listen_value; - - /* Set debug_fork then attach to the child while it sleeps, to debug. */ - static int debug_fork = 0; - - /* It is generally good practice to flush any possible pending stdio - output prior to doing a fork, to avoid the possibility of both the - parent and child flushing the same data after the fork. */ - - gdb_flush (gdb_stdout); - gdb_flush (gdb_stderr); - - /* Open the semaphore pipes. - */ - status = pipe (handoff_semaphore); - if (status < 0) - error ("error getting pipe for handoff semaphore"); - - /* Clone the debugger. Note that the apparent call to vfork() - below *might* actually be a call to fork() due to the fact that - autoconf will ``#define vfork fork'' on certain platforms. */ - if (debug_fork) - debugger_pid = fork (); - else - debugger_pid = vfork (); - - if (debugger_pid < 0) - perror_with_name ("fork"); - - /* Are we the original debugger? If so, we must relinquish all claims - to CHILD_PID. */ - if (debugger_pid != 0) - { - char signal_spelling[100]; /* Arbitrary but sufficient length */ - - /* Detach from CHILD_PID. Deliver a "stop" signal when we do, though, - so that it remains stopped until the clone debugger can attach - to it. - */ - detach_breakpoints (child_pid); - - sprintf (signal_spelling, "%d", target_signal_to_host (TARGET_SIGNAL_STOP)); - target_require_detach (child_pid, signal_spelling, 1); - - /* Notify the clone debugger that it should attach to CHILD_PID. */ - write (handoff_semaphore[SEM_TALK], &talk_value, sizeof (talk_value)); - - *followed_child = 0; - } - - /* We're the child. */ - else - { - if (debug_fork) - sleep (debug_fork); - - /* The child (i.e., the cloned debugger) must now attach to - CHILD_PID. inferior_ptid is presently set to the parent process - of the fork, while CHILD_PID should be the child process of the - fork. - - Wait until the original debugger relinquishes control of CHILD_PID, - though. - */ - read (handoff_semaphore[SEM_LISTEN], &listen_value, sizeof (listen_value)); - - /* Note that we DON'T want to actually detach from inferior_ptid, - because that would allow it to run free. The original - debugger wants to retain control of the process. So, we - just reset inferior_ptid to CHILD_PID, and then ensure that all - breakpoints are really set in CHILD_PID. - */ - target_mourn_inferior (); - - /* Ask the tty subsystem to switch to the one we specified earlier - (or to share the current terminal, if none was specified). */ - - new_tty (); - - dont_repeat (); - sprintf (pid_spelling, "%d", child_pid); - target_require_attach (pid_spelling, 1); - - /* Perform any necessary cleanup, after attachment. (This form - of attaching can behave differently on some targets than the - standard method, where a process formerly not under debugger - control was suddenly attached to..) - */ - target_post_follow_inferior_by_clone (); - - *followed_child = 1; - } - - /* Discard the handoff sempahore. */ - (void) close (handoff_semaphore[SEM_LISTEN]); - (void) close (handoff_semaphore[SEM_TALK]); -} - /* Accept NTRAPS traps from the inferior. */ void diff --git a/gdb/fr30-tdep.c b/gdb/fr30-tdep.c deleted file mode 100644 index 12e9f7e..0000000 --- a/gdb/fr30-tdep.c +++ /dev/null @@ -1,601 +0,0 @@ -// OBSOLETE /* Target-dependent code for the Fujitsu FR30. -// OBSOLETE Copyright 1999, 2000, 2001 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "obstack.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "bfd.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* An expression that tells us whether the function invocation represented -// OBSOLETE by FI does not have a frame on the stack associated with it. */ -// OBSOLETE int -// OBSOLETE fr30_frameless_function_invocation (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE int frameless; -// OBSOLETE CORE_ADDR func_start, after_prologue; -// OBSOLETE func_start = (get_pc_function_start ((fi)->pc) + -// OBSOLETE FUNCTION_START_OFFSET); -// OBSOLETE after_prologue = func_start; -// OBSOLETE after_prologue = SKIP_PROLOGUE (after_prologue); -// OBSOLETE frameless = (after_prologue == func_start); -// OBSOLETE return frameless; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: pop_frame -// OBSOLETE This routine gets called when either the user uses the `return' -// OBSOLETE command, or the call dummy breakpoint gets hit. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE fr30_pop_frame (void) -// OBSOLETE { -// OBSOLETE struct frame_info *frame = get_current_frame (); -// OBSOLETE int regnum; -// OBSOLETE CORE_ADDR sp = read_register (SP_REGNUM); -// OBSOLETE -// OBSOLETE if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) -// OBSOLETE generic_pop_dummy_frame (); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE write_register (PC_REGNUM, FRAME_SAVED_PC (frame)); -// OBSOLETE -// OBSOLETE for (regnum = 0; regnum < NUM_REGS; regnum++) -// OBSOLETE if (frame->fsr.regs[regnum] != 0) -// OBSOLETE { -// OBSOLETE write_register (regnum, -// OBSOLETE read_memory_unsigned_integer (frame->fsr.regs[regnum], -// OBSOLETE REGISTER_RAW_SIZE (regnum))); -// OBSOLETE } -// OBSOLETE write_register (SP_REGNUM, sp + frame->framesize); -// OBSOLETE } -// OBSOLETE flush_cached_frames (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: fr30_store_return_value -// OBSOLETE Put a value where a caller expects to see it. Used by the 'return' -// OBSOLETE command. */ -// OBSOLETE void -// OBSOLETE fr30_store_return_value (struct type *type, -// OBSOLETE char *valbuf) -// OBSOLETE { -// OBSOLETE /* Here's how the FR30 returns values (gleaned from gcc/config/ -// OBSOLETE fr30/fr30.h): -// OBSOLETE -// OBSOLETE If the return value is 32 bits long or less, it goes in r4. -// OBSOLETE -// OBSOLETE If the return value is 64 bits long or less, it goes in r4 (most -// OBSOLETE significant word) and r5 (least significant word. -// OBSOLETE -// OBSOLETE If the function returns a structure, of any size, the caller -// OBSOLETE passes the function an invisible first argument where the callee -// OBSOLETE should store the value. But GDB doesn't let you do that anyway. -// OBSOLETE -// OBSOLETE If you're returning a value smaller than a word, it's not really -// OBSOLETE necessary to zero the upper bytes of the register; the caller is -// OBSOLETE supposed to ignore them. However, the FR30 typically keeps its -// OBSOLETE values extended to the full register width, so we should emulate -// OBSOLETE that. */ -// OBSOLETE -// OBSOLETE /* The FR30 is big-endian, so if we return a small value (like a -// OBSOLETE short or a char), we need to position it correctly within the -// OBSOLETE register. We round the size up to a register boundary, and then -// OBSOLETE adjust the offset so as to place the value at the right end. */ -// OBSOLETE int value_size = TYPE_LENGTH (type); -// OBSOLETE int returned_size = (value_size + FR30_REGSIZE - 1) & ~(FR30_REGSIZE - 1); -// OBSOLETE int offset = (REGISTER_BYTE (RETVAL_REG) -// OBSOLETE + (returned_size - value_size)); -// OBSOLETE char *zeros = alloca (returned_size); -// OBSOLETE memset (zeros, 0, returned_size); -// OBSOLETE -// OBSOLETE write_register_bytes (REGISTER_BYTE (RETVAL_REG), zeros, returned_size); -// OBSOLETE write_register_bytes (offset, valbuf, value_size); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: skip_prologue -// OBSOLETE Return the address of the first code past the prologue of the function. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE fr30_skip_prologue (CORE_ADDR pc) -// OBSOLETE { -// OBSOLETE CORE_ADDR func_addr, func_end; -// OBSOLETE -// OBSOLETE /* See what the symbol table says */ -// OBSOLETE -// OBSOLETE if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) -// OBSOLETE { -// OBSOLETE struct symtab_and_line sal; -// OBSOLETE -// OBSOLETE sal = find_pc_line (func_addr, 0); -// OBSOLETE -// OBSOLETE if (sal.line != 0 && sal.end < func_end) -// OBSOLETE { -// OBSOLETE return sal.end; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Either we didn't find the start of this function (nothing we can do), -// OBSOLETE or there's no line info, or the line after the prologue is after -// OBSOLETE the end of the function (there probably isn't a prologue). */ -// OBSOLETE -// OBSOLETE return pc; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: push_arguments -// OBSOLETE Setup arguments and RP for a call to the target. First four args -// OBSOLETE go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on stack... -// OBSOLETE Structs are passed by reference. XXX not right now Z.R. -// OBSOLETE 64 bit quantities (doubles and long longs) may be split between -// OBSOLETE the regs and the stack. -// OBSOLETE When calling a function that returns a struct, a pointer to the struct -// OBSOLETE is passed in as a secret first argument (always in FIRST_ARGREG). -// OBSOLETE -// OBSOLETE Stack space for the args has NOT been allocated: that job is up to us. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp, -// OBSOLETE int struct_return, CORE_ADDR struct_addr) -// OBSOLETE { -// OBSOLETE int argreg; -// OBSOLETE int argnum; -// OBSOLETE int stack_offset; -// OBSOLETE struct stack_arg -// OBSOLETE { -// OBSOLETE char *val; -// OBSOLETE int len; -// OBSOLETE int offset; -// OBSOLETE }; -// OBSOLETE struct stack_arg *stack_args = -// OBSOLETE (struct stack_arg *) alloca (nargs * sizeof (struct stack_arg)); -// OBSOLETE int nstack_args = 0; -// OBSOLETE -// OBSOLETE argreg = FIRST_ARGREG; -// OBSOLETE -// OBSOLETE /* the struct_return pointer occupies the first parameter-passing reg */ -// OBSOLETE if (struct_return) -// OBSOLETE write_register (argreg++, struct_addr); -// OBSOLETE -// OBSOLETE stack_offset = 0; -// OBSOLETE -// OBSOLETE /* Process args from left to right. Store as many as allowed in -// OBSOLETE registers, save the rest to be pushed on the stack */ -// OBSOLETE for (argnum = 0; argnum < nargs; argnum++) -// OBSOLETE { -// OBSOLETE char *val; -// OBSOLETE struct value *arg = args[argnum]; -// OBSOLETE struct type *arg_type = check_typedef (VALUE_TYPE (arg)); -// OBSOLETE struct type *target_type = TYPE_TARGET_TYPE (arg_type); -// OBSOLETE int len = TYPE_LENGTH (arg_type); -// OBSOLETE enum type_code typecode = TYPE_CODE (arg_type); -// OBSOLETE CORE_ADDR regval; -// OBSOLETE int newarg; -// OBSOLETE -// OBSOLETE val = (char *) VALUE_CONTENTS (arg); -// OBSOLETE -// OBSOLETE { -// OBSOLETE /* Copy the argument to general registers or the stack in -// OBSOLETE register-sized pieces. Large arguments are split between -// OBSOLETE registers and stack. */ -// OBSOLETE while (len > 0) -// OBSOLETE { -// OBSOLETE if (argreg <= LAST_ARGREG) -// OBSOLETE { -// OBSOLETE int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE; -// OBSOLETE regval = extract_address (val, partial_len); -// OBSOLETE -// OBSOLETE /* It's a simple argument being passed in a general -// OBSOLETE register. */ -// OBSOLETE write_register (argreg, regval); -// OBSOLETE argreg++; -// OBSOLETE len -= partial_len; -// OBSOLETE val += partial_len; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* keep for later pushing */ -// OBSOLETE stack_args[nstack_args].val = val; -// OBSOLETE stack_args[nstack_args++].len = len; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE /* now do the real stack pushing, process args right to left */ -// OBSOLETE while (nstack_args--) -// OBSOLETE { -// OBSOLETE sp -= stack_args[nstack_args].len; -// OBSOLETE write_memory (sp, stack_args[nstack_args].val, -// OBSOLETE stack_args[nstack_args].len); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return adjusted stack pointer. */ -// OBSOLETE return sp; -// OBSOLETE } -// OBSOLETE -// OBSOLETE void _initialize_fr30_tdep (void); -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_fr30_tdep (void) -// OBSOLETE { -// OBSOLETE extern int print_insn_fr30 (bfd_vma, disassemble_info *); -// OBSOLETE tm_print_insn = print_insn_fr30; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: check_prologue_cache -// OBSOLETE Check if prologue for this frame's PC has already been scanned. -// OBSOLETE If it has, copy the relevant information about that prologue and -// OBSOLETE return non-zero. Otherwise do not copy anything and return zero. -// OBSOLETE -// OBSOLETE The information saved in the cache includes: -// OBSOLETE * the frame register number; -// OBSOLETE * the size of the stack frame; -// OBSOLETE * the offsets of saved regs (relative to the old SP); and -// OBSOLETE * the offset from the stack pointer to the frame pointer -// OBSOLETE -// OBSOLETE The cache contains only one entry, since this is adequate -// OBSOLETE for the typical sequence of prologue scan requests we get. -// OBSOLETE When performing a backtrace, GDB will usually ask to scan -// OBSOLETE the same function twice in a row (once to get the frame chain, -// OBSOLETE and once to fill in the extra frame information). -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static struct frame_info prologue_cache; -// OBSOLETE -// OBSOLETE static int -// OBSOLETE check_prologue_cache (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE if (fi->pc == prologue_cache.pc) -// OBSOLETE { -// OBSOLETE fi->framereg = prologue_cache.framereg; -// OBSOLETE fi->framesize = prologue_cache.framesize; -// OBSOLETE fi->frameoffset = prologue_cache.frameoffset; -// OBSOLETE for (i = 0; i <= NUM_REGS; i++) -// OBSOLETE fi->fsr.regs[i] = prologue_cache.fsr.regs[i]; -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: save_prologue_cache -// OBSOLETE Copy the prologue information from fi to the prologue cache. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE save_prologue_cache (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE prologue_cache.pc = fi->pc; -// OBSOLETE prologue_cache.framereg = fi->framereg; -// OBSOLETE prologue_cache.framesize = fi->framesize; -// OBSOLETE prologue_cache.frameoffset = fi->frameoffset; -// OBSOLETE -// OBSOLETE for (i = 0; i <= NUM_REGS; i++) -// OBSOLETE { -// OBSOLETE prologue_cache.fsr.regs[i] = fi->fsr.regs[i]; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: scan_prologue -// OBSOLETE Scan the prologue of the function that contains PC, and record what -// OBSOLETE we find in PI. PI->fsr must be zeroed by the called. Returns the -// OBSOLETE pc after the prologue. Note that the addresses saved in pi->fsr -// OBSOLETE are actually just frame relative (negative offsets from the frame -// OBSOLETE pointer). This is because we don't know the actual value of the -// OBSOLETE frame pointer yet. In some circumstances, the frame pointer can't -// OBSOLETE be determined till after we have scanned the prologue. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE fr30_scan_prologue (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE int sp_offset, fp_offset; -// OBSOLETE CORE_ADDR prologue_start, prologue_end, current_pc; -// OBSOLETE -// OBSOLETE /* Check if this function is already in the cache of frame information. */ -// OBSOLETE if (check_prologue_cache (fi)) -// OBSOLETE return; -// OBSOLETE -// OBSOLETE /* Assume there is no frame until proven otherwise. */ -// OBSOLETE fi->framereg = SP_REGNUM; -// OBSOLETE fi->framesize = 0; -// OBSOLETE fi->frameoffset = 0; -// OBSOLETE -// OBSOLETE /* Find the function prologue. If we can't find the function in -// OBSOLETE the symbol table, peek in the stack frame to find the PC. */ -// OBSOLETE if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end)) -// OBSOLETE { -// OBSOLETE /* Assume the prologue is everything between the first instruction -// OBSOLETE in the function and the first source line. */ -// OBSOLETE struct symtab_and_line sal = find_pc_line (prologue_start, 0); -// OBSOLETE -// OBSOLETE if (sal.line == 0) /* no line info, use current PC */ -// OBSOLETE prologue_end = fi->pc; -// OBSOLETE else if (sal.end < prologue_end) /* next line begins after fn end */ -// OBSOLETE prologue_end = sal.end; /* (probably means no prologue) */ -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* XXX Z.R. What now??? The following is entirely bogus */ -// OBSOLETE prologue_start = (read_memory_integer (fi->frame, 4) & 0x03fffffc) - 12; -// OBSOLETE prologue_end = prologue_start + 40; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Now search the prologue looking for instructions that set up the -// OBSOLETE frame pointer, adjust the stack pointer, and save registers. */ -// OBSOLETE -// OBSOLETE sp_offset = fp_offset = 0; -// OBSOLETE for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 2) -// OBSOLETE { -// OBSOLETE unsigned int insn; -// OBSOLETE -// OBSOLETE insn = read_memory_unsigned_integer (current_pc, 2); -// OBSOLETE -// OBSOLETE if ((insn & 0xfe00) == 0x8e00) /* stm0 or stm1 */ -// OBSOLETE { -// OBSOLETE int reg, mask = insn & 0xff; -// OBSOLETE -// OBSOLETE /* scan in one sweep - create virtual 16-bit mask from either insn's mask */ -// OBSOLETE if ((insn & 0x0100) == 0) -// OBSOLETE { -// OBSOLETE mask <<= 8; /* stm0 - move to upper byte in virtual mask */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Calculate offsets of saved registers (to be turned later into addresses). */ -// OBSOLETE for (reg = R4_REGNUM; reg <= R11_REGNUM; reg++) -// OBSOLETE if (mask & (1 << (15 - reg))) -// OBSOLETE { -// OBSOLETE sp_offset -= 4; -// OBSOLETE fi->fsr.regs[reg] = sp_offset; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if ((insn & 0xfff0) == 0x1700) /* st rx,@-r15 */ -// OBSOLETE { -// OBSOLETE int reg = insn & 0xf; -// OBSOLETE -// OBSOLETE sp_offset -= 4; -// OBSOLETE fi->fsr.regs[reg] = sp_offset; -// OBSOLETE } -// OBSOLETE else if ((insn & 0xff00) == 0x0f00) /* enter */ -// OBSOLETE { -// OBSOLETE fp_offset = fi->fsr.regs[FP_REGNUM] = sp_offset - 4; -// OBSOLETE sp_offset -= 4 * (insn & 0xff); -// OBSOLETE fi->framereg = FP_REGNUM; -// OBSOLETE } -// OBSOLETE else if (insn == 0x1781) /* st rp,@-sp */ -// OBSOLETE { -// OBSOLETE sp_offset -= 4; -// OBSOLETE fi->fsr.regs[RP_REGNUM] = sp_offset; -// OBSOLETE } -// OBSOLETE else if (insn == 0x170e) /* st fp,@-sp */ -// OBSOLETE { -// OBSOLETE sp_offset -= 4; -// OBSOLETE fi->fsr.regs[FP_REGNUM] = sp_offset; -// OBSOLETE } -// OBSOLETE else if (insn == 0x8bfe) /* mov sp,fp */ -// OBSOLETE { -// OBSOLETE fi->framereg = FP_REGNUM; -// OBSOLETE } -// OBSOLETE else if ((insn & 0xff00) == 0xa300) /* addsp xx */ -// OBSOLETE { -// OBSOLETE sp_offset += 4 * (signed char) (insn & 0xff); -// OBSOLETE } -// OBSOLETE else if ((insn & 0xff0f) == 0x9b00 && /* ldi:20 xx,r0 */ -// OBSOLETE read_memory_unsigned_integer (current_pc + 4, 2) -// OBSOLETE == 0xac0f) /* sub r0,sp */ -// OBSOLETE { -// OBSOLETE /* large stack adjustment */ -// OBSOLETE sp_offset -= (((insn & 0xf0) << 12) | read_memory_unsigned_integer (current_pc + 2, 2)); -// OBSOLETE current_pc += 4; -// OBSOLETE } -// OBSOLETE else if (insn == 0x9f80 && /* ldi:32 xx,r0 */ -// OBSOLETE read_memory_unsigned_integer (current_pc + 6, 2) -// OBSOLETE == 0xac0f) /* sub r0,sp */ -// OBSOLETE { -// OBSOLETE /* large stack adjustment */ -// OBSOLETE sp_offset -= -// OBSOLETE (read_memory_unsigned_integer (current_pc + 2, 2) << 16 | -// OBSOLETE read_memory_unsigned_integer (current_pc + 4, 2)); -// OBSOLETE current_pc += 6; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The frame size is just the negative of the offset (from the original SP) -// OBSOLETE of the last thing thing we pushed on the stack. The frame offset is -// OBSOLETE [new FP] - [new SP]. */ -// OBSOLETE fi->framesize = -sp_offset; -// OBSOLETE fi->frameoffset = fp_offset - sp_offset; -// OBSOLETE -// OBSOLETE save_prologue_cache (fi); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: init_extra_frame_info -// OBSOLETE Setup the frame's frame pointer, pc, and frame addresses for saved -// OBSOLETE registers. Most of the work is done in scan_prologue(). -// OBSOLETE -// OBSOLETE Note that when we are called for the last frame (currently active frame), -// OBSOLETE that fi->pc and fi->frame will already be setup. However, fi->frame will -// OBSOLETE be valid only if this routine uses FP. For previous frames, fi-frame will -// OBSOLETE always be correct (since that is derived from fr30_frame_chain ()). -// OBSOLETE -// OBSOLETE We can be called with the PC in the call dummy under two circumstances. -// OBSOLETE First, during normal backtracing, second, while figuring out the frame -// OBSOLETE pointer just prior to calling the target function (see run_stack_dummy). */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE fr30_init_extra_frame_info (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE int reg; -// OBSOLETE -// OBSOLETE if (fi->next) -// OBSOLETE fi->pc = FRAME_SAVED_PC (fi->next); -// OBSOLETE -// OBSOLETE memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs); -// OBSOLETE -// OBSOLETE if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) -// OBSOLETE { -// OBSOLETE /* We need to setup fi->frame here because run_stack_dummy gets it wrong -// OBSOLETE by assuming it's always FP. */ -// OBSOLETE fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM); -// OBSOLETE fi->framesize = 0; -// OBSOLETE fi->frameoffset = 0; -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE fr30_scan_prologue (fi); -// OBSOLETE -// OBSOLETE if (!fi->next) /* this is the innermost frame? */ -// OBSOLETE fi->frame = read_register (fi->framereg); -// OBSOLETE else -// OBSOLETE /* not the innermost frame */ -// OBSOLETE /* If we have an FP, the callee saved it. */ -// OBSOLETE if (fi->framereg == FP_REGNUM) -// OBSOLETE if (fi->next->fsr.regs[fi->framereg] != 0) -// OBSOLETE fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg], 4); -// OBSOLETE -// OBSOLETE /* Calculate actual addresses of saved registers using offsets determined -// OBSOLETE by fr30_scan_prologue. */ -// OBSOLETE for (reg = 0; reg < NUM_REGS; reg++) -// OBSOLETE if (fi->fsr.regs[reg] != 0) -// OBSOLETE { -// OBSOLETE fi->fsr.regs[reg] += fi->frame + fi->framesize - fi->frameoffset; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: find_callers_reg -// OBSOLETE Find REGNUM on the stack. Otherwise, it's in an active register. -// OBSOLETE One thing we might want to do here is to check REGNUM against the -// OBSOLETE clobber mask, and somehow flag it as invalid if it isn't saved on -// OBSOLETE the stack somewhere. This would provide a graceful failure mode -// OBSOLETE when trying to get the value of caller-saves registers for an inner -// OBSOLETE frame. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE fr30_find_callers_reg (struct frame_info *fi, int regnum) -// OBSOLETE { -// OBSOLETE for (; fi; fi = fi->next) -// OBSOLETE if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) -// OBSOLETE return generic_read_register_dummy (fi->pc, fi->frame, regnum); -// OBSOLETE else if (fi->fsr.regs[regnum] != 0) -// OBSOLETE return read_memory_unsigned_integer (fi->fsr.regs[regnum], -// OBSOLETE REGISTER_RAW_SIZE (regnum)); -// OBSOLETE -// OBSOLETE return read_register (regnum); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Function: frame_chain -// OBSOLETE Figure out the frame prior to FI. Unfortunately, this involves -// OBSOLETE scanning the prologue of the caller, which will also be done -// OBSOLETE shortly by fr30_init_extra_frame_info. For the dummy frame, we -// OBSOLETE just return the stack pointer that was in use at the time the -// OBSOLETE function call was made. */ -// OBSOLETE -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE fr30_frame_chain (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE CORE_ADDR fn_start, callers_pc, fp; -// OBSOLETE struct frame_info caller_fi; -// OBSOLETE int framereg; -// OBSOLETE -// OBSOLETE /* is this a dummy frame? */ -// OBSOLETE if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) -// OBSOLETE return fi->frame; /* dummy frame same as caller's frame */ -// OBSOLETE -// OBSOLETE /* is caller-of-this a dummy frame? */ -// OBSOLETE callers_pc = FRAME_SAVED_PC (fi); /* find out who called us: */ -// OBSOLETE fp = fr30_find_callers_reg (fi, FP_REGNUM); -// OBSOLETE if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) -// OBSOLETE return fp; /* dummy frame's frame may bear no relation to ours */ -// OBSOLETE -// OBSOLETE if (find_pc_partial_function (fi->pc, 0, &fn_start, 0)) -// OBSOLETE if (fn_start == entry_point_address ()) -// OBSOLETE return 0; /* in _start fn, don't chain further */ -// OBSOLETE -// OBSOLETE framereg = fi->framereg; -// OBSOLETE -// OBSOLETE /* If the caller is the startup code, we're at the end of the chain. */ -// OBSOLETE if (find_pc_partial_function (callers_pc, 0, &fn_start, 0)) -// OBSOLETE if (fn_start == entry_point_address ()) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE memset (&caller_fi, 0, sizeof (caller_fi)); -// OBSOLETE caller_fi.pc = callers_pc; -// OBSOLETE fr30_scan_prologue (&caller_fi); -// OBSOLETE framereg = caller_fi.framereg; -// OBSOLETE -// OBSOLETE /* If the caller used a frame register, return its value. -// OBSOLETE Otherwise, return the caller's stack pointer. */ -// OBSOLETE if (framereg == FP_REGNUM) -// OBSOLETE return fr30_find_callers_reg (fi, framereg); -// OBSOLETE else -// OBSOLETE return fi->frame + fi->framesize; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: frame_saved_pc -// OBSOLETE Find the caller of this frame. We do this by seeing if RP_REGNUM -// OBSOLETE is saved in the stack anywhere, otherwise we get it from the -// OBSOLETE registers. If the inner frame is a dummy frame, return its PC -// OBSOLETE instead of RP, because that's where "caller" of the dummy-frame -// OBSOLETE will be found. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE fr30_frame_saved_pc (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) -// OBSOLETE return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); -// OBSOLETE else -// OBSOLETE return fr30_find_callers_reg (fi, RP_REGNUM); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Function: fix_call_dummy -// OBSOLETE Pokes the callee function's address into the CALL_DUMMY assembly stub. -// OBSOLETE Assumes that the CALL_DUMMY looks like this: -// OBSOLETE jarl , r31 -// OBSOLETE trap -// OBSOLETE */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE fr30_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs, -// OBSOLETE struct value **args, struct type *type, int gcc_p) -// OBSOLETE { -// OBSOLETE long offset24; -// OBSOLETE -// OBSOLETE offset24 = (long) fun - (long) entry_point_address (); -// OBSOLETE offset24 &= 0x3fffff; -// OBSOLETE offset24 |= 0xff800000; /* jarl , r31 */ -// OBSOLETE -// OBSOLETE store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff); -// OBSOLETE store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16); -// OBSOLETE return 0; -// OBSOLETE } diff --git a/gdb/frame.c b/gdb/frame.c index bfefc77..ecdf408 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -33,25 +33,66 @@ #include "dummy-frame.h" #include "gdbcore.h" #include "annotate.h" +#include "language.h" -/* Return a frame uniq ID that can be used to, later re-find the +/* Return a frame uniq ID that can be used to, later, re-find the frame. */ -void -get_frame_id (struct frame_info *fi, struct frame_id *id) +struct frame_id +get_frame_id (struct frame_info *fi) { if (fi == NULL) { - id->base = 0; - id->pc = 0; + return null_frame_id; } else { - id->base = FRAME_FP (fi); - id->pc = fi->pc; + struct frame_id id; + id.base = fi->frame; + id.pc = fi->pc; + return id; } } +const struct frame_id null_frame_id; /* All zeros. */ + +struct frame_id +frame_id_build (CORE_ADDR base, CORE_ADDR func_or_pc) +{ + struct frame_id id; + id.base = base; + id.pc = func_or_pc; + return id; +} + +int +frame_id_p (struct frame_id l) +{ + /* The .func can be NULL but the .base cannot. */ + return (l.base != 0); +} + +int +frame_id_eq (struct frame_id l, struct frame_id r) +{ + /* If .base is different, the frames are different. */ + if (l.base != r.base) + return 0; + /* Add a test to check that the frame ID's are for the same function + here. */ + return 1; +} + +int +frame_id_inner (struct frame_id l, struct frame_id r) +{ + /* Only return non-zero when strictly inner than. Note that, per + comment in "frame.h", there is some fuzz here. Frameless + functions are not strictly inner than (same .base but different + .func). */ + return INNER_THAN (l.base, r.base); +} + struct frame_info * frame_find_by_id (struct frame_id id) { @@ -59,31 +100,52 @@ frame_find_by_id (struct frame_id id) /* ZERO denotes the null frame, let the caller decide what to do about it. Should it instead return get_current_frame()? */ - if (id.base == 0 && id.pc == 0) + if (!frame_id_p (id)) return NULL; for (frame = get_current_frame (); frame != NULL; frame = get_prev_frame (frame)) { - if (INNER_THAN (FRAME_FP (frame), id.base)) - /* ``inner/current < frame < id.base''. Keep looking along - the frame chain. */ - continue; - if (INNER_THAN (id.base, FRAME_FP (frame))) - /* ``inner/current < id.base < frame''. Oops, gone past it. - Just give up. */ + struct frame_id this = get_frame_id (frame); + if (frame_id_eq (id, this)) + /* An exact match. */ + return frame; + if (frame_id_inner (id, this)) + /* Gone to far. */ return NULL; - /* FIXME: cagney/2002-04-21: This isn't sufficient. It should - use id.pc to check that the two frames belong to the same - function. Otherwise we'll do things like match dummy frames - or mis-match frameless functions. However, until someone - notices, stick with the existing behavour. */ - return frame; + /* Either, we're not yet gone far enough out along the frame + chain (inner(this,id), or we're comparing frameless functions + (same .base, different .func, no test available). Struggle + on until we've definitly gone to far. */ } return NULL; } +CORE_ADDR +frame_pc_unwind (struct frame_info *frame) +{ + if (!frame->pc_unwind_cache_p) + { + frame->pc_unwind_cache = frame->pc_unwind (frame, &frame->unwind_cache); + frame->pc_unwind_cache_p = 1; + } + return frame->pc_unwind_cache; +} + +struct frame_id +frame_id_unwind (struct frame_info *frame) +{ + if (!frame->id_unwind_cache_p) + { + frame->id_unwind_cache = + frame->id_unwind (frame, &frame->unwind_cache); + frame->id_unwind_cache_p = 1; + } + return frame->id_unwind_cache; +} + + void frame_register_unwind (struct frame_info *frame, int regnum, int *optimizedp, enum lval_type *lvalp, @@ -124,7 +186,7 @@ frame_register_unwind (struct frame_info *frame, int regnum, } /* Ask this frame to unwind its register. */ - frame->register_unwind (frame, &frame->register_unwind_cache, regnum, + frame->register_unwind (frame, &frame->unwind_cache, regnum, optimizedp, lvalp, addrp, realnump, bufferp); } @@ -250,7 +312,7 @@ frame_read_signed_register (struct frame_info *frame, int regnum, frame_unwind_signed_register (get_next_frame (frame), regnum, val); } -void +static void generic_unwind_get_saved_register (char *raw_buffer, int *optimizedp, CORE_ADDR *addrp, @@ -399,14 +461,20 @@ frame_obstack_alloc (unsigned long size) return obstack_alloc (&frame_cache_obstack, size); } -void +CORE_ADDR * frame_saved_regs_zalloc (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 fi->saved_regs; } +CORE_ADDR * +get_frame_saved_regs (struct frame_info *fi) +{ + return fi->saved_regs; +} /* Return the innermost (currently executing) stack frame. */ @@ -423,10 +491,63 @@ get_current_frame (void) return current_frame; } +/* The "selected" stack frame is used by default for local and arg + access. May be zero, for no selected frame. */ + +struct frame_info *deprecated_selected_frame; + +/* Return the selected frame. Always non-null (unless there isn't an + inferior sufficient for creating a frame) in which case an error is + thrown. */ + +struct frame_info * +get_selected_frame (void) +{ + if (deprecated_selected_frame == NULL) + /* Hey! Don't trust this. It should really be re-finding the + last selected frame of the currently selected thread. This, + though, is better than nothing. */ + select_frame (get_current_frame ()); + /* There is always a frame. */ + gdb_assert (deprecated_selected_frame != NULL); + return deprecated_selected_frame; +} + +/* Select frame FI (or NULL - to invalidate the current frame). */ + void -set_current_frame (struct frame_info *frame) +select_frame (struct frame_info *fi) { - current_frame = frame; + register struct symtab *s; + + deprecated_selected_frame = fi; + /* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the + frame is being invalidated. */ + if (selected_frame_level_changed_hook) + selected_frame_level_changed_hook (frame_relative_level (fi)); + + /* FIXME: kseitz/2002-08-28: It would be nice to call + selected_frame_level_changed_event right here, but due to limitations + in the current interfaces, we would end up flooding UIs with events + because select_frame is used extensively internally. + + Once we have frame-parameterized frame (and frame-related) commands, + the event notification can be moved here, since this function will only + be called when the users selected frame is being changed. */ + + /* Ensure that symbols for this frame are read in. Also, determine the + source language of this frame, and switch to it if desired. */ + if (fi) + { + s = find_pc_symtab (fi->pc); + if (s + && s->language != current_language->la_language + && s->language != language_unknown + && language_mode == language_mode_auto) + { + set_language (s->language); + } + } } /* Return the register saved in the simplistic ``saved_regs'' cache. @@ -445,8 +566,8 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, /* If we're using generic dummy frames, we'd better not be in a call dummy. (generic_call_dummy_register_unwind ought to have been called instead.) */ - gdb_assert (!(USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))); + gdb_assert (!(DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && (get_frame_type (frame) == DUMMY_FRAME))); /* Load the saved_regs register cache. */ if (frame->saved_regs == NULL) @@ -524,6 +645,74 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache, } } +static CORE_ADDR +frame_saved_regs_pc_unwind (struct frame_info *frame, void **cache) +{ + return FRAME_SAVED_PC (frame); +} + +static struct frame_id +frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache) +{ + int fromleaf; + struct frame_id id; + + if (next_frame->next == NULL) + /* FIXME: 2002-11-09: Frameless functions can occure anywhere in + the frame chain, not just the inner most frame! The generic, + per-architecture, frame code should handle this and the below + should simply be removed. */ + fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame); + else + fromleaf = 0; + + if (fromleaf) + /* A frameless inner-most frame. The `FP' (which isn't an + architecture frame-pointer register!) of the caller is the same + as the callee. */ + /* FIXME: 2002-11-09: There isn't any reason to special case this + edge condition. Instead the per-architecture code should hande + it locally. */ + id.base = get_frame_base (next_frame); + else + { + /* Two macros defined in tm.h specify the machine-dependent + actions to be performed here. + + First, get the frame's chain-pointer. + + If that is zero, the frame is the outermost frame or a leaf + called by the outermost frame. This means that if start + calls main without a frame, we'll return 0 (which is fine + anyway). + + Nope; there's a problem. This also returns when the current + routine is a leaf of main. This is unacceptable. We move + this to after the ffi test; I'd rather have backtraces from + start go curfluy than have an abort called from main not show + main. */ + id.base = FRAME_CHAIN (next_frame); + + /* FIXME: cagney/2002-06-08: There should be two tests here. + The first would check for a valid frame chain based on a user + selectable policy. The default being ``stop at main'' (as + implemented by generic_func_frame_chain_valid()). Other + policies would be available - stop at NULL, .... The second + test, if provided by the target architecture, would check for + more exotic cases - most target architectures wouldn't bother + with this second case. */ + if (!FRAME_CHAIN_VALID (id.base, next_frame)) + return null_frame_id; + } + if (id.base == 0) + return null_frame_id; + + /* FIXME: cagney/2002-06-08: This should probably return the frame's + function and not the PC (a.k.a. resume address). */ + id.pc = frame_pc_unwind (next_frame); + return id; +} + /* Function: get_saved_register Find register number REGNUM relative to FRAME and put its (raw, target format) contents in *RAW_BUFFER. @@ -571,7 +760,7 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, while (frame && ((frame = frame->next) != NULL)) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (get_frame_type (frame) == DUMMY_FRAME) { if (lval) /* found it in a CALL_DUMMY frame */ *lval = not_lval; @@ -627,18 +816,34 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, static void set_unwind_by_pc (CORE_ADDR pc, CORE_ADDR fp, - frame_register_unwind_ftype **unwind) -{ - if (!USE_GENERIC_DUMMY_FRAMES) - /* Still need to set this to something. The ``info frame'' code - calls this function to find out where the saved registers are. - Hopefully this is robust enough to stop any core dumps and - return vaguely correct values.. */ - *unwind = frame_saved_regs_register_unwind; - else if (PC_IN_CALL_DUMMY (pc, fp, fp)) - *unwind = dummy_frame_register_unwind; + frame_register_unwind_ftype **unwind_register, + frame_pc_unwind_ftype **unwind_pc, + frame_id_unwind_ftype **unwind_id) +{ + if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES) + { + /* Still need to set this to something. The ``info frame'' code + calls this function to find out where the saved registers are. + Hopefully this is robust enough to stop any core dumps and + return vaguely correct values.. */ + *unwind_register = frame_saved_regs_register_unwind; + *unwind_pc = frame_saved_regs_pc_unwind; + *unwind_id = frame_saved_regs_id_unwind; + } + else if (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) + : pc_in_dummy_frame (pc)) + { + *unwind_register = dummy_frame_register_unwind; + *unwind_pc = dummy_frame_pc_unwind; + *unwind_id = dummy_frame_id_unwind; + } else - *unwind = frame_saved_regs_register_unwind; + { + *unwind_register = frame_saved_regs_register_unwind; + *unwind_pc = frame_saved_regs_pc_unwind; + *unwind_id = frame_saved_regs_id_unwind; + } } /* Create an arbitrary (i.e. address specified by user) or innermost frame. @@ -648,7 +853,7 @@ struct frame_info * create_new_frame (CORE_ADDR addr, CORE_ADDR pc) { struct frame_info *fi; - char *name; + enum frame_type type; fi = (struct frame_info *) obstack_alloc (&frame_cache_obstack, @@ -659,14 +864,37 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) fi->frame = addr; fi->pc = pc; - find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name); + /* NOTE: cagney/2002-11-18: The code segments, found in + create_new_frame and get_prev_frame(), that initializes the + frames type is subtly different. The latter only updates ->type + when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops + get_prev_frame() overriding the frame's type when the INIT code + has previously set it. This is really somewhat bogus. The + initialization, as seen in create_new_frame(), should occur + before the INIT function has been called. */ + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0) + : pc_in_dummy_frame (pc))) + /* NOTE: cagney/2002-11-11: Does this even occure? */ + type = DUMMY_FRAME; + else + { + char *name; + find_pc_partial_function (pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (fi->pc, name)) + type = SIGTRAMP_FRAME; + else + type = NORMAL_FRAME; + } + fi->type = type; if (INIT_EXTRA_FRAME_INFO_P ()) INIT_EXTRA_FRAME_INFO (0, fi); /* Select/initialize an unwind function. */ - set_unwind_by_pc (fi->pc, fi->frame, &fi->register_unwind); + set_unwind_by_pc (fi->pc, fi->frame, &fi->register_unwind, + &fi->pc_unwind, &fi->id_unwind); return fi; } @@ -718,7 +946,6 @@ get_prev_frame (struct frame_info *next_frame) CORE_ADDR address = 0; struct frame_info *prev; int fromleaf; - char *name; /* Return the inner-most frame, when the caller passes in NULL. */ /* NOTE: cagney/2002-11-09: Not sure how this would happen. The @@ -772,7 +999,7 @@ get_prev_frame (struct frame_info *next_frame) /* FIXME: 2002-11-09: There isn't any reason to special case this edge condition. Instead the per-architecture code should hande it locally. */ - address = FRAME_FP (next_frame); + address = get_frame_base (next_frame); else { /* Two macros defined in tm.h specify the machine-dependent @@ -817,26 +1044,32 @@ get_prev_frame (struct frame_info *next_frame) prev->next = next_frame; prev->frame = address; prev->level = next_frame->level + 1; + /* FIXME: cagney/2002-11-18: Should be setting the frame's type + here, before anything else, and not last. Various INIT functions + are full of work-arounds for the frames type not being set + correctly from the word go. Ulgh! */ + prev->type = NORMAL_FRAME; /* This change should not be needed, FIXME! We should determine - whether any targets *need* INIT_FRAME_PC to happen after - INIT_EXTRA_FRAME_INFO and come up with a simple way to express - what goes on here. + whether any targets *need* DEPRECATED_INIT_FRAME_PC to happen + after INIT_EXTRA_FRAME_INFO and come up with a simple way to + express what goes on here. INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame (where the PC is already set up) and here (where it isn't). - INIT_FRAME_PC is only called from here, always after + DEPRECATED_INIT_FRAME_PC is only called from here, always after INIT_EXTRA_FRAME_INFO. The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the PC value (which hasn't been set yet). Some other machines appear to require INIT_EXTRA_FRAME_INFO before they can do - INIT_FRAME_PC. Phoo. + DEPRECATED_INIT_FRAME_PC. Phoo. - We shouldn't need INIT_FRAME_PC_FIRST to add more complication to - an already overcomplicated part of GDB. gnu@cygnus.com, 15Sep92. + We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more + complication to an already overcomplicated part of GDB. + gnu@cygnus.com, 15Sep92. - Assuming that some machines need INIT_FRAME_PC after + Assuming that some machines need DEPRECATED_INIT_FRAME_PC after INIT_EXTRA_FRAME_INFO, one possible scheme: SETUP_INNERMOST_FRAME(): Default version is just create_new_frame @@ -848,17 +1081,17 @@ get_prev_frame (struct frame_info *next_frame) SETUP_ARBITRARY_FRAME would have to do that. INIT_PREV_FRAME(fromleaf, prev) Replace INIT_EXTRA_FRAME_INFO and - INIT_FRAME_PC. This should also return a flag saying whether to - keep the new frame, or whether to discard it, because on some - machines (e.g. mips) it is really awkward to have + DEPRECATED_INIT_FRAME_PC. This should also return a flag saying + whether to keep the new frame, or whether to discard it, because + on some machines (e.g. mips) it is really awkward to have FRAME_CHAIN_VALID called *before* INIT_EXTRA_FRAME_INFO (there is no good way to get information deduced in FRAME_CHAIN_VALID into the extra fields of the new frame). std_frame_pc(fromleaf, prev) This is the default setting for INIT_PREV_FRAME. It just does - what the default INIT_FRAME_PC does. Some machines will call it - from INIT_PREV_FRAME (either at the beginning, the end, or in the - middle). Some machines won't use it. + what the default DEPRECATED_INIT_FRAME_PC does. Some machines + will call it from INIT_PREV_FRAME (either at the beginning, the + end, or in the middle). Some machines won't use it. kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */ @@ -887,7 +1120,8 @@ get_prev_frame (struct frame_info *next_frame) FRAME_SAVED_PC() is being superseed by frame_pc_unwind() and that function does have somewhere to cache that PC value. */ - INIT_FRAME_PC_FIRST (fromleaf, prev); + if (DEPRECATED_INIT_FRAME_PC_FIRST_P ()) + prev->pc = (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)); if (INIT_EXTRA_FRAME_INFO_P ()) INIT_EXTRA_FRAME_INFO (fromleaf, prev); @@ -895,7 +1129,8 @@ get_prev_frame (struct frame_info *next_frame) /* This entry is in the frame queue now, which is good since FRAME_SAVED_PC may use that queue to figure out its value (see tm-sparc.h). We want the pc saved in the inferior frame. */ - INIT_FRAME_PC (fromleaf, prev); + if (DEPRECATED_INIT_FRAME_PC_P ()) + prev->pc = DEPRECATED_INIT_FRAME_PC (fromleaf, prev); /* If ->frame and ->pc are unchanged, we are in the process of getting ourselves into an infinite backtrace. Some architectures @@ -913,12 +1148,41 @@ get_prev_frame (struct frame_info *next_frame) (and probably other architectural information). The PC lets you check things like the debug info at that point (dwarf2cfi?) and use that to decide how the frame should be unwound. */ - set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind); - - find_pc_partial_function (prev->pc, &name, - (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); - if (PC_IN_SIGTRAMP (prev->pc, name)) - prev->signal_handler_caller = 1; + set_unwind_by_pc (prev->pc, prev->frame, &prev->register_unwind, + &prev->pc_unwind, &prev->id_unwind); + + /* NOTE: cagney/2002-11-18: The code segments, found in + create_new_frame and get_prev_frame(), that initializes the + frames type is subtly different. The latter only updates ->type + when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops + get_prev_frame() overriding the frame's type when the INIT code + has previously set it. This is really somewhat bogus. The + initialization, as seen in create_new_frame(), should occur + before the INIT function has been called. */ + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && (DEPRECATED_PC_IN_CALL_DUMMY_P () + ? DEPRECATED_PC_IN_CALL_DUMMY (prev->pc, 0, 0) + : pc_in_dummy_frame (prev->pc))) + prev->type = DUMMY_FRAME; + else + { + /* FIXME: cagney/2002-11-10: This should be moved to before the + INIT code above so that the INIT code knows what the frame's + type is (in fact, for a [generic] dummy-frame, the type can + be set and then the entire initialization can be skipped. + Unforunatly, its the INIT code that sets the PC (Hmm, catch + 22). */ + char *name; + find_pc_partial_function (prev->pc, &name, NULL, NULL); + if (PC_IN_SIGTRAMP (prev->pc, name)) + prev->type = SIGTRAMP_FRAME; + /* FIXME: cagney/2002-11-11: Leave prev->type alone. Some + architectures are forcing the frame's type in INIT so we + don't want to override it here. Remember, NORMAL_FRAME == 0, + so it all works (just :-/). Once this initialization is + moved to the start of this function, all this nastness will + go away. */ + } return prev; } @@ -929,14 +1193,75 @@ get_frame_pc (struct frame_info *frame) return frame->pc; } +static int +pc_notcurrent (struct frame_info *frame) +{ + /* If FRAME is not the innermost frame, that normally means that + FRAME->pc points at the return instruction (which is *after* the + call instruction), and we want to get the line containing the + call (because the call is where the user thinks the program is). + However, if the next frame is either a SIGTRAMP_FRAME or a + DUMMY_FRAME, then the next frame will contain a saved interrupt + PC and such a PC indicates the current (rather than next) + instruction/line, consequently, for such cases, want to get the + line containing fi->pc. */ + struct frame_info *next = get_next_frame (frame); + int notcurrent = (next != NULL && get_frame_type (next) == NORMAL_FRAME); + return notcurrent; +} + +void +find_frame_sal (struct frame_info *frame, struct symtab_and_line *sal) +{ + (*sal) = find_pc_line (frame->pc, pc_notcurrent (frame)); +} + +/* Per "frame.h", return the ``address'' of the frame. Code should + really be using get_frame_id(). */ +CORE_ADDR +get_frame_base (struct frame_info *fi) +{ + return fi->frame; +} + +/* Level of the selected frame: 0 for innermost, 1 for its caller, ... + or -1 for a NULL frame. */ + +int +frame_relative_level (struct frame_info *fi) +{ + if (fi == NULL) + return -1; + else + return fi->level; +} + +enum frame_type +get_frame_type (struct frame_info *frame) +{ + /* Some targets still don't use [generic] dummy frames. Catch them + here. */ + if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES + && deprecated_frame_in_dummy (frame)) + return DUMMY_FRAME; + return frame->type; +} + +void +deprecated_set_frame_type (struct frame_info *frame, enum frame_type type) +{ + /* Arrrg! See comment in "frame.h". */ + frame->type = type; +} + #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 -get_frame_saved_regs (struct frame_info *frame, - struct frame_saved_regs *saved_regs_addr) +deprecated_get_frame_saved_regs (struct frame_info *frame, + struct frame_saved_regs *saved_regs_addr) { if (frame->saved_regs == NULL) { @@ -957,6 +1282,34 @@ get_frame_saved_regs (struct frame_info *frame, } #endif +struct frame_extra_info * +get_frame_extra_info (struct frame_info *fi) +{ + return fi->extra_info; +} + +struct frame_extra_info * +frame_extra_info_zalloc (struct frame_info *fi, long size) +{ + fi->extra_info = frame_obstack_alloc (size); + memset (fi->extra_info, 0, size); + return fi->extra_info; +} + +void +deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) +{ + /* See comment in "frame.h". */ + frame->pc = pc; +} + +void +deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base) +{ + /* See comment in "frame.h". */ + frame->frame = base; +} + void _initialize_frame (void) { diff --git a/gdb/frame.h b/gdb/frame.h index d39096b..3d95dda 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -23,14 +23,16 @@ #if !defined (FRAME_H) #define FRAME_H 1 +struct symtab_and_line; + /* The frame object. */ struct frame_info; /* The frame object's ID. This provides a per-frame unique identifier that can be used to relocate a `struct frame_info' after a target - resume or a frame cache destruct (assuming the target hasn't - unwound the stack past that frame - a problem handled elsewhere). */ + resume or a frame cache destruct. It of course assumes that the + inferior hasn't unwound the stack past that frame. */ struct frame_id { @@ -45,31 +47,86 @@ struct frame_id CORE_ADDR pc; }; +/* Methods for constructing and comparing Frame IDs. + + NOTE: Given frameless functions A and B, where A calls B (and hence + B is inner-to A). The relationships: !eq(A,B); !eq(B,A); + !inner(A,B); !inner(B,A); all hold. This is because, while B is + inner to A, B is not strictly inner to A (being frameless, they + have the same .base value). */ + +/* For convenience. All fields are zero. */ +extern const struct frame_id null_frame_id; + +/* Construct a frame ID. The second parameter isn't yet well defined. + It might be the containing function, or the resume PC (see comment + above in `struct frame_id')? A func/pc of zero indicates a + wildcard (i.e., do not use func in frame ID comparisons). */ +extern struct frame_id frame_id_build (CORE_ADDR base, + CORE_ADDR func_or_pc); + +/* Returns non-zero when L is a valid frame (a valid frame has a + non-zero .base). */ +extern int frame_id_p (struct frame_id l); + +/* Returns non-zero when L and R identify the same frame, or, if + either L or R have a zero .func, then the same frame base. */ +extern int frame_id_eq (struct frame_id l, struct frame_id r); + +/* Returns non-zero when L is strictly inner-than R (they have + different frame .bases). Neither L, nor R can be `null'. See note + above about frameless functions. */ +extern int frame_id_inner (struct frame_id l, struct frame_id r); + + /* For every stopped thread, GDB tracks two frames: current and selected. Current frame is the inner most frame of the selected - thread. Selected frame is the frame currently being examined via - the GDB CLI (selected using `up', `down', ...). The frames are - created on-demand (via get_prev_frame()) and then held in a frame - cache. Provide mechanims for controlling these frames. */ + thread. Selected frame is the one being examined by the the GDB + CLI (selected using `up', `down', ...). The frames are created + on-demand (via get_prev_frame()) and then held in a frame cache. */ +/* FIXME: cagney/2002-11-28: Er, there is a lie here. If you do the + sequence: `thread 1; up; thread 2; thread 1' you loose thread 1's + selected frame. At present GDB only tracks the selected frame of + the current thread. But be warned, that might change. */ /* FIXME: cagney/2002-11-14: At any time, only one thread's selected and current frame can be active. Switching threads causes gdb to discard all that cached frame information. Ulgh! Instead, current and selected frame should be bound to a thread. */ -extern struct frame_info *selected_frame; -extern void select_frame (struct frame_info *); -extern void set_current_frame (struct frame_info *); +/* On demand, create the inner most frame using information found in + the inferior. If the inner most frame can't be created, throw an + error. */ extern struct frame_info *get_current_frame (void); -/* Invalidates the frame cache. */ +/* Invalidates the frame cache (this function should have been called + invalidate_cached_frames). + + FIXME: cagney/2002-11-28: The only difference between + flush_cached_frames() and reinit_frame_cache() is that the latter + explicitly sets the selected frame back to the current frame there + isn't any real difference (except that one delays the selection of + a new frame). Code can instead simply rely on get_selected_frame() + to reinit's the selected frame as needed. As for invalidating the + cache, there should be two methods one that reverts the thread's + selected frame back to current frame (for when the inferior + resumes) and one that does not (for when the user modifies the + target invalidating the frame cache). */ extern void flush_cached_frames (void); - -/* Flushes the frame cache and then selects the inner most (aka - current) frame - it changes selected frame. */ -/* FIXME: cagney/2002-11-14: Should this re-select the selected frame - from before the flush? */ extern void reinit_frame_cache (void); +/* On demand, create the selected frame and then return it. If the + selected frame can not be created, this function throws an error. */ +/* FIXME: cagney/2002-11-28: At present, when there is no selected + frame, this function always returns the current (inner most) frame. + It should instead, when a thread has previously had its frame + selected (but not resumed) and the frame cache invalidated, find + and then return that thread's previously selected frame. */ +extern struct frame_info *get_selected_frame (void); + +/* Select a specific frame. NULL, apparently implies re-select the + inner most frame. */ +extern void select_frame (struct frame_info *); + /* Given a FRAME, return the next (more inner, younger) or previous (more outer, older) frame. */ extern struct frame_info *get_prev_frame (struct frame_info *); @@ -85,14 +142,110 @@ extern struct frame_info *frame_find_by_id (struct frame_id id); this frame. */ extern CORE_ADDR get_frame_pc (struct frame_info *); +/* Closely related to the resume address, various symbol table + attributes that are determined by the PC. Note that for a normal + frame, the PC refers to the resume address after the return, and + not the call instruction. In such a case, the address is adjusted + so that it (approximatly) identifies the call site (and not return + site). + + NOTE: cagney/2002-11-28: The frame cache could be used to cache the + computed value. Working on the assumption that the bottle-neck is + in the single step code, and that code causes the frame cache to be + constantly flushed, caching things in a frame is probably of little + benefit. As they say `show us the numbers'. + + NOTE: cagney/2002-11-28: Plenty more where this one came from: + find_frame_block(), find_frame_partial_function(), + find_frame_symtab(), find_frame_function(). Each will need to be + carefully considered to determine if the real intent was for it to + apply to the PC or the adjusted PC. */ +extern void find_frame_sal (struct frame_info *frame, + struct symtab_and_line *sal); + +/* Return the frame address from FI. Except in the machine-dependent + *FRAME* macros, a frame address has no defined meaning other than + as a magic cookie which identifies a frame over calls to the + inferior (um, SEE NOTE BELOW). The only known exception is + inferior.h (DEPRECATED_PC_IN_CALL_DUMMY) [ON_STACK]; see comments + there. You cannot assume that a frame address contains enough + information to reconstruct the frame; if you want more than just to + identify the frame (e.g. be able to fetch variables relative to + that frame), then save the whole struct frame_info (and the next + struct frame_info, since the latter is used for fetching variables + on some machines) (um, again SEE NOTE BELOW). + + NOTE: cagney/2002-11-18: Actually, the frame address isn't + sufficient for identifying a frame, and the counter examples are + wrong! + + Code that needs to (re)identify a frame must use get_frame_id() and + frame_find_by_id() (and in the future, a frame_compare() function + instead of INNER_THAN()). Two reasons: an architecture (e.g., + ia64) can have more than one frame address (due to multiple stack + pointers) (frame ID is going to be expanded to accomodate this); + successive frameless function calls can only be differientated by + comparing both the frame's base and the frame's enclosing function + (frame_find_by_id() is going to be modified to perform this test). + + The generic dummy frame version of DEPRECATED_PC_IN_CALL_DUMMY() is + able to identify a dummy frame using only the PC value. So the + frame address is not needed. In fact, most + DEPRECATED_PC_IN_CALL_DUMMY() calls now pass zero as the frame/sp + values as the caller knows that those values won't be used. Once + all architectures are using generic dummy frames, + DEPRECATED_PC_IN_CALL_DUMMY() can drop the sp/frame parameters. + When it comes to finding a dummy frame, the next frame's frame ID + (with out duing an unwind) can be used (ok, could if it wasn't for + the need to change the way the PPC defined frame base in a strange + way). + + Modern architectures should be using something like dwarf2's + location expression to describe where a variable lives. Such + expressions specify their own debug info centric frame address. + Consequently, a generic frame address is pretty meaningless. */ + +extern CORE_ADDR get_frame_base (struct frame_info *); + /* Return the per-frame unique identifer. Can be used to relocate a - frame after a frame cache flush (and other similar operations). */ -extern void get_frame_id (struct frame_info *fi, struct frame_id *id); + frame after a frame cache flush (and other similar operations). If + FI is NULL, return the null_frame_id. */ +extern struct frame_id get_frame_id (struct frame_info *fi); /* The frame's level: 0 for innermost, 1 for its caller, ...; or -1 for an invalid frame). */ extern int frame_relative_level (struct frame_info *fi); +/* Return the frame's type. Some are real, some are signal + trampolines, and some are completly artificial (dummy). */ + +enum frame_type +{ + /* A true stack frame, created by the target program during normal + execution. */ + NORMAL_FRAME, + /* A fake frame, created by GDB when performing an inferior function + call. */ + DUMMY_FRAME, + /* In a signal handler, various OSs handle this in various ways. + The main thing is that the frame may be far from normal. */ + SIGTRAMP_FRAME +}; +extern enum frame_type get_frame_type (struct frame_info *); + +/* FIXME: cagney/2002-11-10: Some targets want to directly mark a + frame as being of a specific type. This shouldn't be necessary. + PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and + DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME. I suspect + the real problem here is that get_prev_frame() only sets + initialized after INIT_EXTRA_FRAME_INFO as been called. + Consequently, some targets found that the frame's type was wrong + and tried to fix it. The correct fix is to modify get_prev_frame() + so that it initializes the frame's type before calling any other + functions. */ +extern void deprecated_set_frame_type (struct frame_info *, + enum frame_type type); + /* Unwind the stack frame so that the value of REGNUM, in the previous (up, older) frame is returned. If VALUEP is NULL, don't fetch/compute the value. Instead just return the location of the @@ -139,6 +292,16 @@ extern void frame_read_unsigned_register (struct frame_info *frame, extern int frame_map_name_to_regnum (const char *name, int strlen); extern const char *frame_map_regnum_to_name (int regnum); +/* Unwind the PC. Strictly speaking return the resume address of the + calling frame. For GDB, `pc' is the resume address and not a + specific register. */ + +extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); + +/* Unwind the frame ID. Return an ID that uniquely identifies the + caller's frame. */ +extern struct frame_id frame_id_unwind (struct frame_info *frame); + /* Return the location (and possibly value) of REGNUM for the previous (older, up) frame. All parameters except VALUEP can be assumed to @@ -163,6 +326,18 @@ typedef void (frame_register_unwind_ftype) (struct frame_info *frame, int *realnump, void *valuep); +/* Same as for registers above, but return the address at which the + calling frame would resume. */ + +typedef CORE_ADDR (frame_pc_unwind_ftype) (struct frame_info *frame, + void **unwind_cache); + +/* Same as for registers above, but return the ID of the frame that + called this one. */ + +typedef struct frame_id (frame_id_unwind_ftype) (struct frame_info *frame, + void **unwind_cache); + /* Describe the saved registers of a frame. */ #if defined (EXTRA_FRAME_INFO) || defined (FRAME_FIND_SAVED_REGS) @@ -194,9 +369,10 @@ struct frame_saved_regs struct frame_info { - /* Nominal address of the frame described. See comments at FRAME_FP - about what this means outside the *FRAME* macros; in the *FRAME* - macros, it can mean whatever makes most sense for this machine. */ + /* Nominal address of the frame described. See comments at + get_frame_base() about what this means outside the *FRAME* + macros; in the *FRAME* macros, it can mean whatever makes most + sense for this machine. */ CORE_ADDR frame; /* Address at which execution is occurring in this frame. @@ -215,15 +391,8 @@ struct frame_info moment leave this as speculation. */ int level; - /* Nonzero if this is a frame associated with calling a signal handler. - - Set by machine-dependent code. On some machines, if - the machine-dependent code fails to check for this, the backtrace - will look relatively normal. For example, on the i386 - #3 0x158728 in sighold () - On other machines (e.g. rs6000), the machine-dependent code better - set this to prevent us from trying to print it like a normal frame. */ - int signal_handler_caller; + /* The frame's type. */ + enum frame_type type; /* For each register, address of where it was saved on entry to the frame, or zero if it was not saved on entry to this frame. @@ -252,10 +421,24 @@ struct frame_info related unwind data. */ struct context *context; - /* See description above. Return the register value for the - previous frame. */ + /* Unwind cache shared between the unwind functions - they had + better all agree as to the contents. */ + void *unwind_cache; + + /* See description above. The previous frame's registers. */ frame_register_unwind_ftype *register_unwind; - void *register_unwind_cache; + + /* See description above. The previous frame's resume address. + Save the previous PC in a local cache. */ + frame_pc_unwind_ftype *pc_unwind; + int pc_unwind_cache_p; + CORE_ADDR pc_unwind_cache; + + /* See description above. The previous frame's resume address. + Save the previous PC in a local cache. */ + frame_id_unwind_ftype *id_unwind; + int id_unwind_cache_p; + struct frame_id id_unwind_cache; /* Pointers to the next (down, inner, younger) and previous (up, outer, older) frame_info's in the frame cache. */ @@ -290,21 +473,6 @@ enum print_what (sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS)) extern void *frame_obstack_alloc (unsigned long size); -extern void frame_saved_regs_zalloc (struct frame_info *); - -/* Return the frame address from FI. Except in the machine-dependent - *FRAME* macros, a frame address has no defined meaning other than - as a magic cookie which identifies a frame over calls to the - inferior. The only known exception is inferior.h - (PC_IN_CALL_DUMMY) [ON_STACK]; see comments there. You cannot - assume that a frame address contains enough information to - reconstruct the frame; if you want more than just to identify the - frame (e.g. be able to fetch variables relative to that frame), - then save the whole struct frame_info (and the next struct - frame_info, since the latter is used for fetching variables on some - machines). */ - -#define FRAME_FP(fi) ((fi)->frame) /* Define 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 @@ -321,20 +489,43 @@ extern int generic_file_frame_chain_valid (CORE_ADDR, struct frame_info *); extern int generic_func_frame_chain_valid (CORE_ADDR, struct frame_info *); extern void generic_save_dummy_frame_tos (CORE_ADDR sp); -extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR); #ifdef FRAME_FIND_SAVED_REGS /* XXX - deprecated */ -#define FRAME_INIT_SAVED_REGS(FI) get_frame_saved_regs (FI, NULL) -extern void get_frame_saved_regs (struct frame_info *, - struct frame_saved_regs *); +#define FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL) +extern void deprecated_get_frame_saved_regs (struct frame_info *, + struct frame_saved_regs *); #endif extern struct block *get_frame_block (struct frame_info *, CORE_ADDR *addr_in_block); -extern struct block *get_current_block (CORE_ADDR *addr_in_block); +/* Return the `struct block' that belongs to the selected thread's + selected frame. If the inferior has no state, return NULL. + + NOTE: cagney/2002-11-29: + + No state? Does the inferior have any execution state (a core file + does, an executable does not). At present the code tests + `target_has_stack' but I'm left wondering if it should test + `target_has_registers' or, even, a merged target_has_state. + + Should it look at the most recently specified SAL? If the target + has no state, should this function try to extract a block from the + most recently selected SAL? That way `list foo' would give it some + sort of reference point. Then again, perhaphs that would confuse + things. + + Calls to this function can be broken down into two categories: Code + that uses the selected block as an additional, but optional, data + point; Code that uses the selected block as a prop, when it should + have the relevant frame/block/pc explicitly passed in. + + The latter can be eliminated by correctly parameterizing the code, + the former though is more interesting. Per the "address" command, + it occures in the CLI code and makes it possible for commands to + work, even when the inferior has no state. */ extern struct block *get_selected_block (CORE_ADDR *addr_in_block); @@ -370,10 +561,6 @@ extern void show_frame_info (struct frame_info *, int, int, int); extern struct frame_info *block_innermost_frame (const struct block *); -extern struct frame_info *find_frame_addr_in_frame_chain (CORE_ADDR); - -extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); - /* NOTE: cagney/2002-09-13: There is no need for this function. Instead either of frame_unwind_signed_register() or frame_unwind_unsigned_register() can be used. */ @@ -406,13 +593,6 @@ extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *, struct frame_info *, int, enum lval_type *); -extern void generic_unwind_get_saved_register (char *raw_buffer, - int *optimized, - CORE_ADDR * addrp, - struct frame_info *frame, - int regnum, - enum lval_type *lval); - extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi); extern void get_saved_register (char *raw_buffer, int *optimized, @@ -432,4 +612,66 @@ extern void (*selected_frame_level_changed_hook) (int); extern void return_command (char *, int); + +/* NOTE: cagney/2002-11-27: + + You might think that the below global can simply be replaced by a + call to either get_selected_frame() or select_frame(). + + Unfortunatly, it isn't that easy. + + The relevant code needs to be audited to determine if it is + possible (or pratical) to instead pass the applicable frame in as a + parameter. For instance, DEPRECATED_DO_REGISTERS_INFO() relied on + the deprecated_selected_frame global, while its replacement, + PRINT_REGISTERS_INFO(), is parameterized with the selected frame. + The only real exceptions occure at the edge (in the CLI code) where + user commands need to pick up the selected frame before proceeding. + + This is important. GDB is trying to stamp out the hack: + + saved_frame = deprecated_selected_frame; + deprecated_selected_frame = ...; + hack_using_global_selected_frame (); + deprecated_selected_frame = saved_frame; + + Take care! */ + +extern struct frame_info *deprecated_selected_frame; + + +/* Create a frame using the specified BASE and PC. */ + +extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc); + + +/* Create/access the frame's `extra info'. The extra info is used by + older code to store information such as the analyzed prologue. The + zalloc() should only be called by the INIT_EXTRA_INFO method. */ + +extern struct frame_extra_info *frame_extra_info_zalloc (struct frame_info *fi, + long size); +extern struct frame_extra_info *get_frame_extra_info (struct frame_info *fi); + +/* Create/access the frame's `saved_regs'. The saved regs are used by + older code to store the address of each register (except for + SP_REGNUM where the value of the register in the previous frame is + stored). */ +extern CORE_ADDR *frame_saved_regs_zalloc (struct frame_info *); +extern CORE_ADDR *get_frame_saved_regs (struct frame_info *); + +/* FIXME: cagney/2002-12-06: Has the PC in the current frame changed? + "infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after + the initial frame create. This puts things back in sync. */ +extern void deprecated_update_frame_pc_hack (struct frame_info *frame, + CORE_ADDR pc); + +/* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be + more exact, whas that initial guess at the frame's base as returned + by read_fp() wrong. If it was, fix it. This shouldn't be + necessary since the code should be getting the frame's base correct + from the outset. */ +extern void deprecated_update_frame_base_hack (struct frame_info *frame, + CORE_ADDR base); + #endif /* !defined (FRAME_H) */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 48576cb..0c14e53 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1045,6 +1045,10 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, var); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); set_gdbarch_long_bit (gdbarch, 32); @@ -1081,8 +1085,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, frv_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, frv_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs); @@ -1094,7 +1096,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address); /* Settings for calling functions in the inferior. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_coerce_float_to_double (gdbarch, standard_coerce_float_to_double); @@ -1117,17 +1118,14 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_read_sp (gdbarch, generic_target_read_sp); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); - set_gdbarch_decr_pc_after_break (gdbarch, 0); set_gdbarch_function_start_offset (gdbarch, 0); set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 468726d..938d9fa 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -181,22 +181,22 @@ struct gdbarch gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; gdbarch_cannot_store_register_ftype *cannot_store_register; gdbarch_get_longjmp_target_ftype *get_longjmp_target; - int use_generic_dummy_frames; + int deprecated_use_generic_dummy_frames; int call_dummy_location; gdbarch_call_dummy_address_ftype *call_dummy_address; CORE_ADDR call_dummy_start_offset; CORE_ADDR call_dummy_breakpoint_offset; int call_dummy_breakpoint_offset_p; int call_dummy_length; - gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy; + gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy; int call_dummy_p; LONGEST * call_dummy_words; int sizeof_call_dummy_words; int call_dummy_stack_adjust_p; int call_dummy_stack_adjust; gdbarch_fix_call_dummy_ftype *fix_call_dummy; - gdbarch_init_frame_pc_first_ftype *init_frame_pc_first; - gdbarch_init_frame_pc_ftype *init_frame_pc; + gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first; + gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc; int believe_pcc_promotion; int believe_pcc_promotion_type; gdbarch_coerce_float_to_double_ftype *coerce_float_to_double; @@ -352,7 +352,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, - 0, + generic_pc_in_call_dummy, 0, 0, 0, @@ -522,17 +522,17 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->register_sim_regno = legacy_register_sim_regno; current_gdbarch->cannot_fetch_register = cannot_register_not; current_gdbarch->cannot_store_register = cannot_register_not; - current_gdbarch->use_generic_dummy_frames = -1; + current_gdbarch->deprecated_use_generic_dummy_frames = 1; + current_gdbarch->call_dummy_location = AT_ENTRY_POINT; current_gdbarch->call_dummy_start_offset = -1; current_gdbarch->call_dummy_breakpoint_offset = -1; current_gdbarch->call_dummy_breakpoint_offset_p = -1; current_gdbarch->call_dummy_length = -1; + current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy; current_gdbarch->call_dummy_p = -1; current_gdbarch->call_dummy_words = legacy_call_dummy_words; current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words; current_gdbarch->call_dummy_stack_adjust_p = -1; - current_gdbarch->init_frame_pc_first = init_frame_pc_noop; - current_gdbarch->init_frame_pc = init_frame_pc_default; current_gdbarch->coerce_float_to_double = default_coerce_float_to_double; current_gdbarch->register_convertible = generic_register_convertible_not; current_gdbarch->convert_register_p = legacy_convert_register_p; @@ -556,6 +556,8 @@ gdbarch_alloc (const struct gdbarch_info *info, current_gdbarch->frame_args_skip = -1; current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not; current_gdbarch->frame_chain_valid = generic_func_frame_chain_valid; + current_gdbarch->frame_args_address = get_frame_base; + current_gdbarch->frame_locals_address = get_frame_base; current_gdbarch->extra_stack_alignment_needed = 1; current_gdbarch->convert_from_func_ptr_addr = core_addr_identity; current_gdbarch->addr_bits_remove = core_addr_identity; @@ -676,12 +678,8 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of cannot_fetch_register, invalid_p == 0 */ /* Skip verify of cannot_store_register, invalid_p == 0 */ /* Skip verify of get_longjmp_target, has predicate */ - if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->use_generic_dummy_frames == -1)) - fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames"); - if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->call_dummy_location == 0)) - fprintf_unfiltered (log, "\n\tcall_dummy_location"); + /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ + /* Skip verify of call_dummy_location, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) fprintf_unfiltered (log, "\n\tcall_dummy_address"); @@ -697,9 +695,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->call_dummy_length == -1)) fprintf_unfiltered (log, "\n\tcall_dummy_length"); - if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->pc_in_call_dummy == 0)) - fprintf_unfiltered (log, "\n\tpc_in_call_dummy"); + /* Skip verify of deprecated_pc_in_call_dummy, has predicate */ if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && (gdbarch->call_dummy_p == -1)) fprintf_unfiltered (log, "\n\tcall_dummy_p"); @@ -714,8 +710,8 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->fix_call_dummy == 0)) fprintf_unfiltered (log, "\n\tfix_call_dummy"); - /* Skip verify of init_frame_pc_first, invalid_p == 0 */ - /* Skip verify of init_frame_pc, invalid_p == 0 */ + /* Skip verify of deprecated_init_frame_pc_first, has predicate */ + /* Skip verify of deprecated_init_frame_pc, has predicate */ /* Skip verify of coerce_float_to_double, invalid_p == 0 */ /* Skip verify of get_saved_register, has predicate */ /* Skip verify of register_convertible, invalid_p == 0 */ @@ -777,12 +773,8 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->frame_saved_pc == 0)) fprintf_unfiltered (log, "\n\tframe_saved_pc"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_args_address == 0)) - fprintf_unfiltered (log, "\n\tframe_args_address"); - if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) - && (gdbarch->frame_locals_address == 0)) - fprintf_unfiltered (log, "\n\tframe_locals_address"); + /* Skip verify of frame_args_address, invalid_p == 0 */ + /* Skip verify of frame_locals_address, invalid_p == 0 */ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && (gdbarch->saved_pc_after_call == 0)) fprintf_unfiltered (log, "\n\tsaved_pc_after_call"); @@ -849,6 +841,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) GDB_MULTI_ARCH); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_frame_align_p() = %d\n", + gdbarch_frame_align_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: frame_align = 0x%08lx\n", (long) current_gdbarch->frame_align); if (GDB_MULTI_ARCH) @@ -861,16 +857,37 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->register_reggroup_p); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n", + gdbarch_pseudo_register_read_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_read = 0x%08lx\n", (long) current_gdbarch->pseudo_register_read); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", + gdbarch_pseudo_register_write_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: pseudo_register_write = 0x%08lx\n", (long) current_gdbarch->pseudo_register_write); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", + gdbarch_address_class_name_to_type_flags_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n", (long) current_gdbarch->address_class_name_to_type_flags); +#ifdef ADDRESS_CLASS_TYPE_FLAGS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "ADDRESS_CLASS_TYPE_FLAGS_P()", + XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n", + ADDRESS_CLASS_TYPE_FLAGS_P ()); +#endif #ifdef ADDRESS_CLASS_TYPE_FLAGS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -878,12 +895,16 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = 0x%08lx\n", + "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n", (long) current_gdbarch->address_class_type_flags /*ADDRESS_CLASS_TYPE_FLAGS ()*/); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", + gdbarch_address_class_type_flags_to_name_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n", (long) current_gdbarch->address_class_type_flags_to_name); #ifdef ADDRESS_TO_POINTER @@ -896,7 +917,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: ADDRESS_TO_POINTER = 0x%08lx\n", + "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n", (long) current_gdbarch->address_to_pointer /*ADDRESS_TO_POINTER ()*/); #endif @@ -907,7 +928,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (ADDR_BITS_REMOVE (addr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n", + "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n", (long) current_gdbarch->addr_bits_remove /*ADDR_BITS_REMOVE ()*/); #endif @@ -934,7 +955,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: BREAKPOINT_FROM_PC = 0x%08lx\n", + "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n", (long) current_gdbarch->breakpoint_from_pc /*BREAKPOINT_FROM_PC ()*/); #endif @@ -945,7 +966,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (CALL_DUMMY_ADDRESS ())); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: CALL_DUMMY_ADDRESS = 0x%08lx\n", + "gdbarch_dump: CALL_DUMMY_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->call_dummy_address /*CALL_DUMMY_ADDRESS ()*/); #endif @@ -1031,7 +1052,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (CANNOT_FETCH_REGISTER (regnum))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n", + "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n", (long) current_gdbarch->cannot_fetch_register /*CANNOT_FETCH_REGISTER ()*/); #endif @@ -1050,7 +1071,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (CANNOT_STORE_REGISTER (regnum))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n", + "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n", (long) current_gdbarch->cannot_store_register /*CANNOT_STORE_REGISTER ()*/); #endif @@ -1061,7 +1082,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (COERCE_FLOAT_TO_DOUBLE (formal, actual))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n", + "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = <0x%08lx>\n", (long) current_gdbarch->coerce_float_to_double /*COERCE_FLOAT_TO_DOUBLE ()*/); #endif @@ -1075,7 +1096,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n", + "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n", (long) current_gdbarch->coff_make_msymbol_special /*COFF_MAKE_MSYMBOL_SPECIAL ()*/); #endif @@ -1090,7 +1111,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n", + "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = <0x%08lx>\n", (long) current_gdbarch->convert_from_func_ptr_addr /*CONVERT_FROM_FUNC_PTR_ADDR ()*/); #endif @@ -1101,7 +1122,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (CONVERT_REGISTER_P (regnum))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: CONVERT_REGISTER_P = 0x%08lx\n", + "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n", (long) current_gdbarch->convert_register_p /*CONVERT_REGISTER_P ()*/); #endif @@ -1113,6 +1134,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n", (long) DECR_PC_AFTER_BREAK); #endif +#ifdef DEPRECATED_DO_REGISTERS_INFO_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_DO_REGISTERS_INFO_P()", + XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n", + DEPRECATED_DO_REGISTERS_INFO_P ()); +#endif #ifdef DEPRECATED_DO_REGISTERS_INFO #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1123,7 +1153,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = 0x%08lx\n", + "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n", (long) current_gdbarch->deprecated_do_registers_info /*DEPRECATED_DO_REGISTERS_INFO ()*/); #endif @@ -1137,10 +1167,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = 0x%08lx\n", + "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n", (long) current_gdbarch->deprecated_extract_return_value /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/); #endif +#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()", + XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n", + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()); +#endif #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1148,10 +1187,70 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", + "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->deprecated_extract_struct_value_address /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif +#ifdef DEPRECATED_INIT_FRAME_PC_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_FRAME_PC_P()", + XSTRING (DEPRECATED_INIT_FRAME_PC_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n", + DEPRECATED_INIT_FRAME_PC_P ()); +#endif +#ifdef DEPRECATED_INIT_FRAME_PC + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)", + XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n", + (long) current_gdbarch->deprecated_init_frame_pc + /*DEPRECATED_INIT_FRAME_PC ()*/); +#endif +#ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_FRAME_PC_FIRST_P()", + XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n", + DEPRECATED_INIT_FRAME_PC_FIRST_P ()); +#endif +#ifdef DEPRECATED_INIT_FRAME_PC_FIRST + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)", + XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n", + (long) current_gdbarch->deprecated_init_frame_pc_first + /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/); +#endif +#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PC_IN_CALL_DUMMY_P()", + XSTRING (DEPRECATED_PC_IN_CALL_DUMMY_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY_P() = %d\n", + DEPRECATED_PC_IN_CALL_DUMMY_P ()); +#endif +#ifdef DEPRECATED_PC_IN_CALL_DUMMY + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)", + XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address))); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n", + (long) current_gdbarch->deprecated_pc_in_call_dummy + /*DEPRECATED_PC_IN_CALL_DUMMY ()*/); +#endif #ifdef DEPRECATED_STORE_RETURN_VALUE #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1162,10 +1261,27 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = 0x%08lx\n", + "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n", (long) current_gdbarch->deprecated_store_return_value /*DEPRECATED_STORE_RETURN_VALUE ()*/); #endif +#ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n", + XSTRING (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)); + fprintf_unfiltered (file, + "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES = %d\n", + DEPRECATED_USE_GENERIC_DUMMY_FRAMES); +#endif +#ifdef DWARF2_BUILD_FRAME_INFO_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "DWARF2_BUILD_FRAME_INFO_P()", + XSTRING (DWARF2_BUILD_FRAME_INFO_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: DWARF2_BUILD_FRAME_INFO_P() = %d\n", + DWARF2_BUILD_FRAME_INFO_P ()); +#endif #ifdef DWARF2_BUILD_FRAME_INFO #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1176,7 +1292,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = 0x%08lx\n", + "gdbarch_dump: DWARF2_BUILD_FRAME_INFO = <0x%08lx>\n", (long) current_gdbarch->dwarf2_build_frame_info /*DWARF2_BUILD_FRAME_INFO ()*/); #endif @@ -1187,7 +1303,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n", + "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n", (long) current_gdbarch->dwarf2_reg_to_regnum /*DWARF2_REG_TO_REGNUM ()*/); #endif @@ -1198,7 +1314,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n", + "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n", (long) current_gdbarch->dwarf_reg_to_regnum /*DWARF_REG_TO_REGNUM ()*/); #endif @@ -1209,7 +1325,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n", + "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n", (long) current_gdbarch->ecoff_reg_to_regnum /*ECOFF_REG_TO_REGNUM ()*/); #endif @@ -1223,7 +1339,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n", + "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n", (long) current_gdbarch->elf_make_msymbol_special /*ELF_MAKE_MSYMBOL_SPECIAL ()*/); #endif @@ -1237,10 +1353,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: EXTRACT_RETURN_VALUE = 0x%08lx\n", + "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n", (long) current_gdbarch->extract_return_value /*EXTRACT_RETURN_VALUE ()*/); #endif +#ifdef EXTRACT_STRUCT_VALUE_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "EXTRACT_STRUCT_VALUE_ADDRESS_P()", + XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n", + EXTRACT_STRUCT_VALUE_ADDRESS_P ()); +#endif #ifdef EXTRACT_STRUCT_VALUE_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1248,7 +1373,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n", + "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->extract_struct_value_address /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/); #endif @@ -1270,7 +1395,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FIX_CALL_DUMMY = 0x%08lx\n", + "gdbarch_dump: FIX_CALL_DUMMY = <0x%08lx>\n", (long) current_gdbarch->fix_call_dummy /*FIX_CALL_DUMMY ()*/); #endif @@ -1297,7 +1422,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n", + "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n", (long) current_gdbarch->frameless_function_invocation /*FRAMELESS_FUNCTION_INVOCATION ()*/); #endif @@ -1308,7 +1433,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_ARGS_ADDRESS (fi))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_ARGS_ADDRESS = 0x%08lx\n", + "gdbarch_dump: FRAME_ARGS_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->frame_args_address /*FRAME_ARGS_ADDRESS ()*/); #endif @@ -1327,7 +1452,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_CHAIN (frame))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN = 0x%08lx\n", + "gdbarch_dump: FRAME_CHAIN = <0x%08lx>\n", (long) current_gdbarch->frame_chain /*FRAME_CHAIN ()*/); #endif @@ -1338,7 +1463,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_CHAIN_VALID (chain, thisframe))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_CHAIN_VALID = 0x%08lx\n", + "gdbarch_dump: FRAME_CHAIN_VALID = <0x%08lx>\n", (long) current_gdbarch->frame_chain_valid /*FRAME_CHAIN_VALID ()*/); #endif @@ -1352,7 +1477,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_INIT_SAVED_REGS = 0x%08lx\n", + "gdbarch_dump: FRAME_INIT_SAVED_REGS = <0x%08lx>\n", (long) current_gdbarch->frame_init_saved_regs /*FRAME_INIT_SAVED_REGS ()*/); #endif @@ -1363,7 +1488,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_LOCALS_ADDRESS (fi))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_LOCALS_ADDRESS = 0x%08lx\n", + "gdbarch_dump: FRAME_LOCALS_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->frame_locals_address /*FRAME_LOCALS_ADDRESS ()*/); #endif @@ -1374,7 +1499,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_NUM_ARGS (frame))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_NUM_ARGS = 0x%08lx\n", + "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n", (long) current_gdbarch->frame_num_args /*FRAME_NUM_ARGS ()*/); #endif @@ -1385,7 +1510,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (FRAME_SAVED_PC (fi))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: FRAME_SAVED_PC = 0x%08lx\n", + "gdbarch_dump: FRAME_SAVED_PC = <0x%08lx>\n", (long) current_gdbarch->frame_saved_pc /*FRAME_SAVED_PC ()*/); #endif @@ -1397,6 +1522,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n", (long) FUNCTION_START_OFFSET); #endif +#ifdef GET_LONGJMP_TARGET_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "GET_LONGJMP_TARGET_P()", + XSTRING (GET_LONGJMP_TARGET_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n", + GET_LONGJMP_TARGET_P ()); +#endif #ifdef GET_LONGJMP_TARGET fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1404,10 +1538,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (GET_LONGJMP_TARGET (pc))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n", + "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n", (long) current_gdbarch->get_longjmp_target /*GET_LONGJMP_TARGET ()*/); #endif +#ifdef GET_SAVED_REGISTER_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "GET_SAVED_REGISTER_P()", + XSTRING (GET_SAVED_REGISTER_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: GET_SAVED_REGISTER_P() = %d\n", + GET_SAVED_REGISTER_P ()); +#endif #ifdef GET_SAVED_REGISTER #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1418,7 +1561,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: GET_SAVED_REGISTER = 0x%08lx\n", + "gdbarch_dump: GET_SAVED_REGISTER = <0x%08lx>\n", (long) current_gdbarch->get_saved_register /*GET_SAVED_REGISTER ()*/); #endif @@ -1430,6 +1573,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n", HAVE_NONSTEPPABLE_WATCHPOINT); #endif +#ifdef INIT_EXTRA_FRAME_INFO_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "INIT_EXTRA_FRAME_INFO_P()", + XSTRING (INIT_EXTRA_FRAME_INFO_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: INIT_EXTRA_FRAME_INFO_P() = %d\n", + INIT_EXTRA_FRAME_INFO_P ()); +#endif #ifdef INIT_EXTRA_FRAME_INFO #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1440,38 +1592,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: INIT_EXTRA_FRAME_INFO = 0x%08lx\n", + "gdbarch_dump: INIT_EXTRA_FRAME_INFO = <0x%08lx>\n", (long) current_gdbarch->init_extra_frame_info /*INIT_EXTRA_FRAME_INFO ()*/); #endif -#ifdef INIT_FRAME_PC -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_FRAME_PC(fromleaf, prev)", - XSTRING (INIT_FRAME_PC (fromleaf, prev))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n", - (long) current_gdbarch->init_frame_pc - /*INIT_FRAME_PC ()*/); -#endif -#ifdef INIT_FRAME_PC_FIRST -#if GDB_MULTI_ARCH - /* Macro might contain `[{}]' when not multi-arch */ - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INIT_FRAME_PC_FIRST(fromleaf, prev)", - XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev))); -#endif - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n", - (long) current_gdbarch->init_frame_pc_first - /*INIT_FRAME_PC_FIRST ()*/); -#endif #ifdef INNER_THAN fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1479,10 +1603,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (INNER_THAN (lhs, rhs))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: INNER_THAN = 0x%08lx\n", + "gdbarch_dump: INNER_THAN = <0x%08lx>\n", (long) current_gdbarch->inner_than /*INNER_THAN ()*/); #endif +#ifdef INTEGER_TO_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "INTEGER_TO_ADDRESS_P()", + XSTRING (INTEGER_TO_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n", + INTEGER_TO_ADDRESS_P ()); +#endif #ifdef INTEGER_TO_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1490,7 +1623,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (INTEGER_TO_ADDRESS (type, buf))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: INTEGER_TO_ADDRESS = 0x%08lx\n", + "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->integer_to_address /*INTEGER_TO_ADDRESS ()*/); #endif @@ -1501,7 +1634,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n", + "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n", (long) current_gdbarch->in_solib_call_trampoline /*IN_SOLIB_CALL_TRAMPOLINE ()*/); #endif @@ -1512,7 +1645,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = 0x%08lx\n", + "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n", (long) current_gdbarch->in_solib_return_trampoline /*IN_SOLIB_RETURN_TRAMPOLINE ()*/); #endif @@ -1539,7 +1672,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = 0x%08lx\n", + "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n", (long) current_gdbarch->memory_insert_breakpoint /*MEMORY_INSERT_BREAKPOINT ()*/); #endif @@ -1550,7 +1683,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = 0x%08lx\n", + "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n", (long) current_gdbarch->memory_remove_breakpoint /*MEMORY_REMOVE_BREAKPOINT ()*/); #endif @@ -1559,8 +1692,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: NAME_OF_MALLOC # %s\n", XSTRING (NAME_OF_MALLOC)); fprintf_unfiltered (file, - "gdbarch_dump: NAME_OF_MALLOC = %ld\n", - (long) NAME_OF_MALLOC); + "gdbarch_dump: NAME_OF_MALLOC = %s\n", + NAME_OF_MALLOC); #endif #ifdef NPC_REGNUM fprintf_unfiltered (file, @@ -1594,17 +1727,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: PARM_BOUNDARY = %d\n", PARM_BOUNDARY); #endif -#ifdef PC_IN_CALL_DUMMY - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "PC_IN_CALL_DUMMY(pc, sp, frame_address)", - XSTRING (PC_IN_CALL_DUMMY (pc, sp, frame_address))); - if (GDB_MULTI_ARCH) - fprintf_unfiltered (file, - "gdbarch_dump: PC_IN_CALL_DUMMY = 0x%08lx\n", - (long) current_gdbarch->pc_in_call_dummy - /*PC_IN_CALL_DUMMY ()*/); -#endif #ifdef PC_IN_SIGTRAMP fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1612,7 +1734,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (PC_IN_SIGTRAMP (pc, name))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PC_IN_SIGTRAMP = 0x%08lx\n", + "gdbarch_dump: PC_IN_SIGTRAMP = <0x%08lx>\n", (long) current_gdbarch->pc_in_sigtramp /*PC_IN_SIGTRAMP ()*/); #endif @@ -1631,7 +1753,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (POINTER_TO_ADDRESS (type, buf))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: POINTER_TO_ADDRESS = 0x%08lx\n", + "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->pointer_to_address /*POINTER_TO_ADDRESS ()*/); #endif @@ -1645,7 +1767,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: POP_FRAME = 0x%08lx\n", + "gdbarch_dump: POP_FRAME = <0x%08lx>\n", (long) current_gdbarch->pop_frame /*POP_FRAME ()*/); #endif @@ -1656,12 +1778,16 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (PREPARE_TO_PROCEED (select_it))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PREPARE_TO_PROCEED = 0x%08lx\n", + "gdbarch_dump: PREPARE_TO_PROCEED = <0x%08lx>\n", (long) current_gdbarch->prepare_to_proceed /*PREPARE_TO_PROCEED ()*/); #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", + gdbarch_print_float_info_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: print_float_info = 0x%08lx\n", (long) current_gdbarch->print_float_info); if (GDB_MULTI_ARCH) @@ -1670,6 +1796,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) (long) current_gdbarch->print_registers_info); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", + gdbarch_print_vector_info_p (current_gdbarch)); + if (GDB_MULTI_ARCH) + fprintf_unfiltered (file, "gdbarch_dump: print_vector_info = 0x%08lx\n", (long) current_gdbarch->print_vector_info); #ifdef PROLOGUE_FRAMELESS_P @@ -1679,7 +1809,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (PROLOGUE_FRAMELESS_P (ip))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PROLOGUE_FRAMELESS_P = 0x%08lx\n", + "gdbarch_dump: PROLOGUE_FRAMELESS_P = <0x%08lx>\n", (long) current_gdbarch->prologue_frameless_p /*PROLOGUE_FRAMELESS_P ()*/); #endif @@ -1698,7 +1828,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PUSH_ARGUMENTS = 0x%08lx\n", + "gdbarch_dump: PUSH_ARGUMENTS = <0x%08lx>\n", (long) current_gdbarch->push_arguments /*PUSH_ARGUMENTS ()*/); #endif @@ -1712,10 +1842,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PUSH_DUMMY_FRAME = 0x%08lx\n", + "gdbarch_dump: PUSH_DUMMY_FRAME = <0x%08lx>\n", (long) current_gdbarch->push_dummy_frame /*PUSH_DUMMY_FRAME ()*/); #endif +#ifdef PUSH_RETURN_ADDRESS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "PUSH_RETURN_ADDRESS_P()", + XSTRING (PUSH_RETURN_ADDRESS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: PUSH_RETURN_ADDRESS_P() = %d\n", + PUSH_RETURN_ADDRESS_P ()); +#endif #ifdef PUSH_RETURN_ADDRESS fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1723,7 +1862,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (PUSH_RETURN_ADDRESS (pc, sp))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: PUSH_RETURN_ADDRESS = 0x%08lx\n", + "gdbarch_dump: PUSH_RETURN_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->push_return_address /*PUSH_RETURN_ADDRESS ()*/); #endif @@ -1734,7 +1873,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_BYTE (reg_nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_BYTE = 0x%08lx\n", + "gdbarch_dump: REGISTER_BYTE = <0x%08lx>\n", (long) current_gdbarch->register_byte /*REGISTER_BYTE ()*/); #endif @@ -1746,6 +1885,15 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: REGISTER_BYTES = %d\n", REGISTER_BYTES); #endif +#ifdef REGISTER_BYTES_OK_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "REGISTER_BYTES_OK_P()", + XSTRING (REGISTER_BYTES_OK_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n", + REGISTER_BYTES_OK_P ()); +#endif #ifdef REGISTER_BYTES_OK fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1753,7 +1901,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_BYTES_OK (nr_bytes))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_BYTES_OK = 0x%08lx\n", + "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n", (long) current_gdbarch->register_bytes_ok /*REGISTER_BYTES_OK ()*/); #endif @@ -1764,7 +1912,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_CONVERTIBLE (nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERTIBLE = 0x%08lx\n", + "gdbarch_dump: REGISTER_CONVERTIBLE = <0x%08lx>\n", (long) current_gdbarch->register_convertible /*REGISTER_CONVERTIBLE ()*/); #endif @@ -1778,7 +1926,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERT_TO_RAW = 0x%08lx\n", + "gdbarch_dump: REGISTER_CONVERT_TO_RAW = <0x%08lx>\n", (long) current_gdbarch->register_convert_to_raw /*REGISTER_CONVERT_TO_RAW ()*/); #endif @@ -1792,7 +1940,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = 0x%08lx\n", + "gdbarch_dump: REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n", (long) current_gdbarch->register_convert_to_virtual /*REGISTER_CONVERT_TO_VIRTUAL ()*/); #endif @@ -1803,7 +1951,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_NAME (regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_NAME = 0x%08lx\n", + "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n", (long) current_gdbarch->register_name /*REGISTER_NAME ()*/); #endif @@ -1814,7 +1962,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_RAW_SIZE (reg_nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_RAW_SIZE = 0x%08lx\n", + "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n", (long) current_gdbarch->register_raw_size /*REGISTER_RAW_SIZE ()*/); #endif @@ -1825,7 +1973,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_SIM_REGNO (reg_nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_SIM_REGNO = 0x%08lx\n", + "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n", (long) current_gdbarch->register_sim_regno /*REGISTER_SIM_REGNO ()*/); #endif @@ -1847,7 +1995,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_TO_VALUE = 0x%08lx\n", + "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n", (long) current_gdbarch->register_to_value /*REGISTER_TO_VALUE ()*/); #endif @@ -1858,7 +2006,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_VIRTUAL_SIZE = 0x%08lx\n", + "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n", (long) current_gdbarch->register_virtual_size /*REGISTER_VIRTUAL_SIZE ()*/); #endif @@ -1869,10 +2017,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REGISTER_VIRTUAL_TYPE = 0x%08lx\n", + "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n", (long) current_gdbarch->register_virtual_type /*REGISTER_VIRTUAL_TYPE ()*/); #endif +#ifdef REG_STRUCT_HAS_ADDR_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "REG_STRUCT_HAS_ADDR_P()", + XSTRING (REG_STRUCT_HAS_ADDR_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: REG_STRUCT_HAS_ADDR_P() = %d\n", + REG_STRUCT_HAS_ADDR_P ()); +#endif #ifdef REG_STRUCT_HAS_ADDR fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1880,7 +2037,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REG_STRUCT_HAS_ADDR = 0x%08lx\n", + "gdbarch_dump: REG_STRUCT_HAS_ADDR = <0x%08lx>\n", (long) current_gdbarch->reg_struct_has_addr /*REG_STRUCT_HAS_ADDR ()*/); #endif @@ -1894,7 +2051,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = 0x%08lx\n", + "gdbarch_dump: REMOTE_TRANSLATE_XFER_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->remote_translate_xfer_address /*REMOTE_TRANSLATE_XFER_ADDRESS ()*/); #endif @@ -1905,7 +2062,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (RETURN_VALUE_ON_STACK (type))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: RETURN_VALUE_ON_STACK = 0x%08lx\n", + "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n", (long) current_gdbarch->return_value_on_stack /*RETURN_VALUE_ON_STACK ()*/); #endif @@ -1916,10 +2073,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SAVED_PC_AFTER_CALL (frame))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SAVED_PC_AFTER_CALL = 0x%08lx\n", + "gdbarch_dump: SAVED_PC_AFTER_CALL = <0x%08lx>\n", (long) current_gdbarch->saved_pc_after_call /*SAVED_PC_AFTER_CALL ()*/); #endif +#ifdef SAVE_DUMMY_FRAME_TOS_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SAVE_DUMMY_FRAME_TOS_P()", + XSTRING (SAVE_DUMMY_FRAME_TOS_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: SAVE_DUMMY_FRAME_TOS_P() = %d\n", + SAVE_DUMMY_FRAME_TOS_P ()); +#endif #ifdef SAVE_DUMMY_FRAME_TOS #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -1930,7 +2096,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = 0x%08lx\n", + "gdbarch_dump: SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n", (long) current_gdbarch->save_dummy_frame_tos /*SAVE_DUMMY_FRAME_TOS ()*/); #endif @@ -1941,10 +2107,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SDB_REG_TO_REGNUM (sdb_regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n", + "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n", (long) current_gdbarch->sdb_reg_to_regnum /*SDB_REG_TO_REGNUM ()*/); #endif +#ifdef SIGTRAMP_END_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SIGTRAMP_END_P()", + XSTRING (SIGTRAMP_END_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: SIGTRAMP_END_P() = %d\n", + SIGTRAMP_END_P ()); +#endif #ifdef SIGTRAMP_END fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1952,10 +2127,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SIGTRAMP_END (pc))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SIGTRAMP_END = 0x%08lx\n", + "gdbarch_dump: SIGTRAMP_END = <0x%08lx>\n", (long) current_gdbarch->sigtramp_end /*SIGTRAMP_END ()*/); #endif +#ifdef SIGTRAMP_START_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SIGTRAMP_START_P()", + XSTRING (SIGTRAMP_START_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: SIGTRAMP_START_P() = %d\n", + SIGTRAMP_START_P ()); +#endif #ifdef SIGTRAMP_START fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -1963,7 +2147,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SIGTRAMP_START (pc))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SIGTRAMP_START = 0x%08lx\n", + "gdbarch_dump: SIGTRAMP_START = <0x%08lx>\n", (long) current_gdbarch->sigtramp_start /*SIGTRAMP_START ()*/); #endif @@ -1982,7 +2166,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SKIP_PROLOGUE (ip))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SKIP_PROLOGUE = 0x%08lx\n", + "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n", (long) current_gdbarch->skip_prologue /*SKIP_PROLOGUE ()*/); #endif @@ -1993,7 +2177,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SKIP_TRAMPOLINE_CODE (pc))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SKIP_TRAMPOLINE_CODE = 0x%08lx\n", + "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n", (long) current_gdbarch->skip_trampoline_code /*SKIP_TRAMPOLINE_CODE ()*/); #endif @@ -2004,10 +2188,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (SMASH_TEXT_ADDRESS (addr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n", + "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n", (long) current_gdbarch->smash_text_address /*SMASH_TEXT_ADDRESS ()*/); #endif +#ifdef SOFTWARE_SINGLE_STEP_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "SOFTWARE_SINGLE_STEP_P()", + XSTRING (SOFTWARE_SINGLE_STEP_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n", + SOFTWARE_SINGLE_STEP_P ()); +#endif #ifdef SOFTWARE_SINGLE_STEP #if GDB_MULTI_ARCH /* Macro might contain `[{}]' when not multi-arch */ @@ -2018,7 +2211,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: SOFTWARE_SINGLE_STEP = 0x%08lx\n", + "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n", (long) current_gdbarch->software_single_step /*SOFTWARE_SINGLE_STEP ()*/); #endif @@ -2037,10 +2230,19 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (STAB_REG_TO_REGNUM (stab_regnr))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n", + "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n", (long) current_gdbarch->stab_reg_to_regnum /*STAB_REG_TO_REGNUM ()*/); #endif +#ifdef STACK_ALIGN_P + fprintf_unfiltered (file, + "gdbarch_dump: %s # %s\n", + "STACK_ALIGN_P()", + XSTRING (STACK_ALIGN_P ())); + fprintf_unfiltered (file, + "gdbarch_dump: STACK_ALIGN_P() = %d\n", + STACK_ALIGN_P ()); +#endif #ifdef STACK_ALIGN fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2048,7 +2250,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (STACK_ALIGN (sp))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: STACK_ALIGN = 0x%08lx\n", + "gdbarch_dump: STACK_ALIGN = <0x%08lx>\n", (long) current_gdbarch->stack_align /*STACK_ALIGN ()*/); #endif @@ -2062,7 +2264,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: STORE_RETURN_VALUE = 0x%08lx\n", + "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n", (long) current_gdbarch->store_return_value /*STORE_RETURN_VALUE ()*/); #endif @@ -2076,7 +2278,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: STORE_STRUCT_RETURN = 0x%08lx\n", + "gdbarch_dump: STORE_STRUCT_RETURN = <0x%08lx>\n", (long) current_gdbarch->store_struct_return /*STORE_STRUCT_RETURN ()*/); #endif @@ -2134,8 +2336,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n", XSTRING (TARGET_DOUBLE_FORMAT)); fprintf_unfiltered (file, - "gdbarch_dump: TARGET_DOUBLE_FORMAT = %ld\n", - (long) TARGET_DOUBLE_FORMAT); + "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n", + (TARGET_DOUBLE_FORMAT)->name); #endif #ifdef TARGET_FLOAT_BIT fprintf_unfiltered (file, @@ -2150,8 +2352,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n", XSTRING (TARGET_FLOAT_FORMAT)); fprintf_unfiltered (file, - "gdbarch_dump: TARGET_FLOAT_FORMAT = %ld\n", - (long) TARGET_FLOAT_FORMAT); + "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n", + (TARGET_FLOAT_FORMAT)->name); #endif #ifdef TARGET_INT_BIT fprintf_unfiltered (file, @@ -2182,8 +2384,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n", XSTRING (TARGET_LONG_DOUBLE_FORMAT)); fprintf_unfiltered (file, - "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n", - (long) TARGET_LONG_DOUBLE_FORMAT); + "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n", + (TARGET_LONG_DOUBLE_FORMAT)->name); #endif #ifdef TARGET_LONG_LONG_BIT fprintf_unfiltered (file, @@ -2200,7 +2402,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (TARGET_PRINT_INSN (vma, info))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n", + "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n", (long) current_gdbarch->print_insn /*TARGET_PRINT_INSN ()*/); #endif @@ -2219,7 +2421,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (TARGET_READ_FP ())); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_READ_FP = 0x%08lx\n", + "gdbarch_dump: TARGET_READ_FP = <0x%08lx>\n", (long) current_gdbarch->read_fp /*TARGET_READ_FP ()*/); #endif @@ -2230,7 +2432,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (TARGET_READ_PC (ptid))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_READ_PC = 0x%08lx\n", + "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n", (long) current_gdbarch->read_pc /*TARGET_READ_PC ()*/); #endif @@ -2241,7 +2443,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (TARGET_READ_SP ())); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_READ_SP = 0x%08lx\n", + "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n", (long) current_gdbarch->read_sp /*TARGET_READ_SP ()*/); #endif @@ -2263,7 +2465,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = 0x%08lx\n", + "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n", (long) current_gdbarch->virtual_frame_pointer /*TARGET_VIRTUAL_FRAME_POINTER ()*/); #endif @@ -2277,7 +2479,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_WRITE_PC = 0x%08lx\n", + "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n", (long) current_gdbarch->write_pc /*TARGET_WRITE_PC ()*/); #endif @@ -2291,18 +2493,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: TARGET_WRITE_SP = 0x%08lx\n", + "gdbarch_dump: TARGET_WRITE_SP = <0x%08lx>\n", (long) current_gdbarch->write_sp /*TARGET_WRITE_SP ()*/); #endif -#ifdef USE_GENERIC_DUMMY_FRAMES - fprintf_unfiltered (file, - "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n", - XSTRING (USE_GENERIC_DUMMY_FRAMES)); - fprintf_unfiltered (file, - "gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %d\n", - USE_GENERIC_DUMMY_FRAMES); -#endif #ifdef USE_STRUCT_CONVENTION fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2310,7 +2504,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type))); if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: USE_STRUCT_CONVENTION = 0x%08lx\n", + "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n", (long) current_gdbarch->use_struct_convention /*USE_STRUCT_CONVENTION ()*/); #endif @@ -2324,7 +2518,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) #endif if (GDB_MULTI_ARCH) fprintf_unfiltered (file, - "gdbarch_dump: VALUE_TO_REGISTER = 0x%08lx\n", + "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n", (long) current_gdbarch->value_to_register /*VALUE_TO_REGISTER ()*/); #endif @@ -3327,31 +3521,27 @@ set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, } int -gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) +gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->use_generic_dummy_frames == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_use_generic_dummy_frames invalid"); + /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n"); - return gdbarch->use_generic_dummy_frames; + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n"); + return gdbarch->deprecated_use_generic_dummy_frames; } void -set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, - int use_generic_dummy_frames) +set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, + int deprecated_use_generic_dummy_frames) { - gdbarch->use_generic_dummy_frames = use_generic_dummy_frames; + gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames; } int gdbarch_call_dummy_location (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->call_dummy_location == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_call_dummy_location invalid"); + /* Skip verify of call_dummy_location, invalid_p == 0 */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); return gdbarch->call_dummy_location; @@ -3460,22 +3650,30 @@ set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, } int -gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) +gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->pc_in_call_dummy == 0) + return gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy; +} + +int +gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch->deprecated_pc_in_call_dummy == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pc_in_call_dummy invalid"); + "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); + /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); - return gdbarch->pc_in_call_dummy (pc, sp, frame_address); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); + return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); } void -set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, - gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) +set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, + gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy) { - gdbarch->pc_in_call_dummy = pc_in_call_dummy; + gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy; } int @@ -3588,42 +3786,56 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch->fix_call_dummy = fix_call_dummy; } -void -gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) +int +gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_init_frame_pc_first != 0; +} + +CORE_ADDR +gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) { gdb_assert (gdbarch != NULL); - if (gdbarch->init_frame_pc_first == 0) + if (gdbarch->deprecated_init_frame_pc_first == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_init_frame_pc_first invalid"); + "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n"); - gdbarch->init_frame_pc_first (fromleaf, prev); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n"); + return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev); } void -set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, - gdbarch_init_frame_pc_first_ftype init_frame_pc_first) +set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, + gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first) { - gdbarch->init_frame_pc_first = init_frame_pc_first; + gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first; } -void -gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) +int +gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->deprecated_init_frame_pc != 0; +} + +CORE_ADDR +gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) { gdb_assert (gdbarch != NULL); - if (gdbarch->init_frame_pc == 0) + if (gdbarch->deprecated_init_frame_pc == 0) internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_init_frame_pc invalid"); + "gdbarch: gdbarch_deprecated_init_frame_pc invalid"); if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc called\n"); - gdbarch->init_frame_pc (fromleaf, prev); + fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n"); + return gdbarch->deprecated_init_frame_pc (fromleaf, prev); } void -set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, - gdbarch_init_frame_pc_ftype init_frame_pc) +set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, + gdbarch_deprecated_init_frame_pc_ftype deprecated_init_frame_pc) { - gdbarch->init_frame_pc = init_frame_pc; + gdbarch->deprecated_init_frame_pc = deprecated_init_frame_pc; } int @@ -5156,7 +5368,7 @@ gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) return gdbarch->address_class_type_flags_to_name != 0; } -char * +const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) { gdb_assert (gdbarch != NULL); @@ -5183,7 +5395,7 @@ gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) } int -gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr) +gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) { gdb_assert (gdbarch != NULL); if (gdbarch->address_class_name_to_type_flags == 0) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index a2fa465..0b2381f9 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -970,17 +970,27 @@ extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get reqires that these methods be set up from the word go. This also avoids any potential problems with moving beyond multi-arch partial. */ -extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch); -extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (USE_GENERIC_DUMMY_FRAMES) -#error "Non multi-arch definition of USE_GENERIC_DUMMY_FRAMES" +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1) +#endif + +extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch); +extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (USE_GENERIC_DUMMY_FRAMES) -#define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch)) +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) +#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch)) #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION) +#define CALL_DUMMY_LOCATION (AT_ENTRY_POINT) +#endif + extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION) @@ -1048,15 +1058,46 @@ extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dum #endif #endif -typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); -extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_CALL_DUMMY) -#error "Non multi-arch definition of PC_IN_CALL_DUMMY" +/* NOTE: cagney/2002-11-24: This function with predicate has a valid + (callable) initial value. As a consequence, even when the predicate + is false, the corresponding function works. This simplifies the + migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), + doesn't need to be modified. */ + +#if defined (DEPRECATED_PC_IN_CALL_DUMMY) +/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */ +#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0) +#endif + +extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" +#endif +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P) +#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address)) +#endif + +typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy); +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY) +#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_CALL_DUMMY) -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) +#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY) +#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) #endif #endif @@ -1137,37 +1178,77 @@ extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_cal #endif #endif +#if defined (DEPRECATED_INIT_FRAME_PC_FIRST) +/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */ +#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0) +#endif + +extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P) +#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST) -#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0) #endif -typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); -extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST) -#error "Non multi-arch definition of INIT_FRAME_PC_FIRST" +typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev); +extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); +extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST) -#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST) +#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev)) #endif #endif +#if defined (DEPRECATED_INIT_FRAME_PC) +/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */ +#if !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (0) +#endif + +extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P) +#define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch)) +#endif + /* Default (function) for non- multi-arch platforms. */ -#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC) -#define INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_default (fromleaf, prev)) +#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC) +#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0) #endif -typedef void (gdbarch_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); -extern void gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); -extern void set_gdbarch_init_frame_pc (struct gdbarch *gdbarch, gdbarch_init_frame_pc_ftype *init_frame_pc); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC) -#error "Non multi-arch definition of INIT_FRAME_PC" +typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev); +extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev); +extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC) +#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC" #endif #if GDB_MULTI_ARCH -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC) -#define INIT_FRAME_PC(fromleaf, prev) (gdbarch_init_frame_pc (current_gdbarch, fromleaf, prev)) +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC) +#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (gdbarch_deprecated_init_frame_pc (current_gdbarch, fromleaf, prev)) #endif #endif @@ -1950,6 +2031,11 @@ extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_s #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS) +#define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi)) +#endif + typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); @@ -1962,6 +2048,11 @@ extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_fra #endif #endif +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (FRAME_LOCALS_ADDRESS) +#define FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi)) +#endif + typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); @@ -2671,14 +2762,14 @@ extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbar extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch); -typedef char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags); -extern char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags); +typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags); +extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags); extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name); extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch); -typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, char *name, int *type_flags_ptr); -extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr); +typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); +extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags); /* Is a register in a group */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index f7f9a66..e2da438 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -115,19 +115,25 @@ EOF test "${fmt}" || fmt="%ld" test "${print}" || print="(long) ${macro}" - case "${invalid_p}" in - 0 ) valid_p=1 ;; + case "${class}" in + F | V | M ) + case "${invalid_p}" in "" ) - if [ -n "${predefault}" ] + if test -n "${predefault}" -a "${predefault}" != "0" then #invalid_p="gdbarch->${function} == ${predefault}" - valid_p="gdbarch->${function} != ${predefault}" + predicate="gdbarch->${function} != ${predefault}" else - #invalid_p="gdbarch->${function} == 0" - valid_p="gdbarch->${function} != 0" + # filled in later + predicate="" fi ;; - * ) valid_p="!(${invalid_p})" + * ) + echo "Predicate function ${function} with invalid_p." 1>&2 + kill $$ + exit 1 + ;; + esac esac # PREDEFAULT is a valid fallback definition of MEMBER when @@ -488,22 +494,27 @@ F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc::0:0 # behaviour here (and hence entrench it further) gdbarch simply # reqires that these methods be set up from the word go. This also # avoids any potential problems with moving beyond multi-arch partial. -v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1 -v:1:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0 +v:1:DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0 +v:1:CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0 f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0::gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0 v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1:::0x%08lx v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1:0x%08lx::CALL_DUMMY_BREAKPOINT_OFFSET_P v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1 v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1:::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END -f:1:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::0:0 +# NOTE: cagney/2002-11-24: This function with predicate has a valid +# (callable) initial value. As a consequence, even when the predicate +# is false, the corresponding function works. This simplifies the +# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(), +# doesn't need to be modified. +F:1:DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0:0x%08lx v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0 -f:2:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0 -f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0 +F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev +F::DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev # v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::::: v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::::: @@ -566,8 +577,8 @@ f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 # functions. f:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe:::generic_func_frame_chain_valid::0 f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0 -f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:0 -f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:0 +f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0 +f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0 f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0 f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0 # @@ -578,9 +589,9 @@ F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0 v:2:PARM_BOUNDARY:int:parm_boundary # -v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch) -v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch) -v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (gdbarch) +v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name +v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name +v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name f:2:CONVERT_FROM_FUNC_PTR_ADDR:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr:addr:::core_addr_identity::0 # On some machines there are bits in addresses which are not really # part of the address, but are used by the kernel, the hardware, etc. @@ -661,12 +672,12 @@ m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:construct_inferior_arguments:int argc, ch F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile:objfile:::0 f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0 f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0 -v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0 +v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0 v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0 F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class -M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags: -M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr +M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags: +M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr # Is a register in a group m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0 EOF @@ -686,9 +697,6 @@ EOF do eval echo \"\ \ \ \ ${r}=\${${r}}\" done -# #fallbackdefault=${fallbackdefault} -# #valid_p=${valid_p} -#EOF if class_is_predicate_p && fallback_default_p then echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2 @@ -1562,8 +1570,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: GDB_MULTI_ARCH = %d\\n", GDB_MULTI_ARCH); EOF -function_list | sort -t: +2 | while do_read +function_list | sort -t: -k 3 | while do_read do + # First the predicate + if class_is_predicate_p + then + if class_is_multiarch_p + then + printf " if (GDB_MULTI_ARCH)\n" + printf " fprintf_unfiltered (file,\n" + printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n" + printf " gdbarch_${function}_p (current_gdbarch));\n" + else + printf "#ifdef ${macro}_P\n" + printf " fprintf_unfiltered (file,\n" + printf " \"gdbarch_dump: %%s # %%s\\\\n\",\n" + printf " \"${macro}_P()\",\n" + printf " XSTRING (${macro}_P ()));\n" + printf " fprintf_unfiltered (file,\n" + printf " \"gdbarch_dump: ${macro}_P() = %%d\\\\n\",\n" + printf " ${macro}_P ());\n" + printf "#endif\n" + fi + fi # multiarch functions don't have macros. if class_is_multiarch_p then @@ -1612,7 +1641,7 @@ do then printf " if (GDB_MULTI_ARCH)\n" printf " fprintf_unfiltered (file,\n" - printf " \"gdbarch_dump: ${macro} = 0x%%08lx\\\\n\",\n" + printf " \"gdbarch_dump: ${macro} = <0x%%08lx>\\\\n\",\n" printf " (long) current_gdbarch->${function}\n" printf " /*${macro} ()*/);\n" else @@ -1650,11 +1679,11 @@ do printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n" printf "{\n" printf " gdb_assert (gdbarch != NULL);\n" - if [ -n "${valid_p}" ] + if [ -n "${predicate}" ] then - printf " return ${valid_p};\n" + printf " return ${predicate};\n" else - printf "#error \"gdbarch_${function}_p: not defined\"\n" + printf " return gdbarch->${function} != 0;\n" fi printf "}\n" fi @@ -1673,6 +1702,11 @@ do printf " if (gdbarch->${function} == 0)\n" printf " internal_error (__FILE__, __LINE__,\n" printf " \"gdbarch: gdbarch_${function} invalid\");\n" + if class_is_predicate_p && test -n "${predicate}" + then + # Allow a call to a function with a predicate. + printf " /* Ignore predicate (${predicate}). */\n" + fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" if [ "x${actual}" = "x-" -o "x${actual}" = "x" ] diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index e7ab609..9a25c44 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,17 @@ +2002-11-20 Daniel Jacobowitz + + * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of + defined(PT_FPR0_HI). + +2002-11-17 Stuart Hughes + + * linux-arm-low.c (arm_num_regs): Increase. + (arm_regmap): Include status register. + +2002-11-17 Daniel Jacobowitz + + * linux-low.c (register_addr): Remove incorrect -1 check. + 2002-08-29 Daniel Jacobowitz * linux-low.c (linux_create_inferior): Call setpgid. Return diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index 07e2792..cd075b2 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -26,11 +26,13 @@ #include #endif -#define arm_num_regs 16 +#define arm_num_regs 26 static int arm_regmap[] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + 64 }; static int diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 7644f9e..2cb592a 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -894,8 +894,6 @@ register_addr (int regnum) error ("Invalid register number %d.", regnum); addr = the_low_target.regmap[regnum]; - if (addr == -1) - addr = 0; return addr; } diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c index 8d800ae..9213f68 100644 --- a/gdb/gdbserver/linux-s390-low.c +++ b/gdb/gdbserver/linux-s390-low.c @@ -49,7 +49,8 @@ static int s390_regmap[] = { PT_FPC, -#ifdef PT_FPR0_HI +/* defines GPR_SIZE. */ +#if GPR_SIZE == 4 PT_FPR0_HI, PT_FPR1_HI, PT_FPR2_HI, PT_FPR3_HI, PT_FPR4_HI, PT_FPR5_HI, PT_FPR6_HI, PT_FPR7_HI, PT_FPR8_HI, PT_FPR9_HI, PT_FPR10_HI, PT_FPR11_HI, diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index da89b36..e3df58b 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -28,6 +28,9 @@ /* For bpstat */ #include "breakpoint.h" +/* For struct frame_id. */ +#include "frame.h" + struct thread_info { struct thread_info *next; @@ -43,7 +46,7 @@ struct thread_info struct breakpoint *through_sigtramp_breakpoint; CORE_ADDR step_range_start; CORE_ADDR step_range_end; - CORE_ADDR step_frame_address; + struct frame_id step_frame_id; CORE_ADDR step_sp; int current_line; struct symtab *current_symtab; @@ -118,7 +121,7 @@ extern void save_infrun_state (ptid_t ptid, struct breakpoint *through_sigtramp_breakpoint, CORE_ADDR step_range_start, CORE_ADDR step_range_end, - CORE_ADDR step_frame_address, + const struct frame_id *step_frame_id, int handling_longjmp, int another_trap, int stepping_through_solib_after_catch, @@ -139,7 +142,7 @@ extern void load_infrun_state (ptid_t ptid, struct breakpoint **through_sigtramp_breakpoint, CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, - CORE_ADDR *step_frame_address, + struct frame_id *step_frame_id, int *handling_longjmp, int *another_trap, int *stepping_through_solib_affter_catch, diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 5b28327..b40d1ea 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -416,7 +416,7 @@ address_space_name_to_int (char *space_identifier) /* Identify address space identifier by integer flag as defined in gdbtypes.h -- return the string version of the adress space name. */ -extern char * +const char * address_space_int_to_name (int space_flag) { struct gdbarch *gdbarch = current_gdbarch; @@ -1341,8 +1341,11 @@ get_destructor_fn_field (struct type *t, int *method_indexp, int *field_indexp) This used to be coded as a macro, but I don't think it is called often enough to merit such treatment. */ -struct deprecated_complaint stub_noname_complaint = -{"stub type has NULL name", 0, 0}; +static void +stub_noname_complaint (void) +{ + complaint (&symfile_complaints, "stub type has NULL name"); +} struct type * check_typedef (struct type *type) @@ -1369,7 +1372,7 @@ check_typedef (struct type *type) TYPE_TAG_NAME were separate). */ if (name == NULL) { - complain (&stub_noname_complaint); + stub_noname_complaint (); return type; } sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, @@ -1396,7 +1399,7 @@ check_typedef (struct type *type) struct type *newtype; if (name == NULL) { - complain (&stub_noname_complaint); + stub_noname_complaint (); return type; } newtype = lookup_transparent_type (name); @@ -1414,7 +1417,7 @@ check_typedef (struct type *type) struct symbol *sym; if (name == NULL) { - complain (&stub_noname_complaint); + stub_noname_complaint (); return type; } sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL); @@ -1511,12 +1514,8 @@ add_mangled_type (struct extra *pextras, struct type *t) break; default: { - - static struct deprecated_complaint msg = - {"Bad int type code length x%x\n", 0, 0}; - - complain (&msg, tlen); - + complaint (&symfile_complaints, "Bad int type code length x%x", + tlen); } } break; @@ -1534,9 +1533,8 @@ add_mangled_type (struct extra *pextras, struct type *t) break; default: { - static struct deprecated_complaint msg = - {"Bad float type code length x%x\n", 0, 0}; - complain (&msg, tlen); + complaint (&symfile_complaints, "Bad float type code length x%x", + tlen); } } break; @@ -1550,9 +1548,8 @@ add_mangled_type (struct extra *pextras, struct type *t) break; case TYPE_CODE_TYPEDEF: { - static struct deprecated_complaint msg = - {"Typedefs in overloaded functions not yet supported\n", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, + "Typedefs in overloaded functions not yet supported"); } /* followed by type bytes & name */ break; @@ -1590,9 +1587,7 @@ add_mangled_type (struct extra *pextras, struct type *t) case TYPE_CODE_ERROR: default: { - static struct deprecated_complaint msg = - {"Unknown type code x%x\n", 0, 0}; - complain (&msg, tcode); + complaint (&symfile_complaints, "Unknown type code x%x", tcode); } } if (TYPE_TARGET_TYPE (t)) diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 91f156e..8adc89e 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1097,7 +1097,7 @@ extern void replace_type (struct type *, struct type *); extern int address_space_name_to_int (char *); -extern char *address_space_int_to_name (int); +extern const char *address_space_int_to_name (int); extern struct type *make_type_with_address_space (struct type *type, int space_identifier); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 0b0578c..0fc9d86 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -482,9 +482,10 @@ h8300_frame_init_saved_regs (struct frame_info *fi) } } -/* 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. +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -492,7 +493,7 @@ h8300_frame_init_saved_regs (struct frame_info *fi) static CORE_ADDR h8300_frame_chain (struct frame_info *thisframe) { - if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) { /* initialize the from_pc now */ thisframe->extra_info->from_pc = deprecated_read_register_dummy (thisframe->pc, thisframe->frame, @@ -510,7 +511,7 @@ h8300_frame_chain (struct frame_info *thisframe) static CORE_ADDR h8300_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, E_PC_REGNUM); else @@ -540,7 +541,7 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) static CORE_ADDR h8300_frame_locals_address (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return (CORE_ADDR) 0; /* Not sure what else to do... */ return fi->extra_info->locals_pointer; } @@ -551,7 +552,7 @@ h8300_frame_locals_address (struct frame_info *fi) static CORE_ADDR h8300_frame_args_address (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return (CORE_ADDR) 0; /* Not sure what else to do... */ return fi->extra_info->args_pointer; } @@ -746,7 +747,7 @@ h8300_pop_frame (void) unsigned regno; struct frame_info *frame = get_current_frame (); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { generic_pop_dummy_frame (); } @@ -904,7 +905,7 @@ h8300_print_register (struct gdbarch *gdbarch, struct ui_file *file, int C, Z, N, V; unsigned char b[h8300h_reg_size]; unsigned char l; - frame_register_read (selected_frame, regno, b); + frame_register_read (deprecated_selected_frame, regno, b); l = b[REGISTER_VIRTUAL_SIZE (E_CCR_REGNUM) - 1]; fprintf_filtered (file, "\t"); fprintf_filtered (file, "I-%d ", (l & 0x80) != 0); @@ -945,7 +946,7 @@ h8300_print_register (struct gdbarch *gdbarch, struct ui_file *file, /* EXR register */ unsigned char b[h8300h_reg_size]; unsigned char l; - frame_register_read (selected_frame, regno, b); + frame_register_read (deprecated_selected_frame, regno, b); l = b[REGISTER_VIRTUAL_SIZE (E_EXR_REGNUM) - 1]; fprintf_filtered (file, "\t"); fprintf_filtered (file, "T-%d - - - ", (l & 0x80) != 0); @@ -1079,6 +1080,10 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, 0); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + /* * Basic register fields and methods. */ @@ -1106,7 +1111,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info); set_gdbarch_frame_init_saved_regs (gdbarch, h8300_frame_init_saved_regs); set_gdbarch_frame_chain (gdbarch, h8300_frame_chain); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call); set_gdbarch_frame_saved_pc (gdbarch, h8300_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue); @@ -1138,7 +1142,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, h8300_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value); @@ -1148,13 +1151,11 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, h8300_use_struct_convention); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c index 0bfae7a..944a297 100644 --- a/gdb/h8500-tdep.c +++ b/gdb/h8500-tdep.c @@ -106,9 +106,10 @@ h8500_addr_bits_remove (CORE_ADDR addr) return ((addr) & 0xffffff); } -/* 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. +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ @@ -117,7 +118,7 @@ CORE_ADDR h8500_frame_chain (struct frame_info *thisframe) { if (!inside_entry_file (thisframe->pc)) - return (read_memory_integer (FRAME_FP (thisframe), PTR_SIZE)); + return (read_memory_integer (get_frame_base (thisframe), PTR_SIZE)); else return 0; } @@ -154,7 +155,7 @@ NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, char *pword1) CORE_ADDR frame_saved_pc (struct frame_info *frame) { - return read_memory_integer (FRAME_FP (frame) + 2, PTR_SIZE); + return read_memory_integer (get_frame_base (frame) + 2, PTR_SIZE); } void @@ -164,7 +165,7 @@ h8500_pop_frame (void) struct frame_saved_regs fsr; struct frame_info *frame = get_current_frame (); - get_frame_saved_regs (frame, &fsr); + deprecated_get_frame_saved_regs (frame, &fsr); for (regnum = 0; regnum < 8; regnum++) { @@ -186,7 +187,7 @@ h8500_print_register_hook (int regno) unsigned char b[2]; unsigned char l; - frame_register_read (selected_frame, regno, b); + frame_register_read (deprecated_selected_frame, regno, b); l = b[1]; printf_unfiltered ("\t"); printf_unfiltered ("I-%d - ", (l & 0x80) != 0); @@ -328,7 +329,7 @@ h8500_print_registers_info (struct gdbarch *gdbarch, void h8500_do_registers_info (int regnum, int all) { - h8500_print_registers_info (current_gdbarch, gdb_stdout, selected_frame, + h8500_print_registers_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, regnum, all); } @@ -617,10 +618,10 @@ h8500_value_of_trapped_internalvar (struct internalvar *var) break; } - get_saved_register (regbuf, NULL, NULL, selected_frame, page_regnum, NULL); + get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, page_regnum, NULL); regval = regbuf[0] << 16; - get_saved_register (regbuf, NULL, NULL, selected_frame, regnum, NULL); + get_saved_register (regbuf, NULL, NULL, deprecated_selected_frame, regnum, NULL); regval |= regbuf[0] << 8 | regbuf[1]; /* XXX host/target byte order */ xfree (var->value); /* Free up old value */ diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index e0f7d9e..a9c6fc7 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -31,6 +31,7 @@ #include "regcache.h" #include "completer.h" #include "language.h" +#include "osabi.h" /* For argument passing to the inferior */ #include "symtab.h" @@ -891,7 +892,7 @@ hppa_frame_saved_pc (struct frame_info *frame) #ifdef FRAME_SAVED_PC_IN_SIGTRAMP /* Deal with signal handler caller frames too. */ - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) { CORE_ADDR rp; FRAME_SAVED_PC_IN_SIGTRAMP (frame, &rp); @@ -910,12 +911,12 @@ hppa_frame_saved_pc (struct frame_info *frame) register area to get the return pointer (the values in the registers may not correspond to anything useful). */ if (frame->next - && (frame->next->signal_handler_caller + && ((get_frame_type (frame->next) == SIGTRAMP_FRAME) || pc_in_interrupt_handler (frame->next->pc))) { struct frame_saved_regs saved_regs; - get_frame_saved_regs (frame->next, &saved_regs); + deprecated_get_frame_saved_regs (frame->next, &saved_regs); if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], TARGET_PTR_BIT / 8) & 0x2) { @@ -950,12 +951,12 @@ hppa_frame_saved_pc (struct frame_info *frame) information out of the saved register info. */ if (rp_offset == 0 && frame->next - && (frame->next->signal_handler_caller + && ((get_frame_type (frame->next) == SIGTRAMP_FRAME) || pc_in_interrupt_handler (frame->next->pc))) { struct frame_saved_regs saved_regs; - get_frame_saved_regs (frame->next, &saved_regs); + deprecated_get_frame_saved_regs (frame->next, &saved_regs); if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM], TARGET_PTR_BIT / 8) & 0x2) { @@ -1079,9 +1080,10 @@ init_extra_frame_info (int fromleaf, struct frame_info *frame) frame->frame = read_register (SP_REGNUM) - framesize; } -/* 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. +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. This may involve searching through prologues for several functions at boundaries where GCC calls HP C code, or where code which has @@ -1144,7 +1146,7 @@ frame_chain (struct frame_info *frame) frame_base = read_memory_integer (frame->frame + SP_REGNUM * 4, TARGET_PTR_BIT / 8); #ifdef FRAME_BASE_BEFORE_SIGTRAMP - else if (frame->signal_handler_caller) + else if ((get_frame_type (frame) == SIGTRAMP_FRAME)) { FRAME_BASE_BEFORE_SIGTRAMP (frame, &frame_base); } @@ -1215,7 +1217,7 @@ frame_chain (struct frame_info *frame) } if (u->Save_SP - || tmp_frame->signal_handler_caller + || (get_frame_type (tmp_frame) == SIGTRAMP_FRAME) || pc_in_interrupt_handler (tmp_frame->pc)) break; @@ -1226,7 +1228,7 @@ frame_chain (struct frame_info *frame) /* The unwind entry claims that r3 is saved here. However, in optimized code, GCC often doesn't actually save r3. We'll discover this if we look at the prologue. */ - get_frame_saved_regs (tmp_frame, &saved_regs); + deprecated_get_frame_saved_regs (tmp_frame, &saved_regs); saved_regs_frame = tmp_frame; /* If we have an address for r3, that's good. */ @@ -1240,7 +1242,7 @@ frame_chain (struct frame_info *frame) /* We may have walked down the chain into a function with a frame pointer. */ if (u->Save_SP - && !tmp_frame->signal_handler_caller + && !(get_frame_type (tmp_frame) == SIGTRAMP_FRAME) && !pc_in_interrupt_handler (tmp_frame->pc)) { return read_memory_integer (tmp_frame->frame, TARGET_PTR_BIT / 8); @@ -1275,7 +1277,7 @@ frame_chain (struct frame_info *frame) system call has a variable sized stack frame. */ if (tmp_frame != saved_regs_frame) - get_frame_saved_regs (tmp_frame, &saved_regs); + deprecated_get_frame_saved_regs (tmp_frame, &saved_regs); /* Abominable hack. */ if (current_target.to_has_execution == 0 @@ -1310,7 +1312,7 @@ frame_chain (struct frame_info *frame) tmp_frame = tmp_frame->next; if (tmp_frame != saved_regs_frame) - get_frame_saved_regs (tmp_frame, &saved_regs); + deprecated_get_frame_saved_regs (tmp_frame, &saved_regs); /* Abominable hack. See above. */ if (current_target.to_has_execution == 0 @@ -1388,7 +1390,7 @@ hppa_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) and doesn't "call" an interrupt routine or signal handler caller, then its not valid. */ if (u->Save_SP || u->Total_frame_size || u->stub_unwind.stub_type != 0 - || (thisframe->next && thisframe->next->signal_handler_caller) + || (thisframe->next && (get_frame_type (thisframe->next) == SIGTRAMP_FRAME)) || (next_u && next_u->HP_UX_interrupt_marker)) return 1; @@ -1532,8 +1534,8 @@ hppa_pop_frame (void) struct frame_saved_regs fsr; double freg_buffer; - fp = FRAME_FP (frame); - get_frame_saved_regs (frame, &fsr); + fp = get_frame_base (frame); + deprecated_get_frame_saved_regs (frame, &fsr); #ifndef NO_PC_SPACE_QUEUE_RESTORE if (fsr.regs[IPSW_REGNUM]) /* Restoring a call dummy frame */ @@ -1602,7 +1604,7 @@ hppa_pop_frame (void) for "return_command" will print the frame we returned to. */ sal = find_pc_line (target_pc, 0); sal.pc = target_pc; - breakpoint = set_momentary_breakpoint (sal, NULL, bp_finish); + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_finish); breakpoint->silent = 1; /* So we can clean things up. */ @@ -2510,7 +2512,7 @@ pa_do_registers_info (int regnum, int fpregs) /* Make a copy of gdb's save area (may cause actual reads from the target). */ for (i = 0; i < NUM_REGS; i++) - frame_register_read (selected_frame, i, raw_regs + REGISTER_BYTE (i)); + frame_register_read (deprecated_selected_frame, i, raw_regs + REGISTER_BYTE (i)); if (regnum == -1) pa_print_registers (raw_regs, regnum, fpregs); @@ -2554,7 +2556,7 @@ pa_do_strcat_registers_info (int regnum, int fpregs, struct ui_file *stream, /* Make a copy of gdb's save area (may cause actual reads from the target). */ for (i = 0; i < NUM_REGS; i++) - frame_register_read (selected_frame, i, raw_regs + REGISTER_BYTE (i)); + frame_register_read (deprecated_selected_frame, i, raw_regs + REGISTER_BYTE (i)); if (regnum == -1) pa_strcat_registers (raw_regs, regnum, fpregs, stream); @@ -2806,7 +2808,7 @@ pa_print_fp_reg (int i) char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; /* Get 32bits of data. */ - frame_register_read (selected_frame, i, raw_buffer); + frame_register_read (deprecated_selected_frame, i, raw_buffer); /* Put it in the buffer. No conversions are ever necessary. */ memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i)); @@ -2824,7 +2826,7 @@ pa_print_fp_reg (int i) if ((i % 2) == 0) { /* Get the data in raw format for the 2nd half. */ - frame_register_read (selected_frame, i + 1, raw_buffer); + frame_register_read (deprecated_selected_frame, i + 1, raw_buffer); /* Copy it into the appropriate part of the virtual buffer. */ memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buffer, @@ -2852,7 +2854,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream); /* Get 32bits of data. */ - frame_register_read (selected_frame, i, raw_buffer); + frame_register_read (deprecated_selected_frame, i, raw_buffer); /* Put it in the buffer. No conversions are ever necessary. */ memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i)); @@ -2863,7 +2865,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision) char raw_buf[MAX_REGISTER_RAW_SIZE]; /* Get the data in raw format for the 2nd half. */ - frame_register_read (selected_frame, i + 1, raw_buf); + frame_register_read (deprecated_selected_frame, i + 1, raw_buf); /* Copy it into the appropriate part of the virtual buffer. */ memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buf, REGISTER_RAW_SIZE (i)); @@ -3887,7 +3889,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info, #ifdef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP /* Handle signal handler callers. */ - if (frame_info->signal_handler_caller) + if ((get_frame_type (frame_info) == SIGTRAMP_FRAME)) { FRAME_FIND_SAVED_REGS_IN_SIGTRAMP (frame_info, frame_saved_regs); return; @@ -4892,6 +4894,20 @@ static struct gdbarch * hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; + enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; + + /* Try to determine the ABI of the object we are loading. */ + + if (info.abfd != NULL) + { + osabi = gdbarch_lookup_osabi (info.abfd); + if (osabi == GDB_OSABI_UNKNOWN) + { + /* If it's a SOM file, assume it's HP/UX SOM. */ + if (bfd_get_flavour (info.abfd) == bfd_target_som_flavour) + osabi = GDB_OSABI_HPUX_SOM; + } + } /* find a candidate among the list of pre-declared architectures. */ arches = gdbarch_list_lookup_by_info (arches, &info); @@ -4901,6 +4917,9 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* If none found, then allocate and initialize one. */ gdbarch = gdbarch_alloc (&info, NULL); + /* Hook in ABI-specific overrides, if they have been registered. */ + gdbarch_init_osabi (info, gdbarch, osabi); + return gdbarch; } diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index f10eb5a..84d1f3f 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -35,6 +35,12 @@ extern CORE_ADDR text_end; +extern int hpux_has_forked (int pid, int *childpid); +extern int hpux_has_vforked (int pid, int *childpid); +extern int hpux_has_execd (int pid, char **execd_pathname); +extern int hpux_has_syscall_event (int pid, enum target_waitkind *kind, + int *syscall_id); + static void fetch_register (int); void @@ -378,60 +384,131 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, return len; } +char *saved_child_execd_pathname = NULL; +int saved_vfork_pid; +enum { + STATE_NONE, + STATE_GOT_CHILD, + STATE_GOT_EXEC, + STATE_GOT_PARENT, + STATE_FAKE_EXEC +} saved_vfork_state = STATE_NONE; -void -child_post_follow_inferior_by_clone (void) +int +child_follow_fork (int follow_child) { - int status; + ptid_t last_ptid; + struct target_waitstatus last_status; + int has_vforked; + int parent_pid, child_pid; + + get_last_target_status (&last_ptid, &last_status); + has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED); + parent_pid = ptid_get_pid (last_ptid); + child_pid = last_status.value.related_pid; + + /* At this point, if we are vforking, breakpoints were already + detached from the child in child_wait; and the child has already + called execve(). If we are forking, both the parent and child + have breakpoints inserted. */ + + if (! follow_child) + { + if (! has_vforked) + { + detach_breakpoints (child_pid); +#ifdef SOLIB_REMOVE_INFERIOR_HOOK + SOLIB_REMOVE_INFERIOR_HOOK (child_pid); +#endif + } - /* This function is used when following both the parent and child - of a fork. In this case, the debugger clones itself. The original - debugger follows the parent, the clone follows the child. The - original detaches from the child, delivering a SIGSTOP to it to - keep it from running away until the clone can attach itself. + /* Detach from the child. */ + printf_unfiltered ("Detaching after fork from %s\n", + target_pid_to_str (pid_to_ptid (child_pid))); + hppa_require_detach (child_pid, 0); + + /* The parent and child of a vfork share the same address space. + Also, on some targets the order in which vfork and exec events + are received for parent in child requires some delicate handling + of the events. + + For instance, on ptrace-based HPUX we receive the child's vfork + event first, at which time the parent has been suspended by the + OS and is essentially untouchable until the child's exit or second + exec event arrives. At that time, the parent's vfork event is + delivered to us, and that's when we see and decide how to follow + the vfork. But to get to that point, we must continue the child + until it execs or exits. To do that smoothly, all breakpoints + must be removed from the child, in case there are any set between + the vfork() and exec() calls. But removing them from the child + also removes them from the parent, due to the shared-address-space + nature of a vfork'd parent and child. On HPUX, therefore, we must + take care to restore the bp's to the parent before we continue it. + Else, it's likely that we may not stop in the expected place. (The + worst scenario is when the user tries to step over a vfork() call; + the step-resume bp must be restored for the step to properly stop + in the parent after the call completes!) + + Sequence of events, as reported to gdb from HPUX: + + Parent Child Action for gdb to take + ------------------------------------------------------- + 1 VFORK Continue child + 2 EXEC + 3 EXEC or EXIT + 4 VFORK + + Now that the child has safely exec'd or exited, we must restore + the parent's breakpoints before we continue it. Else, we may + cause it run past expected stopping points. */ + + if (has_vforked) + reattach_breakpoints (parent_pid); + } + else + { + /* Needed to keep the breakpoint lists in sync. */ + if (! has_vforked) + detach_breakpoints (child_pid); - At this point, the clone has attached to the child. Because of - the SIGSTOP, we must now deliver a SIGCONT to the child, or it - won't behave properly. */ - status = kill (PIDGET (inferior_ptid), SIGCONT); -} + /* Before detaching from the parent, remove all breakpoints from it. */ + remove_breakpoints (); + /* Also reset the solib inferior hook from the parent. */ +#ifdef SOLIB_REMOVE_INFERIOR_HOOK + SOLIB_REMOVE_INFERIOR_HOOK (PIDGET (inferior_ptid)); +#endif -void -child_post_follow_vfork (int parent_pid, int followed_parent, int child_pid, - int followed_child) -{ - /* Are we a debugger that followed the parent of a vfork? If so, - then recall that the child's vfork event was delivered to us - first. And, that the parent was suspended by the OS until the - child's exec or exit events were received. - - Upon receiving that child vfork, then, we were forced to remove - all breakpoints in the child and continue it so that it could - reach the exec or exit point. - - But also recall that the parent and child of a vfork share the - same address space. Thus, removing bp's in the child also - removed them from the parent. - - Now that the child has safely exec'd or exited, we must restore - the parent's breakpoints before we continue it. Else, we may - cause it run past expected stopping points. */ - if (followed_parent) - { - reattach_breakpoints (parent_pid); + /* Detach from the parent. */ + target_detach (NULL, 1); + + /* Attach to the child. */ + printf_unfiltered ("Attaching after fork to %s\n", + target_pid_to_str (pid_to_ptid (child_pid))); + hppa_require_attach (child_pid); + inferior_ptid = pid_to_ptid (child_pid); + + /* If we vforked, then we've also execed by now. The exec will be + reported momentarily. follow_exec () will handle breakpoints, so + we don't have to.. */ + if (!has_vforked) + follow_inferior_reset_breakpoints (); } - /* Are we a debugger that followed the child of a vfork? If so, - then recall that we don't actually acquire control of the child - until after it has exec'd or exited. */ - if (followed_child) + if (has_vforked) { - /* If the child has exited, then there's nothing for us to do. - In the case of an exec event, we'll let that be handled by - the normal mechanism that notices and handles exec events, in - resume(). */ + /* If we followed the parent, don't try to follow the child's exec. */ + if (saved_vfork_state != STATE_GOT_PARENT + && saved_vfork_state != STATE_FAKE_EXEC) + fprintf_unfiltered (gdb_stdout, + "hppa: post follow vfork: confused state\n"); + + if (! follow_child || saved_vfork_state == STATE_GOT_PARENT) + saved_vfork_state = STATE_NONE; + else + return 1; } + return 0; } /* Format a process id, given PID. Be sure to terminate @@ -469,6 +546,221 @@ hppa_tid_to_str (ptid_t ptid) return buf; } +/*## */ +/* Enable HACK for ttrace work. In + * infttrace.c/require_notification_of_events, + * this is set to 0 so that the loop in child_wait + * won't loop. + */ +int not_same_real_pid = 1; +/*## */ + +/* Wait for child to do something. Return pid of child, or -1 in case + of error; store status through argument pointer OURSTATUS. */ + +ptid_t +child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) +{ + int save_errno; + int status; + char *execd_pathname = NULL; + int exit_status; + int related_pid; + int syscall_id; + enum target_waitkind kind; + int pid; + + if (saved_vfork_state == STATE_FAKE_EXEC) + { + saved_vfork_state = STATE_NONE; + ourstatus->kind = TARGET_WAITKIND_EXECD; + ourstatus->value.execd_pathname = saved_child_execd_pathname; + return inferior_ptid; + } + + do + { + set_sigint_trap (); /* Causes SIGINT to be passed on to the + attached process. */ + set_sigio_trap (); + + pid = ptrace_wait (inferior_ptid, &status); + + save_errno = errno; + + clear_sigio_trap (); + + clear_sigint_trap (); + + if (pid == -1) + { + if (save_errno == EINTR) + continue; + + fprintf_unfiltered (gdb_stderr, "Child process unexpectedly missing: %s.\n", + safe_strerror (save_errno)); + + /* Claim it exited with unknown signal. */ + ourstatus->kind = TARGET_WAITKIND_SIGNALLED; + ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; + return pid_to_ptid (-1); + } + + /* Did it exit? + */ + if (target_has_exited (pid, status, &exit_status)) + { + /* ??rehrauer: For now, ignore this. */ + continue; + } + + if (!target_thread_alive (pid_to_ptid (pid))) + { + ourstatus->kind = TARGET_WAITKIND_SPURIOUS; + return pid_to_ptid (pid); + } + + if (hpux_has_forked (pid, &related_pid)) + { + /* Ignore the parent's fork event. */ + if (pid == PIDGET (inferior_ptid)) + { + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return inferior_ptid; + } + + /* If this is the child's fork event, report that the + process has forked. */ + if (related_pid == PIDGET (inferior_ptid)) + { + ourstatus->kind = TARGET_WAITKIND_FORKED; + ourstatus->value.related_pid = pid; + return inferior_ptid; + } + } + + if (hpux_has_vforked (pid, &related_pid)) + { + if (pid == PIDGET (inferior_ptid)) + { + if (saved_vfork_state == STATE_GOT_CHILD) + saved_vfork_state = STATE_GOT_PARENT; + else if (saved_vfork_state == STATE_GOT_EXEC) + saved_vfork_state = STATE_FAKE_EXEC; + else + fprintf_unfiltered (gdb_stdout, + "hppah: parent vfork: confused\n"); + } + else if (related_pid == PIDGET (inferior_ptid)) + { + if (saved_vfork_state == STATE_NONE) + saved_vfork_state = STATE_GOT_CHILD; + else + fprintf_unfiltered (gdb_stdout, + "hppah: child vfork: confused\n"); + } + else + fprintf_unfiltered (gdb_stdout, + "hppah: unknown vfork: confused\n"); + + if (saved_vfork_state == STATE_GOT_CHILD) + { + child_post_startup_inferior (pid_to_ptid (pid)); + detach_breakpoints (pid); +#ifdef SOLIB_REMOVE_INFERIOR_HOOK + SOLIB_REMOVE_INFERIOR_HOOK (pid); +#endif + child_resume (pid_to_ptid (pid), 0, TARGET_SIGNAL_0); + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return pid_to_ptid (related_pid); + } + else if (saved_vfork_state == STATE_FAKE_EXEC) + { + ourstatus->kind = TARGET_WAITKIND_VFORKED; + ourstatus->value.related_pid = related_pid; + return pid_to_ptid (pid); + } + else + { + /* We saw the parent's vfork, but we haven't seen the exec yet. + Wait for it, for simplicity's sake. It should be pending. */ + saved_vfork_pid = related_pid; + ourstatus->kind = TARGET_WAITKIND_IGNORE; + return pid_to_ptid (pid); + } + } + + if (hpux_has_execd (pid, &execd_pathname)) + { + /* On HP-UX, events associated with a vforking inferior come in + threes: a vfork event for the child (always first), followed + a vfork event for the parent and an exec event for the child. + The latter two can come in either order. Make sure we get + both. */ + if (saved_vfork_state != STATE_NONE) + { + if (saved_vfork_state == STATE_GOT_CHILD) + { + saved_vfork_state = STATE_GOT_EXEC; + /* On HP/UX with ptrace, the child must be resumed before + the parent vfork event is delivered. A single-step + suffices. */ + if (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK ()) + target_resume (pid_to_ptid (pid), 1, TARGET_SIGNAL_0); + ourstatus->kind = TARGET_WAITKIND_IGNORE; + } + else if (saved_vfork_state == STATE_GOT_PARENT) + { + saved_vfork_state = STATE_FAKE_EXEC; + ourstatus->kind = TARGET_WAITKIND_VFORKED; + ourstatus->value.related_pid = saved_vfork_pid; + } + else + fprintf_unfiltered (gdb_stdout, + "hppa: exec: unexpected state\n"); + + saved_child_execd_pathname = execd_pathname; + + return inferior_ptid; + } + + /* Are we ignoring initial exec events? (This is likely because + we're in the process of starting up the inferior, and another + (older) mechanism handles those.) If so, we'll report this + as a regular stop, not an exec. + */ + if (inferior_ignoring_startup_exec_events) + { + inferior_ignoring_startup_exec_events--; + } + else + { + ourstatus->kind = TARGET_WAITKIND_EXECD; + ourstatus->value.execd_pathname = execd_pathname; + return pid_to_ptid (pid); + } + } + + /* All we must do with these is communicate their occurrence + to wait_for_inferior... + */ + if (hpux_has_syscall_event (pid, &kind, &syscall_id)) + { + ourstatus->kind = kind; + ourstatus->value.syscall_id = syscall_id; + return pid_to_ptid (pid); + } + + /*## } while (pid != PIDGET (inferior_ptid)); ## *//* Some other child died or stopped */ +/* hack for thread testing */ + } + while ((pid != PIDGET (inferior_ptid)) && not_same_real_pid); +/*## */ + + store_waitstatus (ourstatus, status); + return pid_to_ptid (pid); +} + #if !defined (GDB_NATIVE_HPUX_11) /* The following code is a substitute for the infttrace.c versions used @@ -890,7 +1182,7 @@ child_remove_vfork_catchpoint (int pid) } int -child_has_forked (int pid, int *childpid) +hpux_has_forked (int pid, int *childpid) { /* This request is only available on HPUX 10.0 and later. */ #if !defined(PT_GET_PROCESS_STATE) @@ -921,7 +1213,7 @@ child_has_forked (int pid, int *childpid) } int -child_has_vforked (int pid, int *childpid) +hpux_has_vforked (int pid, int *childpid) { /* This request is only available on HPUX 10.0 and later. */ #if !defined(PT_GET_PROCESS_STATE) @@ -953,13 +1245,6 @@ child_has_vforked (int pid, int *childpid) } int -child_can_follow_vfork_prior_to_exec (void) -{ - /* ptrace doesn't allow this. */ - return 0; -} - -int child_insert_exec_catchpoint (int pid) { /* This request is only available on HPUX 10.0 and later. */ @@ -990,7 +1275,7 @@ child_remove_exec_catchpoint (int pid) } int -child_has_execd (int pid, char **execd_pathname) +hpux_has_execd (int pid, char **execd_pathname) { /* This request is only available on HPUX 10.0 and later. */ #if !defined(PT_GET_PROCESS_STATE) @@ -1029,7 +1314,7 @@ child_reported_exec_events_per_exec_call (void) } int -child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) +hpux_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) { /* This request is only available on HPUX 10.30 and later, via the ttrace interface. */ diff --git a/gdb/hpread.c b/gdb/hpread.c index 4c3bed9..602a97d 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -98,7 +98,8 @@ struct hpread_symfile_info *NAMEP = ""; \ else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \ { \ - complain (&string_table_offset_complaint, (char *) symnum); \ + complaint (&symfile_complaints, "bad string table offset in symbol %d", \ + (char *) symnum); \ *NAMEP = ""; \ } \ else \ @@ -127,57 +128,20 @@ struct symloc #define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen) #define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private)) -/* FIXME: Shouldn't this stuff be in a .h file somewhere? */ /* Complaints about the symbols we have encountered. */ -extern struct deprecated_complaint string_table_offset_complaint; -extern struct deprecated_complaint lbrac_unmatched_complaint; -extern struct deprecated_complaint lbrac_mismatch_complaint; - -static struct deprecated_complaint hpread_unhandled_end_common_complaint = -{ - "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n", 0, 0 -}; - -static struct deprecated_complaint hpread_unhandled_type_complaint = -{ - "hpread_type_translate: unhandled type code.", 0, 0 -}; - -static struct deprecated_complaint hpread_struct_complaint = -{ - "hpread_read_struct_type: expected SVAR type...", 0, 0 -}; - -static struct deprecated_complaint hpread_array_complaint = -{ - "error in hpread_array_type.", 0, 0 -}; - -static struct deprecated_complaint hpread_type_lookup_complaint = -{ - "error in hpread_type_lookup().", 0, 0 -}; - - -static struct deprecated_complaint hpread_unexpected_end_complaint = -{ - "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.", 0, 0 -}; - -static struct deprecated_complaint hpread_tagdef_complaint = -{ - "error processing class tagdef", 0, 0 -}; - -static struct deprecated_complaint hpread_unhandled_common_complaint = +static void +lbrac_unmatched_complaint (int arg1) { - "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON.", 0, 0 -}; + complaint (&symfile_complaints, "unmatched N_LBRAC before symtab pos %d", + arg1); +} -static struct deprecated_complaint hpread_unhandled_blockdata_complaint = +static void +lbrac_mismatch_complaint (int arg1) { - "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA.", 0, 0 -}; + complaint (&symfile_complaints, + "N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", arg1); +} /* To generate dumping code, uncomment this define. The dumping itself is controlled by routine-local statics called "dumping". */ @@ -220,6 +184,8 @@ static unsigned long hpread_get_line (sltpointer, struct objfile *); static CORE_ADDR hpread_get_location (sltpointer, struct objfile *); +int hpread_has_name (enum dntt_entry_type kind); + static void hpread_psymtab_to_symtab_1 (struct partial_symtab *); void hpread_psymtab_to_symtab (struct partial_symtab *); @@ -596,11 +562,11 @@ pst_syms_struct; static pst_syms_struct *pst_syms_array = 0; -static pst_syms_count = 0; -static pst_syms_size = 0; +static int pst_syms_count = 0; +static int pst_syms_size = 0; /* used by the TELL_OBJFILE macro */ -static boolean told_objfile = 0; +static int told_objfile = 0; /* Set up psymtab symbol index stuff */ static void @@ -4772,7 +4738,7 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile) dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile); else { - complain (&hpread_type_lookup_complaint); + complaint (&symfile_complaints, "error in hpread_type_lookup()."); return NULL; } @@ -5266,7 +5232,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* Stack must be empty now. */ if (context_stack_depth != 0) - complain (&lbrac_unmatched_complaint, (char *) symnum); + lbrac_unmatched_complaint ((char *) symnum); new = push_context (0, valu); /* Built a type for the function. This includes processing @@ -5384,7 +5350,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, CURRENT_FUNCTION_VALUE (objfile) = valu; /* Stack must be empty now. */ if (context_stack_depth != 0) - complain (&lbrac_unmatched_complaint, (char *) symnum); + lbrac_unmatched_complaint ((char *) symnum); new = push_context (0, valu); /* Built a type for the function. This includes processing @@ -5612,7 +5578,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, new = pop_context (); desc = dn_bufp->dend.beginscope.dnttp.index; if (desc != new->depth) - complain (&lbrac_mismatch_complaint, (char *) symnum); + lbrac_mismatch_complaint ((char *) symnum); /* Make a block for the local symbols within. */ finish_block (new->name, &local_symbols, new->old_blocks, @@ -5630,7 +5596,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, case DNTT_TYPE_COMMON: /* End a FORTRAN common block. We don't currently handle these */ - complain (&hpread_unhandled_end_common_complaint); + complaint (&symfile_complaints, + "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n"); break; case DNTT_TYPE_CLASS_SCOPE: @@ -5647,7 +5614,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, new = pop_context (); desc = dn_bufp->dend.beginscope.dnttp.index; if (desc != new->depth) - complain (&lbrac_mismatch_complaint, (char *) symnum); + lbrac_mismatch_complaint ((char *) symnum); /* Make a block for the local symbols within. */ finish_block (new->name, &local_symbols, new->old_blocks, new->start_addr, valu, objfile); @@ -5657,7 +5624,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, break; default: - complain (&hpread_unexpected_end_complaint); + complaint (&symfile_complaints, + "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind."); break; } break; @@ -5879,7 +5847,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, dn_bufp = hpread_get_lntt (dn_bufp->dtag.type.dnttp.index, objfile); else { - complain (&hpread_tagdef_complaint); + complaint (&symfile_complaints, "error processing class tagdef"); return; } if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS || @@ -5987,7 +5955,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, case DNTT_TYPE_COMMON: /* FORTRAN common. Not yet handled. */ - complain (&hpread_unhandled_common_complaint); + complaint (&symfile_complaints, + "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON."); break; /* DNTT_TYPE_COBSTRUCT is not handled by GDB. */ @@ -5999,7 +5968,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* Not sure what this is - part of FORTRAN support maybe? * Anyway, not yet handled. */ - complain (&hpread_unhandled_blockdata_complaint); + complaint (&symfile_complaints, + "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA."); break; case DNTT_TYPE_CLASS_SCOPE: diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c index ff310ec..f8252e2 100644 --- a/gdb/i386-interix-tdep.c +++ b/gdb/i386-interix-tdep.c @@ -117,12 +117,6 @@ i386_interix_skip_trampoline_code (CORE_ADDR pc) return i386_pe_skip_trampoline_code (pc, 0); } -static void -i386_interix_init_frame_pc (int fromleaf, struct frame_info *prev) -{ - /* Nothing to do on Interix. */ -} - static int i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) { @@ -131,16 +125,16 @@ i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) be a signal handler caller). If we're dealing with a signal handler caller, this will return valid, which is fine. If not, it'll make the correct test. */ - return (thisframe->signal_handler_caller + return ((get_frame_type (thisframe) == SIGTRAMP_FRAME) || (chain != 0 && !inside_entry_file (read_memory_integer (thisframe->frame + 4, 4)))); } -/* We want to find the previous frame, which on Interix is tricky when signals - are involved; set frame->frame appropriately, and also get the pc - and tweak signal_handler_caller; this replaces a boatload of nested - macros, as well. */ +/* We want to find the previous frame, which on Interix is tricky when + signals are involved; set frame->frame appropriately, and also get + the pc and tweak tye frame's type; this replaces a boatload of + nested macros, as well. */ static void i386_interix_back_one_frame (int fromleaf, struct frame_info *frame) { @@ -169,7 +163,7 @@ i386_interix_back_one_frame (int fromleaf, struct frame_info *frame) NullApi or something else? */ ra = SAVED_PC_AFTER_CALL (frame); if (ra >= null_start && ra < null_end) - frame->signal_handler_caller = 1; + deprecated_set_frame_type (frame, SIGTRAMP_FRAME); /* There might also be an indirect call to the mini-frame, putting one more return address on the stack. (XP only, I think?) This can't (reasonably) return the address of the @@ -177,12 +171,12 @@ i386_interix_back_one_frame (int fromleaf, struct frame_info *frame) is safe. */ ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4); if (ra >= null_start && ra < null_end) - frame->signal_handler_caller = 1; + deprecated_set_frame_type (frame, SIGTRAMP_FRAME); } return; } - if (!frame->next->signal_handler_caller) + if (!(get_frame_type (frame->next) == SIGTRAMP_FRAME)) { frame->pc = read_memory_integer (frame->next->frame + 4, 4); return; @@ -316,7 +310,7 @@ i386_interix_frame_saved_pc (struct frame_info *fi) /* Assume that we've already unwound enough to have the caller's address if we're dealing with a signal handler caller (And if that fails, return 0). */ - if (fi->signal_handler_caller) + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) return fi->next ? fi->next->pc : 0; else return read_memory_integer (fi->frame + 4, 4); @@ -337,7 +331,7 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_skip_trampoline_code (gdbarch, i386_interix_skip_trampoline_code); set_gdbarch_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); - set_gdbarch_init_frame_pc (gdbarch, i386_interix_init_frame_pc); + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc); set_gdbarch_name_of_malloc (gdbarch, "_malloc"); @@ -360,6 +354,6 @@ _initialize_i386_interix_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, i386_interix_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_INTERIX, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_INTERIX, i386_interix_init_abi); } diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index f35c4ff..1ef14fc 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -482,6 +482,6 @@ extern void _initialize_i386_linux_tdep (void); void _initialize_i386_linux_tdep (void) { - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LINUX, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX, i386_linux_init_abi); } diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c index c72a7ed..792923c 100644 --- a/gdb/i386-sol2-tdep.c +++ b/gdb/i386-sol2-tdep.c @@ -75,6 +75,6 @@ _initialize_i386_sol2_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, i386_sol2_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SOLARIS, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SOLARIS, i386_sol2_init_abi); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index d658e3a..9d50879 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -38,6 +38,7 @@ #include "value.h" #include "gdb_assert.h" #include "reggroups.h" +#include "dummy-frame.h" #include "i386-tdep.h" #include "i387-tdep.h" @@ -472,17 +473,16 @@ i386_get_frame_setup (CORE_ADDR pc) frame -- that is, the frame which was in progress when the signal trampoline was entered. GDB mostly treats this frame pointer value as a magic cookie. We detect the case of a signal trampoline by - looking at the SIGNAL_HANDLER_CALLER field, which is set based on - PC_IN_SIGTRAMP. + testing for get_frame_type() == SIGTRAMP_FRAME, which is set based + on PC_IN_SIGTRAMP. When a signal trampoline is invoked from a frameless function, we essentially have two frameless functions in a row. In this case, we use the same magic cookie for three frames in a row. We detect - this case by seeing whether the next frame has - SIGNAL_HANDLER_CALLER set, and, if it does, checking whether the - current frame is actually frameless. In this case, we need to get - the PC by looking at the SP register value stored in the signal - context. + this case by seeing whether the next frame is a SIGTRAMP_FRAME, + and, if it does, checking whether the current frame is actually + frameless. In this case, we need to get the PC by looking at the + SP register value stored in the signal context. This should work in most cases except in horrible situations where a signal occurs just as we enter a function but before the frame @@ -498,7 +498,7 @@ i386_get_frame_setup (CORE_ADDR pc) int i386_frameless_signal_p (struct frame_info *frame) { - return (frame->next && frame->next->signal_handler_caller + return (frame->next && get_frame_type (frame->next) == SIGTRAMP_FRAME && (frameless_look_for_prologue (frame) || frame->pc == get_pc_function_start (frame->pc))); } @@ -510,10 +510,10 @@ i386_frameless_signal_p (struct frame_info *frame) static CORE_ADDR i386_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (pc_in_dummy_frame (frame->pc)) return frame->frame; - if (frame->signal_handler_caller + if (get_frame_type (frame) == SIGTRAMP_FRAME || i386_frameless_signal_p (frame)) return frame->frame; @@ -530,7 +530,7 @@ i386_frame_chain (struct frame_info *frame) static int i386_frameless_function_invocation (struct frame_info *frame) { - if (frame->signal_handler_caller) + if (get_frame_type (frame) == SIGTRAMP_FRAME) return 0; return frameless_look_for_prologue (frame); @@ -567,7 +567,7 @@ i386_sigtramp_saved_sp (struct frame_info *frame) static CORE_ADDR i386_frame_saved_pc (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (pc_in_dummy_frame (frame->pc)) { ULONGEST pc; @@ -575,7 +575,7 @@ i386_frame_saved_pc (struct frame_info *frame) return pc; } - if (frame->signal_handler_caller) + if (get_frame_type (frame) == SIGTRAMP_FRAME) return i386_sigtramp_saved_pc (frame); if (i386_frameless_signal_p (frame)) @@ -592,7 +592,7 @@ i386_frame_saved_pc (struct frame_info *frame) static CORE_ADDR i386_saved_pc_after_call (struct frame_info *frame) { - if (frame->signal_handler_caller) + if (get_frame_type (frame) == SIGTRAMP_FRAME) return i386_sigtramp_saved_pc (frame); return read_memory_unsigned_integer (read_register (SP_REGNUM), 4); @@ -861,7 +861,7 @@ i386_do_pop_frame (struct frame_info *frame) int regnum; char regbuf[I386_MAX_REGISTER_SIZE]; - fp = FRAME_FP (frame); + fp = get_frame_base (frame); i386_frame_init_saved_regs (frame); for (regnum = 0; regnum < NUM_REGS; regnum++) @@ -1520,6 +1520,10 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->osabi = osabi; /* The i386 default settings don't include the SSE registers. @@ -1578,10 +1582,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); - /* Call dummy code. */ - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); @@ -1598,10 +1599,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) i386_register_convert_to_virtual); set_gdbarch_register_convert_to_raw (gdbarch, i386_register_convert_to_raw); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); - - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); - /* "An argument's size is increased, if necessary, to make it a multiple of [32-bit] words. This may require tail padding, depending on the size of the argument" -- from the x86 ABI. */ @@ -1639,8 +1636,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_chain (gdbarch, i386_frame_chain); set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, i386_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_saved_pc_after_call (gdbarch, i386_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, i386_frame_num_args); set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp); @@ -1720,11 +1715,11 @@ are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".", gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_nlm_flavour, i386_nlm_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SVR4, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SVR4, i386_svr4_init_abi); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_GO32, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_GO32, i386_go32_init_abi); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETWARE, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETWARE, i386_nw_init_abi); /* Initialize the i386 specific register groups. */ diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c deleted file mode 100644 index 3cca5e4..0000000 --- a/gdb/i386aix-nat.c +++ /dev/null @@ -1,377 +0,0 @@ -// OBSOLETE /* Intel 386 native support. -// OBSOLETE Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, -// OBSOLETE 2000, 2001 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "language.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #ifdef USG -// OBSOLETE #include -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include "gdb_stat.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* Does AIX define this in ? */ -// OBSOLETE extern int errno; -// OBSOLETE -// OBSOLETE #ifdef HAVE_SYS_REG_H -// OBSOLETE #include -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include "floatformat.h" -// OBSOLETE -// OBSOLETE #include "target.h" -// OBSOLETE -// OBSOLETE static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); -// OBSOLETE -// OBSOLETE -// OBSOLETE /* this table must line up with REGISTER_NAMES in tm-i386v.h */ -// OBSOLETE /* symbols like 'EAX' come from */ -// OBSOLETE static int regmap[] = -// OBSOLETE { -// OBSOLETE EAX, ECX, EDX, EBX, -// OBSOLETE USP, EBP, ESI, EDI, -// OBSOLETE EIP, EFL, CS, SS, -// OBSOLETE DS, ES, FS, GS, -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* blockend is the value of u.u_ar0, and points to the -// OBSOLETE * place where GS is stored -// OBSOLETE */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE i386_register_u_addr (int blockend, int regnum) -// OBSOLETE { -// OBSOLETE #if 0 -// OBSOLETE /* this will be needed if fp registers are reinstated */ -// OBSOLETE /* for now, you can look at them with 'info float' -// OBSOLETE * sys5 wont let you change them with ptrace anyway -// OBSOLETE */ -// OBSOLETE if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM) -// OBSOLETE { -// OBSOLETE int ubase, fpstate; -// OBSOLETE struct user u; -// OBSOLETE ubase = blockend + 4 * (SS + 1) - KSTKSZ; -// OBSOLETE fpstate = ubase + ((char *) &u.u_fpstate - (char *) &u); -// OBSOLETE return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM)); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE #endif -// OBSOLETE return (blockend + 4 * regmap[regnum]); -// OBSOLETE -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The code below only work on the aix ps/2 (i386-ibm-aix) - -// OBSOLETE * mtranle@paris - Sat Apr 11 10:34:12 1992 -// OBSOLETE */ -// OBSOLETE -// OBSOLETE struct env387 -// OBSOLETE { -// OBSOLETE unsigned short control; -// OBSOLETE unsigned short r0; -// OBSOLETE unsigned short status; -// OBSOLETE unsigned short r1; -// OBSOLETE unsigned short tag; -// OBSOLETE unsigned short r2; -// OBSOLETE unsigned long eip; -// OBSOLETE unsigned short code_seg; -// OBSOLETE unsigned short opcode; -// OBSOLETE unsigned long operand; -// OBSOLETE unsigned short operand_seg; -// OBSOLETE unsigned short r3; -// OBSOLETE unsigned char regs[8][10]; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static -// OBSOLETE print_387_status (unsigned short status, struct env387 *ep) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE int bothstatus; -// OBSOLETE int top; -// OBSOLETE int fpreg; -// OBSOLETE unsigned char *p; -// OBSOLETE -// OBSOLETE bothstatus = ((status != 0) && (ep->status != 0)); -// OBSOLETE if (status != 0) -// OBSOLETE { -// OBSOLETE if (bothstatus) -// OBSOLETE printf_unfiltered ("u: "); -// OBSOLETE print_387_status_word (status); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (ep->status != 0) -// OBSOLETE { -// OBSOLETE if (bothstatus) -// OBSOLETE printf_unfiltered ("e: "); -// OBSOLETE print_387_status_word (ep->status); -// OBSOLETE } -// OBSOLETE -// OBSOLETE print_387_control_word (ep->control); -// OBSOLETE printf_unfiltered ("last exception: "); -// OBSOLETE printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); -// OBSOLETE printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); -// OBSOLETE printf_unfiltered ("%s; ", local_hex_string (ep->eip)); -// OBSOLETE printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); -// OBSOLETE printf_unfiltered (":%s\n", local_hex_string (ep->operand)); -// OBSOLETE -// OBSOLETE top = ((ep->status >> 11) & 7); -// OBSOLETE -// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n"); -// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--) -// OBSOLETE { -// OBSOLETE double val; -// OBSOLETE -// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); -// OBSOLETE -// OBSOLETE switch ((ep->tag >> ((7 - fpreg) * 2)) & 3) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE printf_unfiltered ("valid "); -// OBSOLETE break; -// OBSOLETE case 1: -// OBSOLETE printf_unfiltered ("zero "); -// OBSOLETE break; -// OBSOLETE case 2: -// OBSOLETE printf_unfiltered ("trap "); -// OBSOLETE break; -// OBSOLETE case 3: -// OBSOLETE printf_unfiltered ("empty "); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE for (i = 9; i >= 0; i--) -// OBSOLETE printf_unfiltered ("%02x", ep->regs[fpreg][i]); -// OBSOLETE -// OBSOLETE i387_to_double ((char *) ep->regs[fpreg], (char *) &val); -// OBSOLETE printf_unfiltered (" %#g\n", val); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct env387 core_env387; -// OBSOLETE -// OBSOLETE void -// OBSOLETE i386_float_info (void) -// OBSOLETE { -// OBSOLETE struct env387 fps; -// OBSOLETE int fpsaved = 0; -// OBSOLETE /* We need to reverse the order of the registers. Apparently AIX stores -// OBSOLETE the highest-numbered ones first. */ -// OBSOLETE struct env387 fps_fixed; -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE if (! ptid_equal (inferior_ptid, null_ptid)) -// OBSOLETE { -// OBSOLETE char buf[10]; -// OBSOLETE unsigned short status; -// OBSOLETE -// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, -// OBSOLETE offsetof (struct env387, status)); -// OBSOLETE memcpy (&status, buf, sizeof (status)); -// OBSOLETE fpsaved = status; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if ((fpsaved = core_env387.status) != 0) -// OBSOLETE memcpy (&fps, &core_env387, sizeof (fps)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (fpsaved == 0) -// OBSOLETE { -// OBSOLETE printf_unfiltered ("no floating point status saved\n"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (! ptid_equal (inferior_ptid, null_ptid)) -// OBSOLETE { -// OBSOLETE int offset; -// OBSOLETE for (offset = 0; offset < sizeof (fps); offset += 10) -// OBSOLETE { -// OBSOLETE char buf[10]; -// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, offset); -// OBSOLETE memcpy ((char *) &fps.control + offset, buf, -// OBSOLETE MIN (10, sizeof (fps) - offset)); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE fps_fixed = fps; -// OBSOLETE for (i = 0; i < 8; ++i) -// OBSOLETE memcpy (fps_fixed.regs[i], fps.regs[7 - i], 10); -// OBSOLETE print_387_status (0, &fps_fixed); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Fetch one register. */ -// OBSOLETE static void -// OBSOLETE fetch_register (int regno) -// OBSOLETE { -// OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE if (regno < FP0_REGNUM) -// OBSOLETE *(int *) buf = ptrace (PT_READ_GPR, PIDGET (inferior_ptid), -// OBSOLETE PT_REG (regmap[regno]), 0, 0); -// OBSOLETE else -// OBSOLETE ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, -// OBSOLETE (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); -// OBSOLETE supply_register (regno, buf); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE fetch_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE if (regno < 0) -// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) -// OBSOLETE fetch_register (regno); -// OBSOLETE else -// OBSOLETE fetch_register (regno); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* store one register */ -// OBSOLETE static void -// OBSOLETE store_register (int regno) -// OBSOLETE { -// OBSOLETE char buf[80]; -// OBSOLETE errno = 0; -// OBSOLETE if (regno < FP0_REGNUM) -// OBSOLETE ptrace (PT_WRITE_GPR, PIDGET (inferior_ptid), PT_REG (regmap[regno]), -// OBSOLETE *(int *) ®isters[REGISTER_BYTE (regno)], 0); -// OBSOLETE else -// OBSOLETE ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid), -// OBSOLETE ®isters[REGISTER_BYTE (regno)], -// OBSOLETE (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs)); -// OBSOLETE -// OBSOLETE if (errno != 0) -// OBSOLETE { -// OBSOLETE sprintf (buf, "writing register number %d", regno); -// OBSOLETE perror_with_name (buf); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store our register values back into the inferior. -// OBSOLETE If REGNO is -1, do this for all registers. -// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ -// OBSOLETE void -// OBSOLETE store_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE if (regno < 0) -// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) -// OBSOLETE store_register (regno); -// OBSOLETE else -// OBSOLETE store_register (regno); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #ifndef CD_AX /* defined in sys/i386/coredump.h */ -// OBSOLETE #define CD_AX 0 -// OBSOLETE #define CD_BX 1 -// OBSOLETE #define CD_CX 2 -// OBSOLETE #define CD_DX 3 -// OBSOLETE #define CD_SI 4 -// OBSOLETE #define CD_DI 5 -// OBSOLETE #define CD_BP 6 -// OBSOLETE #define CD_SP 7 -// OBSOLETE #define CD_FL 8 -// OBSOLETE #define CD_IP 9 -// OBSOLETE #define CD_CS 10 -// OBSOLETE #define CD_DS 11 -// OBSOLETE #define CD_ES 12 -// OBSOLETE #define CD_FS 13 -// OBSOLETE #define CD_GS 14 -// OBSOLETE #define CD_SS 15 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * The order here in core_regmap[] has to be the same as in -// OBSOLETE * regmap[] above. -// OBSOLETE */ -// OBSOLETE static int core_regmap[] = -// OBSOLETE { -// OBSOLETE CD_AX, CD_CX, CD_DX, CD_BX, -// OBSOLETE CD_SP, CD_BP, CD_SI, CD_DI, -// OBSOLETE CD_IP, CD_FL, CD_CS, CD_SS, -// OBSOLETE CD_DS, CD_ES, CD_FS, CD_GS, -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Provide registers to GDB from a core file. -// OBSOLETE -// OBSOLETE CORE_REG_SECT points to an array of bytes, which were obtained from -// OBSOLETE a core file which BFD thinks might contain register contents. -// OBSOLETE CORE_REG_SIZE is its size. -// OBSOLETE -// OBSOLETE WHICH says which register set corelow suspects this is: -// OBSOLETE 0 --- the general-purpose register set -// OBSOLETE 2 --- the floating-point register set -// OBSOLETE -// OBSOLETE REG_ADDR isn't used. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, -// OBSOLETE int which, CORE_ADDR reg_addr) -// OBSOLETE { -// OBSOLETE -// OBSOLETE if (which == 0) -// OBSOLETE { -// OBSOLETE /* Integer registers */ -// OBSOLETE -// OBSOLETE #define cd_regs(n) ((int *)core_reg_sect)[n] -// OBSOLETE #define regs(n) *((int *) ®isters[REGISTER_BYTE (n)]) -// OBSOLETE -// OBSOLETE int i; -// OBSOLETE for (i = 0; i < FP0_REGNUM; i++) -// OBSOLETE regs (i) = cd_regs (core_regmap[i]); -// OBSOLETE } -// OBSOLETE else if (which == 2) -// OBSOLETE { -// OBSOLETE /* Floating point registers */ -// OBSOLETE -// OBSOLETE if (core_reg_size >= sizeof (core_env387)) -// OBSOLETE memcpy (&core_env387, core_reg_sect, core_reg_size); -// OBSOLETE else -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n"); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Register that we are able to handle i386aix core file formats. -// OBSOLETE FIXME: is this really bfd_target_unknown_flavour? */ -// OBSOLETE -// OBSOLETE static struct core_fns i386aix_core_fns = -// OBSOLETE { -// OBSOLETE bfd_target_unknown_flavour, /* core_flavour */ -// OBSOLETE default_check_format, /* check_format */ -// OBSOLETE default_core_sniffer, /* core_sniffer */ -// OBSOLETE fetch_core_registers, /* core_read_registers */ -// OBSOLETE NULL /* next */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_core_i386aix (void) -// OBSOLETE { -// OBSOLETE add_core_fns (&i386aix_core_fns); -// OBSOLETE } diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c index a760123..77a4eec 100644 --- a/gdb/i386bsd-tdep.c +++ b/gdb/i386bsd-tdep.c @@ -195,8 +195,8 @@ _initialize_i386bsd_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour, i386bsd_aout_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_AOUT, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT, i386fbsdaout_init_abi); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_ELF, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF, i386fbsd4_init_abi); } diff --git a/gdb/i386gnu-tdep.c b/gdb/i386gnu-tdep.c index fa56428..143ddc0 100644 --- a/gdb/i386gnu-tdep.c +++ b/gdb/i386gnu-tdep.c @@ -39,5 +39,5 @@ extern void _initialize_i386gnu_tdep (void); void _initialize_i386gnu_tdep (void) { - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_HURD, i386gnu_init_abi); + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_HURD, i386gnu_init_abi); } diff --git a/gdb/i386ly-tdep.c b/gdb/i386ly-tdep.c index 69c3750..22bab3a 100644 --- a/gdb/i386ly-tdep.c +++ b/gdb/i386ly-tdep.c @@ -70,11 +70,11 @@ i386lynx_coff_osabi_sniffer (bfd *abfd) void _initialize_i386lynx_tdep (void); void -_initialize_i386bsd_tdep (void) +_initialize_i386lynx_tdep (void) { gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, i386lynx_coff_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LYNXOS, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LYNXOS, i386lynx_init_abi); } diff --git a/gdb/i386m3-nat.c b/gdb/i386m3-nat.c deleted file mode 100644 index 8cb51d5..0000000 --- a/gdb/i386m3-nat.c +++ /dev/null @@ -1,426 +0,0 @@ -// OBSOLETE /* Low level interface to I386 running mach 3.0. -// OBSOLETE Copyright 1992, 1993, 1994, 1996, 2000, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "floatformat.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* Hmmm... Should this not be here? -// OBSOLETE * Now for i386_float_info() target_has_execution -// OBSOLETE */ -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* This mess is duplicated in bfd/i386mach3.h -// OBSOLETE -// OBSOLETE * This is an ugly way to hack around the incorrect -// OBSOLETE * definition of UPAGES in i386/machparam.h. -// OBSOLETE * -// OBSOLETE * The definition should specify the size reserved -// OBSOLETE * for "struct user" in core files in PAGES, -// OBSOLETE * but instead it gives it in 512-byte core-clicks -// OBSOLETE * for i386 and i860. -// OBSOLETE */ -// OBSOLETE #include -// OBSOLETE #if UPAGES == 16 -// OBSOLETE #define UAREA_SIZE ctob(UPAGES) -// OBSOLETE #elif UPAGES == 2 -// OBSOLETE #define UAREA_SIZE (NBPG*UPAGES) -// OBSOLETE #else -// OBSOLETE FIXME ! !UPAGES is neither 2 nor 16 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* @@@ Should move print_387_status() to i387-tdep.c */ -// OBSOLETE extern void print_387_control_word (); /* i387-tdep.h */ -// OBSOLETE extern void print_387_status_word (); -// OBSOLETE -// OBSOLETE #define private static -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Find offsets to thread states at compile time. -// OBSOLETE * If your compiler does not grok this, calculate offsets -// OBSOLETE * offsets yourself and use them (or get a compatible compiler :-) -// OBSOLETE */ -// OBSOLETE -// OBSOLETE #define REG_OFFSET(reg) (int)(&((struct i386_thread_state *)0)->reg) -// OBSOLETE -// OBSOLETE /* at reg_offset[i] is the offset to the i386_thread_state -// OBSOLETE * location where the gdb registers[i] is stored. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static int reg_offset[] = -// OBSOLETE { -// OBSOLETE REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx), -// OBSOLETE REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi), -// OBSOLETE REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss), -// OBSOLETE REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs) -// OBSOLETE }; -// OBSOLETE -// OBSOLETE #define REG_ADDRESS(state,regnum) ((char *)(state)+reg_offset[regnum]) -// OBSOLETE -// OBSOLETE /* Fetch COUNT contiguous registers from thread STATE starting from REGNUM -// OBSOLETE * Caller knows that the regs handled in one transaction are of same size. -// OBSOLETE */ -// OBSOLETE #define FETCH_REGS(state, regnum, count) \ -// OBSOLETE memcpy (®isters[REGISTER_BYTE (regnum)], \ -// OBSOLETE REG_ADDRESS (state, regnum), \ -// OBSOLETE count*REGISTER_SIZE) -// OBSOLETE -// OBSOLETE /* Store COUNT contiguous registers to thread STATE starting from REGNUM */ -// OBSOLETE #define STORE_REGS(state, regnum, count) \ -// OBSOLETE memcpy (REG_ADDRESS (state, regnum), \ -// OBSOLETE ®isters[REGISTER_BYTE (regnum)], \ -// OBSOLETE count*REGISTER_SIZE) -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Fetch inferiors registers for gdb. -// OBSOLETE * REGNO specifies which (as gdb views it) register, -1 for all. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE fetch_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE kern_return_t ret; -// OBSOLETE thread_state_data_t state; -// OBSOLETE unsigned int stateCnt = i386_THREAD_STATE_COUNT; -// OBSOLETE int index; -// OBSOLETE -// OBSOLETE if (!MACH_PORT_VALID (current_thread)) -// OBSOLETE error ("fetch inferior registers: Invalid thread"); -// OBSOLETE -// OBSOLETE if (must_suspend_thread) -// OBSOLETE setup_thread (current_thread, 1); -// OBSOLETE -// OBSOLETE ret = thread_get_state (current_thread, -// OBSOLETE i386_THREAD_STATE, -// OBSOLETE state, -// OBSOLETE &stateCnt); -// OBSOLETE -// OBSOLETE if (ret != KERN_SUCCESS) -// OBSOLETE warning ("fetch_inferior_registers: %s ", -// OBSOLETE mach_error_string (ret)); -// OBSOLETE #if 0 -// OBSOLETE /* It may be more effective to store validate all of them, -// OBSOLETE * since we fetched them all anyway -// OBSOLETE */ -// OBSOLETE else if (regno != -1) -// OBSOLETE supply_register (regno, (char *) state + reg_offset[regno]); -// OBSOLETE #endif -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (index = 0; index < NUM_REGS; index++) -// OBSOLETE supply_register (index, (char *) state + reg_offset[index]); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (must_suspend_thread) -// OBSOLETE setup_thread (current_thread, 0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store our register values back into the inferior. -// OBSOLETE * If REGNO is -1, do this for all registers. -// OBSOLETE * Otherwise, REGNO specifies which register -// OBSOLETE * -// OBSOLETE * On mach3 all registers are always saved in one call. -// OBSOLETE */ -// OBSOLETE void -// OBSOLETE store_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE kern_return_t ret; -// OBSOLETE thread_state_data_t state; -// OBSOLETE unsigned int stateCnt = i386_THREAD_STATE_COUNT; -// OBSOLETE register int index; -// OBSOLETE -// OBSOLETE if (!MACH_PORT_VALID (current_thread)) -// OBSOLETE error ("store inferior registers: Invalid thread"); -// OBSOLETE -// OBSOLETE if (must_suspend_thread) -// OBSOLETE setup_thread (current_thread, 1); -// OBSOLETE -// OBSOLETE /* Fetch the state of the current thread */ -// OBSOLETE ret = thread_get_state (current_thread, -// OBSOLETE i386_THREAD_STATE, -// OBSOLETE state, -// OBSOLETE &stateCnt); -// OBSOLETE -// OBSOLETE if (ret != KERN_SUCCESS) -// OBSOLETE { -// OBSOLETE warning ("store_inferior_registers (get): %s", -// OBSOLETE mach_error_string (ret)); -// OBSOLETE if (must_suspend_thread) -// OBSOLETE setup_thread (current_thread, 0); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* move gdb's registers to thread's state -// OBSOLETE -// OBSOLETE * Since we save all registers anyway, save the ones -// OBSOLETE * that gdb thinks are valid (e.g. ignore the regno -// OBSOLETE * parameter) -// OBSOLETE */ -// OBSOLETE #if 0 -// OBSOLETE if (regno != -1) -// OBSOLETE STORE_REGS (state, regno, 1); -// OBSOLETE else -// OBSOLETE #endif -// OBSOLETE { -// OBSOLETE for (index = 0; index < NUM_REGS; index++) -// OBSOLETE STORE_REGS (state, index, 1); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Write gdb's current view of register to the thread -// OBSOLETE */ -// OBSOLETE ret = thread_set_state (current_thread, -// OBSOLETE i386_THREAD_STATE, -// OBSOLETE state, -// OBSOLETE i386_THREAD_STATE_COUNT); -// OBSOLETE -// OBSOLETE if (ret != KERN_SUCCESS) -// OBSOLETE warning ("store_inferior_registers (set): %s", -// OBSOLETE mach_error_string (ret)); -// OBSOLETE -// OBSOLETE if (must_suspend_thread) -// OBSOLETE setup_thread (current_thread, 0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Return the address in the core dump or inferior of register REGNO. -// OBSOLETE * BLOCKEND should be the address of the end of the UPAGES area read -// OBSOLETE * in memory, but it's not? -// OBSOLETE * -// OBSOLETE * Currently our UX server dumps the whole thread state to the -// OBSOLETE * core file. If your UX does something else, adapt the routine -// OBSOLETE * below to return the offset to the given register. -// OBSOLETE * -// OBSOLETE * Called by core-aout.c(fetch_core_registers) -// OBSOLETE */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE register_addr (int regno, CORE_ADDR blockend) -// OBSOLETE { -// OBSOLETE CORE_ADDR addr; -// OBSOLETE -// OBSOLETE if (regno < 0 || regno >= NUM_REGS) -// OBSOLETE error ("Invalid register number %d.", regno); -// OBSOLETE -// OBSOLETE /* UAREA_SIZE == 8 kB in i386 */ -// OBSOLETE addr = (unsigned int) REG_ADDRESS (UAREA_SIZE - sizeof (struct i386_thread_state), regno); -// OBSOLETE -// OBSOLETE return addr; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* jtv@hut.fi: I copied and modified this 387 code from -// OBSOLETE * gdb/i386-xdep.c. Modifications for Mach 3.0. -// OBSOLETE * -// OBSOLETE * i387 status dumper. See also i387-tdep.c -// OBSOLETE */ -// OBSOLETE struct env387 -// OBSOLETE { -// OBSOLETE unsigned short control; -// OBSOLETE unsigned short r0; -// OBSOLETE unsigned short status; -// OBSOLETE unsigned short r1; -// OBSOLETE unsigned short tag; -// OBSOLETE unsigned short r2; -// OBSOLETE unsigned long eip; -// OBSOLETE unsigned short code_seg; -// OBSOLETE unsigned short opcode; -// OBSOLETE unsigned long operand; -// OBSOLETE unsigned short operand_seg; -// OBSOLETE unsigned short r3; -// OBSOLETE unsigned char regs[8][10]; -// OBSOLETE }; -// OBSOLETE /* This routine is machine independent? -// OBSOLETE * Should move it to i387-tdep.c but you need to export struct env387 -// OBSOLETE */ -// OBSOLETE private -// OBSOLETE print_387_status (unsigned short status, struct env387 *ep) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE int bothstatus; -// OBSOLETE int top; -// OBSOLETE int fpreg; -// OBSOLETE unsigned char *p; -// OBSOLETE -// OBSOLETE bothstatus = ((status != 0) && (ep->status != 0)); -// OBSOLETE if (status != 0) -// OBSOLETE { -// OBSOLETE if (bothstatus) -// OBSOLETE printf_unfiltered ("u: "); -// OBSOLETE print_387_status_word (status); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (ep->status != 0) -// OBSOLETE { -// OBSOLETE if (bothstatus) -// OBSOLETE printf_unfiltered ("e: "); -// OBSOLETE print_387_status_word (ep->status); -// OBSOLETE } -// OBSOLETE -// OBSOLETE print_387_control_word (ep->control); -// OBSOLETE printf_unfiltered ("last exception: "); -// OBSOLETE printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode)); -// OBSOLETE printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg)); -// OBSOLETE printf_unfiltered ("%s; ", local_hex_string (ep->eip)); -// OBSOLETE printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg)); -// OBSOLETE printf_unfiltered (":%s\n", local_hex_string (ep->operand)); -// OBSOLETE -// OBSOLETE top = (ep->status >> 11) & 7; -// OBSOLETE -// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n"); -// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--) -// OBSOLETE { -// OBSOLETE double val; -// OBSOLETE -// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg); -// OBSOLETE -// OBSOLETE switch ((ep->tag >> (fpreg * 2)) & 3) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE printf_unfiltered ("valid "); -// OBSOLETE break; -// OBSOLETE case 1: -// OBSOLETE printf_unfiltered ("zero "); -// OBSOLETE break; -// OBSOLETE case 2: -// OBSOLETE printf_unfiltered ("trap "); -// OBSOLETE break; -// OBSOLETE case 3: -// OBSOLETE printf_unfiltered ("empty "); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE for (i = 9; i >= 0; i--) -// OBSOLETE printf_unfiltered ("%02x", ep->regs[fpreg][i]); -// OBSOLETE -// OBSOLETE floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg], -// OBSOLETE &val); -// OBSOLETE printf_unfiltered (" %g\n", val); -// OBSOLETE } -// OBSOLETE if (ep->r0) -// OBSOLETE printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string (ep->r0)); -// OBSOLETE if (ep->r1) -// OBSOLETE printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string (ep->r1)); -// OBSOLETE if (ep->r2) -// OBSOLETE printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string (ep->r2)); -// OBSOLETE if (ep->r3) -// OBSOLETE printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string (ep->r3)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * values that go into fp_kind (from ) -// OBSOLETE */ -// OBSOLETE #define FP_NO 0 /* no fp chip, no emulator (no fp support) */ -// OBSOLETE #define FP_SW 1 /* no fp chip, using software emulator */ -// OBSOLETE #define FP_HW 2 /* chip present bit */ -// OBSOLETE #define FP_287 2 /* 80287 chip present */ -// OBSOLETE #define FP_387 3 /* 80387 chip present */ -// OBSOLETE -// OBSOLETE typedef struct fpstate -// OBSOLETE { -// OBSOLETE #if 1 -// OBSOLETE unsigned char state[FP_STATE_BYTES]; /* "hardware" state */ -// OBSOLETE #else -// OBSOLETE struct env387 state; /* Actually this */ -// OBSOLETE #endif -// OBSOLETE int status; /* Duplicate status */ -// OBSOLETE } -// OBSOLETE *fpstate_t; -// OBSOLETE -// OBSOLETE /* Mach 3 specific routines. -// OBSOLETE */ -// OBSOLETE private boolean_t -// OBSOLETE get_i387_state (struct fpstate *fstate) -// OBSOLETE { -// OBSOLETE kern_return_t ret; -// OBSOLETE thread_state_data_t state; -// OBSOLETE unsigned int fsCnt = i386_FLOAT_STATE_COUNT; -// OBSOLETE struct i386_float_state *fsp; -// OBSOLETE -// OBSOLETE ret = thread_get_state (current_thread, -// OBSOLETE i386_FLOAT_STATE, -// OBSOLETE state, -// OBSOLETE &fsCnt); -// OBSOLETE -// OBSOLETE if (ret != KERN_SUCCESS) -// OBSOLETE { -// OBSOLETE warning ("Can not get live floating point state: %s", -// OBSOLETE mach_error_string (ret)); -// OBSOLETE return FALSE; -// OBSOLETE } -// OBSOLETE -// OBSOLETE fsp = (struct i386_float_state *) state; -// OBSOLETE /* The 387 chip (also 486 counts) or a software emulator? */ -// OBSOLETE if (!fsp->initialized || (fsp->fpkind != FP_387 && fsp->fpkind != FP_SW)) -// OBSOLETE return FALSE; -// OBSOLETE -// OBSOLETE /* Clear the target then copy thread's float state there. -// OBSOLETE Make a copy of the status word, for some reason? -// OBSOLETE */ -// OBSOLETE memset (fstate, 0, sizeof (struct fpstate)); -// OBSOLETE -// OBSOLETE fstate->status = fsp->exc_status; -// OBSOLETE -// OBSOLETE memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES); -// OBSOLETE -// OBSOLETE return TRUE; -// OBSOLETE } -// OBSOLETE -// OBSOLETE private boolean_t -// OBSOLETE get_i387_core_state (struct fpstate *fstate) -// OBSOLETE { -// OBSOLETE /* Not implemented yet. Core files do not contain float state. */ -// OBSOLETE return FALSE; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * This is called by "info float" command -// OBSOLETE */ -// OBSOLETE void -// OBSOLETE i386_mach3_float_info (void) -// OBSOLETE { -// OBSOLETE char buf[sizeof (struct fpstate) + 2 * sizeof (int)]; -// OBSOLETE boolean_t valid = FALSE; -// OBSOLETE fpstate_t fps; -// OBSOLETE -// OBSOLETE if (target_has_execution) -// OBSOLETE valid = get_i387_state (buf); -// OBSOLETE #if 0 -// OBSOLETE else if (WE HAVE CORE FILE) /* @@@@ Core files not supported */ -// OBSOLETE valid = get_i387_core_state (buf); -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE if (!valid) -// OBSOLETE { -// OBSOLETE warning ("no floating point status saved"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE fps = (fpstate_t) buf; -// OBSOLETE -// OBSOLETE print_387_status (fps->status, (struct env387 *) fps->state); -// OBSOLETE } diff --git a/gdb/i386mach-nat.c b/gdb/i386mach-nat.c deleted file mode 100644 index ee696c4..0000000 --- a/gdb/i386mach-nat.c +++ /dev/null @@ -1,172 +0,0 @@ -// OBSOLETE /* Native dependent code for Mach 386's for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 1999, 2000, -// OBSOLETE 2001 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include "gdb_stat.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); -// OBSOLETE -// OBSOLETE void -// OBSOLETE fetch_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE struct regs inferior_registers; -// OBSOLETE struct fp_state inferior_fp_registers; -// OBSOLETE -// OBSOLETE registers_fetched (); -// OBSOLETE -// OBSOLETE ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); -// OBSOLETE ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_fp_registers); -// OBSOLETE -// OBSOLETE memcpy (registers, &inferior_registers, sizeof inferior_registers); -// OBSOLETE -// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE inferior_fp_registers.f_st, -// OBSOLETE sizeof inferior_fp_registers.f_st); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], -// OBSOLETE &inferior_fp_registers.f_ctrl, -// OBSOLETE sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store our register values back into the inferior. -// OBSOLETE If REGNO is -1, do this for all registers. -// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE store_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE struct regs inferior_registers; -// OBSOLETE struct fp_state inferior_fp_registers; -// OBSOLETE -// OBSOLETE memcpy (&inferior_registers, registers, 20 * 4); -// OBSOLETE -// OBSOLETE memcpy (inferior_fp_registers.f_st, ®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE sizeof inferior_fp_registers.f_st); -// OBSOLETE memcpy (&inferior_fp_registers.f_ctrl, -// OBSOLETE ®isters[REGISTER_BYTE (FPC_REGNUM)], -// OBSOLETE sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st); -// OBSOLETE -// OBSOLETE #ifdef PTRACE_FP_BUG -// OBSOLETE if (regno == FP_REGNUM || regno == -1) -// OBSOLETE /* Storing the frame pointer requires a gross hack, in which an -// OBSOLETE instruction that moves eax into ebp gets single-stepped. */ -// OBSOLETE { -// OBSOLETE int stack = inferior_registers.r_reg[SP_REGNUM]; -// OBSOLETE int stuff = ptrace (PTRACE_PEEKDATA, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) stack); -// OBSOLETE int reg = inferior_registers.r_reg[EAX]; -// OBSOLETE inferior_registers.r_reg[EAX] = -// OBSOLETE inferior_registers.r_reg[FP_REGNUM]; -// OBSOLETE ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); -// OBSOLETE ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) stack, 0xc589); -// OBSOLETE ptrace (PTRACE_SINGLESTEP, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) stack, 0); -// OBSOLETE wait (0); -// OBSOLETE ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) stack, stuff); -// OBSOLETE inferior_registers.r_reg[EAX] = reg; -// OBSOLETE } -// OBSOLETE #endif -// OBSOLETE ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_registers); -// OBSOLETE ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) & inferior_fp_registers); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Provide registers to GDB from a core file. -// OBSOLETE -// OBSOLETE CORE_REG_SECT points to an array of bytes, which were obtained from -// OBSOLETE a core file which BFD thinks might contain register contents. -// OBSOLETE CORE_REG_SIZE is its size. -// OBSOLETE -// OBSOLETE WHICH says which register set corelow suspects this is: -// OBSOLETE 0 --- the general-purpose register set -// OBSOLETE 2 --- the floating-point register set -// OBSOLETE -// OBSOLETE REG_ADDR isn't used. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, -// OBSOLETE int which, CORE_ADDR reg_addr) -// OBSOLETE { -// OBSOLETE int val; -// OBSOLETE -// OBSOLETE switch (which) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE case 1: -// OBSOLETE memcpy (registers, core_reg_sect, core_reg_size); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 2: -// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE core_reg_sect, -// OBSOLETE core_reg_size); /* FIXME, probably bogus */ -// OBSOLETE #ifdef FPC_REGNUM -// OBSOLETE memcpy (®isters[REGISTER_BYTE (FPC_REGNUM)], -// OBSOLETE &corestr.c_fpu.f_fpstatus.f_ctrl, -// OBSOLETE sizeof corestr.c_fpu.f_fpstatus - -// OBSOLETE sizeof corestr.c_fpu.f_fpstatus.f_st); -// OBSOLETE #endif -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Register that we are able to handle i386mach core file formats. -// OBSOLETE FIXME: is this really bfd_target_unknown_flavour? */ -// OBSOLETE -// OBSOLETE static struct core_fns i386mach_core_fns = -// OBSOLETE { -// OBSOLETE bfd_target_unknown_flavour, /* core_flavour */ -// OBSOLETE default_check_format, /* check_format */ -// OBSOLETE default_core_sniffer, /* core_sniffer */ -// OBSOLETE fetch_core_registers, /* core_read_registers */ -// OBSOLETE NULL /* next */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_core_i386mach (void) -// OBSOLETE { -// OBSOLETE add_core_fns (&i386mach_core_fns); -// OBSOLETE } diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c index 4558a35..69283f8 100644 --- a/gdb/i386nbsd-tdep.c +++ b/gdb/i386nbsd-tdep.c @@ -299,8 +299,8 @@ _initialize_i386nbsd_tdep (void) add_core_fns (&i386nbsd_core_fns); add_core_fns (&i386nbsd_elfcore_fns); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_AOUT, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD_AOUT, i386nbsd_init_abi); - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD_ELF, i386nbsdelf_init_abi); } diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c index 7f16237..8bbce84 100644 --- a/gdb/i386obsd-tdep.c +++ b/gdb/i386obsd-tdep.c @@ -117,6 +117,6 @@ _initialize_i386obsd_tdep (void) expected. */ #define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT - gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_OPENBSD_AOUT, + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_AOUT, i386obsd_init_abi); } diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c deleted file mode 100644 index d059a7b..0000000 --- a/gdb/i960-tdep.c +++ /dev/null @@ -1,1056 +0,0 @@ -// OBSOLETE /* Target-machine dependent code for the Intel 960 -// OBSOLETE -// OBSOLETE Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, -// OBSOLETE 2001, 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE Contributed by Intel Corporation. -// OBSOLETE examine_prologue and other parts contributed by Wind River Systems. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "floatformat.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE -// OBSOLETE static CORE_ADDR next_insn (CORE_ADDR memaddr, -// OBSOLETE unsigned int *pword1, unsigned int *pword2); -// OBSOLETE -// OBSOLETE struct type * -// OBSOLETE i960_register_type (int regnum) -// OBSOLETE { -// OBSOLETE if (regnum < FP0_REGNUM) -// OBSOLETE return builtin_type_int32; -// OBSOLETE else -// OBSOLETE return builtin_type_i960_ext; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Does the specified function use the "struct returning" convention -// OBSOLETE or the "value returning" convention? The "value returning" convention -// OBSOLETE almost invariably returns the entire value in registers. The -// OBSOLETE "struct returning" convention often returns the entire value in -// OBSOLETE memory, and passes a pointer (out of or into the function) saying -// OBSOLETE where the value (is or should go). -// OBSOLETE -// OBSOLETE Since this sometimes depends on whether it was compiled with GCC, -// OBSOLETE this is also an argument. This is used in call_function to build a -// OBSOLETE stack, and in value_being_returned to print return values. -// OBSOLETE -// OBSOLETE On i960, a structure is returned in registers g0-g3, if it will fit. -// OBSOLETE If it's more than 16 bytes long, g13 pointed to it on entry. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE i960_use_struct_convention (int gcc_p, struct type *type) -// OBSOLETE { -// OBSOLETE return (TYPE_LENGTH (type) > 16); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* gdb960 is always running on a non-960 host. Check its characteristics. -// OBSOLETE This routine must be called as part of gdb initialization. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE check_host (void) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE static struct typestruct -// OBSOLETE { -// OBSOLETE int hostsize; /* Size of type on host */ -// OBSOLETE int i960size; /* Size of type on i960 */ -// OBSOLETE char *typename; /* Name of type, for error msg */ -// OBSOLETE } -// OBSOLETE types[] = -// OBSOLETE { -// OBSOLETE { -// OBSOLETE sizeof (short), 2, "short" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE { -// OBSOLETE sizeof (int), 4, "int" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE { -// OBSOLETE sizeof (long), 4, "long" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE { -// OBSOLETE sizeof (float), 4, "float" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE { -// OBSOLETE sizeof (double), 8, "double" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE { -// OBSOLETE sizeof (char *), 4, "pointer" -// OBSOLETE } -// OBSOLETE , -// OBSOLETE }; -// OBSOLETE #define TYPELEN (sizeof(types) / sizeof(struct typestruct)) -// OBSOLETE -// OBSOLETE /* Make sure that host type sizes are same as i960 -// OBSOLETE */ -// OBSOLETE for (i = 0; i < TYPELEN; i++) -// OBSOLETE { -// OBSOLETE if (types[i].hostsize != types[i].i960size) -// OBSOLETE { -// OBSOLETE printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n", -// OBSOLETE types[i].typename, types[i].i960size); -// OBSOLETE } -// OBSOLETE -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Is this register part of the register window system? A yes answer -// OBSOLETE implies that 1) The name of this register will not be the same in -// OBSOLETE other frames, and 2) This register is automatically "saved" upon -// OBSOLETE subroutine calls and thus there is no need to search more than one -// OBSOLETE stack frame for it. -// OBSOLETE -// OBSOLETE On the i960, in fact, the name of this register in another frame is -// OBSOLETE "mud" -- there is no overlap between the windows. Each window is -// OBSOLETE simply saved into the stack (true for our purposes, after having been -// OBSOLETE flushed; normally they reside on-chip and are restored from on-chip -// OBSOLETE without ever going to memory). */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE register_in_window_p (int regnum) -// OBSOLETE { -// OBSOLETE return regnum <= R15_REGNUM; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* i960_find_saved_register () -// OBSOLETE -// OBSOLETE Return the address in which frame FRAME's value of register REGNUM -// OBSOLETE has been saved in memory. Or return zero if it has not been saved. -// OBSOLETE If REGNUM specifies the SP, the value we return is actually the SP -// OBSOLETE value, not an address where it was saved. */ -// OBSOLETE -// OBSOLETE static CORE_ADDR -// OBSOLETE i960_find_saved_register (struct frame_info *frame, int regnum) -// OBSOLETE { -// OBSOLETE register struct frame_info *frame1 = NULL; -// OBSOLETE register CORE_ADDR addr = 0; -// OBSOLETE -// OBSOLETE if (frame == NULL) /* No regs saved if want current frame */ -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE /* We assume that a register in a register window will only be saved -// OBSOLETE in one place (since the name changes and/or disappears as you go -// OBSOLETE towards inner frames), so we only call get_frame_saved_regs on -// OBSOLETE the current frame. This is directly in contradiction to the -// OBSOLETE usage below, which assumes that registers used in a frame must be -// OBSOLETE saved in a lower (more interior) frame. This change is a result -// OBSOLETE of working on a register window machine; get_frame_saved_regs -// OBSOLETE always returns the registers saved within a frame, within the -// OBSOLETE context (register namespace) of that frame. */ -// OBSOLETE -// OBSOLETE /* However, note that we don't want this to return anything if -// OBSOLETE nothing is saved (if there's a frame inside of this one). Also, -// OBSOLETE callers to this routine asking for the stack pointer want the -// OBSOLETE stack pointer saved for *this* frame; this is returned from the -// OBSOLETE next frame. */ -// OBSOLETE -// OBSOLETE if (register_in_window_p (regnum)) -// OBSOLETE { -// OBSOLETE frame1 = get_next_frame (frame); -// OBSOLETE if (!frame1) -// OBSOLETE return 0; /* Registers of this frame are active. */ -// OBSOLETE -// OBSOLETE /* Get the SP from the next frame in; it will be this -// OBSOLETE current frame. */ -// OBSOLETE if (regnum != SP_REGNUM) -// OBSOLETE frame1 = frame; -// OBSOLETE -// OBSOLETE FRAME_INIT_SAVED_REGS (frame1); -// OBSOLETE return frame1->saved_regs[regnum]; /* ... which might be zero */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Note that this next routine assumes that registers used in -// OBSOLETE frame x will be saved only in the frame that x calls and -// OBSOLETE frames interior to it. This is not true on the sparc, but the -// OBSOLETE above macro takes care of it, so we should be all right. */ -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE QUIT; -// OBSOLETE frame1 = get_next_frame (frame); -// OBSOLETE if (frame1 == 0) -// OBSOLETE break; -// OBSOLETE frame = frame1; -// OBSOLETE FRAME_INIT_SAVED_REGS (frame1); -// OBSOLETE if (frame1->saved_regs[regnum]) -// OBSOLETE addr = frame1->saved_regs[regnum]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE return addr; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* i960_get_saved_register () -// OBSOLETE -// OBSOLETE Find register number REGNUM relative to FRAME and put its (raw, -// OBSOLETE target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the -// OBSOLETE variable was optimized out (and thus can't be fetched). Set *LVAL -// OBSOLETE to lval_memory, lval_register, or not_lval, depending on whether -// OBSOLETE the value was fetched from memory, from a register, or in a strange -// OBSOLETE and non-modifiable way (e.g. a frame pointer which was calculated -// OBSOLETE rather than fetched). Set *ADDRP to the address, either in memory -// OBSOLETE on as a REGISTER_BYTE offset into the registers array. -// OBSOLETE -// OBSOLETE Note that this implementation never sets *LVAL to not_lval. But it -// OBSOLETE can be replaced by defining GET_SAVED_REGISTER and supplying your -// OBSOLETE own. -// OBSOLETE -// OBSOLETE The argument RAW_BUFFER must point to aligned memory. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE i960_get_saved_register (char *raw_buffer, -// OBSOLETE int *optimized, -// OBSOLETE CORE_ADDR *addrp, -// OBSOLETE struct frame_info *frame, -// OBSOLETE int regnum, -// OBSOLETE enum lval_type *lval) -// OBSOLETE { -// OBSOLETE CORE_ADDR addr; -// OBSOLETE -// OBSOLETE if (!target_has_registers) -// OBSOLETE error ("No registers."); -// OBSOLETE -// OBSOLETE /* Normal systems don't optimize out things with register numbers. */ -// OBSOLETE if (optimized != NULL) -// OBSOLETE *optimized = 0; -// OBSOLETE addr = i960_find_saved_register (frame, regnum); -// OBSOLETE if (addr != 0) -// OBSOLETE { -// OBSOLETE if (lval != NULL) -// OBSOLETE *lval = lval_memory; -// OBSOLETE if (regnum == SP_REGNUM) -// OBSOLETE { -// OBSOLETE if (raw_buffer != NULL) -// OBSOLETE { -// OBSOLETE /* Put it back in target format. */ -// OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), -// OBSOLETE (LONGEST) addr); -// OBSOLETE } -// OBSOLETE if (addrp != NULL) -// OBSOLETE *addrp = 0; -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE if (raw_buffer != NULL) -// OBSOLETE target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum)); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (lval != NULL) -// OBSOLETE *lval = lval_register; -// OBSOLETE addr = REGISTER_BYTE (regnum); -// OBSOLETE if (raw_buffer != NULL) -// OBSOLETE read_register_gen (regnum, raw_buffer); -// OBSOLETE } -// OBSOLETE if (addrp != NULL) -// OBSOLETE *addrp = addr; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Examine an i960 function prologue, recording the addresses at which -// OBSOLETE registers are saved explicitly by the prologue code, and returning -// OBSOLETE the address of the first instruction after the prologue (but not -// OBSOLETE after the instruction at address LIMIT, as explained below). -// OBSOLETE -// OBSOLETE LIMIT places an upper bound on addresses of the instructions to be -// OBSOLETE examined. If the prologue code scan reaches LIMIT, the scan is -// OBSOLETE aborted and LIMIT is returned. This is used, when examining the -// OBSOLETE prologue for the current frame, to keep examine_prologue () from -// OBSOLETE claiming that a given register has been saved when in fact the -// OBSOLETE instruction that saves it has not yet been executed. LIMIT is used -// OBSOLETE at other times to stop the scan when we hit code after the true -// OBSOLETE function prologue (e.g. for the first source line) which might -// OBSOLETE otherwise be mistaken for function prologue. -// OBSOLETE -// OBSOLETE The format of the function prologue matched by this routine is -// OBSOLETE derived from examination of the source to gcc960 1.21, particularly -// OBSOLETE the routine i960_function_prologue (). A "regular expression" for -// OBSOLETE the function prologue is given below: -// OBSOLETE -// OBSOLETE (lda LRn, g14 -// OBSOLETE mov g14, g[0-7] -// OBSOLETE (mov 0, g14) | (lda 0, g14))? -// OBSOLETE -// OBSOLETE (mov[qtl]? g[0-15], r[4-15])* -// OBSOLETE ((addo [1-31], sp, sp) | (lda n(sp), sp))? -// OBSOLETE (st[qtl]? g[0-15], n(fp))* -// OBSOLETE -// OBSOLETE (cmpobne 0, g14, LFn -// OBSOLETE mov sp, g14 -// OBSOLETE lda 0x30(sp), sp -// OBSOLETE LFn: stq g0, (g14) -// OBSOLETE stq g4, 0x10(g14) -// OBSOLETE stq g8, 0x20(g14))? -// OBSOLETE -// OBSOLETE (st g14, n(fp))? -// OBSOLETE (mov g13,r[4-15])? -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Macros for extracting fields from i960 instructions. */ -// OBSOLETE -// OBSOLETE #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos)) -// OBSOLETE #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width)) -// OBSOLETE -// OBSOLETE #define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5) -// OBSOLETE #define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5) -// OBSOLETE #define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) -// OBSOLETE #define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5) -// OBSOLETE #define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12) -// OBSOLETE -// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or -// OBSOLETE is not the address of a valid instruction, the address of the next -// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word -// OBSOLETE of the instruction, and (for two-word instructions), *PWORD2 receives -// OBSOLETE the second. */ -// OBSOLETE -// OBSOLETE #define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \ -// OBSOLETE (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0) -// OBSOLETE -// OBSOLETE static CORE_ADDR -// OBSOLETE examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, -// OBSOLETE CORE_ADDR frame_addr, struct frame_saved_regs *fsr) -// OBSOLETE { -// OBSOLETE register CORE_ADDR next_ip; -// OBSOLETE register int src, dst; -// OBSOLETE register unsigned int *pcode; -// OBSOLETE unsigned int insn1, insn2; -// OBSOLETE int size; -// OBSOLETE int within_leaf_prologue; -// OBSOLETE CORE_ADDR save_addr; -// OBSOLETE static unsigned int varargs_prologue_code[] = -// OBSOLETE { -// OBSOLETE 0x3507a00c, /* cmpobne 0x0, g14, LFn */ -// OBSOLETE 0x5cf01601, /* mov sp, g14 */ -// OBSOLETE 0x8c086030, /* lda 0x30(sp), sp */ -// OBSOLETE 0xb2879000, /* LFn: stq g0, (g14) */ -// OBSOLETE 0xb2a7a010, /* stq g4, 0x10(g14) */ -// OBSOLETE 0xb2c7a020 /* stq g8, 0x20(g14) */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Accept a leaf procedure prologue code fragment if present. -// OBSOLETE Note that ip might point to either the leaf or non-leaf -// OBSOLETE entry point; we look for the non-leaf entry point first: */ -// OBSOLETE -// OBSOLETE within_leaf_prologue = 0; -// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2)) -// OBSOLETE && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */ -// OBSOLETE || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */ -// OBSOLETE { -// OBSOLETE within_leaf_prologue = 1; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Now look for the prologue code at a leaf entry point: */ -// OBSOLETE -// OBSOLETE if (next_ip -// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ -// OBSOLETE && REG_SRCDST (insn1) <= G0_REGNUM + 7) -// OBSOLETE { -// OBSOLETE within_leaf_prologue = 1; -// OBSOLETE if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2)) -// OBSOLETE && (insn1 == 0x8cf00000 /* lda 0, g14 */ -// OBSOLETE || insn1 == 0x5cf01e00)) /* mov 0, g14 */ -// OBSOLETE { -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE within_leaf_prologue = 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* If something that looks like the beginning of a leaf prologue -// OBSOLETE has been seen, but the remainder of the prologue is missing, bail. -// OBSOLETE We don't know what we've got. */ -// OBSOLETE -// OBSOLETE if (within_leaf_prologue) -// OBSOLETE return (ip); -// OBSOLETE -// OBSOLETE /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4. -// OBSOLETE This may cause us to mistake the moving of a register -// OBSOLETE parameter to a local register for the saving of a callee-saved -// OBSOLETE register, but that can't be helped, since with the -// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved. */ -// OBSOLETE -// OBSOLETE while (next_ip -// OBSOLETE && (insn1 & 0xfc802fb0) == 0x5c000610 -// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) -// OBSOLETE { -// OBSOLETE src = REG_SRC1 (insn1); -// OBSOLETE size = EXTRACT_FIELD (insn1, 24, 2) + 1; -// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4); -// OBSOLETE while (size--) -// OBSOLETE { -// OBSOLETE fsr->regs[src++] = save_addr; -// OBSOLETE save_addr += 4; -// OBSOLETE } -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */ -// OBSOLETE -// OBSOLETE if (next_ip && -// OBSOLETE ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */ -// OBSOLETE || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */ -// OBSOLETE || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */ -// OBSOLETE { -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept zero or more instances of "st[qtl]? gx, n(fp)". -// OBSOLETE This may cause us to mistake the copying of a register -// OBSOLETE parameter to the frame for the saving of a callee-saved -// OBSOLETE register, but that can't be helped, since with the -// OBSOLETE "-fcall-saved" flag, any register can be made callee-saved. -// OBSOLETE We can, however, refuse to accept a save of register g14, -// OBSOLETE since that is matched explicitly below. */ -// OBSOLETE -// OBSOLETE while (next_ip && -// OBSOLETE ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */ -// OBSOLETE || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */ -// OBSOLETE || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */ -// OBSOLETE || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */ -// OBSOLETE && ((src = MEM_SRCDST (insn1)) != G14_REGNUM)) -// OBSOLETE { -// OBSOLETE save_addr = frame_addr + ((insn1 & BITMASK (12, 1)) -// OBSOLETE ? insn2 : MEMA_OFFSET (insn1)); -// OBSOLETE size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3) -// OBSOLETE : ((insn1 & BITMASK (27, 1)) ? 2 : 1); -// OBSOLETE while (size--) -// OBSOLETE { -// OBSOLETE fsr->regs[src++] = save_addr; -// OBSOLETE save_addr += 4; -// OBSOLETE } -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept the varargs prologue code if present. */ -// OBSOLETE -// OBSOLETE size = sizeof (varargs_prologue_code) / sizeof (int); -// OBSOLETE pcode = varargs_prologue_code; -// OBSOLETE while (size-- && next_ip && *pcode++ == insn1) -// OBSOLETE { -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept an optional "st g14, n(fp)". */ -// OBSOLETE -// OBSOLETE if (next_ip && -// OBSOLETE ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */ -// OBSOLETE || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */ -// OBSOLETE { -// OBSOLETE fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1)) -// OBSOLETE ? insn2 : MEMA_OFFSET (insn1)); -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Accept zero or one instance of "mov g13, ry", where y >= 4. -// OBSOLETE This is saving the address where a struct should be returned. */ -// OBSOLETE -// OBSOLETE if (next_ip -// OBSOLETE && (insn1 & 0xff802fbf) == 0x5c00061d -// OBSOLETE && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4)) -// OBSOLETE { -// OBSOLETE save_addr = frame_addr + ((dst - R0_REGNUM) * 4); -// OBSOLETE fsr->regs[G0_REGNUM + 13] = save_addr; -// OBSOLETE ip = next_ip; -// OBSOLETE #if 0 /* We'll need this once there is a subsequent instruction examined. */ -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2); -// OBSOLETE #endif -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (ip); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given an ip value corresponding to the start of a function, -// OBSOLETE return the ip of the first instruction after the function -// OBSOLETE prologue. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE i960_skip_prologue (CORE_ADDR ip) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs saved_regs_dummy; -// OBSOLETE struct symtab_and_line sal; -// OBSOLETE CORE_ADDR limit; -// OBSOLETE -// OBSOLETE sal = find_pc_line (ip, 0); -// OBSOLETE limit = (sal.end) ? sal.end : 0xffffffff; -// OBSOLETE -// OBSOLETE return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, -// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. -// OBSOLETE This includes special registers such as pc and fp saved in special -// OBSOLETE ways in the stack frame. sp is even more special: -// OBSOLETE the address we return for it IS the sp for the next frame. -// OBSOLETE -// OBSOLETE We cache the result of doing this in the frame_obstack, since it is -// OBSOLETE fairly expensive. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr) -// OBSOLETE { -// OBSOLETE register CORE_ADDR next_addr; -// OBSOLETE register CORE_ADDR *saved_regs; -// OBSOLETE register int regnum; -// OBSOLETE register struct frame_saved_regs *cache_fsr; -// OBSOLETE CORE_ADDR ip; -// OBSOLETE struct symtab_and_line sal; -// OBSOLETE CORE_ADDR limit; -// OBSOLETE -// OBSOLETE if (!fi->fsr) -// OBSOLETE { -// OBSOLETE cache_fsr = (struct frame_saved_regs *) -// OBSOLETE frame_obstack_alloc (sizeof (struct frame_saved_regs)); -// OBSOLETE memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); -// OBSOLETE fi->fsr = cache_fsr; -// OBSOLETE -// OBSOLETE /* Find the start and end of the function prologue. If the PC -// OBSOLETE is in the function prologue, we only consider the part that -// OBSOLETE has executed already. */ -// OBSOLETE -// OBSOLETE ip = get_pc_function_start (fi->pc); -// OBSOLETE sal = find_pc_line (ip, 0); -// OBSOLETE limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc; -// OBSOLETE -// OBSOLETE examine_prologue (ip, limit, fi->frame, cache_fsr); -// OBSOLETE -// OBSOLETE /* Record the addresses at which the local registers are saved. -// OBSOLETE Strictly speaking, we should only do this for non-leaf procedures, -// OBSOLETE but no one will ever look at these values if it is a leaf procedure, -// OBSOLETE since local registers are always caller-saved. */ -// OBSOLETE -// OBSOLETE next_addr = (CORE_ADDR) fi->frame; -// OBSOLETE saved_regs = cache_fsr->regs; -// OBSOLETE for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++) -// OBSOLETE { -// OBSOLETE *saved_regs++ = next_addr; -// OBSOLETE next_addr += 4; -// OBSOLETE } -// OBSOLETE -// OBSOLETE cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE *fsr = *fi->fsr; -// OBSOLETE -// OBSOLETE /* Fetch the value of the sp from memory every time, since it -// OBSOLETE is conceivable that it has changed since the cache was flushed. -// OBSOLETE This unfortunately undoes much of the savings from caching the -// OBSOLETE saved register values. I suggest adding an argument to -// OBSOLETE get_frame_saved_regs () specifying the register number we're -// OBSOLETE interested in (or -1 for all registers). This would be passed -// OBSOLETE through to FRAME_FIND_SAVED_REGS (), permitting more efficient -// OBSOLETE computation of saved register addresses (e.g., on the i960, -// OBSOLETE we don't have to examine the prologue to find local registers). -// OBSOLETE -- markf@wrs.com -// OBSOLETE FIXME, we don't need to refetch this, since the cache is cleared -// OBSOLETE every time the child process is restarted. If GDB itself -// OBSOLETE modifies SP, it has to clear the cache by hand (does it?). -gnu */ -// OBSOLETE -// OBSOLETE fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the address of the argument block for the frame -// OBSOLETE described by FI. Returns 0 if the address is unknown. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_args_address (struct frame_info *fi, int must_be_correct) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE CORE_ADDR ap; -// OBSOLETE -// OBSOLETE /* If g14 was saved in the frame by the function prologue code, return -// OBSOLETE the saved value. If the frame is current and we are being sloppy, -// OBSOLETE return the value of g14. Otherwise, return zero. */ -// OBSOLETE -// OBSOLETE get_frame_saved_regs (fi, &fsr); -// OBSOLETE if (fsr.regs[G14_REGNUM]) -// OBSOLETE ap = read_memory_integer (fsr.regs[G14_REGNUM], 4); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (must_be_correct) -// OBSOLETE return 0; /* Don't cache this result */ -// OBSOLETE if (get_next_frame (fi)) -// OBSOLETE ap = 0; -// OBSOLETE else -// OBSOLETE ap = read_register (G14_REGNUM); -// OBSOLETE if (ap == 0) -// OBSOLETE ap = fi->frame; -// OBSOLETE } -// OBSOLETE fi->arg_pointer = ap; /* Cache it for next time */ -// OBSOLETE return ap; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the address of the return struct for the frame -// OBSOLETE described by FI. Returns 0 if the address is unknown. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_struct_result_address (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE CORE_ADDR ap; -// OBSOLETE -// OBSOLETE /* If the frame is non-current, check to see if g14 was saved in the -// OBSOLETE frame by the function prologue code; return the saved value if so, -// OBSOLETE zero otherwise. If the frame is current, return the value of g14. -// OBSOLETE -// OBSOLETE FIXME, shouldn't this use the saved value as long as we are past -// OBSOLETE the function prologue, and only use the current value if we have -// OBSOLETE no saved value and are at TOS? -- gnu@cygnus.com */ -// OBSOLETE -// OBSOLETE if (get_next_frame (fi)) -// OBSOLETE { -// OBSOLETE get_frame_saved_regs (fi, &fsr); -// OBSOLETE if (fsr.regs[G13_REGNUM]) -// OBSOLETE ap = read_memory_integer (fsr.regs[G13_REGNUM], 4); -// OBSOLETE else -// OBSOLETE ap = 0; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE ap = read_register (G13_REGNUM); -// OBSOLETE -// OBSOLETE return ap; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return address to which the currently executing leafproc will return, -// OBSOLETE or 0 if IP, the value of the instruction pointer from the currently -// OBSOLETE executing function, is not in a leafproc (or if we can't tell if it -// OBSOLETE is). -// OBSOLETE -// OBSOLETE Do this by finding the starting address of the routine in which IP lies. -// OBSOLETE If the instruction there is "mov g14, gx" (where x is in [0,7]), this -// OBSOLETE is a leafproc and the return address is in register gx. Well, this is -// OBSOLETE true unless the return address points at a RET instruction in the current -// OBSOLETE procedure, which indicates that we have a 'dual entry' routine that -// OBSOLETE has been entered through the CALL entry point. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE leafproc_return (CORE_ADDR ip) -// OBSOLETE { -// OBSOLETE register struct minimal_symbol *msymbol; -// OBSOLETE char *p; -// OBSOLETE int dst; -// OBSOLETE unsigned int insn1, insn2; -// OBSOLETE CORE_ADDR return_addr; -// OBSOLETE -// OBSOLETE if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL) -// OBSOLETE { -// OBSOLETE if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf")) -// OBSOLETE { -// OBSOLETE if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2) -// OBSOLETE && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */ -// OBSOLETE && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7) -// OBSOLETE { -// OBSOLETE /* Get the return address. If the "mov g14, gx" -// OBSOLETE instruction hasn't been executed yet, read -// OBSOLETE the return address from g14; otherwise, read it -// OBSOLETE from the register into which g14 was moved. */ -// OBSOLETE -// OBSOLETE return_addr = -// OBSOLETE read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol)) -// OBSOLETE ? G14_REGNUM : dst); -// OBSOLETE -// OBSOLETE /* We know we are in a leaf procedure, but we don't know -// OBSOLETE whether the caller actually did a "bal" to the ".lf" -// OBSOLETE entry point, or a normal "call" to the non-leaf entry -// OBSOLETE point one instruction before. In the latter case, the -// OBSOLETE return address will be the address of a "ret" -// OBSOLETE instruction within the procedure itself. We test for -// OBSOLETE this below. */ -// OBSOLETE -// OBSOLETE if (!next_insn (return_addr, &insn1, &insn2) -// OBSOLETE || (insn1 & 0xff000000) != 0xa000000 /* ret */ -// OBSOLETE || lookup_minimal_symbol_by_pc (return_addr) != msymbol) -// OBSOLETE return (return_addr); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Immediately after a function call, return the saved pc. -// OBSOLETE Can't go through the frames for this because on some machines -// OBSOLETE the new frame is not set up until the new function executes -// OBSOLETE some instructions. -// OBSOLETE On the i960, the frame *is* set up immediately after the call, -// OBSOLETE unless the function is a leaf procedure. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE saved_pc_after_call (struct frame_info *frame) -// OBSOLETE { -// OBSOLETE CORE_ADDR saved_pc; -// OBSOLETE -// OBSOLETE saved_pc = leafproc_return (get_frame_pc (frame)); -// OBSOLETE if (!saved_pc) -// OBSOLETE saved_pc = FRAME_SAVED_PC (frame); -// OBSOLETE -// OBSOLETE return saved_pc; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Discard from the stack the innermost frame, -// OBSOLETE restoring all saved registers. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE i960_pop_frame (void) -// OBSOLETE { -// OBSOLETE register struct frame_info *current_fi, *prev_fi; -// OBSOLETE register int i; -// OBSOLETE CORE_ADDR save_addr; -// OBSOLETE CORE_ADDR leaf_return_addr; -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE char local_regs_buf[16 * 4]; -// OBSOLETE -// OBSOLETE current_fi = get_current_frame (); -// OBSOLETE -// OBSOLETE /* First, undo what the hardware does when we return. -// OBSOLETE If this is a non-leaf procedure, restore local registers from -// OBSOLETE the save area in the calling frame. Otherwise, load the return -// OBSOLETE address obtained from leafproc_return () into the rip. */ -// OBSOLETE -// OBSOLETE leaf_return_addr = leafproc_return (current_fi->pc); -// OBSOLETE if (!leaf_return_addr) -// OBSOLETE { -// OBSOLETE /* Non-leaf procedure. Restore local registers, incl IP. */ -// OBSOLETE prev_fi = get_prev_frame (current_fi); -// OBSOLETE read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf)); -// OBSOLETE write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf, -// OBSOLETE sizeof (local_regs_buf)); -// OBSOLETE -// OBSOLETE /* Restore frame pointer. */ -// OBSOLETE write_register (FP_REGNUM, prev_fi->frame); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Leaf procedure. Just restore the return address into the IP. */ -// OBSOLETE write_register (RIP_REGNUM, leaf_return_addr); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Now restore any global regs that the current function had saved. */ -// OBSOLETE get_frame_saved_regs (current_fi, &fsr); -// OBSOLETE for (i = G0_REGNUM; i < G14_REGNUM; i++) -// OBSOLETE { -// OBSOLETE save_addr = fsr.regs[i]; -// OBSOLETE if (save_addr != 0) -// OBSOLETE write_register (i, read_memory_integer (save_addr, 4)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Flush the frame cache, create a frame for the new innermost frame, -// OBSOLETE and make it the current frame. */ -// OBSOLETE -// OBSOLETE flush_cached_frames (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given a 960 stop code (fault or trace), return the signal which -// OBSOLETE corresponds. */ -// OBSOLETE -// OBSOLETE enum target_signal -// OBSOLETE i960_fault_to_signal (int fault) -// OBSOLETE { -// OBSOLETE switch (fault) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE return TARGET_SIGNAL_BUS; /* parallel fault */ -// OBSOLETE case 1: -// OBSOLETE return TARGET_SIGNAL_UNKNOWN; -// OBSOLETE case 2: -// OBSOLETE return TARGET_SIGNAL_ILL; /* operation fault */ -// OBSOLETE case 3: -// OBSOLETE return TARGET_SIGNAL_FPE; /* arithmetic fault */ -// OBSOLETE case 4: -// OBSOLETE return TARGET_SIGNAL_FPE; /* floating point fault */ -// OBSOLETE -// OBSOLETE /* constraint fault. This appears not to distinguish between -// OBSOLETE a range constraint fault (which should be SIGFPE) and a privileged -// OBSOLETE fault (which should be SIGILL). */ -// OBSOLETE case 5: -// OBSOLETE return TARGET_SIGNAL_ILL; -// OBSOLETE -// OBSOLETE case 6: -// OBSOLETE return TARGET_SIGNAL_SEGV; /* virtual memory fault */ -// OBSOLETE -// OBSOLETE /* protection fault. This is for an out-of-range argument to -// OBSOLETE "calls". I guess it also could be SIGILL. */ -// OBSOLETE case 7: -// OBSOLETE return TARGET_SIGNAL_SEGV; -// OBSOLETE -// OBSOLETE case 8: -// OBSOLETE return TARGET_SIGNAL_BUS; /* machine fault */ -// OBSOLETE case 9: -// OBSOLETE return TARGET_SIGNAL_BUS; /* structural fault */ -// OBSOLETE case 0xa: -// OBSOLETE return TARGET_SIGNAL_ILL; /* type fault */ -// OBSOLETE case 0xb: -// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ -// OBSOLETE case 0xc: -// OBSOLETE return TARGET_SIGNAL_BUS; /* process fault */ -// OBSOLETE case 0xd: -// OBSOLETE return TARGET_SIGNAL_SEGV; /* descriptor fault */ -// OBSOLETE case 0xe: -// OBSOLETE return TARGET_SIGNAL_BUS; /* event fault */ -// OBSOLETE case 0xf: -// OBSOLETE return TARGET_SIGNAL_UNKNOWN; /* reserved fault */ -// OBSOLETE case 0x10: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* single-step trace */ -// OBSOLETE case 0x11: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* branch trace */ -// OBSOLETE case 0x12: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* call trace */ -// OBSOLETE case 0x13: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* return trace */ -// OBSOLETE case 0x14: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* pre-return trace */ -// OBSOLETE case 0x15: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* supervisor call trace */ -// OBSOLETE case 0x16: -// OBSOLETE return TARGET_SIGNAL_TRAP; /* breakpoint trace */ -// OBSOLETE default: -// OBSOLETE return TARGET_SIGNAL_UNKNOWN; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /****************************************/ -// OBSOLETE /* MEM format */ -// OBSOLETE /****************************************/ -// OBSOLETE -// OBSOLETE struct tabent -// OBSOLETE { -// OBSOLETE char *name; -// OBSOLETE char numops; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Return instruction length, either 4 or 8. When NOPRINT is non-zero -// OBSOLETE (TRUE), don't output any text. (Actually, as implemented, if NOPRINT -// OBSOLETE is 0, abort() is called.) */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE mem (unsigned long memaddr, unsigned long word1, unsigned long word2, -// OBSOLETE int noprint) -// OBSOLETE { -// OBSOLETE int i, j; -// OBSOLETE int len; -// OBSOLETE int mode; -// OBSOLETE int offset; -// OBSOLETE const char *reg1, *reg2, *reg3; -// OBSOLETE -// OBSOLETE /* This lookup table is too sparse to make it worth typing in, but not -// OBSOLETE * so large as to make a sparse array necessary. We allocate the -// OBSOLETE * table at runtime, initialize all entries to empty, and copy the -// OBSOLETE * real ones in from an initialization table. -// OBSOLETE * -// OBSOLETE * NOTE: In this table, the meaning of 'numops' is: -// OBSOLETE * 1: single operand -// OBSOLETE * 2: 2 operands, load instruction -// OBSOLETE * -2: 2 operands, store instruction -// OBSOLETE */ -// OBSOLETE static struct tabent *mem_tab = NULL; -// OBSOLETE /* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */ -// OBSOLETE #define MEM_MIN 0x80 -// OBSOLETE #define MEM_MAX 0xcf -// OBSOLETE #define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent)) -// OBSOLETE -// OBSOLETE static struct -// OBSOLETE { -// OBSOLETE int opcode; -// OBSOLETE char *name; -// OBSOLETE char numops; -// OBSOLETE } -// OBSOLETE mem_init[] = -// OBSOLETE { -// OBSOLETE 0x80, "ldob", 2, -// OBSOLETE 0x82, "stob", -2, -// OBSOLETE 0x84, "bx", 1, -// OBSOLETE 0x85, "balx", 2, -// OBSOLETE 0x86, "callx", 1, -// OBSOLETE 0x88, "ldos", 2, -// OBSOLETE 0x8a, "stos", -2, -// OBSOLETE 0x8c, "lda", 2, -// OBSOLETE 0x90, "ld", 2, -// OBSOLETE 0x92, "st", -2, -// OBSOLETE 0x98, "ldl", 2, -// OBSOLETE 0x9a, "stl", -2, -// OBSOLETE 0xa0, "ldt", 2, -// OBSOLETE 0xa2, "stt", -2, -// OBSOLETE 0xb0, "ldq", 2, -// OBSOLETE 0xb2, "stq", -2, -// OBSOLETE 0xc0, "ldib", 2, -// OBSOLETE 0xc2, "stib", -2, -// OBSOLETE 0xc8, "ldis", 2, -// OBSOLETE 0xca, "stis", -2, -// OBSOLETE 0, NULL, 0 -// OBSOLETE }; -// OBSOLETE -// OBSOLETE if (mem_tab == NULL) -// OBSOLETE { -// OBSOLETE mem_tab = (struct tabent *) xmalloc (MEM_SIZ); -// OBSOLETE memset (mem_tab, '\0', MEM_SIZ); -// OBSOLETE for (i = 0; mem_init[i].opcode != 0; i++) -// OBSOLETE { -// OBSOLETE j = mem_init[i].opcode - MEM_MIN; -// OBSOLETE mem_tab[j].name = mem_init[i].name; -// OBSOLETE mem_tab[j].numops = mem_init[i].numops; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE i = ((word1 >> 24) & 0xff) - MEM_MIN; -// OBSOLETE mode = (word1 >> 10) & 0xf; -// OBSOLETE -// OBSOLETE if ((mem_tab[i].name != NULL) /* Valid instruction */ -// OBSOLETE && ((mode == 5) || (mode >= 12))) -// OBSOLETE { /* With 32-bit displacement */ -// OBSOLETE len = 8; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE len = 4; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (noprint) -// OBSOLETE { -// OBSOLETE return len; -// OBSOLETE } -// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read the i960 instruction at 'memaddr' and return the address of -// OBSOLETE the next instruction after that, or 0 if 'memaddr' is not the -// OBSOLETE address of a valid instruction. The first word of the instruction -// OBSOLETE is stored at 'pword1', and the second word, if any, is stored at -// OBSOLETE 'pword2'. */ -// OBSOLETE -// OBSOLETE static CORE_ADDR -// OBSOLETE next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2) -// OBSOLETE { -// OBSOLETE int len; -// OBSOLETE char buf[8]; -// OBSOLETE -// OBSOLETE /* Read the two (potential) words of the instruction at once, -// OBSOLETE to eliminate the overhead of two calls to read_memory (). -// OBSOLETE FIXME: Loses if the first one is readable but the second is not -// OBSOLETE (e.g. last word of the segment). */ -// OBSOLETE -// OBSOLETE read_memory (memaddr, buf, 8); -// OBSOLETE *pword1 = extract_unsigned_integer (buf, 4); -// OBSOLETE *pword2 = extract_unsigned_integer (buf + 4, 4); -// OBSOLETE -// OBSOLETE /* Divide instruction set into classes based on high 4 bits of opcode */ -// OBSOLETE -// OBSOLETE switch ((*pword1 >> 28) & 0xf) -// OBSOLETE { -// OBSOLETE case 0x0: -// OBSOLETE case 0x1: /* ctrl */ -// OBSOLETE -// OBSOLETE case 0x2: -// OBSOLETE case 0x3: /* cobr */ -// OBSOLETE -// OBSOLETE case 0x5: -// OBSOLETE case 0x6: -// OBSOLETE case 0x7: /* reg */ -// OBSOLETE len = 4; -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 0x8: -// OBSOLETE case 0x9: -// OBSOLETE case 0xa: -// OBSOLETE case 0xb: -// OBSOLETE case 0xc: -// OBSOLETE len = mem (memaddr, *pword1, *pword2, 1); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: /* invalid instruction */ -// OBSOLETE len = 0; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (len) -// OBSOLETE return memaddr + len; -// OBSOLETE else -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* 'start_frame' is a variable in the MON960 runtime startup routine -// OBSOLETE that contains the frame pointer of the 'start' routine (the routine -// OBSOLETE that calls 'main'). By reading its contents out of remote memory, -// OBSOLETE we can tell where the frame chain ends: backtraces should halt before -// OBSOLETE they display this frame. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe) -// OBSOLETE { -// OBSOLETE struct symbol *sym; -// OBSOLETE struct minimal_symbol *msymbol; -// OBSOLETE -// OBSOLETE /* crtmon960.o is an assembler module that is assumed to be linked -// OBSOLETE * first in an i80960 executable. It contains the true entry point; -// OBSOLETE * it performs startup up initialization and then calls 'main'. -// OBSOLETE * -// OBSOLETE * 'sf' is the name of a variable in crtmon960.o that is set -// OBSOLETE * during startup to the address of the first frame. -// OBSOLETE * -// OBSOLETE * 'a' is the address of that variable in 80960 memory. -// OBSOLETE */ -// OBSOLETE static char sf[] = "start_frame"; -// OBSOLETE CORE_ADDR a; -// OBSOLETE -// OBSOLETE -// OBSOLETE chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers -// OBSOLETE contain return status info in them. */ -// OBSOLETE if (chain == 0) -// OBSOLETE { -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL, -// OBSOLETE (struct symtab **) NULL); -// OBSOLETE if (sym != 0) -// OBSOLETE { -// OBSOLETE a = SYMBOL_VALUE (sym); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE msymbol = lookup_minimal_symbol (sf, NULL, NULL); -// OBSOLETE if (msymbol == NULL) -// OBSOLETE return 0; -// OBSOLETE a = SYMBOL_VALUE_ADDRESS (msymbol); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (chain != read_memory_integer (a, 4)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_i960_tdep (void) -// OBSOLETE { -// OBSOLETE check_host (); -// OBSOLETE -// OBSOLETE tm_print_insn = print_insn_i960; -// OBSOLETE } diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 76b8235..492da07 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_string.h" #include "inferior.h" #include "target.h" #include "gdbcore.h" diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 59c7c73..fab210a 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -328,9 +328,9 @@ read_sigcontext_register (struct frame_info *frame, int regnum) if (frame == NULL) internal_error (__FILE__, __LINE__, "read_sigcontext_register: NULL frame"); - if (!frame->signal_handler_caller) + if (!(get_frame_type (frame) == SIGTRAMP_FRAME)) internal_error (__FILE__, __LINE__, - "read_sigcontext_register: frame not a signal_handler_caller"); + "read_sigcontext_register: frame not a signal trampoline"); if (SIGCONTEXT_REGISTER_ADDRESS == 0) internal_error (__FILE__, __LINE__, "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); @@ -703,9 +703,9 @@ rse_address_add(CORE_ADDR addr, int nslots) CORE_ADDR ia64_frame_chain (struct frame_info *frame) { - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return read_sigcontext_register (frame, sp_regnum); - else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; else { @@ -720,9 +720,9 @@ ia64_frame_chain (struct frame_info *frame) CORE_ADDR ia64_frame_saved_pc (struct frame_info *frame) { - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return read_sigcontext_register (frame, pc_regnum); - else if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return deprecated_read_register_dummy (frame->pc, frame->frame, pc_regnum); else { @@ -730,7 +730,7 @@ ia64_frame_saved_pc (struct frame_info *frame) if (frame->saved_regs[IA64_VRAP_REGNUM]) return read_memory_integer (frame->saved_regs[IA64_VRAP_REGNUM], 8); - else if (frame->next && frame->next->signal_handler_caller) + else if (frame->next && (get_frame_type (frame->next) == SIGTRAMP_FRAME)) return read_sigcontext_register (frame->next, IA64_BR0_REGNUM); else /* either frameless, or not far enough along in the prologue... */ return ia64_saved_pc_after_call (frame); @@ -1163,7 +1163,7 @@ ia64_frame_init_saved_regs (struct frame_info *frame) if (frame->saved_regs) return; - if (frame->signal_handler_caller && SIGCONTEXT_REGISTER_ADDRESS) + if ((get_frame_type (frame) == SIGTRAMP_FRAME) && SIGCONTEXT_REGISTER_ADDRESS) { int regno; @@ -1233,7 +1233,7 @@ ia64_get_saved_register (char *raw_buffer, if (lval != NULL) *lval = not_lval; - is_dummy_frame = PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame); + is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame); if (regnum == SP_REGNUM && frame->next) { @@ -1481,7 +1481,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) { CORE_ADDR bsp, cfm; int next_frame_is_call_dummy = ((frame->next != NULL) - && PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame, + && DEPRECATED_PC_IN_CALL_DUMMY (frame->next->pc, frame->next->frame, frame->next->frame)); frame->extra_info = (struct frame_extra_info *) @@ -1493,7 +1493,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) cfm = read_register (IA64_CFM_REGNUM); } - else if (frame->next->signal_handler_caller) + else if ((get_frame_type (frame->next) == SIGTRAMP_FRAME)) { bsp = read_sigcontext_register (frame->next, IA64_BSP_REGNUM); cfm = read_sigcontext_register (frame->next, IA64_CFM_REGNUM); @@ -1515,10 +1515,10 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) if (frn->saved_regs[IA64_CFM_REGNUM] != 0) cfm = read_memory_integer (frn->saved_regs[IA64_CFM_REGNUM], 8); - else if (frn->next && frn->next->signal_handler_caller) + else if (frn->next && (get_frame_type (frn->next) == SIGTRAMP_FRAME)) cfm = read_sigcontext_register (frn->next, IA64_PFS_REGNUM); else if (frn->next - && PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame, + && DEPRECATED_PC_IN_CALL_DUMMY (frn->next->pc, frn->next->frame, frn->next->frame)) cfm = deprecated_read_register_dummy (frn->next->pc, frn->next->frame, IA64_PFS_REGNUM); @@ -1531,7 +1531,7 @@ ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame) frame->extra_info->sof = cfm & 0x7f; frame->extra_info->sol = (cfm >> 7) & 0x7f; if (frame->next == 0 - || frame->next->signal_handler_caller + || (get_frame_type (frame->next) == SIGTRAMP_FRAME) || next_frame_is_call_dummy) frame->extra_info->bsp = rse_address_add (bsp, -frame->extra_info->sof); else @@ -2120,6 +2120,9 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, tdep); tdep->os_ident = os_ident; + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); /* Set the method of obtaining the sigcontext addresses at which registers are saved. The method of checking to see if @@ -2204,7 +2207,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, ia64_write_pc); /* Settings for calling functions in the inferior. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_push_arguments (gdbarch, ia64_push_arguments); set_gdbarch_push_return_address (gdbarch, ia64_push_return_address); @@ -2231,11 +2233,9 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_read_sp (gdbarch, generic_target_read_sp); set_gdbarch_write_sp (gdbarch, generic_target_write_sp); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 9988f62..6775beb 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -183,7 +183,7 @@ CORE_ADDR step_range_end; /* Exclusive */ This is how we know when we step into a subroutine call, and how to set the frame for the breakpoint used to step out. */ -CORE_ADDR step_frame_address; +struct frame_id step_frame_id; /* Our notion of the current stack pointer. */ @@ -279,7 +279,7 @@ construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) /* We over-compute the size. It shouldn't matter. */ for (i = 0; i < argc; ++i) - length += 2 * strlen (argv[i]) + 1; + length += 2 * strlen (argv[i]) + 1 + 2 * (argv[i][0] == '\0'); result = (char *) xmalloc (length); out = result; @@ -289,11 +289,20 @@ construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) if (i > 0) *out++ = ' '; - for (cp = argv[i]; *cp; ++cp) + /* Need to handle empty arguments specially. */ + if (argv[i][0] == '\0') { - if (strchr (special, *cp) != NULL) - *out++ = '\\'; - *out++ = *cp; + *out++ = '\''; + *out++ = '\''; + } + else + { + for (cp = argv[i]; *cp; ++cp) + { + if (strchr (special, *cp) != NULL) + *out++ = '\\'; + *out++ = *cp; + } } } *out = '\0'; @@ -619,7 +628,7 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) frame = get_current_frame (); if (!frame) /* Avoid coredump here. Why tho? */ error ("No current frame"); - step_frame_address = FRAME_FP (frame); + step_frame_id = get_frame_id (frame); step_sp = read_sp (); if (!single_inst) @@ -734,7 +743,7 @@ step_once (int skip_subroutines, int single_inst, int count) frame = get_current_frame (); if (!frame) /* Avoid coredump here. Why tho? */ error ("No current frame"); - step_frame_address = FRAME_FP (frame); + step_frame_id = get_frame_id (frame); step_sp = read_sp (); if (!single_inst) @@ -993,27 +1002,28 @@ run_stack_dummy (CORE_ADDR addr, struct regcache *buffer) } else { + /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need + to put a breakpoint instruction. If not, the call dummy + already has the breakpoint instruction in it. + + ADDR IS THE ADDRESS of the call dummy plus the + CALL_DUMMY_START_OFFSET, so we need to subtract the + CALL_DUMMY_START_OFFSET. */ sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET; } sal.section = find_pc_overlay (sal.pc); - /* Set up a FRAME for the dummy frame so we can pass it to - set_momentary_breakpoint. We need to give the breakpoint a - frame in case there is only one copy of the dummy (e.g. - CALL_DUMMY_LOCATION == AFTER_TEXT_END). */ - flush_cached_frames (); - set_current_frame (create_new_frame (read_fp (), sal.pc)); - - /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put - a breakpoint instruction. If not, the call dummy already has the - breakpoint instruction in it. - - addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET, - so we need to subtract the CALL_DUMMY_START_OFFSET. */ - bpt = set_momentary_breakpoint (sal, - get_current_frame (), - bp_call_dummy); - bpt->disposition = disp_del; + { + /* Set up a frame ID for the dummy frame so we can pass it to + set_momentary_breakpoint. We need to give the breakpoint a + frame ID so that the breakpoint code can correctly + re-identify the dummy breakpoint. */ + struct frame_id frame = frame_id_build (read_fp (), sal.pc); + /* Create a momentary breakpoint at the return address of the + inferior. That way it breaks when it returns. */ + bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy); + bpt->disposition = disp_del; + } /* If all error()s out of proceed ended up calling normal_stop (and perhaps they should; it already does in the special case of error @@ -1097,7 +1107,7 @@ until_next_command (int from_tty) } step_over_calls = STEP_OVER_ALL; - step_frame_address = FRAME_FP (frame); + step_frame_id = get_frame_id (frame); step_sp = read_sp (); step_multi = 0; /* Only one call to proceed */ @@ -1264,19 +1274,19 @@ finish_command (char *arg, int from_tty) error ("The \"finish\" command does not take any arguments."); if (!target_has_execution) error ("The program is not running."); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); - frame = get_prev_frame (selected_frame); + frame = get_prev_frame (deprecated_selected_frame); if (frame == 0) error ("\"finish\" not meaningful in the outermost frame."); clear_proceed_status (); - sal = find_pc_line (frame->pc, 0); - sal.pc = frame->pc; + sal = find_pc_line (get_frame_pc (frame), 0); + sal.pc = get_frame_pc (frame); - breakpoint = set_momentary_breakpoint (sal, frame, bp_finish); + breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish); if (!event_loop_p || !target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -1285,15 +1295,15 @@ finish_command (char *arg, int from_tty) /* Find the function we will return from. */ - function = find_pc_function (selected_frame->pc); + function = find_pc_function (get_frame_pc (deprecated_selected_frame)); /* Print info on the selected frame, including level number but not source. */ if (from_tty) { printf_filtered ("Run till exit from "); - print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 0); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 0); } /* If running asynchronously and the target support asynchronous @@ -1681,13 +1691,13 @@ registers_info (char *addr_exp, int fpregs) if (!target_has_registers) error ("The program has no registers now."); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); if (!addr_exp) { gdbarch_print_registers_info (current_gdbarch, gdb_stdout, - selected_frame, -1, fpregs); + deprecated_selected_frame, -1, fpregs); return; } @@ -1724,7 +1734,7 @@ registers_info (char *addr_exp, int fpregs) if (regnum >= 0) { gdbarch_print_registers_info (current_gdbarch, gdb_stdout, - selected_frame, regnum, fpregs); + deprecated_selected_frame, regnum, fpregs); continue; } } @@ -1738,7 +1748,7 @@ registers_info (char *addr_exp, int fpregs) && regnum < NUM_REGS + NUM_PSEUDO_REGS) { gdbarch_print_registers_info (current_gdbarch, gdb_stdout, - selected_frame, regnum, fpregs); + deprecated_selected_frame, regnum, fpregs); continue; } } @@ -1764,7 +1774,7 @@ registers_info (char *addr_exp, int fpregs) if (gdbarch_register_reggroup_p (current_gdbarch, regnum, (*group))) gdbarch_print_registers_info (current_gdbarch, - gdb_stdout, selected_frame, + gdb_stdout, deprecated_selected_frame, regnum, fpregs); } continue; @@ -1794,7 +1804,7 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, { if (!target_has_registers) error ("The program has no registers now."); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); if (gdbarch_print_vector_info_p (gdbarch)) @@ -1820,7 +1830,7 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, static void vector_info (char *args, int from_tty) { - print_vector_info (current_gdbarch, gdb_stdout, selected_frame, args); + print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); } @@ -1961,7 +1971,7 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file, { if (!target_has_registers) error ("The program has no registers now."); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); if (gdbarch_print_float_info_p (gdbarch)) @@ -1995,7 +2005,7 @@ No floating-point info available for this processor.\n"); static void float_info (char *args, int from_tty) { - print_float_info (current_gdbarch, gdb_stdout, selected_frame, args); + print_float_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); } /* ARGSUSED */ diff --git a/gdb/inferior.h b/gdb/inferior.h index 2cccda1..09cd7ff 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -32,6 +32,9 @@ struct regcache; /* For enum target_signal. */ #include "target.h" +/* For struct frame_id. */ +#include "frame.h" + /* Structure in which to save the status of the inferior. Create/Save through "save_inferior_status", restore through "restore_inferior_status". @@ -234,14 +237,6 @@ extern void terminal_init_inferior_with_pgrp (int pgrp); extern int attach (int); -#if !defined(REQUIRE_ATTACH) -#define REQUIRE_ATTACH attach -#endif - -#if !defined(REQUIRE_DETACH) -#define REQUIRE_DETACH(pid,siggnal) detach (siggnal) -#endif - extern void detach (int); /* PTRACE method of waiting for inferior process. */ @@ -270,8 +265,6 @@ extern void fork_inferior (char *, char *, char **, void (*)(int), void (*)(void), char *); -extern void clone_and_follow_inferior (int, int *); - extern void startup_inferior (int); extern char *construct_inferior_arguments (struct gdbarch *, int, char **); @@ -303,6 +296,8 @@ extern int signal_pass_update (int, int); extern void get_last_target_status(ptid_t *ptid, struct target_waitstatus *status); +extern void follow_inferior_reset_breakpoints (void); + /* From infcmd.c */ extern void tty_command (char *, int); @@ -371,7 +366,7 @@ extern CORE_ADDR step_range_end; /* Exclusive */ This is how we know when we step into a subroutine call, and how to set the frame for the breakpoint used to step out. */ -extern CORE_ADDR step_frame_address; +extern struct frame_id step_frame_id; /* Our notion of the current stack pointer. */ @@ -425,14 +420,6 @@ extern int attach_flag; #define AFTER_TEXT_END 3 #define AT_ENTRY_POINT 4 -#if !defined (USE_GENERIC_DUMMY_FRAMES) -#define USE_GENERIC_DUMMY_FRAMES 0 -#endif - -#if !defined (CALL_DUMMY_LOCATION) -#define CALL_DUMMY_LOCATION ON_STACK -#endif /* No CALL_DUMMY_LOCATION. */ - #if !defined (CALL_DUMMY_ADDRESS) #define CALL_DUMMY_ADDRESS() (internal_error (__FILE__, __LINE__, "CALL_DUMMY_ADDRESS"), 0) #endif @@ -488,37 +475,41 @@ extern int attach_flag; /* Are we in a call dummy? */ -extern int pc_in_call_dummy_before_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address); -#if !GDB_MULTI_ARCH -#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == BEFORE_TEXT_END -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_before_text_end (pc, sp, frame_address) -#endif /* Before text_end. */ -#endif +/* NOTE: cagney/2002-11-24: Targets need to both switch to generic + dummy frames, and use generic_pc_in_call_dummy(). The generic + version should be able to handle all cases since that code works by + saving the address of the dummy's breakpoint (where ever it is). */ -extern int pc_in_call_dummy_after_text_end (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address); -#if !GDB_MULTI_ARCH -#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AFTER_TEXT_END -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_after_text_end (pc, sp, frame_address) -#endif -#endif +extern int deprecated_pc_in_call_dummy_before_text_end (CORE_ADDR pc, + CORE_ADDR sp, + CORE_ADDR frame_address); -extern int pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address); -#if !GDB_MULTI_ARCH -#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == ON_STACK -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_on_stack (pc, sp, frame_address) -#endif -#endif +/* NOTE: cagney/2002-11-24: Targets need to both switch to generic + dummy frames, and use generic_pc_in_call_dummy(). The generic + version should be able to handle all cases since that code works by + saving the address of the dummy's breakpoint (where ever it is). */ -extern int pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address); -#if !GDB_MULTI_ARCH -#if !defined (PC_IN_CALL_DUMMY) && CALL_DUMMY_LOCATION == AT_ENTRY_POINT -#define PC_IN_CALL_DUMMY(pc, sp, frame_address) pc_in_call_dummy_at_entry_point (pc, sp, frame_address) -#endif -#endif +extern int deprecated_pc_in_call_dummy_after_text_end (CORE_ADDR pc, + CORE_ADDR sp, + CORE_ADDR frame_address); + +/* NOTE: cagney/2002-11-24: Targets need to both switch to generic + dummy frames, and use generic_pc_in_call_dummy(). The generic + version should be able to handle all cases since that code works by + saving the address of the dummy's breakpoint (where ever it is). */ + +extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, + CORE_ADDR sp, + CORE_ADDR frame_address); + +/* NOTE: cagney/2002-11-24: Targets need to both switch to generic + dummy frames, and use generic_pc_in_call_dummy(). The generic + version should be able to handle all cases since that code works by + saving the address of the dummy's breakpoint (where ever it is). */ + +extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, + CORE_ADDR sp, + CORE_ADDR frame_address); /* It's often not enough for our clients to know whether the PC is merely somewhere within the call dummy. They may need to know whether the @@ -539,7 +530,7 @@ extern int pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, */ #if !defined(CALL_DUMMY_HAS_COMPLETED) #define CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ - PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) + DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) #endif /* If STARTUP_WITH_SHELL is set, GDB's "run" diff --git a/gdb/inflow.c b/gdb/inflow.c index d286b5e..c8df106 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -608,11 +608,11 @@ kill_command (char *arg, int from_tty) if (target_has_stack) { printf_filtered ("In %s,\n", target_longname); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) fputs_filtered ("No selected stack frame.\n", gdb_stdout); else - print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } } diff --git a/gdb/infrun.c b/gdb/infrun.c index 88c59c5..aa404cf 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -66,12 +66,7 @@ static int restore_selected_frame (void *); static void build_infrun (void); -static void follow_inferior_fork (int parent_pid, int child_pid, - int has_forked, int has_vforked); - -static void follow_fork (int parent_pid, int child_pid); - -static void follow_vfork (int parent_pid, int child_pid); +static int follow_fork (); static void set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c); @@ -360,43 +355,19 @@ static struct struct { int parent_pid; - int saw_parent_fork; int child_pid; - int saw_child_fork; - int saw_child_exec; } fork_event; char *execd_pathname; } pending_follow; -/* Some platforms don't allow us to do anything meaningful with a - vforked child until it has exec'd. Vforked processes on such - platforms can only be followed after they've exec'd. - - When this is set to 0, a vfork can be immediately followed, - and an exec can be followed merely as an exec. When this is - set to 1, a vfork event has been seen, but cannot be followed - until the exec is seen. - - (In the latter case, inferior_ptid is still the parent of the - vfork, and pending_follow.fork_event.child_pid is the child. The - appropriate process is followed, according to the setting of - follow-fork-mode.) */ -static int follow_vfork_when_exec; - static const char follow_fork_mode_ask[] = "ask"; -static const char follow_fork_mode_both[] = "both"; static const char follow_fork_mode_child[] = "child"; static const char follow_fork_mode_parent[] = "parent"; static const char *follow_fork_mode_kind_names[] = { follow_fork_mode_ask, - /* ??rehrauer: The "both" option is broken, by what may be a 10.20 - kernel problem. It's also not terribly useful without a GUI to - help the user drive two debuggers. So for now, I'm disabling the - "both" option. */ - /* follow_fork_mode_both, */ follow_fork_mode_child, follow_fork_mode_parent, NULL @@ -405,15 +376,11 @@ static const char *follow_fork_mode_kind_names[] = { static const char *follow_fork_mode_string = follow_fork_mode_parent; -static void -follow_inferior_fork (int parent_pid, int child_pid, int has_forked, - int has_vforked) +static int +follow_fork () { - int followed_parent = 0; - int followed_child = 0; - - /* Which process did the user want us to follow? */ const char *follow_mode = follow_fork_mode_string; + int follow_child = (follow_mode == follow_fork_mode_child); /* Or, did the user not know, and want us to ask? */ if (follow_fork_mode_string == follow_fork_mode_ask) @@ -423,175 +390,33 @@ follow_inferior_fork (int parent_pid, int child_pid, int has_forked, /* follow_mode = follow_fork_mode_...; */ } - /* If we're to be following the parent, then detach from child_pid. - We're already following the parent, so need do nothing explicit - for it. */ - if (follow_mode == follow_fork_mode_parent) - { - followed_parent = 1; - - /* We're already attached to the parent, by default. */ - - /* Before detaching from the child, remove all breakpoints from - it. (This won't actually modify the breakpoint list, but will - physically remove the breakpoints from the child.) */ - if (!has_vforked || !follow_vfork_when_exec) - { - detach_breakpoints (child_pid); -#ifdef SOLIB_REMOVE_INFERIOR_HOOK - SOLIB_REMOVE_INFERIOR_HOOK (child_pid); -#endif - } - - /* Detach from the child. */ - dont_repeat (); - - target_require_detach (child_pid, "", 1); - } - - /* If we're to be following the child, then attach to it, detach - from inferior_ptid, and set inferior_ptid to child_pid. */ - else if (follow_mode == follow_fork_mode_child) - { - char child_pid_spelling[100]; /* Arbitrary length. */ - - followed_child = 1; - - /* Before detaching from the parent, detach all breakpoints from - the child. But only if we're forking, or if we follow vforks - as soon as they happen. (If we're following vforks only when - the child has exec'd, then it's very wrong to try to write - back the "shadow contents" of inserted breakpoints now -- they - belong to the child's pre-exec'd a.out.) */ - if (!has_vforked || !follow_vfork_when_exec) - { - detach_breakpoints (child_pid); - } - - /* Before detaching from the parent, remove all breakpoints from it. */ - remove_breakpoints (); - - /* Also reset the solib inferior hook from the parent. */ -#ifdef SOLIB_REMOVE_INFERIOR_HOOK - SOLIB_REMOVE_INFERIOR_HOOK (PIDGET (inferior_ptid)); -#endif - - /* Detach from the parent. */ - dont_repeat (); - target_detach (NULL, 1); - - /* Attach to the child. */ - inferior_ptid = pid_to_ptid (child_pid); - sprintf (child_pid_spelling, "%d", child_pid); - dont_repeat (); - - target_require_attach (child_pid_spelling, 1); - - /* Was there a step_resume breakpoint? (There was if the user - did a "next" at the fork() call.) If so, explicitly reset its - thread number. - - step_resumes are a form of bp that are made to be per-thread. - Since we created the step_resume bp when the parent process - was being debugged, and now are switching to the child process, - from the breakpoint package's viewpoint, that's a switch of - "threads". We must update the bp's notion of which thread - it is for, or it'll be ignored when it triggers... */ - if (step_resume_breakpoint && (!has_vforked || !follow_vfork_when_exec)) - breakpoint_re_set_thread (step_resume_breakpoint); - - /* Reinsert all breakpoints in the child. (The user may've set - breakpoints after catching the fork, in which case those - actually didn't get set in the child, but only in the parent.) */ - if (!has_vforked || !follow_vfork_when_exec) - { - breakpoint_re_set (); - insert_breakpoints (); - } - } - - /* If we're to be following both parent and child, then fork ourselves, - and attach the debugger clone to the child. */ - else if (follow_mode == follow_fork_mode_both) - { - char pid_suffix[100]; /* Arbitrary length. */ - - /* Clone ourselves to follow the child. This is the end of our - involvement with child_pid; our clone will take it from here... */ - dont_repeat (); - target_clone_and_follow_inferior (child_pid, &followed_child); - followed_parent = !followed_child; - - /* We continue to follow the parent. To help distinguish the two - debuggers, though, both we and our clone will reset our prompts. */ - sprintf (pid_suffix, "[%d] ", PIDGET (inferior_ptid)); - set_prompt (strcat (get_prompt (), pid_suffix)); - } - - /* The parent and child of a vfork share the same address space. - Also, on some targets the order in which vfork and exec events - are received for parent in child requires some delicate handling - of the events. - - For instance, on ptrace-based HPUX we receive the child's vfork - event first, at which time the parent has been suspended by the - OS and is essentially untouchable until the child's exit or second - exec event arrives. At that time, the parent's vfork event is - delivered to us, and that's when we see and decide how to follow - the vfork. But to get to that point, we must continue the child - until it execs or exits. To do that smoothly, all breakpoints - must be removed from the child, in case there are any set between - the vfork() and exec() calls. But removing them from the child - also removes them from the parent, due to the shared-address-space - nature of a vfork'd parent and child. On HPUX, therefore, we must - take care to restore the bp's to the parent before we continue it. - Else, it's likely that we may not stop in the expected place. (The - worst scenario is when the user tries to step over a vfork() call; - the step-resume bp must be restored for the step to properly stop - in the parent after the call completes!) - - Sequence of events, as reported to gdb from HPUX: - - Parent Child Action for gdb to take - ------------------------------------------------------- - 1 VFORK Continue child - 2 EXEC - 3 EXEC or EXIT - 4 VFORK */ - if (has_vforked) - { - target_post_follow_vfork (parent_pid, - followed_parent, child_pid, followed_child); - } - - pending_follow.fork_event.saw_parent_fork = 0; - pending_follow.fork_event.saw_child_fork = 0; + return target_follow_fork (follow_child); } -static void -follow_fork (int parent_pid, int child_pid) +void +follow_inferior_reset_breakpoints (void) { - follow_inferior_fork (parent_pid, child_pid, 1, 0); -} + /* Was there a step_resume breakpoint? (There was if the user + did a "next" at the fork() call.) If so, explicitly reset its + thread number. + step_resumes are a form of bp that are made to be per-thread. + Since we created the step_resume bp when the parent process + was being debugged, and now are switching to the child process, + from the breakpoint package's viewpoint, that's a switch of + "threads". We must update the bp's notion of which thread + it is for, or it'll be ignored when it triggers. */ -/* Forward declaration. */ -static void follow_exec (int, char *); + if (step_resume_breakpoint) + breakpoint_re_set_thread (step_resume_breakpoint); -static void -follow_vfork (int parent_pid, int child_pid) -{ - follow_inferior_fork (parent_pid, child_pid, 0, 1); + /* Reinsert all breakpoints in the child. The user may have set + breakpoints after catching the fork, in which case those + were never set in the child, but only in the parent. This makes + sure the inserted breakpoints match the breakpoint list. */ - /* Did we follow the child? Had it exec'd before we saw the parent vfork? */ - if (pending_follow.fork_event.saw_child_exec - && (PIDGET (inferior_ptid) == child_pid)) - { - pending_follow.fork_event.saw_child_exec = 0; - pending_follow.kind = TARGET_WAITKIND_SPURIOUS; - follow_exec (PIDGET (inferior_ptid), pending_follow.execd_pathname); - xfree (pending_follow.execd_pathname); - } + breakpoint_re_set (); + insert_breakpoints (); } /* EXECD_PATHNAME is assumed to be non-NULL. */ @@ -605,23 +430,6 @@ follow_exec (int pid, char *execd_pathname) if (!may_follow_exec) return; - /* Did this exec() follow a vfork()? If so, we must follow the - vfork now too. Do it before following the exec. */ - if (follow_vfork_when_exec && - (pending_follow.kind == TARGET_WAITKIND_VFORKED)) - { - pending_follow.kind = TARGET_WAITKIND_SPURIOUS; - follow_vfork (PIDGET (inferior_ptid), - pending_follow.fork_event.child_pid); - follow_vfork_when_exec = 0; - saved_pid = PIDGET (inferior_ptid); - - /* Did we follow the parent? If so, we're done. If we followed - the child then we must also follow its exec(). */ - if (PIDGET (inferior_ptid) == pending_follow.fork_event.parent_pid) - return; - } - /* This is an exec event that we actually wish to pay attention to. Refresh our symbol table to the newly exec'd program, remove any momentary bp's, etc. @@ -797,38 +605,19 @@ resume (int step, enum target_signal sig) #endif /* If there were any forks/vforks/execs that were caught and are - now to be followed, then do so. */ + now to be followed, then do so. */ switch (pending_follow.kind) { - case (TARGET_WAITKIND_FORKED): + case TARGET_WAITKIND_FORKED: + case TARGET_WAITKIND_VFORKED: pending_follow.kind = TARGET_WAITKIND_SPURIOUS; - follow_fork (PIDGET (inferior_ptid), - pending_follow.fork_event.child_pid); + if (follow_fork ()) + should_resume = 0; break; - case (TARGET_WAITKIND_VFORKED): - { - int saw_child_exec = pending_follow.fork_event.saw_child_exec; - - pending_follow.kind = TARGET_WAITKIND_SPURIOUS; - follow_vfork (PIDGET (inferior_ptid), - pending_follow.fork_event.child_pid); - - /* Did we follow the child, but not yet see the child's exec event? - If so, then it actually ought to be waiting for us; we respond to - parent vfork events. We don't actually want to resume the child - in this situation; we want to just get its exec event. */ - if (!saw_child_exec && - (PIDGET (inferior_ptid) == pending_follow.fork_event.child_pid)) - should_resume = 0; - } - break; - - case (TARGET_WAITKIND_EXECD): - /* If we saw a vfork event but couldn't follow it until we saw - an exec, then now might be the time! */ - pending_follow.kind = TARGET_WAITKIND_SPURIOUS; + case TARGET_WAITKIND_EXECD: /* follow_exec is called as soon as the exec event is seen. */ + pending_follow.kind = TARGET_WAITKIND_SPURIOUS; break; default: @@ -887,7 +676,7 @@ clear_proceed_status (void) trap_expected = 0; step_range_start = 0; step_range_end = 0; - step_frame_address = 0; + step_frame_id = null_frame_id; step_over_calls = STEP_OVER_UNDEBUGGABLE; stop_after_trap = 0; stop_soon_quietly = 0; @@ -1075,9 +864,6 @@ init_wait_for_inferior (void) /* The first resume is not following a fork/vfork/exec. */ pending_follow.kind = TARGET_WAITKIND_SPURIOUS; /* I.e., none. */ - pending_follow.fork_event.saw_parent_fork = 0; - pending_follow.fork_event.saw_child_fork = 0; - pending_follow.fork_event.saw_child_exec = 0; /* See wait_for_inferior's handling of SYSCALL_ENTRY/RETURN events. */ number_of_threads_in_syscalls = 0; @@ -1356,7 +1142,7 @@ context_switch (struct execution_control_state *ecs) prev_func_start, prev_func_name, trap_expected, step_resume_breakpoint, through_sigtramp_breakpoint, step_range_start, - step_range_end, step_frame_address, + step_range_end, &step_frame_id, ecs->handling_longjmp, ecs->another_trap, ecs->stepping_through_solib_after_catch, ecs->stepping_through_solib_catchpoints, @@ -1368,7 +1154,7 @@ context_switch (struct execution_control_state *ecs) &prev_func_start, &prev_func_name, &trap_expected, &step_resume_breakpoint, &through_sigtramp_breakpoint, &step_range_start, - &step_range_end, &step_frame_address, + &step_range_end, &step_frame_id, &ecs->handling_longjmp, &ecs->another_trap, &ecs->stepping_through_solib_after_catch, &ecs->stepping_through_solib_catchpoints, @@ -1540,108 +1326,40 @@ handle_inferior_event (struct execution_control_state *ecs) /* The following are the only cases in which we keep going; the above cases end in a continue or goto. */ case TARGET_WAITKIND_FORKED: + case TARGET_WAITKIND_VFORKED: stop_signal = TARGET_SIGNAL_TRAP; pending_follow.kind = ecs->ws.kind; - /* Ignore fork events reported for the parent; we're only - interested in reacting to forks of the child. Note that - we expect the child's fork event to be available if we - waited for it now. */ - if (ptid_equal (inferior_ptid, ecs->ptid)) - { - pending_follow.fork_event.saw_parent_fork = 1; - pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid); - pending_follow.fork_event.child_pid = ecs->ws.value.related_pid; - prepare_to_wait (ecs); - return; - } - else - { - pending_follow.fork_event.saw_child_fork = 1; - pending_follow.fork_event.child_pid = PIDGET (ecs->ptid); - pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid; - } + pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid); + pending_follow.fork_event.child_pid = ecs->ws.value.related_pid; - stop_pc = read_pc_pid (ecs->ptid); - ecs->saved_inferior_ptid = inferior_ptid; - inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); - ecs->random_signal = !bpstat_explains_signal (stop_bpstat); - inferior_ptid = ecs->saved_inferior_ptid; - goto process_event_stop_test; + stop_pc = read_pc (); - /* If this a platform which doesn't allow a debugger to touch a - vfork'd inferior until after it exec's, then we'd best keep - our fingers entirely off the inferior, other than continuing - it. This has the unfortunate side-effect that catchpoints - of vforks will be ignored. But since the platform doesn't - allow the inferior be touched at vfork time, there's really - little choice. */ - case TARGET_WAITKIND_VFORKED: - stop_signal = TARGET_SIGNAL_TRAP; - pending_follow.kind = ecs->ws.kind; + /* Assume that catchpoints are not really software breakpoints. If + some future target implements them using software breakpoints then + that target is responsible for fudging DECR_PC_AFTER_BREAK. Thus + we pass 1 for the NOT_A_SW_BREAKPOINT argument, so that + bpstat_stop_status will not decrement the PC. */ - /* Is this a vfork of the parent? If so, then give any - vfork catchpoints a chance to trigger now. (It's - dangerous to do so if the child canot be touched until - it execs, and the child has not yet exec'd. We probably - should warn the user to that effect when the catchpoint - triggers...) */ - if (ptid_equal (ecs->ptid, inferior_ptid)) - { - pending_follow.fork_event.saw_parent_fork = 1; - pending_follow.fork_event.parent_pid = PIDGET (ecs->ptid); - pending_follow.fork_event.child_pid = ecs->ws.value.related_pid; - } + stop_bpstat = bpstat_stop_status (&stop_pc, 1); - /* If we've seen the child's vfork event but cannot really touch - the child until it execs, then we must continue the child now. - Else, give any vfork catchpoints a chance to trigger now. */ - else + ecs->random_signal = !bpstat_explains_signal (stop_bpstat); + + /* If no catchpoint triggered for this, then keep going. */ + if (ecs->random_signal) { - pending_follow.fork_event.saw_child_fork = 1; - pending_follow.fork_event.child_pid = PIDGET (ecs->ptid); - pending_follow.fork_event.parent_pid = ecs->ws.value.related_pid; - target_post_startup_inferior (pid_to_ptid - (pending_follow.fork_event. - child_pid)); - follow_vfork_when_exec = !target_can_follow_vfork_prior_to_exec (); - if (follow_vfork_when_exec) - { - target_resume (ecs->ptid, 0, TARGET_SIGNAL_0); - prepare_to_wait (ecs); - return; - } + stop_signal = TARGET_SIGNAL_0; + keep_going (ecs); + return; } - - stop_pc = read_pc (); - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); - ecs->random_signal = !bpstat_explains_signal (stop_bpstat); goto process_event_stop_test; case TARGET_WAITKIND_EXECD: stop_signal = TARGET_SIGNAL_TRAP; + /* NOTE drow/2002-12-05: This code should be pushed down into the + target_wait function. Until then following vfork on HP/UX 10.20 + is probably broken by this. Of course, it's broken anyway. */ /* Is this a target which reports multiple exec events per actual call to exec()? (HP-UX using ptrace does, for example.) If so, ignore all but the last one. Just resume the exec'r, and wait @@ -1663,36 +1381,6 @@ handle_inferior_event (struct execution_control_state *ecs) savestring (ecs->ws.value.execd_pathname, strlen (ecs->ws.value.execd_pathname)); - /* Did inferior_ptid exec, or did a (possibly not-yet-followed) - child of a vfork exec? - - ??rehrauer: This is unabashedly an HP-UX specific thing. On - HP-UX, events associated with a vforking inferior come in - threes: a vfork event for the child (always first), followed - a vfork event for the parent and an exec event for the child. - The latter two can come in either order. - - If we get the parent vfork event first, life's good: We follow - either the parent or child, and then the child's exec event is - a "don't care". - - But if we get the child's exec event first, then we delay - responding to it until we handle the parent's vfork. Because, - otherwise we can't satisfy a "catch vfork". */ - if (pending_follow.kind == TARGET_WAITKIND_VFORKED) - { - pending_follow.fork_event.saw_child_exec = 1; - - /* On some targets, the child must be resumed before - the parent vfork event is delivered. A single-step - suffices. */ - if (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK ()) - target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); - /* We expect the parent vfork event to be available now. */ - prepare_to_wait (ecs); - return; - } - /* This causes the eventpoints and symbol table to be reset. Must do this now, before trying to determine whether to stop. */ follow_exec (PIDGET (inferior_ptid), pending_follow.execd_pathname); @@ -1701,19 +1389,25 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = read_pc_pid (ecs->ptid); ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - /* The second argument of bpstat_stop_status is meant to help - distinguish between a breakpoint trap and a singlestep trap. - This is only important on targets where DECR_PC_AFTER_BREAK - is non-zero. The prev_pc test is meant to distinguish between - singlestepping a trap instruction, and singlestepping thru a - jump to the instruction following a trap instruction. */ - - stop_bpstat = bpstat_stop_status (&stop_pc, - currently_stepping (ecs) && - prev_pc != - stop_pc - DECR_PC_AFTER_BREAK); + + /* Assume that catchpoints are not really software breakpoints. If + some future target implements them using software breakpoints then + that target is responsible for fudging DECR_PC_AFTER_BREAK. Thus + we pass 1 for the NOT_A_SW_BREAKPOINT argument, so that + bpstat_stop_status will not decrement the PC. */ + + stop_bpstat = bpstat_stop_status (&stop_pc, 1); + ecs->random_signal = !bpstat_explains_signal (stop_bpstat); inferior_ptid = ecs->saved_inferior_ptid; + + /* If no catchpoint triggered for this, then keep going. */ + if (ecs->random_signal) + { + stop_signal = TARGET_SIGNAL_0; + keep_going (ecs); + return; + } goto process_event_stop_test; /* These syscall events are returned on HP-UX, as part of its @@ -1775,13 +1469,15 @@ handle_inferior_event (struct execution_control_state *ecs) /* We had an event in the inferior, but we are not interested in handling it at this level. The lower layers have already - done what needs to be done, if anything. This case can - occur only when the target is async or extended-async. One - of the circumstamces for this to happen is when the - inferior produces output for the console. The inferior has - not stopped, and we are ignoring the event. */ + done what needs to be done, if anything. + + One of the possible circumstances for this is when the + inferior produces output for the console. The inferior has + not stopped, and we are ignoring the event. Another possible + circumstance is any event which the lower level knows will be + reported multiple times without an intervening resume. */ case TARGET_WAITKIND_IGNORE: - ecs->wait_some_more = 1; + prepare_to_wait (ecs); return; } @@ -2124,8 +1820,8 @@ handle_inferior_event (struct execution_control_state *ecs) = !(bpstat_explains_signal (stop_bpstat) || trap_expected || (!CALL_DUMMY_BREAKPOINT_OFFSET_P - && PC_IN_CALL_DUMMY (stop_pc, read_sp (), - FRAME_FP (get_current_frame ()))) + && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (), + get_frame_base (get_current_frame ()))) || (step_range_end && step_resume_breakpoint == NULL)); else @@ -2135,8 +1831,8 @@ handle_inferior_event (struct execution_control_state *ecs) news) give another signal besides SIGTRAP, so check here as well as above. */ || (!CALL_DUMMY_BREAKPOINT_OFFSET_P - && PC_IN_CALL_DUMMY (stop_pc, read_sp (), - FRAME_FP + && DEPRECATED_PC_IN_CALL_DUMMY (stop_pc, read_sp (), + get_frame_base (get_current_frame ())))); if (!ecs->random_signal) @@ -2150,54 +1846,8 @@ handle_inferior_event (struct execution_control_state *ecs) else ecs->random_signal = 1; - /* If a fork, vfork or exec event was seen, then there are two - possible responses we can make: - - 1. If a catchpoint triggers for the event (ecs->random_signal == 0), - then we must stop now and issue a prompt. We will resume - the inferior when the user tells us to. - 2. If no catchpoint triggers for the event (ecs->random_signal == 1), - then we must resume the inferior now and keep checking. - - In either case, we must take appropriate steps to "follow" the - the fork/vfork/exec when the inferior is resumed. For example, - if follow-fork-mode is "child", then we must detach from the - parent inferior and follow the new child inferior. - - In either case, setting pending_follow causes the next resume() - to take the appropriate following action. */ -process_event_stop_test: - if (ecs->ws.kind == TARGET_WAITKIND_FORKED) - { - if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */ - { - trap_expected = 1; - stop_signal = TARGET_SIGNAL_0; - keep_going (ecs); - return; - } - } - else if (ecs->ws.kind == TARGET_WAITKIND_VFORKED) - { - if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */ - { - stop_signal = TARGET_SIGNAL_0; - keep_going (ecs); - return; - } - } - else if (ecs->ws.kind == TARGET_WAITKIND_EXECD) - { - pending_follow.kind = ecs->ws.kind; - if (ecs->random_signal) /* I.e., no catchpoint triggered for this. */ - { - trap_expected = 1; - stop_signal = TARGET_SIGNAL_0; - keep_going (ecs); - return; - } - } +process_event_stop_test: /* For the program's own signals, act according to the signal handling tables. */ @@ -2315,7 +1965,7 @@ process_event_stop_test: set_longjmp_resume_breakpoint (jmp_buf_pc, get_current_frame ()); else #endif /* 0 */ - set_longjmp_resume_breakpoint (jmp_buf_pc, NULL); + set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id); ecs->handling_longjmp = 1; /* FIXME */ keep_going (ecs); return; @@ -2327,8 +1977,8 @@ process_event_stop_test: #if 0 /* FIXME - Need to implement nested temporary breakpoints */ if (step_over_calls - && (INNER_THAN (FRAME_FP (get_current_frame ()), - step_frame_address))) + && (frame_id_inner (get_frame_id (get_current_frame ()), + step_frame_id))) { ecs->another_trap = 1; keep_going (ecs); @@ -2538,7 +2188,7 @@ process_event_stop_test: case she'd better know what she's doing. */ if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (), - FRAME_FP (get_current_frame ())) + get_frame_base (get_current_frame ())) && !step_range_end) { stop_print_frame = 0; @@ -2608,7 +2258,7 @@ process_event_stop_test: check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, NULL, bp_step_resume); + set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); if (breakpoints_inserted) insert_breakpoints (); } @@ -2639,9 +2289,9 @@ process_event_stop_test: { - CORE_ADDR current_frame = FRAME_FP (get_current_frame ()); + struct frame_id current_frame = get_frame_id (get_current_frame ()); - if (INNER_THAN (current_frame, step_frame_address)) + if (frame_id_inner (current_frame, step_frame_id)) { /* We have just taken a signal; go until we are back to the point where we took it and one more. */ @@ -2661,11 +2311,10 @@ process_event_stop_test: sr_sal.line = 0; sr_sal.pc = prev_pc; /* We could probably be setting the frame to - step_frame_address; I don't think anyone thought to - try it. */ + step_frame_id; I don't think anyone thought to try it. */ check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, NULL, bp_step_resume); + set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); if (breakpoints_inserted) insert_breakpoints (); } @@ -2736,17 +2385,17 @@ process_event_stop_test: /* We're doing a "next". */ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name) - && INNER_THAN (step_frame_address, read_sp ())) + && frame_id_inner (step_frame_id, + frame_id_build (read_sp (), 0))) /* We stepped out of a signal handler, and into its calling trampoline. This is misdetected as a subroutine call, but stepping over the signal - trampoline isn't such a bad idea. In order to do - that, we have to ignore the value in - step_frame_address, since that doesn't represent the - frame that'll reach when we return from the signal - trampoline. Otherwise we'll probably continue to the - end of the program. */ - step_frame_address = 0; + trampoline isn't such a bad idea. In order to do that, + we have to ignore the value in step_frame_id, since + that doesn't represent the frame that'll reach when we + return from the signal trampoline. Otherwise we'll + probably continue to the end of the program. */ + step_frame_id = null_frame_id; step_over_function (ecs); keep_going (ecs); @@ -2774,7 +2423,7 @@ process_event_stop_test: xxx.section = find_pc_overlay (xxx.pc); check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (xxx, NULL, bp_step_resume); + set_momentary_breakpoint (xxx, null_frame_id, bp_step_resume); insert_breakpoints (); keep_going (ecs); return; @@ -2852,7 +2501,7 @@ process_event_stop_test: is where the new fp value is established. */ check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, NULL, bp_step_resume); + set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); if (breakpoints_inserted) insert_breakpoints (); @@ -2910,17 +2559,17 @@ process_event_stop_test: } step_range_start = ecs->sal.pc; step_range_end = ecs->sal.end; - step_frame_address = FRAME_FP (get_current_frame ()); + step_frame_id = get_frame_id (get_current_frame ()); ecs->current_line = ecs->sal.line; ecs->current_symtab = ecs->sal.symtab; - /* In the case where we just stepped out of a function into the middle - of a line of the caller, continue stepping, but step_frame_address - must be modified to current frame */ + /* In the case where we just stepped out of a function into the + middle of a line of the caller, continue stepping, but + step_frame_id must be modified to current frame */ { - CORE_ADDR current_frame = FRAME_FP (get_current_frame ()); - if (!(INNER_THAN (current_frame, step_frame_address))) - step_frame_address = current_frame; + struct frame_id current_frame = get_frame_id (get_current_frame ()); + if (!(frame_id_inner (current_frame, step_frame_id))) + step_frame_id = current_frame; } keep_going (ecs); @@ -2966,7 +2615,7 @@ check_sigtramp2 (struct execution_control_state *ecs) /* We perhaps could set the frame if we kept track of what the frame corresponding to prev_pc was. But we don't, so don't. */ through_sigtramp_breakpoint = - set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp); + set_momentary_breakpoint (sr_sal, null_frame_id, bp_through_sigtramp); if (breakpoints_inserted) insert_breakpoints (); @@ -3024,7 +2673,7 @@ step_into_function (struct execution_control_state *ecs) established. */ check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, NULL, bp_step_resume); + set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); if (breakpoints_inserted) insert_breakpoints (); @@ -3043,7 +2692,7 @@ step_into_function (struct execution_control_state *ecs) of the call. To do this, we set the step_resume bp's frame to our current - caller's frame (step_frame_address, which is set by the "next" or + caller's frame (step_frame_id, which is set by the "next" or "until" command, before execution begins). */ static void @@ -3057,10 +2706,12 @@ step_over_function (struct execution_control_state *ecs) check_for_old_step_resume_breakpoint (); step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, get_current_frame (), bp_step_resume); + set_momentary_breakpoint (sr_sal, get_frame_id (get_current_frame ()), + bp_step_resume); - if (step_frame_address && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc)) - step_resume_breakpoint->frame = step_frame_address; + if (frame_id_p (step_frame_id) + && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc)) + step_resume_breakpoint->frame_id = step_frame_id; if (breakpoints_inserted) insert_breakpoints (); @@ -3071,30 +2722,6 @@ stop_stepping (struct execution_control_state *ecs) { if (target_has_execution) { - /* Are we stopping for a vfork event? We only stop when we see - the child's event. However, we may not yet have seen the - parent's event. And, inferior_ptid is still set to the - parent's pid, until we resume again and follow either the - parent or child. - - To ensure that we can really touch inferior_ptid (aka, the - parent process) -- which calls to functions like read_pc - implicitly do -- wait on the parent if necessary. */ - if ((pending_follow.kind == TARGET_WAITKIND_VFORKED) - && !pending_follow.fork_event.saw_parent_fork) - { - ptid_t parent_ptid; - - do - { - if (target_wait_hook) - parent_ptid = target_wait_hook (pid_to_ptid (-1), &(ecs->ws)); - else - parent_ptid = target_wait (pid_to_ptid (-1), &(ecs->ws)); - } - while (!ptid_equal (parent_ptid, inferior_ptid)); - } - /* Assuming the inferior still exists, set these up for next time, just like we did above if we didn't break out of the loop. */ @@ -3114,16 +2741,6 @@ stop_stepping (struct execution_control_state *ecs) static void keep_going (struct execution_control_state *ecs) { - /* ??rehrauer: ttrace on HP-UX theoretically allows one to debug a - vforked child between its creation and subsequent exit or call to - exec(). However, I had big problems in this rather creaky exec - engine, getting that to work. The fundamental problem is that - I'm trying to debug two processes via an engine that only - understands a single process with possibly multiple threads. - - Hence, this spot is known to have problems when - target_can_follow_vfork_prior_to_exec returns 1. */ - /* Save the pc before execution, to compare with pc after stop. */ prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */ prev_func_start = ecs->stop_func_start; /* Ok, since if DECR_PC_AFTER @@ -3363,8 +2980,12 @@ normal_stop (void) /* Make sure that the current_frame's pc is correct. This is a correction for setting up the frame info before doing DECR_PC_AFTER_BREAK */ - if (target_has_execution && get_current_frame ()) - (get_current_frame ())->pc = read_pc (); + if (target_has_execution) + /* FIXME: cagney/2002-12-06: Has the PC changed? Thanks to + DECR_PC_AFTER_BREAK, the program counter can change. Ask the + frame code to check for this and sort out any resultant mess. + DECR_PC_AFTER_BREAK needs to just go away. */ + deprecated_update_frame_pc_hack (get_current_frame (), read_pc ()); if (target_has_execution && breakpoints_inserted) { @@ -3424,7 +3045,7 @@ normal_stop (void) bpstat_print() contains the logic deciding in detail what to print, based on the event(s) that just occurred. */ - if (stop_print_frame && selected_frame) + if (stop_print_frame && deprecated_selected_frame) { int bpstat_ret; int source_flag; @@ -3434,8 +3055,12 @@ normal_stop (void) switch (bpstat_ret) { case PRINT_UNKNOWN: + /* FIXME: cagney/2002-12-01: Given that a frame ID does + (or should) carry around the function and does (or + should) use that when doing a frame comparison. */ if (stop_step - && step_frame_address == FRAME_FP (get_current_frame ()) + && frame_id_eq (step_frame_id, + get_frame_id (get_current_frame ())) && step_start_function == find_pc_function (stop_pc)) source_flag = SRC_LINE; /* finished step, just print source line */ else @@ -3468,7 +3093,7 @@ normal_stop (void) LOCATION: Print only location SRC_AND_LOC: Print location and source line */ if (do_frame_printing) - show_and_print_stack_frame (selected_frame, -1, source_flag); + show_and_print_stack_frame (deprecated_selected_frame, -1, source_flag); /* Display the auto-display expressions. */ do_displays (); @@ -3873,7 +3498,7 @@ struct inferior_status int trap_expected; CORE_ADDR step_range_start; CORE_ADDR step_range_end; - CORE_ADDR step_frame_address; + struct frame_id step_frame_id; enum step_over_calls_kind step_over_calls; CORE_ADDR step_resume_break_address; int stop_after_trap; @@ -3920,7 +3545,7 @@ save_inferior_status (int restore_stack_info) inf_status->trap_expected = trap_expected; inf_status->step_range_start = step_range_start; inf_status->step_range_end = step_range_end; - inf_status->step_frame_address = step_frame_address; + inf_status->step_frame_id = step_frame_id; inf_status->step_over_calls = step_over_calls; inf_status->stop_after_trap = stop_after_trap; inf_status->stop_soon_quietly = stop_soon_quietly; @@ -3938,7 +3563,7 @@ save_inferior_status (int restore_stack_info) inf_status->registers = regcache_dup (current_regcache); - get_frame_id (selected_frame, &inf_status->selected_frame_id); + inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame); return inf_status; } @@ -3950,8 +3575,8 @@ restore_selected_frame (void *args) frame = frame_find_by_id (*fid); - /* If inf_status->selected_frame_address is NULL, there was no - previously selected frame. */ + /* If inf_status->selected_frame_id is NULL, there was no previously + selected frame. */ if (frame == NULL) { warning ("Unable to restore previously selected frame.\n"); @@ -3974,7 +3599,7 @@ restore_inferior_status (struct inferior_status *inf_status) trap_expected = inf_status->trap_expected; step_range_start = inf_status->step_range_start; step_range_end = inf_status->step_range_end; - step_frame_address = inf_status->step_frame_address; + step_frame_id = inf_status->step_frame_id; step_over_calls = inf_status->step_over_calls; stop_after_trap = inf_status->stop_after_trap; stop_soon_quietly = inf_status->stop_soon_quietly; @@ -4041,6 +3666,60 @@ discard_inferior_status (struct inferior_status *inf_status) xfree (inf_status); } +int +inferior_has_forked (int pid, int *child_pid) +{ + struct target_waitstatus last; + ptid_t last_ptid; + + get_last_target_status (&last_ptid, &last); + + if (last.kind != TARGET_WAITKIND_FORKED) + return 0; + + if (ptid_get_pid (last_ptid) != pid) + return 0; + + *child_pid = last.value.related_pid; + return 1; +} + +int +inferior_has_vforked (int pid, int *child_pid) +{ + struct target_waitstatus last; + ptid_t last_ptid; + + get_last_target_status (&last_ptid, &last); + + if (last.kind != TARGET_WAITKIND_VFORKED) + return 0; + + if (ptid_get_pid (last_ptid) != pid) + return 0; + + *child_pid = last.value.related_pid; + return 1; +} + +int +inferior_has_execd (int pid, char **execd_pathname) +{ + struct target_waitstatus last; + ptid_t last_ptid; + + get_last_target_status (&last_ptid, &last); + + if (last.kind != TARGET_WAITKIND_EXECD) + return 0; + + if (ptid_get_pid (last_ptid) != pid) + return 0; + + *execd_pathname = xstrdup (last.value.execd_pathname); + return 1; +} + /* Oft used ptids */ ptid_t null_ptid; ptid_t minus_one_ptid; diff --git a/gdb/inftarg.c b/gdb/inftarg.c index e496811..471eb3c 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -61,20 +61,12 @@ static void child_files_info (struct target_ops *); static void child_detach (char *, int); -static void child_detach_from_process (int, char *, int, int); - static void child_attach (char *, int); -static void child_attach_to_process (char *, int, int); - #if !defined(CHILD_POST_ATTACH) extern void child_post_attach (int); #endif -static void child_require_attach (char *, int); - -static void child_require_detach (int, char *, int); - static void ptrace_me (void); static void ptrace_him (int); @@ -104,16 +96,6 @@ int child_suppress_run = 0; /* Non-zero if inftarg should pretend not to #ifndef CHILD_WAIT -/*## */ -/* Enable HACK for ttrace work. In - * infttrace.c/require_notification_of_events, - * this is set to 0 so that the loop in child_wait - * won't loop. - */ -int not_same_real_pid = 1; -/*## */ - - /* Wait for child to do something. Return pid of child, or -1 in case of error; store status through argument pointer OURSTATUS. */ @@ -170,59 +152,7 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) ourstatus->kind = TARGET_WAITKIND_SPURIOUS; return pid_to_ptid (pid); } - - if (target_has_forked (pid, &related_pid) - && ((pid == PIDGET (inferior_ptid)) - || (related_pid == PIDGET (inferior_ptid)))) - { - ourstatus->kind = TARGET_WAITKIND_FORKED; - ourstatus->value.related_pid = related_pid; - return pid_to_ptid (pid); - } - - if (target_has_vforked (pid, &related_pid) - && ((pid == PIDGET (inferior_ptid)) - || (related_pid == PIDGET (inferior_ptid)))) - { - ourstatus->kind = TARGET_WAITKIND_VFORKED; - ourstatus->value.related_pid = related_pid; - return pid_to_ptid (pid); - } - - if (target_has_execd (pid, &execd_pathname)) - { - /* Are we ignoring initial exec events? (This is likely because - we're in the process of starting up the inferior, and another - (older) mechanism handles those.) If so, we'll report this - as a regular stop, not an exec. - */ - if (inferior_ignoring_startup_exec_events) - { - inferior_ignoring_startup_exec_events--; - } - else - { - ourstatus->kind = TARGET_WAITKIND_EXECD; - ourstatus->value.execd_pathname = execd_pathname; - return pid_to_ptid (pid); - } - } - - /* All we must do with these is communicate their occurrence - to wait_for_inferior... - */ - if (target_has_syscall_event (pid, &kind, &syscall_id)) - { - ourstatus->kind = kind; - ourstatus->value.syscall_id = syscall_id; - return pid_to_ptid (pid); - } - - /*## } while (pid != PIDGET (inferior_ptid)); ## *//* Some other child died or stopped */ -/* hack for thread testing */ - } - while ((pid != PIDGET (inferior_ptid)) && not_same_real_pid); -/*## */ + } while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */ store_waitstatus (ourstatus, status); return pid_to_ptid (pid); @@ -257,8 +187,10 @@ child_thread_alive (ptid_t ptid) #endif +/* Attach to process PID, then initialize for debugging it. */ + static void -child_attach_to_process (char *args, int from_tty, int after_fork) +child_attach (char *args, int from_tty) { if (!args) error_no_arg ("process-id to attach"); @@ -284,10 +216,7 @@ child_attach_to_process (char *args, int from_tty, int after_fork) { exec_file = (char *) get_exec_file (0); - if (after_fork) - printf_unfiltered ("Attaching after fork to %s\n", - target_pid_to_str (pid_to_ptid (pid))); - else if (exec_file) + if (exec_file) printf_unfiltered ("Attaching to program: %s, %s\n", exec_file, target_pid_to_str (pid_to_ptid (pid))); else @@ -297,10 +226,7 @@ child_attach_to_process (char *args, int from_tty, int after_fork) gdb_flush (gdb_stdout); } - if (!after_fork) - attach (pid); - else - REQUIRE_ATTACH (pid); + attach (pid); inferior_ptid = pid_to_ptid (pid); push_target (&child_ops); @@ -308,15 +234,6 @@ child_attach_to_process (char *args, int from_tty, int after_fork) #endif /* ATTACH_DETACH */ } - -/* Attach to process PID, then initialize for debugging it. */ - -static void -child_attach (char *args, int from_tty) -{ - child_attach_to_process (args, from_tty, 0); -} - #if !defined(CHILD_POST_ATTACH) void child_post_attach (int pid) @@ -326,68 +243,44 @@ child_post_attach (int pid) } #endif -static void -child_require_attach (char *args, int from_tty) -{ - child_attach_to_process (args, from_tty, 1); -} +/* Take a program previously attached to and detaches it. + The program resumes execution and will no longer stop + on signals, etc. We'd better not have left any breakpoints + in the program or it'll die when it hits one. For this + to work, it may be necessary for the process to have been + previously attached. It *might* work if the program was + started via the normal ptrace (PTRACE_TRACEME). */ static void -child_detach_from_process (int pid, char *args, int from_tty, int after_fork) +child_detach (char *args, int from_tty) { #ifdef ATTACH_DETACH { int siggnal = 0; + int pid = PIDGET (inferior_ptid); if (from_tty) { char *exec_file = get_exec_file (0); if (exec_file == 0) exec_file = ""; - if (after_fork) - printf_unfiltered ("Detaching after fork from %s\n", - target_pid_to_str (pid_to_ptid (pid))); - else - printf_unfiltered ("Detaching from program: %s, %s\n", exec_file, - target_pid_to_str (pid_to_ptid (pid))); + printf_unfiltered ("Detaching from program: %s, %s\n", exec_file, + target_pid_to_str (pid_to_ptid (pid))); gdb_flush (gdb_stdout); } if (args) siggnal = atoi (args); - if (!after_fork) - detach (siggnal); - else - REQUIRE_DETACH (pid, siggnal); + detach (siggnal); + + inferior_ptid = null_ptid; + unpush_target (&child_ops); } #else error ("This version of Unix does not support detaching a process."); #endif } -/* Take a program previously attached to and detaches it. - The program resumes execution and will no longer stop - on signals, etc. We'd better not have left any breakpoints - in the program or it'll die when it hits one. For this - to work, it may be necessary for the process to have been - previously attached. It *might* work if the program was - started via the normal ptrace (PTRACE_TRACEME). */ - -static void -child_detach (char *args, int from_tty) -{ - child_detach_from_process (PIDGET (inferior_ptid), args, from_tty, 0); - inferior_ptid = null_ptid; - unpush_target (&child_ops); -} - -static void -child_require_detach (int pid, char *args, int from_tty) -{ - child_detach_from_process (pid, args, from_tty, 1); -} - - /* Get ready to modify the registers array. On machines which store individual registers, this doesn't need to do anything. On machines which store all the registers in one fell swoop, this makes sure @@ -495,27 +388,6 @@ child_acknowledge_created_inferior (int pid) #endif -void -child_clone_and_follow_inferior (int child_pid, int *followed_child) -{ - clone_and_follow_inferior (child_pid, followed_child); - - /* Don't resume CHILD_PID; it's stopped where it ought to be, until - the decision gets made elsewhere how to continue it. - */ -} - - -#if !defined(CHILD_POST_FOLLOW_INFERIOR_BY_CLONE) -void -child_post_follow_inferior_by_clone (void) -{ - /* This version of Unix doesn't require a meaningful "post follow inferior" - operation by a clone debugger. - */ -} -#endif - #if !defined(CHILD_INSERT_FORK_CATCHPOINT) int child_insert_fork_catchpoint (int pid) @@ -552,51 +424,15 @@ child_remove_vfork_catchpoint (int pid) } #endif -#if !defined(CHILD_HAS_FORKED) -int -child_has_forked (int pid, int *child_pid) -{ - /* This version of Unix doesn't support notification of fork events. */ - return 0; -} -#endif - - -#if !defined(CHILD_HAS_VFORKED) -int -child_has_vforked (int pid, int *child_pid) -{ - /* This version of Unix doesn't support notification of vfork events. - */ - return 0; -} -#endif - - -#if !defined(CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC) +#if !defined(CHILD_FOLLOW_FORK) int -child_can_follow_vfork_prior_to_exec (void) +child_follow_fork (int follow_child) { - /* This version of Unix doesn't support notification of vfork events. - However, if it did, it probably wouldn't allow vforks to be followed - before the following exec. - */ + /* This version of Unix doesn't support following fork or vfork events. */ return 0; } #endif - -#if !defined(CHILD_POST_FOLLOW_VFORK) -void -child_post_follow_vfork (int parent_pid, int followed_parent, int child_pid, - int followed_child) -{ - /* This version of Unix doesn't require a meaningful "post follow vfork" - operation by a clone debugger. - */ -} -#endif - #if !defined(CHILD_INSERT_EXEC_CATCHPOINT) int child_insert_exec_catchpoint (int pid) @@ -615,17 +451,6 @@ child_remove_exec_catchpoint (int pid) } #endif -#if !defined(CHILD_HAS_EXECD) -int -child_has_execd (int pid, char **execd_pathname) -{ - /* This version of Unix doesn't support notification of exec events. - */ - return 0; -} -#endif - - #if !defined(CHILD_REPORTED_EXEC_EVENTS_PER_EXEC_CALL) int child_reported_exec_events_per_exec_call (void) @@ -636,18 +461,6 @@ child_reported_exec_events_per_exec_call (void) } #endif - -#if !defined(CHILD_HAS_SYSCALL_EVENT) -int -child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) -{ - /* This version of Unix doesn't support notification of syscall events. - */ - return 0; -} -#endif - - #if !defined(CHILD_HAS_EXITED) int child_has_exited (int pid, int wait_status, int *exit_status) @@ -758,9 +571,7 @@ init_child_ops (void) child_ops.to_open = child_open; child_ops.to_attach = child_attach; child_ops.to_post_attach = child_post_attach; - child_ops.to_require_attach = child_require_attach; child_ops.to_detach = child_detach; - child_ops.to_require_detach = child_require_detach; child_ops.to_resume = child_resume; child_ops.to_wait = child_wait; child_ops.to_post_wait = child_post_wait; @@ -781,21 +592,14 @@ init_child_ops (void) child_ops.to_create_inferior = child_create_inferior; child_ops.to_post_startup_inferior = child_post_startup_inferior; child_ops.to_acknowledge_created_inferior = child_acknowledge_created_inferior; - child_ops.to_clone_and_follow_inferior = child_clone_and_follow_inferior; - child_ops.to_post_follow_inferior_by_clone = child_post_follow_inferior_by_clone; child_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint; child_ops.to_remove_fork_catchpoint = child_remove_fork_catchpoint; child_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint; child_ops.to_remove_vfork_catchpoint = child_remove_vfork_catchpoint; - child_ops.to_has_forked = child_has_forked; - child_ops.to_has_vforked = child_has_vforked; - child_ops.to_can_follow_vfork_prior_to_exec = child_can_follow_vfork_prior_to_exec; - child_ops.to_post_follow_vfork = child_post_follow_vfork; + child_ops.to_follow_fork = child_follow_fork; child_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint; child_ops.to_remove_exec_catchpoint = child_remove_exec_catchpoint; - child_ops.to_has_execd = child_has_execd; child_ops.to_reported_exec_events_per_exec_call = child_reported_exec_events_per_exec_call; - child_ops.to_has_syscall_event = child_has_syscall_event; child_ops.to_has_exited = child_has_exited; child_ops.to_mourn_inferior = child_mourn_inferior; child_ops.to_can_run = child_can_run; diff --git a/gdb/infttrace.c b/gdb/infttrace.c index a1a789c..589a0e2 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -2289,7 +2289,7 @@ call_ttrace_wait (int pid, ttwopt_t option, ttstate_t *tsp, size_t tsp_size) thread descriptor. This caches the state. The implementation of queries like - target_has_execd can then use this cached state, rather than + hpux_has_execd can then use this cached state, rather than be forced to make an explicit ttrace call to get it. (Guard against the condition that this is the first time we've @@ -3357,8 +3357,6 @@ child_remove_vfork_catchpoint (int tid) } #endif -#if defined(CHILD_HAS_FORKED) - /* Q: Do we need to map the returned process ID to a thread ID? * A: I don't think so--here we want a _real_ pid. Any later @@ -3366,7 +3364,7 @@ child_remove_vfork_catchpoint (int tid) * start the mapping. */ int -child_has_forked (int tid, int *childpid) +hpux_has_forked (int tid, int *childpid) { int tt_status; ttstate_t ttrace_state; @@ -3403,15 +3401,11 @@ child_has_forked (int tid, int *childpid) return 0; } -#endif - -#if defined(CHILD_HAS_VFORKED) - -/* See child_has_forked for pid discussion. +/* See hpux_has_forked for pid discussion. */ int -child_has_vforked (int tid, int *childpid) +hpux_has_vforked (int tid, int *childpid) { int tt_status; ttstate_t ttrace_state; @@ -3446,22 +3440,6 @@ child_has_vforked (int tid, int *childpid) return 0; } -#endif - - -#if defined(CHILD_CAN_FOLLOW_VFORK_PRIOR_TO_EXEC) -int -child_can_follow_vfork_prior_to_exec (void) -{ - /* ttrace does allow this. - - ??rehrauer: However, I had major-league problems trying to - convince wait_for_inferior to handle that case. Perhaps when - it is rewritten to grok multiple processes in an explicit way... - */ - return 0; -} -#endif #if defined(CHILD_INSERT_EXEC_CATCHPOINT) @@ -3490,9 +3468,8 @@ child_remove_exec_catchpoint (int tid) #endif -#if defined(CHILD_HAS_EXECD) int -child_has_execd (int tid, char **execd_pathname) +hpux_has_execd (int tid, char **execd_pathname) { int tt_status; ttstate_t ttrace_state; @@ -3531,12 +3508,10 @@ child_has_execd (int tid, char **execd_pathname) return 0; } -#endif -#if defined(CHILD_HAS_SYSCALL_EVENT) int -child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) +hpux_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) { int tt_status; ttstate_t ttrace_state; @@ -3576,7 +3551,6 @@ child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id) *syscall_id = ttrace_state.tts_scno; return 1; } -#endif @@ -4549,7 +4523,15 @@ child_resume (ptid_t ptid, int step, enum target_signal signal) pending signal will be passed to the inferior. interrupt.exp in the testsuite does this precise thing and fails due to the unwanted signal delivery to the inferior. */ - if (resume_all_threads) + /* drow/2002-12-05: However, note that we must use TT_PROC_CONTINUE + if we are tracing a vfork. */ + if (vfork_in_flight) + { + call_ttrace (TT_PROC_CONTINUE, tid, TT_NIL, TT_NIL, TT_NIL); + clear_all_handled (); + clear_all_stepping_mode (); + } + else if (resume_all_threads) { #ifdef THREAD_DEBUG if (debug_on) @@ -5068,9 +5050,7 @@ pre_fork_inferior (void) } } -/* Called via #define REQUIRE_ATTACH from inftarg.c, - * ultimately from "follow_inferior_fork" in infrun.c, - * itself called from "resume". +/* Called from child_follow_fork in hppah-nat.c. * * This seems to be intended to attach after a fork or * vfork, while "attach" is used to attach to a pid diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index 4b9d57d..0b30cea 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -34,7 +34,7 @@ #include "gdbcmd.h" static int debug_lin_lwp; -extern const char *strsignal (int sig); +extern char *strsignal (int sig); /* On GNU/Linux there are no real LWP's. The closest thing to LWP's are processes sharing the same VM space. A multi-threaded process @@ -1343,32 +1343,6 @@ lin_lwp_mourn_inferior (void) child_ops.to_mourn_inferior (); } -static void -lin_lwp_fetch_registers (int regno) -{ - struct cleanup *old_chain = save_inferior_ptid (); - - if (is_lwp (inferior_ptid)) - inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid)); - - fetch_inferior_registers (regno); - - do_cleanups (old_chain); -} - -static void -lin_lwp_store_registers (int regno) -{ - struct cleanup *old_chain = save_inferior_ptid (); - - if (is_lwp (inferior_ptid)) - inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid)); - - store_inferior_registers (regno); - - do_cleanups (old_chain); -} - static int lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct mem_attrib *attrib, @@ -1380,7 +1354,9 @@ lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, if (is_lwp (inferior_ptid)) inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid)); - xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target); + xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target); + if (xfer == 0) + xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target); do_cleanups (old_chain); return xfer; @@ -1426,8 +1402,10 @@ init_lin_lwp_ops (void) lin_lwp_ops.to_detach = lin_lwp_detach; lin_lwp_ops.to_resume = lin_lwp_resume; lin_lwp_ops.to_wait = lin_lwp_wait; - lin_lwp_ops.to_fetch_registers = lin_lwp_fetch_registers; - lin_lwp_ops.to_store_registers = lin_lwp_store_registers; + /* fetch_inferior_registers and store_inferior_registers will + honor the LWP id, so we can use them directly. */ + lin_lwp_ops.to_fetch_registers = fetch_inferior_registers; + lin_lwp_ops.to_store_registers = store_inferior_registers; lin_lwp_ops.to_xfer_memory = lin_lwp_xfer_memory; lin_lwp_ops.to_kill = lin_lwp_kill; lin_lwp_ops.to_create_inferior = lin_lwp_create_inferior; diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c index f76def3..2f43ae6 100644 --- a/gdb/linux-proc.c +++ b/gdb/linux-proc.c @@ -25,6 +25,8 @@ #include /* for elf_gregset etc. */ #include /* for struct stat */ #include /* for isdigit */ +#include /* for open, pread64 */ +#include /* for O_RDONLY */ #include "regcache.h" /* for registers_changed */ #include "gregset.h" /* for gregset */ #include "gdbcore.h" /* for get_exec_file */ @@ -33,6 +35,10 @@ #include "cli/cli-decode.h" /* for add_info */ #include "gdb_string.h" +#ifndef O_LARGEFILE +#define O_LARGEFILE 0 +#endif + /* Function: child_pid_to_exec_file * * Accepts an integer pid @@ -577,3 +583,46 @@ Specify any of the following keywords for detailed info:\n\ status -- list a different bunch of random process info.\n\ all -- list all available /proc info."); } + +int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, + struct mem_attrib *attrib, + struct target_ops *target) +{ + int fd, ret; + char filename[64]; + + if (write) + return 0; + + /* Don't bother for one word. */ + if (len < 3 * sizeof (long)) + return 0; + + /* We could keep this file open and cache it - possibly one + per thread. That requires some juggling, but is even faster. */ + sprintf (filename, "/proc/%d/mem", PIDGET (inferior_ptid)); + fd = open (filename, O_RDONLY | O_LARGEFILE); + if (fd == -1) + return 0; + + /* If pread64 is available, use it. It's faster if the kernel + supports it (only one syscall), and it's 64-bit safe even + on 32-bit platforms (for instance, SPARC debugging a SPARC64 + application). + + We play some autoconf and CFLAGS games to get this declaration + exposed: -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE. And then + a -D_BSD_SOURCE to counteract the defaults for _XOPEN_SOURCE. */ +#ifdef HAVE_PREAD64 + if (pread64 (fd, myaddr, len, addr) != len) +#else + if (lseek (fd, addr, SEEK_SET) == -1 + || read (fd, myaddr, len) != len) +#endif + ret = 0; + else + ret = len; + + close (fd); + return ret; +} diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index b1bc3ed..eeb6335 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -386,7 +386,7 @@ m32r_init_extra_frame_info (struct frame_info *fi) memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -462,7 +462,7 @@ CORE_ADDR m32r_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->fsr.regs[regnum] != 0) return read_memory_integer (fi->fsr.regs[regnum], @@ -470,11 +470,11 @@ m32r_find_callers_reg (struct frame_info *fi, int regnum) return read_register (regnum); } -/* 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 m32r, we save the frame size when we initialize the frame_info. */ +/* 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 + DEPRECATED_INIT_FRAME_PC will be called for the new frame. For + m32r, we save the frame size when we initialize the frame_info. */ CORE_ADDR m32r_frame_chain (struct frame_info *fi) @@ -482,13 +482,13 @@ m32r_frame_chain (struct frame_info *fi) CORE_ADDR fn_start, callers_pc, fp; /* is this a dummy frame? */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_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 = m32r_find_callers_reg (fi, FP_REGNUM); - if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) + if (DEPRECATED_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)) @@ -527,7 +527,7 @@ m32r_pop_frame (struct frame_info *frame) { int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -554,7 +554,7 @@ m32r_pop_frame (struct frame_info *frame) CORE_ADDR m32r_frame_saved_pc (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); else return m32r_find_callers_reg (fi, RP_REGNUM); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 3045a58..7b2dc43 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -434,11 +434,11 @@ m68hc11_pop_frame (void) register CORE_ADDR fp, sp; register int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { - fp = FRAME_FP (frame); + fp = get_frame_base (frame); FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame. */ @@ -802,17 +802,17 @@ m68hc11_skip_prologue (CORE_ADDR pc) return pc; } -/* 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. -*/ +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. */ static CORE_ADDR m68hc11_frame_chain (struct frame_info *frame) { CORE_ADDR addr; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->extra_info->return_pc == 0 @@ -1177,33 +1177,6 @@ m68hc11_push_return_address (CORE_ADDR pc, CORE_ADDR sp) return sp; } -/* Index within `registers' of the first byte of the space for - register N. */ -static int -m68hc11_register_byte (int reg_nr) -{ - return (reg_nr * M68HC11_REG_SIZE); -} - -static int -m68hc11_register_raw_size (int reg_nr) -{ - switch (reg_nr) - { - case HARD_PAGE_REGNUM: - case HARD_A_REGNUM: - case HARD_B_REGNUM: - case HARD_CCR_REGNUM: - return 1; - - case M68HC12_HARD_PC_REGNUM: - return 4; - - default: - return M68HC11_REG_SIZE; - } -} - /* Test whether the ELF symbol corresponds to a function using rtc or rti to return. */ @@ -1263,6 +1236,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info, gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + switch (info.bfd_arch_info->arch) { case bfd_arch_m68hc11: @@ -1311,9 +1288,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_fp0_regnum (gdbarch, -1); set_gdbarch_max_register_raw_size (gdbarch, 2); set_gdbarch_max_register_virtual_size (gdbarch, 2); - set_gdbarch_register_raw_size (gdbarch, m68hc11_register_raw_size); - set_gdbarch_register_virtual_size (gdbarch, m68hc11_register_raw_size); - set_gdbarch_register_byte (gdbarch, m68hc11_register_byte); set_gdbarch_frame_init_saved_regs (gdbarch, m68hc11_frame_init_saved_regs); set_gdbarch_frame_args_skip (gdbarch, 0); @@ -1332,14 +1306,11 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_pseudo_register_read (gdbarch, m68hc11_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, m68hc11_pseudo_register_write); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, m68hc11_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); /*???*/ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_words (gdbarch, m68hc11_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (m68hc11_call_dummy_words)); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index d27d177..8735e07 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -28,6 +28,8 @@ #include "inferior.h" #include "regcache.h" #include "arch-utils.h" + +#include "m68k-tdep.h" #define P_LINKL_FP 0x480e @@ -43,29 +45,6 @@ #define P_TRAP 0x4e40 -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -/* Note: Since they are used in files other than this (monitor files), - D0_REGNUM and A0_REGNUM are currently defined in tm-m68k.h. */ - -enum -{ - E_A1_REGNUM = 9, - E_FP_REGNUM = 14, /* Contains address of executing stack frame */ - E_SP_REGNUM = 15, /* Contains address of top of stack */ - E_PS_REGNUM = 16, /* Contains processor status */ - E_PC_REGNUM = 17, /* Contains program counter */ - E_FP0_REGNUM = 18, /* Floating point register 0 */ - E_FPC_REGNUM = 26, /* 68881 control register */ - E_FPS_REGNUM = 27, /* 68881 status register */ - E_FPI_REGNUM = 28 -}; - #define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4) #define REGISTER_BYTES_NOFP (16*4 + 8) @@ -148,24 +127,31 @@ m68k_register_virtual_size (int regnum) return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4); } -/* Return the GDB type object for the "standard" data type of data - in register N. This should be int for D0-D7, long double for FP0-FP7, - and void pointer for all others (A0-A7, PC, SR, FPCONTROL etc). - Note, for registers which contain addresses return pointer to void, - not pointer to char, because we don't want to attempt to print - the string after printing the address. */ +/* Return the GDB type object for the "standard" data type of data in + register N. This should be int for D0-D7, SR, FPCONTROL and + FPSTATUS, long double for FP0-FP7, and void pointer for all others + (A0-A7, PC, FPIADDR). Note, for registers which contain + addresses return pointer to void, not pointer to char, because we + don't want to attempt to print the string after printing the + address. */ static struct type * m68k_register_virtual_type (int regnum) { - if ((unsigned) regnum >= E_FPC_REGNUM) - return lookup_pointer_type (builtin_type_void); - else if ((unsigned) regnum >= FP0_REGNUM) - return builtin_type_long_double; - else if ((unsigned) regnum >= A0_REGNUM) - return lookup_pointer_type (builtin_type_void); - else - return builtin_type_int; + if (regnum >= FP0_REGNUM && regnum <= FP0_REGNUM + 7) + return builtin_type_m68881_ext; + + if (regnum == M68K_FPI_REGNUM || regnum == PC_REGNUM) + return builtin_type_void_func_ptr; + + if (regnum == M68K_FPC_REGNUM || regnum == M68K_FPS_REGNUM + || regnum == PS_REGNUM) + return builtin_type_int32; + + if (regnum >= M68K_A0_REGNUM && regnum <= M68K_A0_REGNUM + 7) + return builtin_type_void_data_ptr; + + return builtin_type_int32; } /* Function: m68k_register_name @@ -204,8 +190,8 @@ m68k_stack_align (CORE_ADDR addr) static int m68k_register_byte (int regnum) { - if (regnum >= E_FPC_REGNUM) - return (((regnum - E_FPC_REGNUM) * 4) + 168); + if (regnum >= M68K_FPC_REGNUM) + return (((regnum - M68K_FPC_REGNUM) * 4) + 168); else if (regnum >= FP0_REGNUM) return (((regnum - FP0_REGNUM) * 12) + 72); else @@ -218,7 +204,7 @@ m68k_register_byte (int regnum) static void m68k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) { - write_register (E_A1_REGNUM, addr); + write_register (M68K_A1_REGNUM, addr); } /* Extract from an array regbuf containing the (raw) register state @@ -270,10 +256,10 @@ m68k_store_return_value (struct type *type, char *valbuf) static CORE_ADDR m68k_frame_chain (struct frame_info *thisframe) { - if (thisframe->signal_handler_caller) + if (get_frame_type (thisframe) == SIGTRAMP_FRAME) return thisframe->frame; - else if (!inside_entry_file ((thisframe)->pc)) - return read_memory_integer ((thisframe)->frame, 4); + else if (!inside_entry_file (thisframe->pc)) + return read_memory_unsigned_integer (thisframe->frame, 4); else return 0; } @@ -285,7 +271,7 @@ m68k_frame_chain (struct frame_info *thisframe) static int m68k_frameless_function_invocation (struct frame_info *fi) { - if (fi->signal_handler_caller) + if (get_frame_type (fi) == SIGTRAMP_FRAME) return 0; else return frameless_look_for_prologue (fi); @@ -294,16 +280,17 @@ m68k_frameless_function_invocation (struct frame_info *fi) static CORE_ADDR m68k_frame_saved_pc (struct frame_info *frame) { - if (frame->signal_handler_caller) + if (get_frame_type (frame) == SIGTRAMP_FRAME) { if (frame->next) - return read_memory_integer (frame->next->frame + SIG_PC_FP_OFFSET, 4); + return read_memory_unsigned_integer (frame->next->frame + + SIG_PC_FP_OFFSET, 4); else - return read_memory_integer (read_register (SP_REGNUM) - + SIG_PC_FP_OFFSET - 8, 4); + return read_memory_unsigned_integer (read_register (SP_REGNUM) + + SIG_PC_FP_OFFSET - 8, 4); } else - return read_memory_integer (frame->frame + 4, 4); + return read_memory_unsigned_integer (frame->frame + 4, 4); } @@ -313,7 +300,7 @@ m68k_frame_saved_pc (struct frame_info *frame) extern CORE_ADDR altos_skip_prologue (CORE_ADDR pc) { - register int op = read_memory_integer (pc, 2); + register int op = read_memory_unsigned_integer (pc, 2); if (op == P_LINKW_FP) pc += 4; /* Skip link #word */ else if (op == P_LINKL_FP) @@ -343,12 +330,12 @@ delta68_frame_args_address (struct frame_info *frame_info) { /* we assume here that the only frameless functions are the system calls or other functions who do not put anything on the stack. */ - if (frame_info->signal_handler_caller) + if (get_frame_type (frame_info) == SIGTRAMP_FRAME) return frame_info->frame + 12; else if (frameless_look_for_prologue (frame_info)) { /* Check for an interrupted system call */ - if (frame_info->next && frame_info->next->signal_handler_caller) + if (frame_info->next && (get_frame_type (frame_info->next) == SIGTRAMP_FRAME)) return frame_info->next->frame + 16; else return frame_info->frame + 4; @@ -360,7 +347,8 @@ delta68_frame_args_address (struct frame_info *frame_info) CORE_ADDR delta68_frame_saved_pc (struct frame_info *frame_info) { - return read_memory_integer (delta68_frame_args_address (frame_info) + 4, 4); + return read_memory_unsigned_integer (delta68_frame_args_address (frame_info) + + 4, 4); } /* Return number of args passed to a frame. @@ -371,7 +359,7 @@ isi_frame_num_args (struct frame_info *fi) { int val; CORE_ADDR pc = FRAME_SAVED_PC (fi); - int insn = 0177777 & read_memory_integer (pc, 2); + int insn = read_memory_unsigned_integer (pc, 2); val = 0; if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ val = read_memory_integer (pc + 2, 2); @@ -393,7 +381,7 @@ delta68_frame_num_args (struct frame_info *fi) { int val; CORE_ADDR pc = FRAME_SAVED_PC (fi); - int insn = 0177777 & read_memory_integer (pc, 2); + int insn = read_memory_unsigned_integer (pc, 2); val = 0; if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ val = read_memory_integer (pc + 2, 2); @@ -415,7 +403,7 @@ news_frame_num_args (struct frame_info *fi) { int val; CORE_ADDR pc = FRAME_SAVED_PC (fi); - int insn = 0177777 & read_memory_integer (pc, 2); + int insn = read_memory_unsigned_integer (pc, 2); val = 0; if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ val = read_memory_integer (pc + 2, 2); @@ -486,7 +474,7 @@ m68k_pop_frame (void) register int regnum; char raw_buffer[12]; - fp = FRAME_FP (frame); + fp = get_frame_base (frame); m68k_frame_init_saved_regs (frame); for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--) { @@ -564,8 +552,7 @@ m68k_skip_prologue (CORE_ADDR ip) while (ip < limit) { - op = read_memory_integer (ip, 2); - op &= 0xFFFF; + op = read_memory_unsigned_integer (ip, 2); if (op == P_LINKW_FP) ip += 4; /* Skip link.w */ @@ -601,7 +588,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) /* First possible address for a pc in a call dummy for this frame. */ CORE_ADDR possible_call_dummy_start = - (frame_info)->frame - 28 - FP_REGNUM * 4 - 4 - 8 * 12; + frame_info->frame - 28 - FP_REGNUM * 4 - 4 - 8 * 12; int nextinsn; @@ -612,8 +599,8 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) memset (frame_info->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS); - if ((frame_info)->pc >= possible_call_dummy_start - && (frame_info)->pc <= (frame_info)->frame) + if (frame_info->pc >= possible_call_dummy_start + && frame_info->pc <= frame_info->frame) { /* It is a call dummy. We could just stop now, since we know @@ -621,16 +608,16 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) to parse the "prologue" which is part of the call dummy. This is needlessly complex and confusing. FIXME. */ - next_addr = (frame_info)->frame; + next_addr = frame_info->frame; pc = possible_call_dummy_start; } else { - pc = get_pc_function_start ((frame_info)->pc); + pc = get_pc_function_start (frame_info->pc); - nextinsn = read_memory_integer (pc, 2); + nextinsn = read_memory_unsigned_integer (pc, 2); if (P_PEA_FP == nextinsn - && P_MOVL_SP_FP == read_memory_integer (pc + 2, 2)) + && P_MOVL_SP_FP == read_memory_unsigned_integer (pc + 2, 2)) { /* pea %fp move.l %sp, %fp */ @@ -642,7 +629,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) /* Find the address above the saved regs using the amount of storage from the link instruction. */ { - next_addr = (frame_info)->frame + read_memory_integer (pc + 2, 4); + next_addr = frame_info->frame + read_memory_integer (pc + 2, 4); pc += 6; } else if (P_LINKW_FP == nextinsn) @@ -650,21 +637,21 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) /* Find the address above the saved regs using the amount of storage from the link instruction. */ { - next_addr = (frame_info)->frame + read_memory_integer (pc + 2, 2); + next_addr = frame_info->frame + read_memory_integer (pc + 2, 2); pc += 4; } else goto lose; /* If have an addal #-n, sp next, adjust next_addr. */ - if ((0177777 & read_memory_integer (pc, 2)) == 0157774) + if (read_memory_unsigned_integer (pc, 2) == 0157774) next_addr += read_memory_integer (pc += 2, 4), pc += 4; } for (;;) { - nextinsn = 0xffff & read_memory_integer (pc, 2); - regmask = read_memory_integer (pc + 2, 2); + nextinsn = read_memory_unsigned_integer (pc, 2); + regmask = read_memory_unsigned_integer (pc + 2, 2); /* fmovemx to -(sp) */ if (0xf227 == nextinsn && (regmask & 0xff00) == 0xe000) { @@ -679,7 +666,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) { register CORE_ADDR addr; - addr = (frame_info)->frame + read_memory_integer (pc + 4, 2); + addr = frame_info->frame + read_memory_integer (pc + 4, 2); /* Regmask's low bit is for register fp7, the first pushed */ for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1) if (regmask & 1) @@ -706,7 +693,7 @@ m68k_frame_init_saved_regs (struct frame_info *frame_info) { register CORE_ADDR addr; - addr = (frame_info)->frame + read_memory_integer (pc + 4, 2); + addr = frame_info->frame + read_memory_integer (pc + 4, 2); /* Regmask's low bit is for register 0, the first written */ for (regnum = 0; regnum < 16; regnum++, regmask >>= 1) if (regmask & 1) @@ -759,7 +746,7 @@ lose:; frame_info->saved_regs[PC_REGNUM] = (frame_info)->frame + 4; #ifdef SIG_SP_FP_OFFSET /* Adjust saved SP_REGNUM for fake _sigtramp frames. */ - if (frame_info->signal_handler_caller && frame_info->next) + if ((get_frame_type (frame_info) == SIGTRAMP_FRAME) && frame_info->next) frame_info->saved_regs[SP_REGNUM] = frame_info->next->frame + SIG_SP_FP_OFFSET; #endif @@ -862,14 +849,14 @@ supply_fpregset (fpregset_t *fpregsetp) register int regi; char *from; - for (regi = FP0_REGNUM; regi < E_FPC_REGNUM; regi++) + for (regi = FP0_REGNUM; regi < M68K_FPC_REGNUM; regi++) { from = (char *) &(fpregsetp->f_fpregs[regi - FP0_REGNUM][0]); supply_register (regi, from); } - supply_register (E_FPC_REGNUM, (char *) &(fpregsetp->f_pcr)); - supply_register (E_FPS_REGNUM, (char *) &(fpregsetp->f_psr)); - supply_register (E_FPI_REGNUM, (char *) &(fpregsetp->f_fpiaddr)); + supply_register (M68K_FPC_REGNUM, (char *) &(fpregsetp->f_pcr)); + supply_register (M68K_FPS_REGNUM, (char *) &(fpregsetp->f_psr)); + supply_register (M68K_FPI_REGNUM, (char *) &(fpregsetp->f_fpiaddr)); } /* Given a pointer to a floating point register set in /proc format @@ -884,7 +871,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) char *to; char *from; - for (regi = FP0_REGNUM; regi < E_FPC_REGNUM; regi++) + for (regi = FP0_REGNUM; regi < M68K_FPC_REGNUM; regi++) { if ((regno == -1) || (regno == regi)) { @@ -893,17 +880,17 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) memcpy (to, from, REGISTER_RAW_SIZE (regi)); } } - if ((regno == -1) || (regno == E_FPC_REGNUM)) + if ((regno == -1) || (regno == M68K_FPC_REGNUM)) { - fpregsetp->f_pcr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPC_REGNUM)]; + fpregsetp->f_pcr = *(int *) &deprecated_registers[REGISTER_BYTE (M68K_FPC_REGNUM)]; } - if ((regno == -1) || (regno == E_FPS_REGNUM)) + if ((regno == -1) || (regno == M68K_FPS_REGNUM)) { - fpregsetp->f_psr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPS_REGNUM)]; + fpregsetp->f_psr = *(int *) &deprecated_registers[REGISTER_BYTE (M68K_FPS_REGNUM)]; } - if ((regno == -1) || (regno == E_FPI_REGNUM)) + if ((regno == -1) || (regno == M68K_FPI_REGNUM)) { - fpregsetp->f_fpiaddr = *(int *) &deprecated_registers[REGISTER_BYTE (E_FPI_REGNUM)]; + fpregsetp->f_fpiaddr = *(int *) &deprecated_registers[REGISTER_BYTE (M68K_FPI_REGNUM)]; } } @@ -962,13 +949,13 @@ m68k_saved_pc_after_call (struct frame_info *frame) #ifdef SYSCALL_TRAP int op; - op = read_memory_integer (frame->pc - SYSCALL_TRAP_OFFSET, 2); + op = read_memory_unsigned_integer (frame->pc - SYSCALL_TRAP_OFFSET, 2); if (op == SYSCALL_TRAP) - return read_memory_integer (read_register (SP_REGNUM) + 4, 4); + return read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4); else #endif /* SYSCALL_TRAP */ - return read_memory_integer (read_register (SP_REGNUM), 4); + return read_memory_unsigned_integer (read_register (SP_REGNUM), 4); } /* Function: m68k_gdbarch_init @@ -996,6 +983,10 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, 0); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext); set_gdbarch_long_double_bit (gdbarch, 96); @@ -1027,8 +1018,6 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* OK to default this value to 'unknown'. */ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size); set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size); @@ -1041,17 +1030,17 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 29); set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok); set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4)); - set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM); - set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM); - set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); - set_gdbarch_ps_regnum (gdbarch, E_PS_REGNUM); - set_gdbarch_fp0_regnum (gdbarch, E_FP0_REGNUM); + set_gdbarch_sp_regnum (gdbarch, M68K_SP_REGNUM); + set_gdbarch_fp_regnum (gdbarch, M68K_FP_REGNUM); + set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM); + set_gdbarch_ps_regnum (gdbarch, M68K_PS_REGNUM); + set_gdbarch_fp0_regnum (gdbarch, M68K_FP0_REGNUM); - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 24); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 28); diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index add1490..cf47dd1 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -25,8 +25,11 @@ #include "inferior.h" #include "language.h" #include "gdbcore.h" +#include "gdb_string.h" #include "regcache.h" +#include "m68k-tdep.h" + #ifdef USG #include #endif @@ -51,7 +54,6 @@ #include "target.h" - /* This table must line up with REGISTER_NAMES in tm-m68k.h */ static const int regmap[] = { @@ -78,7 +80,7 @@ getregs_supplies (int regno) int getfpregs_supplies (int regno) { - return FP0_REGNUM <= regno && regno <= FPI_REGNUM; + return FP0_REGNUM <= regno && regno <= M68K_FPI_REGNUM; } /* Does the current host support the GETREGS request? */ @@ -275,7 +277,7 @@ supply_gregset (elf_gregset_t *gregsetp) elf_greg_t *regp = (elf_greg_t *) gregsetp; int regi; - for (regi = D0_REGNUM; regi <= SP_REGNUM; regi++) + for (regi = M68K_D0_REGNUM; regi <= SP_REGNUM; regi++) supply_register (regi, (char *) ®p[regmap[regi]]); supply_register (PS_REGNUM, (char *) ®p[PT_SR]); supply_register (PC_REGNUM, (char *) ®p[PT_PC]); @@ -359,11 +361,11 @@ supply_fpregset (elf_fpregset_t *fpregsetp) { int regi; - for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++) + for (regi = FP0_REGNUM; regi < FP0_REGNUM + 8; regi++) supply_register (regi, FPREG_ADDR (fpregsetp, regi - FP0_REGNUM)); - supply_register (FPC_REGNUM, (char *) &fpregsetp->fpcntl[0]); - supply_register (FPS_REGNUM, (char *) &fpregsetp->fpcntl[1]); - supply_register (FPI_REGNUM, (char *) &fpregsetp->fpcntl[2]); + supply_register (M68K_FPC_REGNUM, (char *) &fpregsetp->fpcntl[0]); + supply_register (M68K_FPS_REGNUM, (char *) &fpregsetp->fpcntl[1]); + supply_register (M68K_FPI_REGNUM, (char *) &fpregsetp->fpcntl[2]); } /* Fill register REGNO (if it is a floating-point register) in @@ -381,9 +383,9 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regno) regcache_collect (regno, FPREG_ADDR (fpregsetp, regno - FP0_REGNUM)); /* Fill in the floating-point control registers. */ - for (i = FPC_REGNUM; i <= FPI_REGNUM; i++) + for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++) if (regno == -1 || regno == i) - regcache_collect (regno, (char *) &fpregsetp->fpcntl[regno - FPC_REGNUM]); + regcache_collect (regno, (char *) &fpregsetp->fpcntl[regno - M68K_FPC_REGNUM]); } #ifdef HAVE_PTRACE_GETREGS @@ -594,103 +596,6 @@ kernel_u_size (void) return (sizeof (struct user)); } -/* Check whether insn1 and insn2 are parts of a signal trampoline. */ - -#define IS_SIGTRAMP(insn1, insn2) \ - (/* addaw #20,sp; moveq #119,d0; trap #0 */ \ - (insn1 == 0xdefc0014 && insn2 == 0x70774e40) \ - /* moveq #119,d0; trap #0 */ \ - || insn1 == 0x70774e40) - -#define IS_RT_SIGTRAMP(insn1, insn2) \ - (/* movel #173,d0; trap #0 */ \ - (insn1 == 0x203c0000 && insn2 == 0x00ad4e40) \ - /* moveq #82,d0; notb d0; trap #0 */ \ - || (insn1 == 0x70524600 && (insn2 >> 16) == 0x4e40)) - -/* Return non-zero if PC points into the signal trampoline. For the sake - of m68k_linux_frame_saved_pc we also distinguish between non-RT and RT - signal trampolines. */ - -int -m68k_linux_in_sigtramp (CORE_ADDR pc) -{ - CORE_ADDR sp; - char buf[12]; - unsigned long insn0, insn1, insn2; - - if (read_memory_nobpt (pc - 4, buf, sizeof (buf))) - return 0; - insn1 = extract_unsigned_integer (buf + 4, 4); - insn2 = extract_unsigned_integer (buf + 8, 4); - if (IS_SIGTRAMP (insn1, insn2)) - return 1; - if (IS_RT_SIGTRAMP (insn1, insn2)) - return 2; - - insn0 = extract_unsigned_integer (buf, 4); - if (IS_SIGTRAMP (insn0, insn1)) - return 1; - if (IS_RT_SIGTRAMP (insn0, insn1)) - return 2; - - insn0 = (insn0 << 16) | (insn1 >> 16); - insn1 = (insn1 << 16) | (insn2 >> 16); - if (IS_SIGTRAMP (insn0, insn1)) - return 1; - if (IS_RT_SIGTRAMP (insn0, insn1)) - return 2; - - return 0; -} - -/* Offset to saved PC in sigcontext, from . */ -#define SIGCONTEXT_PC_OFFSET 26 - -/* Offset to saved PC in ucontext, from . */ -#define UCONTEXT_PC_OFFSET 88 - -/* Get saved user PC for sigtramp from sigcontext or ucontext. */ - -static CORE_ADDR -m68k_linux_sigtramp_saved_pc (struct frame_info *frame) -{ - CORE_ADDR sigcontext_addr; - char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT]; - int ptrbytes = TARGET_PTR_BIT / TARGET_CHAR_BIT; - int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; - - /* Get sigcontext address, it is the third parameter on the stack. */ - if (frame->next) - sigcontext_addr = read_memory_integer (FRAME_ARGS_ADDRESS (frame->next) - + FRAME_ARGS_SKIP - + sigcontext_offs, - ptrbytes); - else - sigcontext_addr = read_memory_integer (read_register (SP_REGNUM) - + sigcontext_offs, - ptrbytes); - - /* Don't cause a memory_error when accessing sigcontext in case the - stack layout has changed or the stack is corrupt. */ - if (m68k_linux_in_sigtramp (frame->pc) == 2) - target_read_memory (sigcontext_addr + UCONTEXT_PC_OFFSET, buf, ptrbytes); - else - target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); - return extract_unsigned_integer (buf, ptrbytes); -} - -/* Return the saved program counter for FRAME. */ - -CORE_ADDR -m68k_linux_frame_saved_pc (struct frame_info *frame) -{ - if (frame->signal_handler_caller) - return m68k_linux_sigtramp_saved_pc (frame); - - return read_memory_integer (frame->frame + 4, 4); -} - /* Register that we are able to handle GNU/Linux ELF core file formats. */ diff --git a/gdb/m88k-nat.c b/gdb/m88k-nat.c deleted file mode 100644 index 11bde57..0000000 --- a/gdb/m88k-nat.c +++ /dev/null @@ -1,290 +0,0 @@ -// OBSOLETE /* Native-dependent Motorola 88xxx support for GDB, the GNU Debugger. -// OBSOLETE Copyright 1988, 1990, 1991, 1992, 1993, 1995, 1999, 2000, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #ifndef USER /* added to support BCS ptrace_user */ -// OBSOLETE #define USER ptrace_user -// OBSOLETE #endif -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include "gdb_stat.h" -// OBSOLETE -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "setjmp.h" -// OBSOLETE #include "value.h" -// OBSOLETE -// OBSOLETE #ifdef DELTA88 -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* define offsets to the pc instruction offsets in ptrace_user struct */ -// OBSOLETE #define SXIP_OFFSET ((char *)&u.pt_sigframe.sig_sxip - (char *)&u) -// OBSOLETE #define SNIP_OFFSET ((char *)&u.pt_sigframe.sig_snip - (char *)&u) -// OBSOLETE #define SFIP_OFFSET ((char *)&u.pt_sigframe.sig_sfip - (char *)&u) -// OBSOLETE #else -// OBSOLETE /* define offsets to the pc instruction offsets in ptrace_user struct */ -// OBSOLETE #define SXIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u) -// OBSOLETE #define SNIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u) -// OBSOLETE #define SFIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u) -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE extern int have_symbol_file_p (); -// OBSOLETE -// OBSOLETE extern jmp_buf stack_jmp; -// OBSOLETE -// OBSOLETE extern int errno; -// OBSOLETE -// OBSOLETE void -// OBSOLETE fetch_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE register unsigned int regaddr; -// OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE register int i; -// OBSOLETE -// OBSOLETE struct USER u; -// OBSOLETE unsigned int offset; -// OBSOLETE -// OBSOLETE offset = (char *) &u.pt_r0 - (char *) &u; -// OBSOLETE regaddr = offset; /* byte offset to r0; */ -// OBSOLETE -// OBSOLETE /* offset = ptrace (3, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */ -// OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) -// OBSOLETE { -// OBSOLETE /*regaddr = register_addr (regno, offset); */ -// OBSOLETE /* 88k enhancement */ -// OBSOLETE -// OBSOLETE for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int)) -// OBSOLETE { -// OBSOLETE *(int *) &buf[i] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, 0); -// OBSOLETE regaddr += sizeof (int); -// OBSOLETE } -// OBSOLETE supply_register (regno, buf); -// OBSOLETE } -// OBSOLETE /* now load up registers 36 - 38; special pc registers */ -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0); -// OBSOLETE supply_register (SXIP_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0); -// OBSOLETE supply_register (SNIP_REGNUM, buf); -// OBSOLETE *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0); -// OBSOLETE supply_register (SFIP_REGNUM, buf); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store our register values back into the inferior. -// OBSOLETE If REGNO is -1, do this for all registers. -// OBSOLETE Otherwise, REGNO specifies which register (so we can save time). */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE store_inferior_registers (int regno) -// OBSOLETE { -// OBSOLETE register unsigned int regaddr; -// OBSOLETE char buf[80]; -// OBSOLETE -// OBSOLETE struct USER u; -// OBSOLETE -// OBSOLETE unsigned int offset = (char *) &u.pt_r0 - (char *) &u; -// OBSOLETE -// OBSOLETE regaddr = offset; -// OBSOLETE -// OBSOLETE /* Don't try to deal with EXIP_REGNUM or ENIP_REGNUM, because I think either -// OBSOLETE svr3 doesn't run on an 88110, or the kernel isolates the different (not -// OBSOLETE completely sure this is true, but seems to be. */ -// OBSOLETE if (regno >= 0) -// OBSOLETE { -// OBSOLETE /* regaddr = register_addr (regno, offset); */ -// OBSOLETE if (regno < PC_REGNUM) -// OBSOLETE { -// OBSOLETE regaddr = offset + regno * sizeof (int); -// OBSOLETE errno = 0; -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); -// OBSOLETE if (errno != 0) -// OBSOLETE { -// OBSOLETE sprintf (buf, "writing register number %d", regno); -// OBSOLETE perror_with_name (buf); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (regno == SXIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == SNIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno)); -// OBSOLETE else if (regno == SFIP_REGNUM) -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (regno)); -// OBSOLETE else -// OBSOLETE printf_unfiltered ("Bad register number for store_inferior routine\n"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (regno = 0; regno < PC_REGNUM; regno++) -// OBSOLETE { -// OBSOLETE /* regaddr = register_addr (regno, offset); */ -// OBSOLETE errno = 0; -// OBSOLETE regaddr = offset + regno * sizeof (int); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) regaddr, read_register (regno)); -// OBSOLETE if (errno != 0) -// OBSOLETE { -// OBSOLETE sprintf (buf, "writing register number %d", regno); -// OBSOLETE perror_with_name (buf); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM)); -// OBSOLETE ptrace (6, PIDGET (inferior_ptid), -// OBSOLETE (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (SFIP_REGNUM)); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* blockend is the address of the end of the user structure */ -// OBSOLETE m88k_register_u_addr (int blockend, int regnum) -// OBSOLETE { -// OBSOLETE struct USER u; -// OBSOLETE int ustart = blockend - sizeof (struct USER); -// OBSOLETE switch (regnum) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE case 1: -// OBSOLETE case 2: -// OBSOLETE case 3: -// OBSOLETE case 4: -// OBSOLETE case 5: -// OBSOLETE case 6: -// OBSOLETE case 7: -// OBSOLETE case 8: -// OBSOLETE case 9: -// OBSOLETE case 10: -// OBSOLETE case 11: -// OBSOLETE case 12: -// OBSOLETE case 13: -// OBSOLETE case 14: -// OBSOLETE case 15: -// OBSOLETE case 16: -// OBSOLETE case 17: -// OBSOLETE case 18: -// OBSOLETE case 19: -// OBSOLETE case 20: -// OBSOLETE case 21: -// OBSOLETE case 22: -// OBSOLETE case 23: -// OBSOLETE case 24: -// OBSOLETE case 25: -// OBSOLETE case 26: -// OBSOLETE case 27: -// OBSOLETE case 28: -// OBSOLETE case 29: -// OBSOLETE case 30: -// OBSOLETE case 31: -// OBSOLETE return (ustart + ((int) &u.pt_r0 - (int) &u) + REGISTER_SIZE * regnum); -// OBSOLETE case PSR_REGNUM: -// OBSOLETE return (ustart + ((int) &u.pt_psr - (int) &u)); -// OBSOLETE case FPSR_REGNUM: -// OBSOLETE return (ustart + ((int) &u.pt_fpsr - (int) &u)); -// OBSOLETE case FPCR_REGNUM: -// OBSOLETE return (ustart + ((int) &u.pt_fpcr - (int) &u)); -// OBSOLETE case SXIP_REGNUM: -// OBSOLETE return (ustart + SXIP_OFFSET); -// OBSOLETE case SNIP_REGNUM: -// OBSOLETE return (ustart + SNIP_OFFSET); -// OBSOLETE case SFIP_REGNUM: -// OBSOLETE return (ustart + SFIP_OFFSET); -// OBSOLETE default: -// OBSOLETE if (regnum < NUM_REGS) -// OBSOLETE /* The register is one of those which is not defined... -// OBSOLETE give it zero */ -// OBSOLETE return (ustart + ((int) &u.pt_r0 - (int) &u)); -// OBSOLETE else -// OBSOLETE return (blockend + REGISTER_SIZE * regnum); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE #ifdef USE_PROC_FS -// OBSOLETE -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* Prototypes for supply_gregset etc. */ -// OBSOLETE #include "gregset.h" -// OBSOLETE -// OBSOLETE /* Given a pointer to a general register set in /proc format (gregset_t *), -// OBSOLETE unpack the register contents and supply them as gdb's idea of the current -// OBSOLETE register values. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE supply_gregset (gregset_t *gregsetp) -// OBSOLETE { -// OBSOLETE register int regi; -// OBSOLETE register greg_t *regp = (greg_t *) gregsetp; -// OBSOLETE -// OBSOLETE for (regi = 0; regi <= SP_REGNUM; regi++) -// OBSOLETE supply_register (regi, (char *) (regp + regi)); -// OBSOLETE -// OBSOLETE supply_register (SXIP_REGNUM, (char *) (regp + R_XIP)); -// OBSOLETE supply_register (SNIP_REGNUM, (char *) (regp + R_NIP)); -// OBSOLETE supply_register (SFIP_REGNUM, (char *) (regp + R_FIP)); -// OBSOLETE supply_register (PSR_REGNUM, (char *) (regp + R_PSR)); -// OBSOLETE supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR)); -// OBSOLETE supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE fill_gregset (gregset_t *gregsetp, int regno) -// OBSOLETE { -// OBSOLETE int regi; -// OBSOLETE register greg_t *regp = (greg_t *) gregsetp; -// OBSOLETE -// OBSOLETE for (regi = 0; regi <= R_R31; regi++) -// OBSOLETE if ((regno == -1) || (regno == regi)) -// OBSOLETE *(regp + regi) = *(int *) ®isters[REGISTER_BYTE (regi)]; -// OBSOLETE -// OBSOLETE if ((regno == -1) || (regno == SXIP_REGNUM)) -// OBSOLETE *(regp + R_XIP) = *(int *) ®isters[REGISTER_BYTE (SXIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == SNIP_REGNUM)) -// OBSOLETE *(regp + R_NIP) = *(int *) ®isters[REGISTER_BYTE (SNIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == SFIP_REGNUM)) -// OBSOLETE *(regp + R_FIP) = *(int *) ®isters[REGISTER_BYTE (SFIP_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == PSR_REGNUM)) -// OBSOLETE *(regp + R_PSR) = *(int *) ®isters[REGISTER_BYTE (PSR_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == FPSR_REGNUM)) -// OBSOLETE *(regp + R_FPSR) = *(int *) ®isters[REGISTER_BYTE (FPSR_REGNUM)]; -// OBSOLETE if ((regno == -1) || (regno == FPCR_REGNUM)) -// OBSOLETE *(regp + R_FPCR) = *(int *) ®isters[REGISTER_BYTE (FPCR_REGNUM)]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #endif /* USE_PROC_FS */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c deleted file mode 100644 index da0b67c..0000000 --- a/gdb/m88k-tdep.c +++ /dev/null @@ -1,661 +0,0 @@ -// OBSOLETE /* Target-machine dependent code for Motorola 88000 series, for GDB. -// OBSOLETE -// OBSOLETE Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -// OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "setjmp.h" -// OBSOLETE #include "value.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* Size of an instruction */ -// OBSOLETE #define BYTES_PER_88K_INSN 4 -// OBSOLETE -// OBSOLETE void frame_find_saved_regs (); -// OBSOLETE -// OBSOLETE /* Is this target an m88110? Otherwise assume m88100. This has -// OBSOLETE relevance for the ways in which we screw with instruction pointers. */ -// OBSOLETE -// OBSOLETE int target_is_m88110 = 0; -// OBSOLETE -// OBSOLETE void -// OBSOLETE m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid) -// OBSOLETE { -// OBSOLETE /* According to the MC88100 RISC Microprocessor User's Manual, -// OBSOLETE section 6.4.3.1.2: -// OBSOLETE -// OBSOLETE ... can be made to return to a particular instruction by placing -// OBSOLETE a valid instruction address in the SNIP and the next sequential -// OBSOLETE instruction address in the SFIP (with V bits set and E bits -// OBSOLETE clear). The rte resumes execution at the instruction pointed to -// OBSOLETE by the SNIP, then the SFIP. -// OBSOLETE -// OBSOLETE The E bit is the least significant bit (bit 0). The V (valid) -// OBSOLETE bit is bit 1. This is why we logical or 2 into the values we are -// OBSOLETE writing below. It turns out that SXIP plays no role when -// OBSOLETE returning from an exception so nothing special has to be done -// OBSOLETE with it. We could even (presumably) give it a totally bogus -// OBSOLETE value. -// OBSOLETE -// OBSOLETE -- Kevin Buettner */ -// OBSOLETE -// OBSOLETE write_register_pid (SXIP_REGNUM, pc, ptid); -// OBSOLETE write_register_pid (SNIP_REGNUM, (pc | 2), ptid); -// OBSOLETE write_register_pid (SFIP_REGNUM, (pc | 2) + 4, ptid); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The type of a register. */ -// OBSOLETE struct type * -// OBSOLETE m88k_register_type (int regnum) -// OBSOLETE { -// OBSOLETE if (regnum >= XFP_REGNUM) -// OBSOLETE return builtin_type_m88110_ext; -// OBSOLETE else if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM) -// OBSOLETE return builtin_type_void_func_ptr; -// OBSOLETE else -// OBSOLETE return builtin_type_int32; -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* The m88k kernel aligns all instructions on 4-byte boundaries. The -// OBSOLETE kernel also uses the least significant two bits for its own hocus -// OBSOLETE pocus. When gdb receives an address from the kernel, it needs to -// OBSOLETE preserve those right-most two bits, but gdb also needs to be careful -// OBSOLETE to realize that those two bits are not really a part of the address -// OBSOLETE of an instruction. Shrug. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE m88k_addr_bits_remove (CORE_ADDR addr) -// OBSOLETE { -// OBSOLETE return ((addr) & ~3); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Given a GDB frame, determine the address of the calling function's frame. -// OBSOLETE This will be used to create a new GDB frame struct, and then -// OBSOLETE INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. -// OBSOLETE -// OBSOLETE For us, the frame address is its stack pointer value, so we look up -// OBSOLETE the function prologue to determine the caller's sp value, and return it. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_chain (struct frame_info *thisframe) -// OBSOLETE { -// OBSOLETE -// OBSOLETE frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0); -// OBSOLETE /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not -// OBSOLETE the ADDRESS, of SP_REGNUM. It also depends on the cache of -// OBSOLETE frame_find_saved_regs results. */ -// OBSOLETE if (thisframe->fsr->regs[SP_REGNUM]) -// OBSOLETE return thisframe->fsr->regs[SP_REGNUM]; -// OBSOLETE else -// OBSOLETE return thisframe->frame; /* Leaf fn -- next frame up has same SP. */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE int -// OBSOLETE frameless_function_invocation (struct frame_info *frame) -// OBSOLETE { -// OBSOLETE -// OBSOLETE frame_find_saved_regs (frame, (struct frame_saved_regs *) 0); -// OBSOLETE /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not -// OBSOLETE the ADDRESS, of SP_REGNUM. It also depends on the cache of -// OBSOLETE frame_find_saved_regs results. */ -// OBSOLETE if (frame->fsr->regs[SP_REGNUM]) -// OBSOLETE return 0; /* Frameful -- return addr saved somewhere */ -// OBSOLETE else -// OBSOLETE return 1; /* Frameless -- no saved return address */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE init_extra_frame_info (int fromleaf, struct frame_info *frame) -// OBSOLETE { -// OBSOLETE frame->fsr = 0; /* Not yet allocated */ -// OBSOLETE frame->args_pointer = 0; /* Unknown */ -// OBSOLETE frame->locals_pointer = 0; /* Unknown */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Examine an m88k function prologue, recording the addresses at which -// OBSOLETE registers are saved explicitly by the prologue code, and returning -// OBSOLETE the address of the first instruction after the prologue (but not -// OBSOLETE after the instruction at address LIMIT, as explained below). -// OBSOLETE -// OBSOLETE LIMIT places an upper bound on addresses of the instructions to be -// OBSOLETE examined. If the prologue code scan reaches LIMIT, the scan is -// OBSOLETE aborted and LIMIT is returned. This is used, when examining the -// OBSOLETE prologue for the current frame, to keep examine_prologue () from -// OBSOLETE claiming that a given register has been saved when in fact the -// OBSOLETE instruction that saves it has not yet been executed. LIMIT is used -// OBSOLETE at other times to stop the scan when we hit code after the true -// OBSOLETE function prologue (e.g. for the first source line) which might -// OBSOLETE otherwise be mistaken for function prologue. -// OBSOLETE -// OBSOLETE The format of the function prologue matched by this routine is -// OBSOLETE derived from examination of the source to gcc 1.95, particularly -// OBSOLETE the routine output_prologue () in config/out-m88k.c. -// OBSOLETE -// OBSOLETE subu r31,r31,n # stack pointer update -// OBSOLETE -// OBSOLETE (st rn,r31,offset)? # save incoming regs -// OBSOLETE (st.d rn,r31,offset)? -// OBSOLETE -// OBSOLETE (addu r30,r31,n)? # frame pointer update -// OBSOLETE -// OBSOLETE (pic sequence)? # PIC code prologue -// OBSOLETE -// OBSOLETE (or rn,rm,0)? # Move parameters to other regs -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Macros for extracting fields from instructions. */ -// OBSOLETE -// OBSOLETE #define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos)) -// OBSOLETE #define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width)) -// OBSOLETE #define SUBU_OFFSET(x) ((unsigned)(x & 0xFFFF)) -// OBSOLETE #define ST_OFFSET(x) ((unsigned)((x) & 0xFFFF)) -// OBSOLETE #define ST_SRC(x) EXTRACT_FIELD ((x), 21, 5) -// OBSOLETE #define ADDU_OFFSET(x) ((unsigned)(x & 0xFFFF)) -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * prologue_insn_tbl is a table of instructions which may comprise a -// OBSOLETE * function prologue. Associated with each table entry (corresponding -// OBSOLETE * to a single instruction or group of instructions), is an action. -// OBSOLETE * This action is used by examine_prologue (below) to determine -// OBSOLETE * the state of certain machine registers and where the stack frame lives. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE enum prologue_insn_action -// OBSOLETE { -// OBSOLETE PIA_SKIP, /* don't care what the instruction does */ -// OBSOLETE PIA_NOTE_ST, /* note register stored and where */ -// OBSOLETE PIA_NOTE_STD, /* note pair of registers stored and where */ -// OBSOLETE PIA_NOTE_SP_ADJUSTMENT, /* note stack pointer adjustment */ -// OBSOLETE PIA_NOTE_FP_ASSIGNMENT, /* note frame pointer assignment */ -// OBSOLETE PIA_NOTE_PROLOGUE_END, /* no more prologue */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE struct prologue_insns -// OBSOLETE { -// OBSOLETE unsigned long insn; -// OBSOLETE unsigned long mask; -// OBSOLETE enum prologue_insn_action action; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE struct prologue_insns prologue_insn_tbl[] = -// OBSOLETE { -// OBSOLETE /* Various register move instructions */ -// OBSOLETE {0x58000000, 0xf800ffff, PIA_SKIP}, /* or/or.u with immed of 0 */ -// OBSOLETE {0xf4005800, 0xfc1fffe0, PIA_SKIP}, /* or rd, r0, rs */ -// OBSOLETE {0xf4005800, 0xfc00ffff, PIA_SKIP}, /* or rd, rs, r0 */ -// OBSOLETE -// OBSOLETE /* Stack pointer setup: "subu sp, sp, n" where n is a multiple of 8 */ -// OBSOLETE {0x67ff0000, 0xffff0007, PIA_NOTE_SP_ADJUSTMENT}, -// OBSOLETE -// OBSOLETE /* Frame pointer assignment: "addu r30, r31, n" */ -// OBSOLETE {0x63df0000, 0xffff0000, PIA_NOTE_FP_ASSIGNMENT}, -// OBSOLETE -// OBSOLETE /* Store to stack instructions; either "st rx, sp, n" or "st.d rx, sp, n" */ -// OBSOLETE {0x241f0000, 0xfc1f0000, PIA_NOTE_ST}, /* st rx, sp, n */ -// OBSOLETE {0x201f0000, 0xfc1f0000, PIA_NOTE_STD}, /* st.d rs, sp, n */ -// OBSOLETE -// OBSOLETE /* Instructions needed for setting up r25 for pic code. */ -// OBSOLETE {0x5f200000, 0xffff0000, PIA_SKIP}, /* or.u r25, r0, offset_high */ -// OBSOLETE {0xcc000002, 0xffffffff, PIA_SKIP}, /* bsr.n Lab */ -// OBSOLETE {0x5b390000, 0xffff0000, PIA_SKIP}, /* or r25, r25, offset_low */ -// OBSOLETE {0xf7396001, 0xffffffff, PIA_SKIP}, /* Lab: addu r25, r25, r1 */ -// OBSOLETE -// OBSOLETE /* Various branch or jump instructions which have a delay slot -- these -// OBSOLETE do not form part of the prologue, but the instruction in the delay -// OBSOLETE slot might be a store instruction which should be noted. */ -// OBSOLETE {0xc4000000, 0xe4000000, PIA_NOTE_PROLOGUE_END}, -// OBSOLETE /* br.n, bsr.n, bb0.n, or bb1.n */ -// OBSOLETE {0xec000000, 0xfc000000, PIA_NOTE_PROLOGUE_END}, /* bcnd.n */ -// OBSOLETE {0xf400c400, 0xfffff7e0, PIA_NOTE_PROLOGUE_END} /* jmp.n or jsr.n */ -// OBSOLETE -// OBSOLETE }; -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or -// OBSOLETE is not the address of a valid instruction, the address of the next -// OBSOLETE instruction beyond ADDR otherwise. *PWORD1 receives the first word -// OBSOLETE of the instruction. */ -// OBSOLETE -// OBSOLETE #define NEXT_PROLOGUE_INSN(addr, lim, pword1) \ -// OBSOLETE (((addr) < (lim)) ? next_insn (addr, pword1) : 0) -// OBSOLETE -// OBSOLETE /* Read the m88k instruction at 'memaddr' and return the address of -// OBSOLETE the next instruction after that, or 0 if 'memaddr' is not the -// OBSOLETE address of a valid instruction. The instruction -// OBSOLETE is stored at 'pword1'. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE next_insn (CORE_ADDR memaddr, unsigned long *pword1) -// OBSOLETE { -// OBSOLETE *pword1 = read_memory_integer (memaddr, BYTES_PER_88K_INSN); -// OBSOLETE return memaddr + BYTES_PER_88K_INSN; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read a register from frames called by us (or from the hardware regs). */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE read_next_frame_reg (struct frame_info *frame, int regno) -// OBSOLETE { -// OBSOLETE for (; frame; frame = frame->next) -// OBSOLETE { -// OBSOLETE if (regno == SP_REGNUM) -// OBSOLETE return FRAME_FP (frame); -// OBSOLETE else if (frame->fsr->regs[regno]) -// OBSOLETE return read_memory_integer (frame->fsr->regs[regno], 4); -// OBSOLETE } -// OBSOLETE return read_register (regno); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Examine the prologue of a function. `ip' points to the first instruction. -// OBSOLETE `limit' is the limit of the prologue (e.g. the addr of the first -// OBSOLETE linenumber, or perhaps the program counter if we're stepping through). -// OBSOLETE `frame_sp' is the stack pointer value in use in this frame. -// OBSOLETE `fsr' is a pointer to a frame_saved_regs structure into which we put -// OBSOLETE info about the registers saved by this frame. -// OBSOLETE `fi' is a struct frame_info pointer; we fill in various fields in it -// OBSOLETE to reflect the offsets of the arg pointer and the locals pointer. */ -// OBSOLETE -// OBSOLETE static CORE_ADDR -// OBSOLETE examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit, -// OBSOLETE CORE_ADDR frame_sp, struct frame_saved_regs *fsr, -// OBSOLETE struct frame_info *fi) -// OBSOLETE { -// OBSOLETE register CORE_ADDR next_ip; -// OBSOLETE register int src; -// OBSOLETE unsigned long insn; -// OBSOLETE int size, offset; -// OBSOLETE char must_adjust[32]; /* If set, must adjust offsets in fsr */ -// OBSOLETE int sp_offset = -1; /* -1 means not set (valid must be mult of 8) */ -// OBSOLETE int fp_offset = -1; /* -1 means not set */ -// OBSOLETE CORE_ADDR frame_fp; -// OBSOLETE CORE_ADDR prologue_end = 0; -// OBSOLETE -// OBSOLETE memset (must_adjust, '\0', sizeof (must_adjust)); -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn); -// OBSOLETE -// OBSOLETE while (next_ip) -// OBSOLETE { -// OBSOLETE struct prologue_insns *pip; -// OBSOLETE -// OBSOLETE for (pip = prologue_insn_tbl; (insn & pip->mask) != pip->insn;) -// OBSOLETE if (++pip >= prologue_insn_tbl + sizeof prologue_insn_tbl) -// OBSOLETE goto end_of_prologue_found; /* not a prologue insn */ -// OBSOLETE -// OBSOLETE switch (pip->action) -// OBSOLETE { -// OBSOLETE case PIA_NOTE_ST: -// OBSOLETE case PIA_NOTE_STD: -// OBSOLETE if (sp_offset != -1) -// OBSOLETE { -// OBSOLETE src = ST_SRC (insn); -// OBSOLETE offset = ST_OFFSET (insn); -// OBSOLETE must_adjust[src] = 1; -// OBSOLETE fsr->regs[src++] = offset; /* Will be adjusted later */ -// OBSOLETE if (pip->action == PIA_NOTE_STD && src < 32) -// OBSOLETE { -// OBSOLETE offset += 4; -// OBSOLETE must_adjust[src] = 1; -// OBSOLETE fsr->regs[src++] = offset; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE goto end_of_prologue_found; -// OBSOLETE break; -// OBSOLETE case PIA_NOTE_SP_ADJUSTMENT: -// OBSOLETE if (sp_offset == -1) -// OBSOLETE sp_offset = -SUBU_OFFSET (insn); -// OBSOLETE else -// OBSOLETE goto end_of_prologue_found; -// OBSOLETE break; -// OBSOLETE case PIA_NOTE_FP_ASSIGNMENT: -// OBSOLETE if (fp_offset == -1) -// OBSOLETE fp_offset = ADDU_OFFSET (insn); -// OBSOLETE else -// OBSOLETE goto end_of_prologue_found; -// OBSOLETE break; -// OBSOLETE case PIA_NOTE_PROLOGUE_END: -// OBSOLETE if (!prologue_end) -// OBSOLETE prologue_end = ip; -// OBSOLETE break; -// OBSOLETE case PIA_SKIP: -// OBSOLETE default: -// OBSOLETE /* Do nothing */ -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE ip = next_ip; -// OBSOLETE next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn); -// OBSOLETE } -// OBSOLETE -// OBSOLETE end_of_prologue_found: -// OBSOLETE -// OBSOLETE if (prologue_end) -// OBSOLETE ip = prologue_end; -// OBSOLETE -// OBSOLETE /* We're done with the prologue. If we don't care about the stack -// OBSOLETE frame itself, just return. (Note that fsr->regs has been trashed, -// OBSOLETE but the one caller who calls with fi==0 passes a dummy there.) */ -// OBSOLETE -// OBSOLETE if (fi == 0) -// OBSOLETE return ip; -// OBSOLETE -// OBSOLETE /* -// OBSOLETE OK, now we have: -// OBSOLETE -// OBSOLETE sp_offset original (before any alloca calls) displacement of SP -// OBSOLETE (will be negative). -// OBSOLETE -// OBSOLETE fp_offset displacement from original SP to the FP for this frame -// OBSOLETE or -1. -// OBSOLETE -// OBSOLETE fsr->regs[0..31] displacement from original SP to the stack -// OBSOLETE location where reg[0..31] is stored. -// OBSOLETE -// OBSOLETE must_adjust[0..31] set if corresponding offset was set. -// OBSOLETE -// OBSOLETE If alloca has been called between the function prologue and the current -// OBSOLETE IP, then the current SP (frame_sp) will not be the original SP as set by -// OBSOLETE the function prologue. If the current SP is not the original SP, then the -// OBSOLETE compiler will have allocated an FP for this frame, fp_offset will be set, -// OBSOLETE and we can use it to calculate the original SP. -// OBSOLETE -// OBSOLETE Then, we figure out where the arguments and locals are, and relocate the -// OBSOLETE offsets in fsr->regs to absolute addresses. */ -// OBSOLETE -// OBSOLETE if (fp_offset != -1) -// OBSOLETE { -// OBSOLETE /* We have a frame pointer, so get it, and base our calc's on it. */ -// OBSOLETE frame_fp = (CORE_ADDR) read_next_frame_reg (fi->next, ACTUAL_FP_REGNUM); -// OBSOLETE frame_sp = frame_fp - fp_offset; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* We have no frame pointer, therefore frame_sp is still the same value -// OBSOLETE as set by prologue. But where is the frame itself? */ -// OBSOLETE if (must_adjust[SRP_REGNUM]) -// OBSOLETE { -// OBSOLETE /* Function header saved SRP (r1), the return address. Frame starts -// OBSOLETE 4 bytes down from where it was saved. */ -// OBSOLETE frame_fp = frame_sp + fsr->regs[SRP_REGNUM] - 4; -// OBSOLETE fi->locals_pointer = frame_fp; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Function header didn't save SRP (r1), so we are in a leaf fn or -// OBSOLETE are otherwise confused. */ -// OBSOLETE frame_fp = -1; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* The locals are relative to the FP (whether it exists as an allocated -// OBSOLETE register, or just as an assumed offset from the SP) */ -// OBSOLETE fi->locals_pointer = frame_fp; -// OBSOLETE -// OBSOLETE /* The arguments are just above the SP as it was before we adjusted it -// OBSOLETE on entry. */ -// OBSOLETE fi->args_pointer = frame_sp - sp_offset; -// OBSOLETE -// OBSOLETE /* Now that we know the SP value used by the prologue, we know where -// OBSOLETE it saved all the registers. */ -// OBSOLETE for (src = 0; src < 32; src++) -// OBSOLETE if (must_adjust[src]) -// OBSOLETE fsr->regs[src] += frame_sp; -// OBSOLETE -// OBSOLETE /* The saved value of the SP is always known. */ -// OBSOLETE /* (we hope...) */ -// OBSOLETE if (fsr->regs[SP_REGNUM] != 0 -// OBSOLETE && fsr->regs[SP_REGNUM] != frame_sp - sp_offset) -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Bad saved SP value %lx != %lx, offset %x!\n", -// OBSOLETE fsr->regs[SP_REGNUM], -// OBSOLETE frame_sp - sp_offset, sp_offset); -// OBSOLETE -// OBSOLETE fsr->regs[SP_REGNUM] = frame_sp - sp_offset; -// OBSOLETE -// OBSOLETE return (ip); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given an ip value corresponding to the start of a function, -// OBSOLETE return the ip of the first instruction after the function -// OBSOLETE prologue. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE m88k_skip_prologue (CORE_ADDR ip) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs saved_regs_dummy; -// OBSOLETE struct symtab_and_line sal; -// OBSOLETE CORE_ADDR limit; -// OBSOLETE -// OBSOLETE sal = find_pc_line (ip, 0); -// OBSOLETE limit = (sal.end) ? sal.end : 0xffffffff; -// OBSOLETE -// OBSOLETE return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy, -// OBSOLETE (struct frame_info *) 0)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, -// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. -// OBSOLETE This includes special registers such as pc and fp saved in special -// OBSOLETE ways in the stack frame. sp is even more special: -// OBSOLETE the address we return for it IS the sp for the next frame. -// OBSOLETE -// OBSOLETE We cache the result of doing this in the frame_obstack, since it is -// OBSOLETE fairly expensive. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr) -// OBSOLETE { -// OBSOLETE register struct frame_saved_regs *cache_fsr; -// OBSOLETE CORE_ADDR ip; -// OBSOLETE struct symtab_and_line sal; -// OBSOLETE CORE_ADDR limit; -// OBSOLETE -// OBSOLETE if (!fi->fsr) -// OBSOLETE { -// OBSOLETE cache_fsr = (struct frame_saved_regs *) -// OBSOLETE frame_obstack_alloc (sizeof (struct frame_saved_regs)); -// OBSOLETE memset (cache_fsr, '\0', sizeof (struct frame_saved_regs)); -// OBSOLETE fi->fsr = cache_fsr; -// OBSOLETE -// OBSOLETE /* Find the start and end of the function prologue. If the PC -// OBSOLETE is in the function prologue, we only consider the part that -// OBSOLETE has executed already. In the case where the PC is not in -// OBSOLETE the function prologue, we set limit to two instructions beyond -// OBSOLETE where the prologue ends in case if any of the prologue instructions -// OBSOLETE were moved into a delay slot of a branch instruction. */ -// OBSOLETE -// OBSOLETE ip = get_pc_function_start (fi->pc); -// OBSOLETE sal = find_pc_line (ip, 0); -// OBSOLETE limit = (sal.end && sal.end < fi->pc) ? sal.end + 2 * BYTES_PER_88K_INSN -// OBSOLETE : fi->pc; -// OBSOLETE -// OBSOLETE /* This will fill in fields in *fi as well as in cache_fsr. */ -// OBSOLETE #ifdef SIGTRAMP_FRAME_FIXUP -// OBSOLETE if (fi->signal_handler_caller) -// OBSOLETE SIGTRAMP_FRAME_FIXUP (fi->frame); -// OBSOLETE #endif -// OBSOLETE examine_prologue (ip, limit, fi->frame, cache_fsr, fi); -// OBSOLETE #ifdef SIGTRAMP_SP_FIXUP -// OBSOLETE if (fi->signal_handler_caller && fi->fsr->regs[SP_REGNUM]) -// OBSOLETE SIGTRAMP_SP_FIXUP (fi->fsr->regs[SP_REGNUM]); -// OBSOLETE #endif -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (fsr) -// OBSOLETE *fsr = *fi->fsr; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the address of the locals block for the frame -// OBSOLETE described by FI. Returns 0 if the address is unknown. -// OBSOLETE NOTE! Frame locals are referred to by negative offsets from the -// OBSOLETE argument pointer, so this is the same as frame_args_address(). */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_locals_address (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE -// OBSOLETE if (fi->args_pointer) /* Cached value is likely there. */ -// OBSOLETE return fi->args_pointer; -// OBSOLETE -// OBSOLETE /* Nope, generate it. */ -// OBSOLETE -// OBSOLETE get_frame_saved_regs (fi, &fsr); -// OBSOLETE -// OBSOLETE return fi->args_pointer; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the address of the argument block for the frame -// OBSOLETE described by FI. Returns 0 if the address is unknown. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_args_address (struct frame_info *fi) -// OBSOLETE { -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE -// OBSOLETE if (fi->args_pointer) /* Cached value is likely there. */ -// OBSOLETE return fi->args_pointer; -// OBSOLETE -// OBSOLETE /* Nope, generate it. */ -// OBSOLETE -// OBSOLETE get_frame_saved_regs (fi, &fsr); -// OBSOLETE -// OBSOLETE return fi->args_pointer; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the saved PC from this frame. -// OBSOLETE -// OBSOLETE If the frame has a memory copy of SRP_REGNUM, use that. If not, -// OBSOLETE just use the register SRP_REGNUM itself. */ -// OBSOLETE -// OBSOLETE CORE_ADDR -// OBSOLETE frame_saved_pc (struct frame_info *frame) -// OBSOLETE { -// OBSOLETE return read_next_frame_reg (frame, SRP_REGNUM); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE #define DUMMY_FRAME_SIZE 192 -// OBSOLETE -// OBSOLETE static void -// OBSOLETE write_word (CORE_ADDR sp, ULONGEST word) -// OBSOLETE { -// OBSOLETE register int len = REGISTER_SIZE; -// OBSOLETE char buffer[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE -// OBSOLETE store_unsigned_integer (buffer, len, word); -// OBSOLETE write_memory (sp, buffer, len); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE m88k_push_dummy_frame (void) -// OBSOLETE { -// OBSOLETE register CORE_ADDR sp = read_register (SP_REGNUM); -// OBSOLETE register int rn; -// OBSOLETE int offset; -// OBSOLETE -// OBSOLETE sp -= DUMMY_FRAME_SIZE; /* allocate a bunch of space */ -// OBSOLETE -// OBSOLETE for (rn = 0, offset = 0; rn <= SP_REGNUM; rn++, offset += 4) -// OBSOLETE write_word (sp + offset, read_register (rn)); -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (SXIP_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (SNIP_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (SFIP_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (PSR_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (FPSR_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_word (sp + offset, read_register (FPCR_REGNUM)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (SP_REGNUM, sp); -// OBSOLETE write_register (ACTUAL_FP_REGNUM, sp); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE pop_frame (void) -// OBSOLETE { -// OBSOLETE register struct frame_info *frame = get_current_frame (); -// OBSOLETE register int regnum; -// OBSOLETE struct frame_saved_regs fsr; -// OBSOLETE -// OBSOLETE get_frame_saved_regs (frame, &fsr); -// OBSOLETE -// OBSOLETE if (PC_IN_CALL_DUMMY (read_pc (), read_register (SP_REGNUM), frame->frame)) -// OBSOLETE { -// OBSOLETE /* FIXME: I think get_frame_saved_regs should be handling this so -// OBSOLETE that we can deal with the saved registers properly (e.g. frame -// OBSOLETE 1 is a call dummy, the user types "frame 2" and then "print $ps"). */ -// OBSOLETE register CORE_ADDR sp = read_register (ACTUAL_FP_REGNUM); -// OBSOLETE int offset; -// OBSOLETE -// OBSOLETE for (regnum = 0, offset = 0; regnum <= SP_REGNUM; regnum++, offset += 4) -// OBSOLETE (void) write_register (regnum, read_memory_integer (sp + offset, 4)); -// OBSOLETE -// OBSOLETE write_register (SXIP_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (SNIP_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (SFIP_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (PSR_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (FPSR_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE write_register (FPCR_REGNUM, read_memory_integer (sp + offset, 4)); -// OBSOLETE offset += 4; -// OBSOLETE -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE for (regnum = FP_REGNUM; regnum > 0; regnum--) -// OBSOLETE if (fsr.regs[regnum]) -// OBSOLETE write_register (regnum, -// OBSOLETE read_memory_integer (fsr.regs[regnum], 4)); -// OBSOLETE write_pc (frame_saved_pc (frame)); -// OBSOLETE } -// OBSOLETE reinit_frame_cache (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_m88k_tdep (void) -// OBSOLETE { -// OBSOLETE tm_print_insn = print_insn_m88k; -// OBSOLETE } diff --git a/gdb/macroscope.c b/gdb/macroscope.c index b482068..19557d7 100644 --- a/gdb/macroscope.c +++ b/gdb/macroscope.c @@ -87,8 +87,8 @@ default_macro_scope (void) struct macro_scope *ms; /* If there's a selected frame, use its PC. */ - if (selected_frame) - sal = find_pc_line (selected_frame->pc, 0); + if (deprecated_selected_frame) + sal = find_pc_line (get_frame_pc (deprecated_selected_frame), 0); /* If the target has any registers at all, then use its PC. Why we would have registers but no stack, I'm not sure. */ diff --git a/gdb/macrotab.c b/gdb/macrotab.c index 5bc5b73..1432847 100644 --- a/gdb/macrotab.c +++ b/gdb/macrotab.c @@ -445,12 +445,9 @@ macro_include (struct macro_source_file *source, should tolerate bad debug info. So: First, squawk. */ - static struct deprecated_complaint bogus_inclusion_line = { - "both `%s' and `%s' allegedly #included at %s:%d", 0, 0 - }; - - complain (&bogus_inclusion_line, - included, (*link)->filename, source->filename, line); + complaint (&symfile_complaints, + "both `%s' and `%s' allegedly #included at %s:%d", included, + (*link)->filename, source->filename, line); /* Now, choose a new, unoccupied line number for this #inclusion, after the alleged #inclusion line. */ @@ -707,15 +704,10 @@ check_for_redefinition (struct macro_source_file *source, int line, if (! same) { - static struct deprecated_complaint macro_redefined = { - "macro `%s' redefined at %s:%d; original definition at %s:%d", - 0, 0 - }; - complain (¯o_redefined, - name, - source->filename, line, - found_key->start_file->filename, - found_key->start_line); + complaint (&symfile_complaints, + "macro `%s' redefined at %s:%d; original definition at %s:%d", + name, source->filename, line, + found_key->start_file->filename, found_key->start_line); } return found_key; @@ -801,12 +793,10 @@ macro_undef (struct macro_source_file *source, int line, if (key->end_file) { - static struct deprecated_complaint double_undef = { - "macro '%s' is #undefined twice, at %s:%d and %s:%d", - 0, 0 - }; - complain (&double_undef, name, source->filename, line, - key->end_file->filename, key->end_line); + complaint (&symfile_complaints, + "macro '%s' is #undefined twice, at %s:%d and %s:%d", name, + source->filename, line, key->end_file->filename, + key->end_line); } /* Whatever the case, wipe out the old ending point, and @@ -820,11 +810,9 @@ macro_undef (struct macro_source_file *source, int line, has no macro definition in scope is ignored. So we should ignore it too. */ #if 0 - static struct deprecated_complaint no_macro_to_undefine = { - "no definition for macro `%s' in scope to #undef at %s:%d", - 0, 0 - }; - complain (&no_macro_to_undefine, name, source->filename, line); + complaint (&symfile_complaints, + "no definition for macro `%s' in scope to #undef at %s:%d", + name, source->filename, line); #endif } } diff --git a/gdb/maint.c b/gdb/maint.c index e45d54d..678fd2b 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -697,7 +697,7 @@ Configure variables internal to GDB that aid in GDB's maintenance", #ifndef _WIN32 add_cmd ("dump-me", class_maintenance, maintenance_dump_me, "Get fatal error; make debugger dump its core.\n\ -GDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\n\ +GDB sets its handling of SIGQUIT back to SIG_DFL and then sends\n\ itself a SIGQUIT signal.", &maintenancelist); #endif diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 23ee96f..ae2821f 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -638,9 +638,10 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue) return addr; } -/* 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. */ +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. */ CORE_ADDR mcore_frame_chain (struct frame_info * fi) @@ -756,7 +757,7 @@ mcore_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi != NULL; fi = fi->next) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->saved_regs[regnum] != 0) return read_memory_integer (fi->saved_regs[regnum], @@ -772,7 +773,7 @@ CORE_ADDR mcore_frame_saved_pc (struct frame_info * fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); else return mcore_find_callers_reg (fi, PR_REGNUM); @@ -789,7 +790,7 @@ mcore_pop_frame (void) int rn; struct frame_info *fi = get_current_frame (); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) generic_pop_dummy_frame (); else { @@ -810,7 +811,7 @@ mcore_pop_frame (void) } /* Actually cut back the stack. */ - write_register (SP_REGNUM, FRAME_FP (fi)); + write_register (SP_REGNUM, get_frame_base (fi)); } /* Finally, throw away any cached frame information. */ @@ -1047,7 +1048,7 @@ mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info->status = 0; fi->extra_info->framesize = 0; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1084,6 +1085,10 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, 0); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + /* Registers: */ /* All registers are 32 bits */ @@ -1100,22 +1105,18 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, 64); set_gdbarch_sp_regnum (gdbarch, 0); set_gdbarch_fp_regnum (gdbarch, 0); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); /* Call Dummies: */ set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); set_gdbarch_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call); set_gdbarch_function_start_offset (gdbarch, 0); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 77a6aa1..34d162f 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -144,96 +144,43 @@ struct symloc #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined) /* Various complaints about symbol reading that don't abort the process */ +static void +index_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "bad aux index at symbol %s", arg1); +} -static struct deprecated_complaint bad_file_number_complaint = -{"bad file number %d", 0, 0}; - -static struct deprecated_complaint index_complaint = -{"bad aux index at symbol %s", 0, 0}; - -static struct deprecated_complaint aux_index_complaint = -{"bad proc end in aux found from symbol %s", 0, 0}; - -static struct deprecated_complaint block_index_complaint = -{"bad aux index at block symbol %s", 0, 0}; - -static struct deprecated_complaint unknown_ext_complaint = -{"unknown external symbol %s", 0, 0}; - -static struct deprecated_complaint unknown_sym_complaint = -{"unknown local symbol %s", 0, 0}; - -static struct deprecated_complaint unknown_st_complaint = -{"with type %d", 0, 0}; - -static struct deprecated_complaint block_overflow_complaint = -{"block containing %s overfilled", 0, 0}; - -static struct deprecated_complaint basic_type_complaint = -{"cannot map ECOFF basic type 0x%x for %s", 0, 0}; - -static struct deprecated_complaint unknown_type_qual_complaint = -{"unknown type qualifier 0x%x", 0, 0}; - -static struct deprecated_complaint array_index_type_complaint = -{"illegal array index type for %s, assuming int", 0, 0}; - -static struct deprecated_complaint bad_tag_guess_complaint = -{"guessed tag type of %s incorrectly", 0, 0}; - -static struct deprecated_complaint block_member_complaint = -{"declaration block contains unhandled symbol type %d", 0, 0}; - -static struct deprecated_complaint stEnd_complaint = -{"stEnd with storage class %d not handled", 0, 0}; - -static struct deprecated_complaint unknown_mdebug_symtype_complaint = -{"unknown symbol type 0x%x", 0, 0}; - -static struct deprecated_complaint stab_unknown_complaint = -{"unknown stabs symbol %s", 0, 0}; - -static struct deprecated_complaint pdr_for_nonsymbol_complaint = -{"PDR for %s, but no symbol", 0, 0}; - -static struct deprecated_complaint pdr_static_symbol_complaint = -{"can't handle PDR for static proc at 0x%lx", 0, 0}; - -static struct deprecated_complaint bad_setjmp_pdr_complaint = -{"fixing bad setjmp PDR from libc", 0, 0}; - -static struct deprecated_complaint bad_fbitfield_complaint = -{"can't handle TIR fBitfield for %s", 0, 0}; - -static struct deprecated_complaint bad_continued_complaint = -{"illegal TIR continued for %s", 0, 0}; - -static struct deprecated_complaint bad_rfd_entry_complaint = -{"bad rfd entry for %s: file %d, index %d", 0, 0}; - -static struct deprecated_complaint unexpected_type_code_complaint = -{"unexpected type code for %s", 0, 0}; - -static struct deprecated_complaint unable_to_cross_ref_complaint = -{"unable to cross ref btTypedef for %s", 0, 0}; - -static struct deprecated_complaint bad_indirect_xref_complaint = -{"unable to cross ref btIndirect for %s", 0, 0}; - -static struct deprecated_complaint illegal_forward_tq0_complaint = -{"illegal tq0 in forward typedef for %s", 0, 0}; +static void +unknown_ext_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "unknown external symbol %s", arg1); +} -static struct deprecated_complaint illegal_forward_bt_complaint = -{"illegal bt %d in forward typedef for %s", 0, 0}; +static void +basic_type_complaint (int arg1, const char *arg2) +{ + complaint (&symfile_complaints, "cannot map ECOFF basic type 0x%x for %s", + arg1, arg2); +} -static struct deprecated_complaint bad_linetable_guess_complaint = -{"guessed size of linetable for %s incorrectly", 0, 0}; +static void +bad_tag_guess_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "guessed tag type of %s incorrectly", arg1); +} -static struct deprecated_complaint bad_ext_ifd_complaint = -{"bad ifd for external symbol: %d (max %d)", 0, 0}; +static void +bad_rfd_entry_complaint (const char *arg1, int arg2, int arg3) +{ + complaint (&symfile_complaints, "bad rfd entry for %s: file %d, index %d", + arg1, arg2, arg3); +} -static struct deprecated_complaint bad_ext_iss_complaint = -{"bad iss for external symbol: %ld (max %ld)", 0, 0}; +static void +unexpected_type_code_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "unexpected type code for %s", arg1); +} /* Macros and extra defs */ @@ -986,7 +933,9 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, break; default: - complain (&block_member_complaint, tsym.st); + complaint (&symfile_complaints, + "declaration block contains unhandled symbol type %d", + tsym.st); } } end_of_fields:; @@ -1272,7 +1221,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, ; } else - complain (&stEnd_complaint, sh->sc); + complaint (&symfile_complaints, + "stEnd with storage class %d not handled", sh->sc); pop_parse_stack (); /* restore previous lexical context */ break; @@ -1384,7 +1334,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case stConstant: break; /* constant */ default: - complain (&unknown_mdebug_symtype_complaint, sh->st); + complaint (&symfile_complaints, "unknown symbol type 0x%x", sh->st); break; } @@ -1453,7 +1403,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, /* Handle corrupt aux indices. */ if (aux_index >= (debug_info->fdr + fd)->caux) { - complain (&index_complaint, sym_name); + index_complaint (sym_name); return mdebug_type_int; } ax += aux_index; @@ -1462,7 +1412,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, (*debug_swap->swap_tir_in) (bigend, &ax->a_ti, t); if (t->bt >= (sizeof (map_bt) / sizeof (*map_bt))) { - complain (&basic_type_complaint, t->bt, sym_name); + basic_type_complaint (t->bt, sym_name); return mdebug_type_int; } if (map_bt[t->bt]) @@ -1501,7 +1451,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, type_code = TYPE_CODE_ERROR; break; default: - complain (&basic_type_complaint, t->bt, sym_name); + basic_type_complaint (t->bt, sym_name); return mdebug_type_int; } } @@ -1527,7 +1477,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, else if (t->bt == btEnum) ; else - complain (&bad_fbitfield_complaint, sym_name); + complaint (&symfile_complaints, "can't handle TIR fBitfield for %s", + sym_name); } else *bs = width; @@ -1555,7 +1506,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, if (rf == -1) { - complain (&bad_indirect_xref_complaint, sym_name); + complaint (&symfile_complaints, + "unable to cross ref btIndirect for %s", sym_name); return mdebug_type_int; } xref_fh = get_rfd (fd, rf); @@ -1595,7 +1547,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, && TYPE_CODE (tp) != TYPE_CODE_UNION && TYPE_CODE (tp) != TYPE_CODE_ENUM) { - complain (&unexpected_type_code_complaint, sym_name); + unexpected_type_code_complaint (sym_name); } else { @@ -1609,7 +1561,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, || (TYPE_CODE (tp) != TYPE_CODE_ENUM && type_code == TYPE_CODE_ENUM)) { - complain (&bad_tag_guess_complaint, sym_name); + bad_tag_guess_complaint (sym_name); } if (TYPE_CODE (tp) != type_code) @@ -1646,7 +1598,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, are corrupted. */ if (TYPE_CODE (tp) != TYPE_CODE_RANGE) { - complain (&unexpected_type_code_complaint, sym_name); + unexpected_type_code_complaint (sym_name); } else { @@ -1654,7 +1606,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, exception is if we guessed wrong re struct/union/enum. */ if (TYPE_CODE (tp) != type_code) { - complain (&bad_tag_guess_complaint, sym_name); + bad_tag_guess_complaint (sym_name); TYPE_CODE (tp) = type_code; } if (TYPE_NAME (tp) == NULL || !STREQ (TYPE_NAME (tp), name)) @@ -1670,7 +1622,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name); if (tp == (struct type *) NULL) { - complain (&unable_to_cross_ref_complaint, sym_name); + complaint (&symfile_complaints, + "unable to cross ref btTypedef for %s", sym_name); tp = mdebug_type_int; } } @@ -1720,7 +1673,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, /* Complain for illegal continuations due to corrupt aux entries. */ if (t->continued) - complain (&bad_continued_complaint, sym_name); + complaint (&symfile_complaints, "illegal TIR continued for %s", sym_name); return tp; } @@ -1782,7 +1735,8 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, else due to corrupt aux entries. */ if (TYPE_CODE (indx) != TYPE_CODE_INT) { - complain (&array_index_type_complaint, sym_name); + complaint (&symfile_complaints, + "illegal array index type for %s, assuming int", sym_name); indx = mdebug_type_int; } @@ -1832,7 +1786,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, return 0; default: - complain (&unknown_type_qual_complaint, tq); + complaint (&symfile_complaints, "unknown type qualifier 0x%x", tq); return 0; } } @@ -1867,7 +1821,9 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, { /* Static procedure at address pr->adr. Sigh. */ /* FIXME-32x64. assuming pr->adr fits in long. */ - complain (&pdr_static_symbol_complaint, (unsigned long) pr->adr); + complaint (&symfile_complaints, + "can't handle PDR for static proc at 0x%lx", + (unsigned long) pr->adr); return; } else @@ -1927,7 +1883,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, } else { - complain (&pdr_for_nonsymbol_complaint, sh_name); + complaint (&symfile_complaints, "PDR for %s, but no symbol", sh_name); #if 1 return; #else @@ -1975,7 +1931,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, to make backtrace through setjmp work. */ if (e->pdr.pcreg == 0 && STREQ (sh_name, "setjmp")) { - complain (&bad_setjmp_pdr_complaint, 0); + complaint (&symfile_complaints, "fixing bad setjmp PDR from libc"); e->pdr.pcreg = RA_REGNUM; e->pdr.regmask = 0x80000000; e->pdr.regoffset = -4; @@ -2172,7 +2128,9 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines, with corrupt binaries. */ if (lt->nitems >= maxlines) { - complain (&bad_linetable_guess_complaint, fdr_name (fh)); + complaint (&symfile_complaints, + "guessed size of linetable for %s incorrectly", + fdr_name (fh)); break; } k = add_line (lt, lineno, l, k); @@ -2181,6 +2139,14 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines, } } +static void +function_outside_compilation_unit_complaint (const char *arg1) +{ + complaint (&symfile_complaints, + "function `%s' appears to be defined outside of all compilation units", + arg1); +} + /* Master parsing procedure for first-pass reading of file symbols into a partial_symtab. */ @@ -2357,13 +2323,16 @@ parse_partial_symbols (struct objfile *objfile) external symbols. */ if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax) { - complain (&bad_ext_ifd_complaint, ext_in->ifd, hdr->ifdMax); + complaint (&symfile_complaints, + "bad ifd for external symbol: %d (max %ld)", ext_in->ifd, + hdr->ifdMax); continue; } if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax) { - complain (&bad_ext_iss_complaint, ext_in->asym.iss, - hdr->issExtMax); + complaint (&symfile_complaints, + "bad iss for external symbol: %ld (max %ld)", + ext_in->asym.iss, hdr->issExtMax); continue; } @@ -2489,7 +2458,7 @@ parse_partial_symbols (struct objfile *objfile) /* Fall through. */ default: ms_type = mst_unknown; - complain (&unknown_ext_complaint, name); + unknown_ext_complaint (name); } if (!ECOFF_IN_ELF (cur_bfd)) prim_record_minimal_symbol (name, svalue, ms_type, objfile); @@ -2721,9 +2690,6 @@ parse_partial_symbols (struct objfile *objfile) switch (type_code) { - static struct deprecated_complaint function_outside_compilation_unit = { - "function `%s' appears to be defined outside of all compilation units", 0, 0 - }; char *p; /* * Standard, external, non-debugger, symbols @@ -3126,7 +3092,7 @@ parse_partial_symbols (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -3147,7 +3113,7 @@ parse_partial_symbols (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -3198,7 +3164,8 @@ parse_partial_symbols (struct objfile *objfile) time searching to the end of every string looking for a backslash. */ - complain (&unknown_symchar_complaint, p[1]); + complaint (&symfile_complaints, + "unknown symbol descriptor `%c'", p[1]); /* Ignore it; perhaps it is an extension that we don't know about. */ @@ -3259,8 +3226,8 @@ parse_partial_symbols (struct objfile *objfile) default: /* If we haven't found it yet, ignore it. It's probably some new type we don't know about yet. */ - complain (&unknown_symtype_complaint, - local_hex_string (type_code)); /*CUR_SYMBOL_TYPE*/ + complaint (&symfile_complaints, "unknown symbol type %s", + local_hex_string (type_code)); /*CUR_SYMBOL_TYPE*/ continue; } if (stabstring @@ -3365,7 +3332,7 @@ parse_partial_symbols (struct objfile *objfile) { /* Should not happen, but does when cross-compiling with the MIPS compiler. FIXME -- pull later. */ - complain (&index_complaint, name); + index_complaint (name); new_sdx = cur_sdx + 1; /* Don't skip at all */ } else @@ -3378,7 +3345,9 @@ parse_partial_symbols (struct objfile *objfile) if (new_sdx <= cur_sdx) { /* This should not happen either... FIXME. */ - complain (&aux_index_complaint, name); + complaint (&symfile_complaints, + "bad proc end in aux found from symbol %s", + name); new_sdx = cur_sdx + 1; /* Don't skip backward */ } @@ -3457,7 +3426,8 @@ parse_partial_symbols (struct objfile *objfile) if (new_sdx <= cur_sdx) { /* This happens with the Ultrix kernel. */ - complain (&block_index_complaint, name); + complaint (&symfile_complaints, + "bad aux index at block symbol %s", name); new_sdx = cur_sdx + 1; /* Don't skip backward */ } cur_sdx = new_sdx; @@ -3477,8 +3447,9 @@ parse_partial_symbols (struct objfile *objfile) default: /* Both complaints are valid: one gives symbol name, the other the offending symbol type. */ - complain (&unknown_sym_complaint, name); - complain (&unknown_st_complaint, sh.st); + complaint (&symfile_complaints, "unknown local symbol %s", + name); + complaint (&symfile_complaints, "with type %d", sh.st); cur_sdx++; continue; } @@ -3547,8 +3518,7 @@ parse_partial_symbols (struct objfile *objfile) class = LOC_LABEL; break; default: - complain (&unknown_ext_complaint, - debug_info->ssext + psh->iss); + unknown_ext_complaint (debug_info->ssext + psh->iss); /* Fall through, pretend it's global. */ case stGlobal: /* Global common symbols are resolved by the runtime loader, @@ -3645,7 +3615,7 @@ parse_partial_symbols (struct objfile *objfile) &rh); if (rh < 0 || rh >= hdr->ifdMax) { - complain (&bad_file_number_complaint, rh); + complaint (&symfile_complaints, "bad file number %ld", rh); continue; } @@ -3952,7 +3922,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename) /* These are generated by gcc-2.x, do not complain */ ; else - complain (&stab_unknown_complaint, name); + complaint (&symfile_complaints, "unknown stabs symbol %s", name); } if (! last_symtab_ended) @@ -4249,8 +4219,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod { /* File indirect entry is corrupt. */ *pname = ""; - complain (&bad_rfd_entry_complaint, - sym_name, xref_fd, rn->index); + bad_rfd_entry_complaint (sym_name, xref_fd, rn->index); return result; } @@ -4274,8 +4243,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod { /* File indirect entry is corrupt. */ *pname = ""; - complain (&bad_rfd_entry_complaint, - sym_name, xref_fd, rn->index); + bad_rfd_entry_complaint (sym_name, xref_fd, rn->index); return result; } @@ -4311,7 +4279,8 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod + fh->iauxBase + sh.index)->a_ti, &tir); if (tir.tq0 != tqNil) - complain (&illegal_forward_tq0_complaint, sym_name); + complaint (&symfile_complaints, + "illegal tq0 in forward typedef for %s", sym_name); switch (tir.bt) { case btVoid: @@ -4348,7 +4317,9 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod break; default: - complain (&illegal_forward_bt_complaint, tir.bt, sym_name); + complaint (&symfile_complaints, + "illegal bt %d in forward typedef for %s", tir.bt, + sym_name); *tpp = init_type (type_code, 0, 0, (char *) NULL, current_objfile); break; diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index a493a2d..97d8d46 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,22 @@ +2002-12-13 Jeff Johnston + + * mi-cmds.c (-environment-directory) Change to use mi_cmd_env_dir, + (-environment-cd): Change to use mi_cmd_env_cd,. + (-environment-pwd): Change to use mi_cmd_env_pwd. + (-environment-path): Change to use mi_cmd_env_path. + * mi-cmds.h (mi_cmd_env_cd, mi_cmd_env_dir): New prototypes. + (mi_cmd_env_path, mi_cmd_env_pwd): Ditto. + * mi-cmd-env.c: New file. Part of fix for PR gdb/741. + * gdbmi.texinfo (environment-cd): Update output and example. + (environment-pwd): Ditto. + (environment-dir): Update output, description, and examples. + (environment-path): Ditto. + +2002-11-29 Andrew Cagney + + * mi/mi-cmd-stack.c, mi/mi-main.c: Update to use + deprecated_selected_frame. + 2002-11-13 Andrew Cagney * mi-main.c (mi_cmd_data_write_register_values): Use diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo index d64328c..4cf34c2 100644 --- a/gdb/mi/gdbmi.texinfo +++ b/gdb/mi/gdbmi.texinfo @@ -1665,10 +1665,25 @@ The corresponding @value{GDBN} command is @samp{cd}. @subsubheading Synopsis @example - -environment-directory @var{pathdir} + -environment-directory [ -r ] [ @var{pathdir} ]+ @end example -Add directory @var{pathdir} to beginning of search path for source files. +Add directories @var{pathdir} to beginning of search path for source files. +If the @samp{-r} option is used, the search path is reset to the default +search path. If directories @var{pathdir} are supplied in addition to the +@samp{-r} option, the search path is first reset and then addition +occurs as normal. +Multiple directories may be specified, separated by blanks. Specifying +multiple directories in a single command +results in the directories added to the beginning of the +search path in the same order they were presented in the command. +If blanks are needed as +part of a directory name, double-quotes should be used around +the name. In the command output, the path will show up separated +by the system directory-separator character. The directory-seperator +character must not be used +in any directory name. +If no directories are specified, the current search path is displayed. @subsubheading @value{GDBN} Command @@ -1679,7 +1694,16 @@ The corresponding @value{GDBN} command is @samp{dir}. @smallexample (@value{GDBP}) -environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb -^done +^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" +(@value{GDBP}) +-environment-directory "" +^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd" +(@value{GDBP}) +-environment-directory -r /home/jjohnstn/src/gdb /usr/src +^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd" +(@value{GDBP}) +-environment-directory -r +^done,source-path="$cdir:$cwd" (@value{GDBP}) @end smallexample @@ -1690,10 +1714,27 @@ The corresponding @value{GDBN} command is @samp{dir}. @subsubheading Synopsis @example - -environment-path ( @var{pathdir} )+ + -environment-path [ -r ] [ @var{pathdir} ]+ @end example Add directories @var{pathdir} to beginning of search path for object files. +If the @samp{-r} option is used, the search path is reset to the original +search path that existed at gdb start-up. If directories @var{pathdir} are +supplied in addition to the +@samp{-r} option, the search path is first reset and then addition +occurs as normal. +Multiple directories may be specified, separated by blanks. Specifying +multiple directories in a single command +results in the directories added to the beginning of the +search path in the same order they were presented in the command. +If blanks are needed as +part of a directory name, double-quotes should be used around +the name. In the command output, the path will show up separated +by the system directory-separator character. The directory-seperator +character must not be used +in any directory name. +If no directories are specified, the current path is displayed. + @subsubheading @value{GDBN} Command @@ -1703,8 +1744,14 @@ The corresponding @value{GDBN} command is @samp{path}. @smallexample (@value{GDBP}) --environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb -^done +-environment-path +^done,path="/usr/bin" +(@value{GDBP}) +-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin +^done,path="/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin" +(@value{GDBP}) +-environment-path -r /usr/local/bin +^done,path="/usr/local/bin:/usr/bin" (@value{GDBP}) @end smallexample @@ -1729,8 +1776,7 @@ The corresponding @value{GDBN} command is @samp{pwd}. @smallexample (@value{GDBP}) -environment-pwd -~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb. -^done +^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb" (@value{GDBP}) @end smallexample diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index ae87a8b..2711119 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -144,7 +144,7 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc) if (argc != 1) error ("mi_cmd_stack_list_locals: Usage: PRINT_VALUES"); - list_args_or_locals (1, atoi (argv[0]), selected_frame); + list_args_or_locals (1, atoi (argv[0]), deprecated_selected_frame); return MI_CMD_DONE; } diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 233d06b..699937d 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -56,10 +56,10 @@ struct mi_cmd mi_cmds[] = {"display-enable", 0, 0}, {"display-insert", 0, 0}, {"display-list", 0, 0}, - {"environment-cd", "cd %s", 0}, - {"environment-directory", "dir %s", 0}, - {"environment-path", "path %s", 0}, - {"environment-pwd", "pwd", 0}, + {"environment-cd", 0, 0, mi_cmd_env_cd}, + {"environment-directory", 0, 0, mi_cmd_env_dir}, + {"environment-path", 0, 0, mi_cmd_env_path}, + {"environment-pwd", 0, 0, mi_cmd_env_pwd}, {"exec-abort", 0, 0}, {"exec-arguments", "set args %s", 0}, {"exec-continue", 0, mi_cmd_exec_continue}, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 88775e6..f4fe64d 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -64,6 +64,10 @@ extern mi_cmd_argv_ftype mi_cmd_data_list_changed_registers; extern mi_cmd_argv_ftype mi_cmd_data_read_memory; extern mi_cmd_argv_ftype mi_cmd_data_write_memory; extern mi_cmd_argv_ftype mi_cmd_data_write_register_values; +extern mi_cmd_argv_ftype mi_cmd_env_cd; +extern mi_cmd_argv_ftype mi_cmd_env_dir; +extern mi_cmd_argv_ftype mi_cmd_env_path; +extern mi_cmd_argv_ftype mi_cmd_env_pwd; extern mi_cmd_args_ftype mi_cmd_exec_continue; extern mi_cmd_args_ftype mi_cmd_exec_finish; extern mi_cmd_args_ftype mi_cmd_exec_next; diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 8af91cc..536e8a5 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -183,8 +183,8 @@ mi_cmd_exec_return (char *args, int from_tty) /* Because we have called return_command with from_tty = 0, we need to print the frame here. */ - show_and_print_stack_frame (selected_frame, - frame_relative_level (selected_frame), + show_and_print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), LOC_AND_ADDRESS); return MI_CMD_DONE; @@ -397,7 +397,7 @@ register_changed_p (int regnum) { char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); - if (! frame_register_read (selected_frame, regnum, raw_buffer)) + if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) return -1; if (memcmp (&old_regs[REGISTER_BYTE (regnum)], raw_buffer, @@ -518,7 +518,8 @@ get_register (int regnum, int format) if (format == 'N') format = 0; - get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, selected_frame, + get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, + deprecated_selected_frame, regnum, (enum lval_type *) NULL); if (optim) { diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c index 73183ca..d5ff31e 100644 --- a/gdb/mips-irix-tdep.c +++ b/gdb/mips-irix-tdep.c @@ -90,6 +90,6 @@ _initialize_mips_irix_tdep (void) bfd_target_elf_flavour, mips_irix_elf_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_IRIX, + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_IRIX, mips_irix_init_abi); } diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index 9ad457b..e5aecff 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -23,6 +23,8 @@ #include "gdbcore.h" #include "target.h" #include "solib-svr4.h" +#include "osabi.h" +#include "gdb_string.h" /* Copied from . */ #define ELF_NGREG 45 @@ -60,7 +62,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; which we extract the pc (MIPS_LINUX_JB_PC) that we will land at. The pc is copied into PC. This routine returns 1 on success. */ -int +#define MIPS_LINUX_JB_ELEMENT_SIZE 4 +#define MIPS_LINUX_JB_PC 0 + +static int mips_linux_get_longjmp_target (CORE_ADDR *pc) { CORE_ADDR jb_addr; @@ -309,7 +314,7 @@ static struct core_fns regset_core_fns = This makes it possible to access GNU/Linux MIPS shared libraries from a GDB that was built on a different host platform (for cross debugging). */ -struct link_map_offsets * +static struct link_map_offsets * mips_linux_svr4_fetch_link_map_offsets (void) { static struct link_map_offsets lmo; @@ -342,8 +347,18 @@ mips_linux_svr4_fetch_link_map_offsets (void) return lmp; } +static void +mips_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + set_gdbarch_get_longjmp_target (gdbarch, mips_linux_get_longjmp_target); + set_solib_svr4_fetch_link_map_offsets + (gdbarch, mips_linux_svr4_fetch_link_map_offsets); +} + void _initialize_mips_linux_tdep (void) { + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_LINUX, + mips_linux_init_abi); add_core_fns (®set_core_fns); } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 16c206e..ece50b9 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -40,6 +40,7 @@ #include "arch-utils.h" #include "regcache.h" #include "osabi.h" +#include "mips-tdep.h" #include "opcode/mips.h" #include "elf/mips.h" @@ -58,19 +59,6 @@ enum MIPS_FPU_DOUBLE_REGSIZE = 8 }; -/* All the possible MIPS ABIs. */ - -enum mips_abi - { - MIPS_ABI_UNKNOWN = 0, - MIPS_ABI_N32, - MIPS_ABI_O32, - MIPS_ABI_N64, - MIPS_ABI_O64, - MIPS_ABI_EABI32, - MIPS_ABI_EABI64, - MIPS_ABI_LAST - }; static const char *mips_abi_string; @@ -163,6 +151,13 @@ static const char *mips_saved_regsize_string = size_auto; #define MIPS_SAVED_REGSIZE (mips_saved_regsize()) +/* Return the MIPS ABI associated with GDBARCH. */ +enum mips_abi +mips_abi (struct gdbarch *gdbarch) +{ + return gdbarch_tdep (gdbarch)->mips_abi; +} + static unsigned int mips_saved_regsize (void) { @@ -1424,7 +1419,7 @@ mips_find_saved_regs (struct frame_info *fci) /* FIXME! Is this correct?? */ #define SIGFRAME_REG_SIZE MIPS_REGSIZE #endif - if (fci->signal_handler_caller) + if ((get_frame_type (fci) == SIGTRAMP_FRAME)) { for (ireg = 0; ireg < MIPS_NUMREGS; ireg++) { @@ -1457,7 +1452,7 @@ mips_find_saved_regs (struct frame_info *fci) a signal, we assume that all registers have been saved. This assumes that all register saves in a function happen before the first function call. */ - (fci->next == NULL || fci->next->signal_handler_caller) + (fci->next == NULL || (get_frame_type (fci->next) == SIGTRAMP_FRAME)) /* In a dummy frame we know exactly where things are saved. */ && !PROC_DESC_IS_DUMMY (proc_desc) @@ -1683,7 +1678,7 @@ mips_software_single_step (enum target_signal sig, int insert_breakpoints_p) target_remove_breakpoint (next_pc, break_mem); } -static void +static CORE_ADDR mips_init_frame_pc_first (int fromleaf, struct frame_info *prev) { CORE_ADDR pc, tmp; @@ -1691,7 +1686,7 @@ mips_init_frame_pc_first (int fromleaf, struct frame_info *prev) pc = ((fromleaf) ? SAVED_PC_AFTER_CALL (prev->next) : prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ()); tmp = SKIP_TRAMPOLINE_CODE (pc); - prev->pc = tmp ? tmp : pc; + return tmp ? tmp : pc; } @@ -1702,11 +1697,10 @@ mips_frame_saved_pc (struct frame_info *frame) mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc; /* We have to get the saved pc from the sigcontext if it is a signal handler frame. */ - int pcreg = frame->signal_handler_caller ? PC_REGNUM + int pcreg = (get_frame_type (frame) == SIGTRAMP_FRAME) ? PC_REGNUM : (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM); - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) { LONGEST tmp; frame_unwind_signed_register (frame, PC_REGNUM, &tmp); @@ -1721,7 +1715,13 @@ mips_frame_saved_pc (struct frame_info *frame) } static struct mips_extra_func_info temp_proc_desc; -static CORE_ADDR temp_saved_regs[NUM_REGS]; + +/* This hack will go away once the get_prev_frame() code has been + modified to set the frame's type first. That is BEFORE init extra + frame info et.al. is called. This is because it will become + possible to skip the init extra info call for sigtramp and dummy + frames. */ +static CORE_ADDR *temp_saved_regs; /* Set a register's saved stack address in temp_saved_regs. If an address has already been set for this register, do nothing; this way we will @@ -2033,6 +2033,7 @@ mips32_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, CORE_ADDR cur_pc; CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */ restart: + temp_saved_regs = xrealloc (temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); PROC_FRAME_OFFSET (&temp_proc_desc) = 0; PROC_FRAME_ADJUST (&temp_proc_desc) = 0; /* offset of FP from SP */ @@ -2141,7 +2142,8 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, if (start_pc == 0) return NULL; memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc)); - memset (&temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); + temp_saved_regs = xrealloc (temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); + memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); PROC_LOW_ADDR (&temp_proc_desc) = start_pc; PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM; PROC_PC_REG (&temp_proc_desc) = RA_REGNUM; @@ -2189,7 +2191,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) struct obj_section *sec; struct mips_objfile_private *priv; - if (PC_IN_CALL_DUMMY (pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) return NULL; find_pc_partial_function (pc, NULL, &startaddr, NULL); @@ -2429,8 +2431,7 @@ mips_frame_chain (struct frame_info *frame) if ((tmp = SKIP_TRAMPOLINE_CODE (saved_pc)) != 0) saved_pc = tmp; - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (saved_pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (saved_pc, 0, 0)) { /* A dummy frame, uses SP not FP. Get the old SP value. If all is well, frame->frame the bottom of the current frame will @@ -2452,11 +2453,10 @@ mips_frame_chain (struct frame_info *frame) && PROC_FRAME_OFFSET (proc_desc) == 0 /* The previous frame from a sigtramp frame might be frameless and have frame size zero. */ - && !frame->signal_handler_caller + && !(get_frame_type (frame) == SIGTRAMP_FRAME) /* For a generic dummy frame, let get_frame_pointer() unwind a register value saved as part of the dummy frame call. */ - && !(USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (frame->pc, 0, 0))) + && !(DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0))) return 0; else return get_frame_pointer (frame, proc_desc); @@ -2486,8 +2486,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) if (fci->pc == PROC_LOW_ADDR (proc_desc) && !PROC_DESC_IS_DUMMY (proc_desc)) fci->frame = read_next_frame_reg (fci->next, SP_REGNUM); - else if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (fci->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (fci->pc, 0, 0)) /* Do not ``fix'' fci->frame. It will have the value of the generic dummy frame's top-of-stack (since the draft fci->frame is obtained by returning the unwound stack @@ -2503,8 +2502,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci) char *name; /* Do not set the saved registers for a sigtramp frame, - mips_find_saved_registers will do that for us. - We can't use fci->signal_handler_caller, it is not yet set. */ + mips_find_saved_registers will do that for us. We can't + use (get_frame_type (fci) == SIGTRAMP_FRAME), it is not + yet set. */ + /* FIXME: cagney/2002-11-18: This problem will go away once + frame.c:get_prev_frame() is modified to set the frame's + type before calling functions like this. */ find_pc_partial_function (fci->pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); if (!PC_IN_SIGTRAMP (fci->pc, name)) @@ -3810,11 +3813,10 @@ mips_pop_frame (void) { register int regnum; struct frame_info *frame = get_current_frame (); - CORE_ADDR new_sp = FRAME_FP (frame); + CORE_ADDR new_sp = get_frame_base (frame); mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc; - if (USE_GENERIC_DUMMY_FRAMES - && PC_IN_CALL_DUMMY (frame->pc, 0, 0)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, 0, 0)) { generic_pop_dummy_frame (); flush_cached_frames (); @@ -3943,7 +3945,7 @@ mips_read_fp_register_single (int regno, char *rare_buffer) int raw_size = REGISTER_RAW_SIZE (regno); char *raw_buffer = alloca (raw_size); - if (!frame_register_read (selected_frame, regno, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regno, raw_buffer)) error ("can't read register %d (%s)", regno, REGISTER_NAME (regno)); if (raw_size == 8) { @@ -3977,7 +3979,7 @@ mips_read_fp_register_double (int regno, char *rare_buffer) { /* We have a 64-bit value for this register, and we should use all 64 bits. */ - if (!frame_register_read (selected_frame, regno, rare_buffer)) + if (!frame_register_read (deprecated_selected_frame, regno, rare_buffer)) error ("can't read register %d (%s)", regno, REGISTER_NAME (regno)); } else @@ -4008,7 +4010,7 @@ mips_print_register (int regnum, int all) char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE); /* Get the data in raw format. */ - if (!frame_register_read (selected_frame, regnum, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) { printf_filtered ("%s: [Invalid]", REGISTER_NAME (regnum)); return; @@ -4188,7 +4190,7 @@ do_gp_register_row (int regnum) if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT) break; /* end row: reached FP register */ /* OK: get the data in raw format. */ - if (!frame_register_read (selected_frame, regnum, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum)); /* pad small registers */ for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++) @@ -5764,6 +5766,11 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_elf_make_msymbol_special (gdbarch, mips_elf_make_msymbol_special); + if (osabi == GDB_OSABI_IRIX) + set_gdbarch_num_regs (gdbarch, 71); + else + set_gdbarch_num_regs (gdbarch, 90); + switch (mips_abi) { case MIPS_ABI_O32: @@ -5971,9 +5978,9 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove); /* There's a mess in stack frame creation. See comments in - blockframe.c near reference to INIT_FRAME_PC_FIRST. */ - set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first); - set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop); + blockframe.c near reference to DEPRECATED_INIT_FRAME_PC_FIRST. */ + set_gdbarch_deprecated_init_frame_pc_first (gdbarch, mips_init_frame_pc_first); + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); /* Map debug register numbers onto internal register numbers. */ set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum); @@ -5987,38 +5994,20 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); -#if OLD_STYLE_MIPS_DUMMY_FRAMES - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); -#else - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); -#endif - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); -#if OLD_STYLE_MIPS_DUMMY_FRAMES - set_gdbarch_push_dummy_frame (gdbarch, mips_push_dummy_frame); -#else set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); -#endif set_gdbarch_pop_frame (gdbarch, mips_pop_frame); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy); -#if OLD_STYLE_MIPS_DUMMY_FRAMES - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); -#else - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); -#endif set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words)); set_gdbarch_push_return_address (gdbarch, mips_push_return_address); set_gdbarch_frame_align (gdbarch, mips_frame_align); -#if OLD_STYLE_MIPS_DUMMY_FRAMES -#else set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); -#endif set_gdbarch_register_convertible (gdbarch, mips_register_convertible); set_gdbarch_register_convert_to_virtual (gdbarch, mips_register_convert_to_virtual); @@ -6032,8 +6021,6 @@ mips_gdbarch_init (struct gdbarch_info info, set_gdbarch_frameless_function_invocation (gdbarch, generic_frameless_function_invocation_not); set_gdbarch_frame_saved_pc (gdbarch, mips_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_args_skip (gdbarch, 0); @@ -6212,12 +6199,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: GDB_TARGET_IS_MIPS64 = %d\n", GDB_TARGET_IS_MIPS64); fprintf_unfiltered (file, - "mips_dump_tdep: GDB_TARGET_MASK_DISAS_PC # %s\n", - XSTRING (GDB_TARGET_MASK_DISAS_PC (PC))); - fprintf_unfiltered (file, - "mips_dump_tdep: GDB_TARGET_UNMASK_DISAS_PC # %s\n", - XSTRING (GDB_TARGET_UNMASK_DISAS_PC (PC))); - fprintf_unfiltered (file, "mips_dump_tdep: GEN_REG_SAVE_MASK = %d\n", GEN_REG_SAVE_MASK); fprintf_unfiltered (file, diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 73ba384..7776d46 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -359,7 +359,7 @@ mipsnbsd_init_abi (struct gdbarch_info info, void _initialize_mipsnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD_ELF, mipsnbsd_init_abi); add_core_fns (&mipsnbsd_core_fns); diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c index a8d7d72..fdc0941 100644 --- a/gdb/mn10200-tdep.c +++ b/gdb/mn10200-tdep.c @@ -685,7 +685,7 @@ mn10200_pop_frame (struct frame_info *frame) { int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -703,7 +703,7 @@ mn10200_pop_frame (struct frame_info *frame) } /* Actually cut back the stack. */ - write_register (SP_REGNUM, FRAME_FP (frame)); + write_register (SP_REGNUM, get_frame_base (frame)); /* Don't we need to set the PC?!? XXX FIXME. */ } diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index ed55da9..e503d19 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -738,7 +738,7 @@ mn10300_pop_frame_regular (struct frame_info *frame) } /* Actually cut back the stack. */ - write_register (SP_REGNUM, FRAME_FP (frame)); + write_register (SP_REGNUM, get_frame_base (frame)); /* Don't we need to set the PC?!? XXX FIXME. */ } @@ -1012,7 +1012,7 @@ mn10300_print_register (const char *name, int regnum, int reg_width) printf_filtered ("%s: ", name); /* Get the data */ - if (!frame_register_read (selected_frame, regnum, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) { printf_filtered ("[invalid]"); return; @@ -1162,13 +1162,12 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_decr_pc_after_break (gdbarch, 0); /* Stack unwinding. */ - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); set_gdbarch_saved_pc_after_call (gdbarch, mn10300_saved_pc_after_call); set_gdbarch_init_extra_frame_info (gdbarch, mn10300_init_extra_frame_info); - set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop); + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop); set_gdbarch_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs); set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain); set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc); @@ -1180,8 +1179,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame); set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue); set_gdbarch_frame_args_skip (gdbarch, 0); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); /* That's right, we're using the stack pointer as our frame pointer. */ set_gdbarch_read_fp (gdbarch, generic_target_read_sp); @@ -1191,7 +1188,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_words (gdbarch, mn10300_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, @@ -1199,8 +1195,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_call_dummy_length (gdbarch, 0); set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, mn10300_push_arguments); set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr); diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 5563cf9..6e51b83 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -314,11 +314,36 @@ ns32k_frame_chain (struct frame_info *frame) return (read_memory_integer (frame->frame, 4)); } + +static CORE_ADDR +ns32k_sigtramp_saved_pc (struct frame_info *frame) +{ + CORE_ADDR sigcontext_addr; + char *buf; + int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr); + int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; + + buf = alloca (ptrbytes); + /* Get sigcontext address, it is the third parameter on the stack. */ + if (frame->next) + sigcontext_addr = read_memory_typed_address + (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs, + builtin_type_void_data_ptr); + else + sigcontext_addr = read_memory_typed_address + (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr); + + /* Don't cause a memory_error when accessing sigcontext in case the stack + layout has changed or the stack is corrupt. */ + target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); + return extract_typed_address (buf, builtin_type_void_func_ptr); +} + static CORE_ADDR ns32k_frame_saved_pc (struct frame_info *frame) { - if (frame->signal_handler_caller) - return (sigtramp_saved_pc (frame)); /* XXXJRT */ + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) + return (ns32k_sigtramp_saved_pc (frame)); /* XXXJRT */ return (read_memory_integer (frame->frame + 4, 4)); } @@ -535,6 +560,10 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->osabi = osabi; /* Register info */ @@ -590,8 +619,8 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_fix_call_dummy (gdbarch, ns32k_fix_call_dummy); set_gdbarch_call_dummy_start_offset (gdbarch, 3); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 0); - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ diff --git a/gdb/ns32knbsd-tdep.c b/gdb/ns32knbsd-tdep.c index d5ec828..ad360c8 100644 --- a/gdb/ns32knbsd-tdep.c +++ b/gdb/ns32knbsd-tdep.c @@ -66,6 +66,6 @@ _initialize_ns32knbsd_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_ns32k, bfd_target_aout_flavour, ns32knbsd_aout_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_ns32k, GDB_OSABI_NETBSD_AOUT, + gdbarch_register_osabi (bfd_arch_ns32k, 0, GDB_OSABI_NETBSD_AOUT, ns32knbsd_init_abi_aout); } diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 334e6be..42ee124 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -342,9 +342,9 @@ exp : '[' TYPENAME start_msglist(); } msglist ']' - { write_exp_elt_opcode (OP_MSGCALL); + { write_exp_elt_opcode (OP_OBJC_MSGCALL); end_msglist(); - write_exp_elt_opcode (OP_MSGCALL); + write_exp_elt_opcode (OP_OBJC_MSGCALL); } ; @@ -357,18 +357,18 @@ exp : '[' CLASSNAME start_msglist(); } msglist ']' - { write_exp_elt_opcode (OP_MSGCALL); + { write_exp_elt_opcode (OP_OBJC_MSGCALL); end_msglist(); - write_exp_elt_opcode (OP_MSGCALL); + write_exp_elt_opcode (OP_OBJC_MSGCALL); } ; exp : '[' exp { start_msglist(); } msglist ']' - { write_exp_elt_opcode (OP_MSGCALL); + { write_exp_elt_opcode (OP_OBJC_MSGCALL); end_msglist(); - write_exp_elt_opcode (OP_MSGCALL); + write_exp_elt_opcode (OP_OBJC_MSGCALL); } ; @@ -566,9 +566,9 @@ exp : VARIABLE exp : SELECTOR { - write_exp_elt_opcode (OP_SELECTOR); + write_exp_elt_opcode (OP_OBJC_SELECTOR); write_exp_string ($1); - write_exp_elt_opcode (OP_SELECTOR); } + write_exp_elt_opcode (OP_OBJC_SELECTOR); } exp : SIZEOF '(' type ')' %prec UNARY { write_exp_elt_opcode (OP_LONG); @@ -606,9 +606,9 @@ exp : STRING exp : NSSTRING /* ObjC NextStep NSString constant * of the form '@' '"' string '"'. */ - { write_exp_elt_opcode (OP_NSSTRING); + { write_exp_elt_opcode (OP_OBJC_NSSTRING); write_exp_string ($1); - write_exp_elt_opcode (OP_NSSTRING); } + write_exp_elt_opcode (OP_OBJC_NSSTRING); } ; block : BLOCKNAME @@ -759,8 +759,8 @@ variable: name_not_typename if (innermost_block == 0 || contained_in (block_found, innermost_block)) innermost_block = block_found; - write_exp_elt_opcode (OP_SELF); - write_exp_elt_opcode (OP_SELF); + write_exp_elt_opcode (OP_OBJC_SELF); + write_exp_elt_opcode (OP_OBJC_SELF); write_exp_elt_opcode (STRUCTOP_PTR); write_exp_string ($1.stoken); write_exp_elt_opcode (STRUCTOP_PTR); @@ -1308,9 +1308,7 @@ yylex () c = *lexptr++; if (c != '\'') { - namelen = skip_quoted (tokstart, - get_gdb_completer_word_break_characters()) - - tokstart; + namelen = skip_quoted (tokstart) - tokstart; if (namelen > 2) { lexptr = tokstart + namelen; diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 924c79c..f6890b0 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -75,15 +75,6 @@ struct objc_method { /* Complaints about ObjC classes, selectors, etc. */ -static struct deprecated_complaint noclass_lookup_complaint = { - "no way to lookup Objective-C classes", 0, 0 -}; - -static struct deprecated_complaint nosel_lookup_complaint = { - "no way to lookup Objective-C selectors", 0, 0 -}; - - #if (!defined __GNUC__ || __GNUC__ < 2 || __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4)) #define __CHECK_FUNCTION ((__const char *) 0) #else @@ -161,7 +152,8 @@ lookup_objc_class (char *classname) function = find_function_in_inferior("objc_lookup_class"); else { - complain (&noclass_lookup_complaint, 0); + complaint (&symfile_complaints, "no way to lookup Objective-C classes", + 0); return 0; } @@ -188,7 +180,8 @@ lookup_child_selector (char *selname) function = find_function_in_inferior("sel_get_any_uid"); else { - complain (&nosel_lookup_complaint, 0); + complaint (&symfile_complaints, "no way to lookup Objective-C selectors", + 0); return 0; } @@ -371,7 +364,7 @@ objc_printchar (int c, struct ui_file *stream) static void objc_printstr (struct ui_file *stream, char *string, - unsigned int length, int force_ellipses) + unsigned int length, int width, int force_ellipses) { register unsigned int i; unsigned int things_printed = 0; @@ -797,14 +790,14 @@ int specialcmp(char *a, char *b) } /* - * Function: compare_selectors (void *, void *) + * Function: compare_selectors (const void *, const void *) * * Comparison function for use with qsort. Arguments are symbols or * msymbols Compares selector part of objc method name alphabetically. */ static int -compare_selectors (void *a, void *b) +compare_selectors (const void *a, const void *b) { char *aname, *bname; @@ -955,14 +948,14 @@ selectors_info (char *regexp, int from_tty) } /* - * Function: compare_classes (void *, void *) + * Function: compare_classes (const void *, const void *) * * Comparison function for use with qsort. Arguments are symbols or * msymbols Compares class part of objc method name alphabetically. */ static int -compare_classes (void *a, void *b) +compare_classes (const void *a, const void *b) { char *aname, *bname; @@ -1364,7 +1357,7 @@ find_methods (struct symtab *symtab, char type, sym = find_pc_function (SYMBOL_VALUE_ADDRESS (msymbol)); if (sym != NULL) { - const char *newsymname = SYMBOL_DEMANGLED_NAME (sym); + const char *newsymname = SYMBOL_DEMANGLED_NAME (sym); if (newsymname == NULL) newsymname = SYMBOL_NAME (sym); @@ -1460,7 +1453,7 @@ char *find_imps (struct symtab *symtab, struct block *block, if (msym != NULL) { if (syms) - syms[csym] = msym; + syms[csym] = (struct symbol *)msym; csym++; } } @@ -1537,7 +1530,7 @@ void print_object_command (char *args, int from_tty) { struct value *object, *function, *description; - CORE_ADDR string_addr; + CORE_ADDR string_addr, object_addr; int i = 0; char c = -1; @@ -1551,18 +1544,17 @@ print_object_command (char *args, int from_tty) make_cleanup (free_current_contents, &expr); int pc = 0; -#if 1 object = expr->language_defn->evaluate_exp (builtin_type_void_data_ptr, expr, &pc, EVAL_NORMAL); -#else - object = evaluate_subexp (builtin_type_void_data_ptr, - expr, &pc, EVAL_NORMAL); -#endif do_cleanups (old_chain); } + /* Validate the address for sanity. */ + object_addr = value_as_long (object); + read_memory (object_addr, &c, 1); + function = find_function_in_inferior ("_NSPrintForDebugger"); - if (!function) + if (function == NULL) error ("Unable to locate _NSPrintForDebugger in child process"); description = call_function_by_hand (function, 1, &object); @@ -1592,7 +1584,7 @@ print_object_command (char *args, int from_tty) struct objc_methcall { char *name; /* Return instance method to be called. */ - CORE_ADDR (*stop_at) (CORE_ADDR); + int (*stop_at) (CORE_ADDR, CORE_ADDR *); /* Start of pc range corresponding to method invocation. */ CORE_ADDR begin; /* End of pc range corresponding to method invocation. */ @@ -1664,7 +1656,7 @@ find_objc_msgsend (void) */ struct objc_submethod_helper_data { - CORE_ADDR (*f) (CORE_ADDR, CORE_ADDR *); + int (*f) (CORE_ADDR, CORE_ADDR *); CORE_ADDR pc; CORE_ADDR *new_pc; }; @@ -1682,7 +1674,7 @@ find_objc_msgcall_submethod_helper (void * arg) } int -find_objc_msgcall_submethod (CORE_ADDR (*f) (CORE_ADDR, CORE_ADDR *), +find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *), CORE_ADDR pc, CORE_ADDR *new_pc) { @@ -1731,7 +1723,7 @@ _initialize_objc_language (void) add_info ("classes", classes_info, /* INFO CLASSES command. */ "All Objective-C classes, or those matching REGEXP."); add_com ("print-object", class_vars, print_object_command, - "Ask an Objective-C object to print itself.\n"); + "Ask an Objective-C object to print itself."); add_com_alias ("po", "print-object", class_vars, 1); } diff --git a/gdb/objc-lang.h b/gdb/objc-lang.h index 9fd93e7..58f1884 100644 --- a/gdb/objc-lang.h +++ b/gdb/objc-lang.h @@ -35,21 +35,23 @@ extern int c_value_print (struct value *, struct ui_file *, extern CORE_ADDR lookup_objc_class (char *classname); extern int lookup_child_selector (char *methodname); -char *objc_demangle (const char *mangled); +extern char *objc_demangle (const char *mangled); -int find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc); +extern int find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc); -char *parse_selector (char *method, char **selector); +extern char *parse_selector (char *method, char **selector); -char *parse_method (char *method, char *type, - char **class, char **category, - char **selector); +extern char *parse_method (char *method, char *type, + char **class, char **category, + char **selector); -void find_methods (struct symtab *symtab, char type, - const char *class, const char *category, - const char *selector, struct symbol **syms, - unsigned int *nsym, unsigned int *ndebug); +extern void find_methods (struct symtab *symtab, char type, + const char *class, const char *category, + const char *selector, struct symbol **syms, + unsigned int *nsym, unsigned int *ndebug); -char *find_imps (struct symtab *symtab, struct block *block, - char *method, struct symbol **syms, - unsigned int *nsym, unsigned int *ndebug); +extern char *find_imps (struct symtab *symtab, struct block *block, + char *method, struct symbol **syms, + unsigned int *nsym, unsigned int *ndebug); + +extern struct value *value_nsstring (char *ptr, int len); diff --git a/gdb/ocd.c b/gdb/ocd.c index 9dd90e9..e735fe0 100644 --- a/gdb/ocd.c +++ b/gdb/ocd.c @@ -254,9 +254,7 @@ ocd_start_remote (PTR dummy) flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - set_current_frame (create_new_frame (read_fp (), stop_pc)); - select_frame (get_current_frame ()); - print_stack_frame (selected_frame, -1, 1); + print_stack_frame (get_selected_frame (), -1, 1); buf[0] = OCD_LOG_FILE; buf[1] = 3; /* close existing WIGGLERS.LOG */ diff --git a/gdb/os9kread.c b/gdb/os9kread.c deleted file mode 100644 index 767d684..0000000 --- a/gdb/os9kread.c +++ /dev/null @@ -1,1621 +0,0 @@ -// OBSOLETE /* Read os9/os9k symbol tables and convert to internal format, for GDB. -// OBSOLETE Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, -// OBSOLETE 1996, 1997, 1998, 1999, 2000, 2001 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* This module provides three functions: os9k_symfile_init, -// OBSOLETE which initializes to read a symbol file; os9k_new_init, which -// OBSOLETE discards existing cached information when all symbols are being -// OBSOLETE discarded; and os9k_symfile_read, which reads a symbol table -// OBSOLETE from a file. -// OBSOLETE -// OBSOLETE os9k_symfile_read only does the minimum work necessary for letting the -// OBSOLETE user "name" things symbolically; it does not read the entire symtab. -// OBSOLETE Instead, it reads the external and static symbols and puts them in partial -// OBSOLETE symbol tables. When more extensive information is requested of a -// OBSOLETE file, the corresponding partial symbol table is mutated into a full -// OBSOLETE fledged symbol table by going back and reading the symbols -// OBSOLETE for real. os9k_psymtab_to_symtab() is the function that does this */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include "gdb_assert.h" -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #if defined(USG) || defined(__CYGNUSCLIB__) -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include "obstack.h" -// OBSOLETE #include "gdb_stat.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "breakpoint.h" -// OBSOLETE #include "command.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "gdbcore.h" /* for bfd stuff */ -// OBSOLETE #include "libaout.h" /* FIXME Secret internal BFD stuff for a.out */ -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "objfiles.h" -// OBSOLETE #include "buildsym.h" -// OBSOLETE #include "gdb-stabs.h" -// OBSOLETE #include "demangle.h" -// OBSOLETE #include "language.h" /* Needed inside partial-stab.h */ -// OBSOLETE #include "complaints.h" -// OBSOLETE #include "os9k.h" -// OBSOLETE #include "stabsread.h" -// OBSOLETE -// OBSOLETE extern void _initialize_os9kread (void); -// OBSOLETE -// OBSOLETE /* Each partial symbol table entry contains a pointer to private data for the -// OBSOLETE read_symtab() function to use when expanding a partial symbol table entry -// OBSOLETE to a full symbol table entry. -// OBSOLETE -// OBSOLETE For dbxread this structure contains the offset within the file symbol table -// OBSOLETE of first local symbol for this file, and count of the section -// OBSOLETE of the symbol table devoted to this file's symbols (actually, the section -// OBSOLETE bracketed may contain more than just this file's symbols). It also contains -// OBSOLETE further information needed to locate the symbols if they are in an ELF file. -// OBSOLETE -// OBSOLETE If ldsymcnt is 0, the only reason for this thing's existence is the -// OBSOLETE dependency list. Nothing else will happen when it is read in. */ -// OBSOLETE -// OBSOLETE #define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff) -// OBSOLETE #define LDSYMCNT(p) (((struct symloc *)((p)->read_symtab_private))->ldsymnum) -// OBSOLETE -// OBSOLETE struct symloc -// OBSOLETE { -// OBSOLETE int ldsymoff; -// OBSOLETE int ldsymnum; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE /* Remember what we deduced to be the source language of this psymtab. */ -// OBSOLETE static enum language psymtab_language = language_unknown; -// OBSOLETE -// OBSOLETE /* keep partial symbol table file nested depth */ -// OBSOLETE static int psymfile_depth = 0; -// OBSOLETE -// OBSOLETE /* keep symbol table file nested depth */ -// OBSOLETE static int symfile_depth = 0; -// OBSOLETE -// OBSOLETE extern int previous_stab_code; -// OBSOLETE -// OBSOLETE /* Name of last function encountered. Used in Solaris to approximate -// OBSOLETE object file boundaries. */ -// OBSOLETE static char *last_function_name; -// OBSOLETE -// OBSOLETE /* Complaints about the symbols we have encountered. */ -// OBSOLETE extern struct complaint lbrac_complaint; -// OBSOLETE -// OBSOLETE extern struct complaint unknown_symtype_complaint; -// OBSOLETE -// OBSOLETE extern struct complaint unknown_symchar_complaint; -// OBSOLETE -// OBSOLETE extern struct complaint lbrac_rbrac_complaint; -// OBSOLETE -// OBSOLETE extern struct complaint repeated_header_complaint; -// OBSOLETE -// OBSOLETE extern struct complaint repeated_header_name_complaint; -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE static struct complaint lbrac_unmatched_complaint = -// OBSOLETE {"unmatched Increment Block Entry before symtab pos %d", 0, 0}; -// OBSOLETE -// OBSOLETE static struct complaint lbrac_mismatch_complaint = -// OBSOLETE {"IBE/IDE symbol mismatch at symtab pos %d", 0, 0}; -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* Local function prototypes */ -// OBSOLETE -// OBSOLETE static void read_minimal_symbols (struct objfile *); -// OBSOLETE -// OBSOLETE static void os9k_read_ofile_symtab (struct partial_symtab *); -// OBSOLETE -// OBSOLETE static void os9k_psymtab_to_symtab (struct partial_symtab *); -// OBSOLETE -// OBSOLETE static void os9k_psymtab_to_symtab_1 (struct partial_symtab *); -// OBSOLETE -// OBSOLETE static void read_os9k_psymtab (struct objfile *, CORE_ADDR, int); -// OBSOLETE -// OBSOLETE static int fill_sym (FILE *, bfd *); -// OBSOLETE -// OBSOLETE static void os9k_symfile_init (struct objfile *); -// OBSOLETE -// OBSOLETE static void os9k_new_init (struct objfile *); -// OBSOLETE -// OBSOLETE static void os9k_symfile_read (struct objfile *, int); -// OBSOLETE -// OBSOLETE static void os9k_symfile_finish (struct objfile *); -// OBSOLETE -// OBSOLETE static void os9k_process_one_symbol (int, int, CORE_ADDR, char *, -// OBSOLETE struct section_offsets *, -// OBSOLETE struct objfile *); -// OBSOLETE -// OBSOLETE static struct partial_symtab *os9k_start_psymtab (struct objfile *, char *, -// OBSOLETE CORE_ADDR, int, int, -// OBSOLETE struct partial_symbol **, -// OBSOLETE struct partial_symbol **); -// OBSOLETE -// OBSOLETE static struct partial_symtab *os9k_end_psymtab (struct partial_symtab *, -// OBSOLETE char **, int, int, CORE_ADDR, -// OBSOLETE struct partial_symtab **, -// OBSOLETE int); -// OBSOLETE -// OBSOLETE static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *); -// OBSOLETE -// OBSOLETE #define HANDLE_RBRAC(val) \ -// OBSOLETE if ((val) > pst->texthigh) pst->texthigh = (val); -// OBSOLETE -// OBSOLETE #define SWAP_STBHDR(hdrp, abfd) \ -// OBSOLETE { \ -// OBSOLETE (hdrp)->fmtno = bfd_get_16(abfd, (unsigned char *)&(hdrp)->fmtno); \ -// OBSOLETE (hdrp)->crc = bfd_get_32(abfd, (unsigned char *)&(hdrp)->crc); \ -// OBSOLETE (hdrp)->offset = bfd_get_32(abfd, (unsigned char *)&(hdrp)->offset); \ -// OBSOLETE (hdrp)->nsym = bfd_get_32(abfd, (unsigned char *)&(hdrp)->nsym); \ -// OBSOLETE } -// OBSOLETE #define SWAP_STBSYM(symp, abfd) \ -// OBSOLETE { \ -// OBSOLETE (symp)->value = bfd_get_32(abfd, (unsigned char *)&(symp)->value); \ -// OBSOLETE (symp)->type = bfd_get_16(abfd, (unsigned char *)&(symp)->type); \ -// OBSOLETE (symp)->stroff = bfd_get_32(abfd, (unsigned char *)&(symp)->stroff); \ -// OBSOLETE } -// OBSOLETE #define N_DATA 0 -// OBSOLETE #define N_BSS 1 -// OBSOLETE #define N_RDATA 2 -// OBSOLETE #define N_IDATA 3 -// OBSOLETE #define N_TEXT 4 -// OBSOLETE #define N_ABS 6 -// OBSOLETE -// OBSOLETE static void -// OBSOLETE record_minimal_symbol (char *name, CORE_ADDR address, int type, -// OBSOLETE struct objfile *objfile) -// OBSOLETE { -// OBSOLETE enum minimal_symbol_type ms_type; -// OBSOLETE -// OBSOLETE switch (type) -// OBSOLETE { -// OBSOLETE case N_TEXT: -// OBSOLETE ms_type = mst_text; -// OBSOLETE address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE break; -// OBSOLETE case N_DATA: -// OBSOLETE ms_type = mst_data; -// OBSOLETE break; -// OBSOLETE case N_BSS: -// OBSOLETE ms_type = mst_bss; -// OBSOLETE break; -// OBSOLETE case N_RDATA: -// OBSOLETE ms_type = mst_bss; -// OBSOLETE break; -// OBSOLETE case N_IDATA: -// OBSOLETE ms_type = mst_data; -// OBSOLETE break; -// OBSOLETE case N_ABS: -// OBSOLETE ms_type = mst_abs; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE ms_type = mst_unknown; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE prim_record_minimal_symbol (name, address, ms_type, objfile); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* read and process .stb file and store in minimal symbol table */ -// OBSOLETE typedef char mhhdr[80]; -// OBSOLETE struct stbhdr -// OBSOLETE { -// OBSOLETE mhhdr comhdr; -// OBSOLETE char *name; -// OBSOLETE short fmtno; -// OBSOLETE int crc; -// OBSOLETE int offset; -// OBSOLETE int nsym; -// OBSOLETE char *pad; -// OBSOLETE }; -// OBSOLETE struct stbsymbol -// OBSOLETE { -// OBSOLETE int value; -// OBSOLETE short type; -// OBSOLETE int stroff; -// OBSOLETE }; -// OBSOLETE #define STBSYMSIZE 10 -// OBSOLETE -// OBSOLETE static void -// OBSOLETE read_minimal_symbols (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE FILE *fp; -// OBSOLETE bfd *abfd; -// OBSOLETE struct stbhdr hdr; -// OBSOLETE struct stbsymbol sym; -// OBSOLETE int ch, i, j, off; -// OBSOLETE char buf[64], buf1[128]; -// OBSOLETE -// OBSOLETE fp = objfile->auxf1; -// OBSOLETE if (fp == NULL) -// OBSOLETE return; -// OBSOLETE abfd = objfile->obfd; -// OBSOLETE fread (&hdr.comhdr[0], sizeof (mhhdr), 1, fp); -// OBSOLETE i = 0; -// OBSOLETE ch = getc (fp); -// OBSOLETE while (ch != -1) -// OBSOLETE { -// OBSOLETE buf[i] = (char) ch; -// OBSOLETE i++; -// OBSOLETE if (ch == 0) -// OBSOLETE break; -// OBSOLETE ch = getc (fp); -// OBSOLETE }; -// OBSOLETE if (i % 2) -// OBSOLETE ch = getc (fp); -// OBSOLETE hdr.name = &buf[0]; -// OBSOLETE -// OBSOLETE fread (&hdr.fmtno, sizeof (hdr.fmtno), 1, fp); -// OBSOLETE fread (&hdr.crc, sizeof (hdr.crc), 1, fp); -// OBSOLETE fread (&hdr.offset, sizeof (hdr.offset), 1, fp); -// OBSOLETE fread (&hdr.nsym, sizeof (hdr.nsym), 1, fp); -// OBSOLETE SWAP_STBHDR (&hdr, abfd); -// OBSOLETE -// OBSOLETE /* read symbols */ -// OBSOLETE init_minimal_symbol_collection (); -// OBSOLETE off = hdr.offset; -// OBSOLETE for (i = hdr.nsym; i > 0; i--) -// OBSOLETE { -// OBSOLETE fseek (fp, (long) off, 0); -// OBSOLETE fread (&sym.value, sizeof (sym.value), 1, fp); -// OBSOLETE fread (&sym.type, sizeof (sym.type), 1, fp); -// OBSOLETE fread (&sym.stroff, sizeof (sym.stroff), 1, fp); -// OBSOLETE SWAP_STBSYM (&sym, abfd); -// OBSOLETE fseek (fp, (long) sym.stroff, 0); -// OBSOLETE j = 0; -// OBSOLETE ch = getc (fp); -// OBSOLETE while (ch != -1) -// OBSOLETE { -// OBSOLETE buf1[j] = (char) ch; -// OBSOLETE j++; -// OBSOLETE if (ch == 0) -// OBSOLETE break; -// OBSOLETE ch = getc (fp); -// OBSOLETE }; -// OBSOLETE record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile); -// OBSOLETE off += STBSYMSIZE; -// OBSOLETE }; -// OBSOLETE install_minimal_symbols (objfile); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Scan and build partial symbols for a symbol file. -// OBSOLETE We have been initialized by a call to os9k_symfile_init, which -// OBSOLETE put all the relevant info into a "struct os9k_symfile_info", -// OBSOLETE hung off the objfile structure. -// OBSOLETE -// OBSOLETE MAINLINE is true if we are reading the main symbol -// OBSOLETE table (as opposed to a shared lib or dynamically loaded file). */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_symfile_read (struct objfile *objfile, int mainline) -// OBSOLETE { -// OBSOLETE bfd *sym_bfd; -// OBSOLETE struct cleanup *back_to; -// OBSOLETE -// OBSOLETE sym_bfd = objfile->obfd; -// OBSOLETE /* If we are reinitializing, or if we have never loaded syms yet, init */ -// OBSOLETE if (mainline -// OBSOLETE || (objfile->global_psymbols.size == 0 -// OBSOLETE && objfile->static_psymbols.size == 0)) -// OBSOLETE init_psymbol_list (objfile, DBX_SYMCOUNT (objfile)); -// OBSOLETE -// OBSOLETE free_pending_blocks (); -// OBSOLETE back_to = make_cleanup (really_free_pendings, 0); -// OBSOLETE -// OBSOLETE make_cleanup_discard_minimal_symbols (); -// OBSOLETE read_minimal_symbols (objfile); -// OBSOLETE -// OBSOLETE /* Now that the symbol table data of the executable file are all in core, -// OBSOLETE process them and define symbols accordingly. */ -// OBSOLETE read_os9k_psymtab (objfile, -// OBSOLETE DBX_TEXT_ADDR (objfile), -// OBSOLETE DBX_TEXT_SIZE (objfile)); -// OBSOLETE -// OBSOLETE do_cleanups (back_to); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Initialize anything that needs initializing when a completely new -// OBSOLETE symbol file is specified (not just adding some symbols from another -// OBSOLETE file, e.g. a shared library). */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_new_init (struct objfile *ignore) -// OBSOLETE { -// OBSOLETE stabsread_new_init (); -// OBSOLETE buildsym_new_init (); -// OBSOLETE psymfile_depth = 0; -// OBSOLETE /* -// OBSOLETE init_header_files (); -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* os9k_symfile_init () -// OBSOLETE It is passed a struct objfile which contains, among other things, -// OBSOLETE the BFD for the file whose symbols are being read, and a slot for a pointer -// OBSOLETE to "private data" which we fill with goodies. -// OBSOLETE -// OBSOLETE Since BFD doesn't know how to read debug symbols in a format-independent -// OBSOLETE way (and may never do so...), we have to do it ourselves. We will never -// OBSOLETE be called unless this is an a.out (or very similar) file. -// OBSOLETE FIXME, there should be a cleaner peephole into the BFD environment here. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_symfile_init (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE bfd *sym_bfd = objfile->obfd; -// OBSOLETE char *name = bfd_get_filename (sym_bfd); -// OBSOLETE char dbgname[512], stbname[512]; -// OBSOLETE FILE *symfile = 0; -// OBSOLETE FILE *minfile = 0; -// OBSOLETE asection *text_sect; -// OBSOLETE -// OBSOLETE strcpy (dbgname, name); -// OBSOLETE strcat (dbgname, ".dbg"); -// OBSOLETE strcpy (stbname, name); -// OBSOLETE strcat (stbname, ".stb"); -// OBSOLETE -// OBSOLETE if ((symfile = fopen (dbgname, "r")) == NULL) -// OBSOLETE { -// OBSOLETE warning ("Symbol file %s not found", dbgname); -// OBSOLETE } -// OBSOLETE objfile->auxf2 = symfile; -// OBSOLETE -// OBSOLETE if ((minfile = fopen (stbname, "r")) == NULL) -// OBSOLETE { -// OBSOLETE warning ("Symbol file %s not found", stbname); -// OBSOLETE } -// OBSOLETE objfile->auxf1 = minfile; -// OBSOLETE -// OBSOLETE /* Allocate struct to keep track of the symfile */ -// OBSOLETE objfile->sym_stab_info = (struct dbx_symfile_info *) -// OBSOLETE xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); -// OBSOLETE DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL; -// OBSOLETE -// OBSOLETE text_sect = bfd_get_section_by_name (sym_bfd, ".text"); -// OBSOLETE if (!text_sect) -// OBSOLETE error ("Can't find .text section in file"); -// OBSOLETE DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect); -// OBSOLETE DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect); -// OBSOLETE -// OBSOLETE DBX_SYMBOL_SIZE (objfile) = 0; /* variable size symbol */ -// OBSOLETE DBX_SYMCOUNT (objfile) = 0; /* used to be bfd_get_symcount(sym_bfd) */ -// OBSOLETE DBX_SYMTAB_OFFSET (objfile) = 0; /* used to be SYMBOL_TABLE_OFFSET */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Perform any local cleanups required when we are done with a particular -// OBSOLETE objfile. I.E, we are in the process of discarding all symbol information -// OBSOLETE for an objfile, freeing up all memory held for it, and unlinking the -// OBSOLETE objfile struct from the global list of known objfiles. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_symfile_finish (struct objfile *objfile) -// OBSOLETE { -// OBSOLETE if (objfile->sym_stab_info != NULL) -// OBSOLETE { -// OBSOLETE xmfree (objfile->md, objfile->sym_stab_info); -// OBSOLETE } -// OBSOLETE /* -// OBSOLETE free_header_files (); -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE struct st_dbghdr -// OBSOLETE { -// OBSOLETE int sync; -// OBSOLETE short rev; -// OBSOLETE int crc; -// OBSOLETE short os; -// OBSOLETE short cpu; -// OBSOLETE }; -// OBSOLETE #define SYNC (int)0xefbefeca -// OBSOLETE -// OBSOLETE #define SWAP_DBGHDR(hdrp, abfd) \ -// OBSOLETE { \ -// OBSOLETE (hdrp)->sync = bfd_get_32(abfd, (unsigned char *)&(hdrp)->sync); \ -// OBSOLETE (hdrp)->rev = bfd_get_16(abfd, (unsigned char *)&(hdrp)->rev); \ -// OBSOLETE (hdrp)->crc = bfd_get_32(abfd, (unsigned char *)&(hdrp)->crc); \ -// OBSOLETE (hdrp)->os = bfd_get_16(abfd, (unsigned char *)&(hdrp)->os); \ -// OBSOLETE (hdrp)->cpu = bfd_get_16(abfd, (unsigned char *)&(hdrp)->cpu); \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define N_SYM_CMPLR 0 -// OBSOLETE #define N_SYM_SLINE 1 -// OBSOLETE #define N_SYM_SYM 2 -// OBSOLETE #define N_SYM_LBRAC 3 -// OBSOLETE #define N_SYM_RBRAC 4 -// OBSOLETE #define N_SYM_SE 5 -// OBSOLETE -// OBSOLETE struct internal_symstruct -// OBSOLETE { -// OBSOLETE short n_type; -// OBSOLETE short n_desc; -// OBSOLETE long n_value; -// OBSOLETE char *n_strx; -// OBSOLETE }; -// OBSOLETE static struct internal_symstruct symbol; -// OBSOLETE static struct internal_symstruct *symbuf = &symbol; -// OBSOLETE static char strbuf[4096]; -// OBSOLETE static struct st_dbghdr dbghdr; -// OBSOLETE static short cmplrid; -// OBSOLETE -// OBSOLETE #define VER_PRE_ULTRAC ((short)4) -// OBSOLETE #define VER_ULTRAC ((short)5) -// OBSOLETE -// OBSOLETE static int -// OBSOLETE fill_sym (FILE *dbg_file, bfd *abfd) -// OBSOLETE { -// OBSOLETE short si, nmask; -// OBSOLETE long li; -// OBSOLETE int ii; -// OBSOLETE char *p; -// OBSOLETE -// OBSOLETE int nbytes = fread (&si, sizeof (si), 1, dbg_file); -// OBSOLETE if (nbytes == 0) -// OBSOLETE return 0; -// OBSOLETE if (nbytes < 0) -// OBSOLETE perror_with_name ("reading .dbg file."); -// OBSOLETE symbuf->n_desc = 0; -// OBSOLETE symbuf->n_value = 0; -// OBSOLETE symbuf->n_strx = NULL; -// OBSOLETE symbuf->n_type = bfd_get_16 (abfd, (unsigned char *) &si); -// OBSOLETE symbuf->n_type = 0xf & symbuf->n_type; -// OBSOLETE switch (symbuf->n_type) -// OBSOLETE { -// OBSOLETE case N_SYM_CMPLR: -// OBSOLETE fread (&si, sizeof (si), 1, dbg_file); -// OBSOLETE symbuf->n_desc = bfd_get_16 (abfd, (unsigned char *) &si); -// OBSOLETE cmplrid = symbuf->n_desc & 0xff; -// OBSOLETE break; -// OBSOLETE case N_SYM_SLINE: -// OBSOLETE fread (&li, sizeof (li), 1, dbg_file); -// OBSOLETE symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li); -// OBSOLETE fread (&li, sizeof (li), 1, dbg_file); -// OBSOLETE li = bfd_get_32 (abfd, (unsigned char *) &li); -// OBSOLETE symbuf->n_strx = (char *) (li >> 12); -// OBSOLETE symbuf->n_desc = li & 0xfff; -// OBSOLETE break; -// OBSOLETE case N_SYM_SYM: -// OBSOLETE fread (&li, sizeof (li), 1, dbg_file); -// OBSOLETE symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li); -// OBSOLETE si = 0; -// OBSOLETE do -// OBSOLETE { -// OBSOLETE ii = getc (dbg_file); -// OBSOLETE strbuf[si++] = (char) ii; -// OBSOLETE } -// OBSOLETE while (ii != 0 || si % 2 != 0); -// OBSOLETE symbuf->n_strx = strbuf; -// OBSOLETE p = (char *) strchr (strbuf, ':'); -// OBSOLETE if (!p) -// OBSOLETE break; -// OBSOLETE if ((p[1] == 'F' || p[1] == 'f') && cmplrid == VER_PRE_ULTRAC) -// OBSOLETE { -// OBSOLETE fread (&si, sizeof (si), 1, dbg_file); -// OBSOLETE nmask = bfd_get_16 (abfd, (unsigned char *) &si); -// OBSOLETE for (ii = 0; ii < nmask; ii++) -// OBSOLETE fread (&si, sizeof (si), 1, dbg_file); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE case N_SYM_LBRAC: -// OBSOLETE fread (&li, sizeof (li), 1, dbg_file); -// OBSOLETE symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li); -// OBSOLETE break; -// OBSOLETE case N_SYM_RBRAC: -// OBSOLETE fread (&li, sizeof (li), 1, dbg_file); -// OBSOLETE symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li); -// OBSOLETE break; -// OBSOLETE case N_SYM_SE: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Given pointers to an a.out symbol table in core containing dbx -// OBSOLETE style data, setup partial_symtab's describing each source file for -// OBSOLETE which debugging information is available. -// OBSOLETE SYMFILE_NAME is the name of the file we are reading from. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE read_os9k_psymtab (struct objfile *objfile, CORE_ADDR text_addr, int text_size) -// OBSOLETE { -// OBSOLETE register struct internal_symstruct *bufp = 0; /* =0 avoids gcc -Wall glitch */ -// OBSOLETE register char *namestring; -// OBSOLETE int past_first_source_file = 0; -// OBSOLETE CORE_ADDR last_o_file_start = 0; -// OBSOLETE #if 0 -// OBSOLETE struct cleanup *back_to; -// OBSOLETE #endif -// OBSOLETE bfd *abfd; -// OBSOLETE FILE *fp; -// OBSOLETE -// OBSOLETE /* End of the text segment of the executable file. */ -// OBSOLETE static CORE_ADDR end_of_text_addr; -// OBSOLETE -// OBSOLETE /* Current partial symtab */ -// OBSOLETE static struct partial_symtab *pst = 0; -// OBSOLETE -// OBSOLETE /* List of current psymtab's include files */ -// OBSOLETE char **psymtab_include_list; -// OBSOLETE int includes_allocated; -// OBSOLETE int includes_used; -// OBSOLETE -// OBSOLETE /* Index within current psymtab dependency list */ -// OBSOLETE struct partial_symtab **dependency_list; -// OBSOLETE int dependencies_used, dependencies_allocated; -// OBSOLETE -// OBSOLETE includes_allocated = 30; -// OBSOLETE includes_used = 0; -// OBSOLETE psymtab_include_list = (char **) alloca (includes_allocated * -// OBSOLETE sizeof (char *)); -// OBSOLETE -// OBSOLETE dependencies_allocated = 30; -// OBSOLETE dependencies_used = 0; -// OBSOLETE dependency_list = -// OBSOLETE (struct partial_symtab **) alloca (dependencies_allocated * -// OBSOLETE sizeof (struct partial_symtab *)); -// OBSOLETE -// OBSOLETE last_source_file = NULL; -// OBSOLETE -// OBSOLETE #ifdef END_OF_TEXT_DEFAULT -// OBSOLETE end_of_text_addr = END_OF_TEXT_DEFAULT; -// OBSOLETE #else -// OBSOLETE end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)) -// OBSOLETE + text_size; /* Relocate */ -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE abfd = objfile->obfd; -// OBSOLETE fp = objfile->auxf2; -// OBSOLETE if (!fp) -// OBSOLETE return; -// OBSOLETE -// OBSOLETE fread (&dbghdr.sync, sizeof (dbghdr.sync), 1, fp); -// OBSOLETE fread (&dbghdr.rev, sizeof (dbghdr.rev), 1, fp); -// OBSOLETE fread (&dbghdr.crc, sizeof (dbghdr.crc), 1, fp); -// OBSOLETE fread (&dbghdr.os, sizeof (dbghdr.os), 1, fp); -// OBSOLETE fread (&dbghdr.cpu, sizeof (dbghdr.cpu), 1, fp); -// OBSOLETE SWAP_DBGHDR (&dbghdr, abfd); -// OBSOLETE -// OBSOLETE symnum = 0; -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE int ret; -// OBSOLETE long cursymoffset; -// OBSOLETE -// OBSOLETE /* Get the symbol for this run and pull out some info */ -// OBSOLETE QUIT; /* allow this to be interruptable */ -// OBSOLETE cursymoffset = ftell (objfile->auxf2); -// OBSOLETE ret = fill_sym (objfile->auxf2, abfd); -// OBSOLETE if (ret <= 0) -// OBSOLETE break; -// OBSOLETE else -// OBSOLETE symnum++; -// OBSOLETE bufp = symbuf; -// OBSOLETE -// OBSOLETE /* Special case to speed up readin. */ -// OBSOLETE if (bufp->n_type == (short) N_SYM_SLINE) -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE #define CUR_SYMBOL_VALUE bufp->n_value -// OBSOLETE /* partial-stab.h */ -// OBSOLETE -// OBSOLETE switch (bufp->n_type) -// OBSOLETE { -// OBSOLETE char *p; -// OBSOLETE -// OBSOLETE case N_SYM_CMPLR: -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case N_SYM_SE: -// OBSOLETE CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE if (psymfile_depth == 1 && pst) -// OBSOLETE { -// OBSOLETE os9k_end_psymtab (pst, psymtab_include_list, includes_used, -// OBSOLETE symnum, CUR_SYMBOL_VALUE, -// OBSOLETE dependency_list, dependencies_used); -// OBSOLETE pst = (struct partial_symtab *) 0; -// OBSOLETE includes_used = 0; -// OBSOLETE dependencies_used = 0; -// OBSOLETE } -// OBSOLETE psymfile_depth--; -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case N_SYM_SYM: /* Typedef or automatic variable. */ -// OBSOLETE namestring = bufp->n_strx; -// OBSOLETE p = (char *) strchr (namestring, ':'); -// OBSOLETE if (!p) -// OBSOLETE continue; /* Not a debugging symbol. */ -// OBSOLETE -// OBSOLETE /* Main processing section for debugging symbols which -// OBSOLETE the initial read through the symbol tables needs to worry -// OBSOLETE about. If we reach this point, the symbol which we are -// OBSOLETE considering is definitely one we are interested in. -// OBSOLETE p must also contain the (valid) index into the namestring -// OBSOLETE which indicates the debugging type symbol. */ -// OBSOLETE -// OBSOLETE switch (p[1]) -// OBSOLETE { -// OBSOLETE case 'S': -// OBSOLETE { -// OBSOLETE unsigned long valu; -// OBSOLETE enum language tmp_language; -// OBSOLETE char *str, *p; -// OBSOLETE int n; -// OBSOLETE -// OBSOLETE valu = CUR_SYMBOL_VALUE; -// OBSOLETE if (valu) -// OBSOLETE valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE past_first_source_file = 1; -// OBSOLETE -// OBSOLETE p = strchr (namestring, ':'); -// OBSOLETE if (p) -// OBSOLETE n = p - namestring; -// OBSOLETE else -// OBSOLETE n = strlen (namestring); -// OBSOLETE str = alloca (n + 1); -// OBSOLETE strncpy (str, namestring, n); -// OBSOLETE str[n] = '\0'; -// OBSOLETE -// OBSOLETE if (psymfile_depth == 0) -// OBSOLETE { -// OBSOLETE if (!pst) -// OBSOLETE pst = os9k_start_psymtab (objfile, -// OBSOLETE str, valu, -// OBSOLETE cursymoffset, -// OBSOLETE symnum - 1, -// OBSOLETE objfile->global_psymbols.next, -// OBSOLETE objfile->static_psymbols.next); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { /* this is a include file */ -// OBSOLETE tmp_language = deduce_language_from_filename (str); -// OBSOLETE if (tmp_language != language_unknown -// OBSOLETE && (tmp_language != language_c -// OBSOLETE || psymtab_language != language_cplus)) -// OBSOLETE psymtab_language = tmp_language; -// OBSOLETE -// OBSOLETE /* -// OBSOLETE if (pst && STREQ (str, pst->filename)) -// OBSOLETE continue; -// OBSOLETE { -// OBSOLETE register int i; -// OBSOLETE for (i = 0; i < includes_used; i++) -// OBSOLETE if (STREQ (str, psymtab_include_list[i])) -// OBSOLETE { -// OBSOLETE i = -1; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE if (i == -1) -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE */ -// OBSOLETE -// OBSOLETE psymtab_include_list[includes_used++] = str; -// OBSOLETE if (includes_used >= includes_allocated) -// OBSOLETE { -// OBSOLETE char **orig = psymtab_include_list; -// OBSOLETE -// OBSOLETE psymtab_include_list = (char **) -// OBSOLETE alloca ((includes_allocated *= 2) * sizeof (char *)); -// OBSOLETE memcpy ((PTR) psymtab_include_list, (PTR) orig, -// OBSOLETE includes_used * sizeof (char *)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE } -// OBSOLETE psymfile_depth++; -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE -// OBSOLETE case 'v': -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_STATIC, -// OBSOLETE &objfile->static_psymbols, -// OBSOLETE 0, CUR_SYMBOL_VALUE, -// OBSOLETE psymtab_language, objfile); -// OBSOLETE continue; -// OBSOLETE case 'V': -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_STATIC, -// OBSOLETE &objfile->global_psymbols, -// OBSOLETE 0, CUR_SYMBOL_VALUE, -// OBSOLETE psymtab_language, objfile); -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case 'T': -// OBSOLETE if (p != namestring) /* a name is there, not just :T... */ -// OBSOLETE { -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE STRUCT_NAMESPACE, LOC_TYPEDEF, -// OBSOLETE &objfile->static_psymbols, -// OBSOLETE CUR_SYMBOL_VALUE, 0, -// OBSOLETE psymtab_language, objfile); -// OBSOLETE if (p[2] == 't') -// OBSOLETE { -// OBSOLETE /* Also a typedef with the same name. */ -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, -// OBSOLETE &objfile->static_psymbols, -// OBSOLETE CUR_SYMBOL_VALUE, 0, psymtab_language, -// OBSOLETE objfile); -// OBSOLETE p += 1; -// OBSOLETE } -// OBSOLETE /* The semantics of C++ state that "struct foo { ... }" -// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront -// OBSOLETE never makes the typedef when translating from C++ to C. -// OBSOLETE We make the typedef here so that "ptype foo" works as -// OBSOLETE expected for cfront translated code. */ -// OBSOLETE else if (psymtab_language == language_cplus) -// OBSOLETE { -// OBSOLETE /* Also a typedef with the same name. */ -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, -// OBSOLETE &objfile->static_psymbols, -// OBSOLETE CUR_SYMBOL_VALUE, 0, psymtab_language, -// OBSOLETE objfile); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE goto check_enum; -// OBSOLETE case 't': -// OBSOLETE if (p != namestring) /* a name is there, not just :T... */ -// OBSOLETE { -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF, -// OBSOLETE &objfile->static_psymbols, -// OBSOLETE CUR_SYMBOL_VALUE, 0, -// OBSOLETE psymtab_language, objfile); -// OBSOLETE } -// OBSOLETE check_enum: -// OBSOLETE /* If this is an enumerated type, we need to -// OBSOLETE add all the enum constants to the partial symbol -// OBSOLETE table. This does not cover enums without names, e.g. -// OBSOLETE "enum {a, b} c;" in C, but fortunately those are -// OBSOLETE rare. There is no way for GDB to find those from the -// OBSOLETE enum type without spending too much time on it. Thus -// OBSOLETE to solve this problem, the compiler needs to put out the -// OBSOLETE enum in a nameless type. GCC2 does this. */ -// OBSOLETE -// OBSOLETE /* We are looking for something of the form -// OBSOLETE ":" ("t" | "T") [ "="] "e" -// OBSOLETE { ":" ","} ";". */ -// OBSOLETE -// OBSOLETE /* Skip over the colon and the 't' or 'T'. */ -// OBSOLETE p += 2; -// OBSOLETE /* This type may be given a number. Also, numbers can come -// OBSOLETE in pairs like (0,26). Skip over it. */ -// OBSOLETE while ((*p >= '0' && *p <= '9') -// OBSOLETE || *p == '(' || *p == ',' || *p == ')' -// OBSOLETE || *p == '=') -// OBSOLETE p++; -// OBSOLETE -// OBSOLETE if (*p++ == 'e') -// OBSOLETE { -// OBSOLETE /* We have found an enumerated type. skip size */ -// OBSOLETE while (*p >= '0' && *p <= '9') -// OBSOLETE p++; -// OBSOLETE /* According to comments in read_enum_type -// OBSOLETE a comma could end it instead of a semicolon. -// OBSOLETE I don't know where that happens. -// OBSOLETE Accept either. */ -// OBSOLETE while (*p && *p != ';' && *p != ',') -// OBSOLETE { -// OBSOLETE char *q; -// OBSOLETE -// OBSOLETE /* Check for and handle cretinous dbx symbol name -// OBSOLETE continuation! -// OBSOLETE if (*p == '\\') -// OBSOLETE p = next_symbol_text (objfile); -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Point to the character after the name -// OBSOLETE of the enum constant. */ -// OBSOLETE for (q = p; *q && *q != ':'; q++) -// OBSOLETE ; -// OBSOLETE /* Note that the value doesn't matter for -// OBSOLETE enum constants in psymtabs, just in symtabs. */ -// OBSOLETE add_psymbol_to_list (p, q - p, -// OBSOLETE VAR_NAMESPACE, LOC_CONST, -// OBSOLETE &objfile->static_psymbols, 0, -// OBSOLETE 0, psymtab_language, objfile); -// OBSOLETE /* Point past the name. */ -// OBSOLETE p = q; -// OBSOLETE /* Skip over the value. */ -// OBSOLETE while (*p && *p != ',') -// OBSOLETE p++; -// OBSOLETE /* Advance past the comma. */ -// OBSOLETE if (*p) -// OBSOLETE p++; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE continue; -// OBSOLETE case 'c': -// OBSOLETE /* Constant, e.g. from "const" in Pascal. */ -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_CONST, -// OBSOLETE &objfile->static_psymbols, CUR_SYMBOL_VALUE, -// OBSOLETE 0, psymtab_language, objfile); -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case 'f': -// OBSOLETE CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE if (pst && pst->textlow == 0) -// OBSOLETE pst->textlow = CUR_SYMBOL_VALUE; -// OBSOLETE -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_BLOCK, -// OBSOLETE &objfile->static_psymbols, CUR_SYMBOL_VALUE, -// OBSOLETE 0, psymtab_language, objfile); -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case 'F': -// OBSOLETE CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE if (pst && pst->textlow == 0) -// OBSOLETE pst->textlow = CUR_SYMBOL_VALUE; -// OBSOLETE -// OBSOLETE add_psymbol_to_list (namestring, p - namestring, -// OBSOLETE VAR_NAMESPACE, LOC_BLOCK, -// OBSOLETE &objfile->global_psymbols, CUR_SYMBOL_VALUE, -// OBSOLETE 0, psymtab_language, objfile); -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case 'p': -// OBSOLETE case 'l': -// OBSOLETE case 's': -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE case ':': -// OBSOLETE /* It is a C++ nested symbol. We don't need to record it -// OBSOLETE (I don't think); if we try to look up foo::bar::baz, -// OBSOLETE then symbols for the symtab containing foo should get -// OBSOLETE read in, I think. */ -// OBSOLETE /* Someone says sun cc puts out symbols like -// OBSOLETE /foo/baz/maclib::/usr/local/bin/maclib, -// OBSOLETE which would get here with a symbol type of ':'. */ -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE /* Unexpected symbol descriptor. The second and subsequent stabs -// OBSOLETE of a continued stab can show up here. The question is -// OBSOLETE whether they ever can mimic a normal stab--it would be -// OBSOLETE nice if not, since we certainly don't want to spend the -// OBSOLETE time searching to the end of every string looking for -// OBSOLETE a backslash. */ -// OBSOLETE -// OBSOLETE complain (&unknown_symchar_complaint, p[1]); -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE -// OBSOLETE case N_SYM_RBRAC: -// OBSOLETE CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE #ifdef HANDLE_RBRAC -// OBSOLETE HANDLE_RBRAC (CUR_SYMBOL_VALUE); -// OBSOLETE continue; -// OBSOLETE #endif -// OBSOLETE case N_SYM_LBRAC: -// OBSOLETE continue; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE /* If we haven't found it yet, ignore it. It's probably some -// OBSOLETE new type we don't know about yet. */ -// OBSOLETE complain (&unknown_symtype_complaint, -// OBSOLETE local_hex_string ((unsigned long) bufp->n_type)); -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE DBX_SYMCOUNT (objfile) = symnum; -// OBSOLETE -// OBSOLETE /* If there's stuff to be cleaned up, clean it up. */ -// OBSOLETE if (DBX_SYMCOUNT (objfile) > 0 -// OBSOLETE /*FIXME, does this have a bug at start address 0? */ -// OBSOLETE && last_o_file_start -// OBSOLETE && objfile->ei.entry_point < bufp->n_value -// OBSOLETE && objfile->ei.entry_point >= last_o_file_start) -// OBSOLETE { -// OBSOLETE objfile->ei.entry_file_lowpc = last_o_file_start; -// OBSOLETE objfile->ei.entry_file_highpc = bufp->n_value; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (pst) -// OBSOLETE { -// OBSOLETE os9k_end_psymtab (pst, psymtab_include_list, includes_used, -// OBSOLETE symnum, end_of_text_addr, -// OBSOLETE dependency_list, dependencies_used); -// OBSOLETE } -// OBSOLETE /* -// OBSOLETE do_cleanups (back_to); -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Allocate and partially fill a partial symtab. It will be -// OBSOLETE completely filled at the end of the symbol list. -// OBSOLETE -// OBSOLETE SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR -// OBSOLETE is the address relative to which its symbols are (incremental) or 0 -// OBSOLETE (normal). */ -// OBSOLETE -// OBSOLETE -// OBSOLETE static struct partial_symtab * -// OBSOLETE os9k_start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow, -// OBSOLETE int ldsymoff, int ldsymcnt, -// OBSOLETE struct partial_symbol **global_syms, -// OBSOLETE struct partial_symbol **static_syms) -// OBSOLETE { -// OBSOLETE struct partial_symtab *result = -// OBSOLETE start_psymtab_common (objfile, objfile->section_offsets, -// OBSOLETE filename, textlow, global_syms, static_syms); -// OBSOLETE -// OBSOLETE result->read_symtab_private = (char *) -// OBSOLETE obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc)); -// OBSOLETE -// OBSOLETE LDSYMOFF (result) = ldsymoff; -// OBSOLETE LDSYMCNT (result) = ldsymcnt; -// OBSOLETE result->read_symtab = os9k_psymtab_to_symtab; -// OBSOLETE -// OBSOLETE /* Deduce the source language from the filename for this psymtab. */ -// OBSOLETE psymtab_language = deduce_language_from_filename (filename); -// OBSOLETE return result; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Close off the current usage of PST. -// OBSOLETE Returns PST or NULL if the partial symtab was empty and thrown away. -// OBSOLETE FIXME: List variables and peculiarities of same. */ -// OBSOLETE -// OBSOLETE static struct partial_symtab * -// OBSOLETE os9k_end_psymtab (struct partial_symtab *pst, char **include_list, -// OBSOLETE int num_includes, int capping_symbol_cnt, -// OBSOLETE CORE_ADDR capping_text, -// OBSOLETE struct partial_symtab **dependency_list, -// OBSOLETE int number_dependencies) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE struct partial_symtab *p1; -// OBSOLETE struct objfile *objfile = pst->objfile; -// OBSOLETE -// OBSOLETE if (capping_symbol_cnt != -1) -// OBSOLETE LDSYMCNT (pst) = capping_symbol_cnt - LDSYMCNT (pst); -// OBSOLETE -// OBSOLETE /* Under Solaris, the N_SO symbols always have a value of 0, -// OBSOLETE instead of the usual address of the .o file. Therefore, -// OBSOLETE we have to do some tricks to fill in texthigh and textlow. -// OBSOLETE The first trick is in partial-stab.h: if we see a static -// OBSOLETE or global function, and the textlow for the current pst -// OBSOLETE is still 0, then we use that function's address for -// OBSOLETE the textlow of the pst. -// OBSOLETE -// OBSOLETE Now, to fill in texthigh, we remember the last function seen -// OBSOLETE in the .o file (also in partial-stab.h). Also, there's a hack in -// OBSOLETE bfd/elf.c and gdb/elfread.c to pass the ELF st_size field -// OBSOLETE to here via the misc_info field. Therefore, we can fill in -// OBSOLETE a reliable texthigh by taking the address plus size of the -// OBSOLETE last function in the file. -// OBSOLETE -// OBSOLETE Unfortunately, that does not cover the case where the last function -// OBSOLETE in the file is static. See the paragraph below for more comments -// OBSOLETE on this situation. -// OBSOLETE -// OBSOLETE Finally, if we have a valid textlow for the current file, we run -// OBSOLETE down the partial_symtab_list filling in previous texthighs that -// OBSOLETE are still unknown. */ -// OBSOLETE -// OBSOLETE if (pst->texthigh == 0 && last_function_name) -// OBSOLETE { -// OBSOLETE char *p; -// OBSOLETE int n; -// OBSOLETE struct minimal_symbol *minsym; -// OBSOLETE -// OBSOLETE p = strchr (last_function_name, ':'); -// OBSOLETE if (p == NULL) -// OBSOLETE p = last_function_name; -// OBSOLETE n = p - last_function_name; -// OBSOLETE p = alloca (n + 1); -// OBSOLETE strncpy (p, last_function_name, n); -// OBSOLETE p[n] = 0; -// OBSOLETE -// OBSOLETE minsym = lookup_minimal_symbol (p, NULL, objfile); -// OBSOLETE -// OBSOLETE if (minsym) -// OBSOLETE { -// OBSOLETE pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym) + (long) MSYMBOL_INFO (minsym); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* This file ends with a static function, and it's -// OBSOLETE difficult to imagine how hard it would be to track down -// OBSOLETE the elf symbol. Luckily, most of the time no one will notice, -// OBSOLETE since the next file will likely be compiled with -g, so -// OBSOLETE the code below will copy the first fuction's start address -// OBSOLETE back to our texthigh variable. (Also, if this file is the -// OBSOLETE last one in a dynamically linked program, texthigh already -// OBSOLETE has the right value.) If the next file isn't compiled -// OBSOLETE with -g, then the last function in this file winds up owning -// OBSOLETE all of the text space up to the next -g file, or the end (minus -// OBSOLETE shared libraries). This only matters for single stepping, -// OBSOLETE and even then it will still work, except that it will single -// OBSOLETE step through all of the covered functions, instead of setting -// OBSOLETE breakpoints around them as it usualy does. This makes it -// OBSOLETE pretty slow, but at least it doesn't fail. -// OBSOLETE -// OBSOLETE We can fix this with a fairly big change to bfd, but we need -// OBSOLETE to coordinate better with Cygnus if we want to do that. FIXME. */ -// OBSOLETE } -// OBSOLETE last_function_name = NULL; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* this test will be true if the last .o file is only data */ -// OBSOLETE if (pst->textlow == 0) -// OBSOLETE pst->textlow = pst->texthigh; -// OBSOLETE -// OBSOLETE /* If we know our own starting text address, then walk through all other -// OBSOLETE psymtabs for this objfile, and if any didn't know their ending text -// OBSOLETE address, set it to our starting address. Take care to not set our -// OBSOLETE own ending address to our starting address, nor to set addresses on -// OBSOLETE `dependency' files that have both textlow and texthigh zero. */ -// OBSOLETE if (pst->textlow) -// OBSOLETE { -// OBSOLETE ALL_OBJFILE_PSYMTABS (objfile, p1) -// OBSOLETE { -// OBSOLETE if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst) -// OBSOLETE { -// OBSOLETE p1->texthigh = pst->textlow; -// OBSOLETE /* if this file has only data, then make textlow match texthigh */ -// OBSOLETE if (p1->textlow == 0) -// OBSOLETE p1->textlow = p1->texthigh; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* End of kludge for patching Solaris textlow and texthigh. */ -// OBSOLETE -// OBSOLETE pst->n_global_syms = -// OBSOLETE objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset); -// OBSOLETE pst->n_static_syms = -// OBSOLETE objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset); -// OBSOLETE -// OBSOLETE pst->number_of_dependencies = number_dependencies; -// OBSOLETE if (number_dependencies) -// OBSOLETE { -// OBSOLETE pst->dependencies = (struct partial_symtab **) -// OBSOLETE obstack_alloc (&objfile->psymbol_obstack, -// OBSOLETE number_dependencies * sizeof (struct partial_symtab *)); -// OBSOLETE memcpy (pst->dependencies, dependency_list, -// OBSOLETE number_dependencies * sizeof (struct partial_symtab *)); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE pst->dependencies = 0; -// OBSOLETE -// OBSOLETE for (i = 0; i < num_includes; i++) -// OBSOLETE { -// OBSOLETE struct partial_symtab *subpst = -// OBSOLETE allocate_psymtab (include_list[i], objfile); -// OBSOLETE -// OBSOLETE subpst->section_offsets = pst->section_offsets; -// OBSOLETE subpst->read_symtab_private = -// OBSOLETE (char *) obstack_alloc (&objfile->psymbol_obstack, -// OBSOLETE sizeof (struct symloc)); -// OBSOLETE LDSYMOFF (subpst) = -// OBSOLETE LDSYMCNT (subpst) = -// OBSOLETE subpst->textlow = -// OBSOLETE subpst->texthigh = 0; -// OBSOLETE -// OBSOLETE /* We could save slight bits of space by only making one of these, -// OBSOLETE shared by the entire set of include files. FIXME-someday. */ -// OBSOLETE subpst->dependencies = (struct partial_symtab **) -// OBSOLETE obstack_alloc (&objfile->psymbol_obstack, -// OBSOLETE sizeof (struct partial_symtab *)); -// OBSOLETE subpst->dependencies[0] = pst; -// OBSOLETE subpst->number_of_dependencies = 1; -// OBSOLETE -// OBSOLETE subpst->globals_offset = -// OBSOLETE subpst->n_global_syms = -// OBSOLETE subpst->statics_offset = -// OBSOLETE subpst->n_static_syms = 0; -// OBSOLETE -// OBSOLETE subpst->readin = 0; -// OBSOLETE subpst->symtab = 0; -// OBSOLETE subpst->read_symtab = pst->read_symtab; -// OBSOLETE } -// OBSOLETE -// OBSOLETE sort_pst_symbols (pst); -// OBSOLETE -// OBSOLETE /* If there is already a psymtab or symtab for a file of this name, -// OBSOLETE remove it. -// OBSOLETE (If there is a symtab, more drastic things also happen.) -// OBSOLETE This happens in VxWorks. */ -// OBSOLETE free_named_symtabs (pst->filename); -// OBSOLETE -// OBSOLETE if (num_includes == 0 -// OBSOLETE && number_dependencies == 0 -// OBSOLETE && pst->n_global_syms == 0 -// OBSOLETE && pst->n_static_syms == 0) -// OBSOLETE { -// OBSOLETE /* Throw away this psymtab, it's empty. We can't deallocate it, since -// OBSOLETE it is on the obstack, but we can forget to chain it on the list. */ -// OBSOLETE /* Indicate that psymtab was thrown away. */ -// OBSOLETE -// OBSOLETE discard_psymtab (pst); -// OBSOLETE -// OBSOLETE pst = (struct partial_symtab *) NULL; -// OBSOLETE } -// OBSOLETE return pst; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_psymtab_to_symtab_1 (struct partial_symtab *pst) -// OBSOLETE { -// OBSOLETE struct cleanup *old_chain; -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE if (!pst) -// OBSOLETE return; -// OBSOLETE -// OBSOLETE if (pst->readin) -// OBSOLETE { -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n", -// OBSOLETE pst->filename); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read in all partial symtabs on which this one is dependent */ -// OBSOLETE for (i = 0; i < pst->number_of_dependencies; i++) -// OBSOLETE if (!pst->dependencies[i]->readin) -// OBSOLETE { -// OBSOLETE /* Inform about additional files that need to be read in. */ -// OBSOLETE if (info_verbose) -// OBSOLETE { -// OBSOLETE fputs_filtered (" ", gdb_stdout); -// OBSOLETE wrap_here (""); -// OBSOLETE fputs_filtered ("and ", gdb_stdout); -// OBSOLETE wrap_here (""); -// OBSOLETE printf_filtered ("%s...", pst->dependencies[i]->filename); -// OBSOLETE wrap_here (""); /* Flush output */ -// OBSOLETE gdb_flush (gdb_stdout); -// OBSOLETE } -// OBSOLETE os9k_psymtab_to_symtab_1 (pst->dependencies[i]); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (LDSYMCNT (pst)) /* Otherwise it's a dummy */ -// OBSOLETE { -// OBSOLETE /* Init stuff necessary for reading in symbols */ -// OBSOLETE stabsread_init (); -// OBSOLETE buildsym_init (); -// OBSOLETE old_chain = make_cleanup (really_free_pendings, 0); -// OBSOLETE -// OBSOLETE /* Read in this file's symbols */ -// OBSOLETE os9k_read_ofile_symtab (pst); -// OBSOLETE sort_symtab_syms (pst->symtab); -// OBSOLETE do_cleanups (old_chain); -// OBSOLETE } -// OBSOLETE -// OBSOLETE pst->readin = 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read in all of the symbols for a given psymtab for real. -// OBSOLETE Be verbose about it if the user wants that. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_psymtab_to_symtab (struct partial_symtab *pst) -// OBSOLETE { -// OBSOLETE bfd *sym_bfd; -// OBSOLETE -// OBSOLETE if (!pst) -// OBSOLETE return; -// OBSOLETE -// OBSOLETE if (pst->readin) -// OBSOLETE { -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n", -// OBSOLETE pst->filename); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (LDSYMCNT (pst) || pst->number_of_dependencies) -// OBSOLETE { -// OBSOLETE /* Print the message now, before reading the string table, -// OBSOLETE to avoid disconcerting pauses. */ -// OBSOLETE if (info_verbose) -// OBSOLETE { -// OBSOLETE printf_filtered ("Reading in symbols for %s...", pst->filename); -// OBSOLETE gdb_flush (gdb_stdout); -// OBSOLETE } -// OBSOLETE -// OBSOLETE sym_bfd = pst->objfile->obfd; -// OBSOLETE os9k_psymtab_to_symtab_1 (pst); -// OBSOLETE -// OBSOLETE /* Match with global symbols. This only needs to be done once, -// OBSOLETE after all of the symtabs and dependencies have been read in. */ -// OBSOLETE scan_file_globals (pst->objfile); -// OBSOLETE -// OBSOLETE /* Finish up the debug error message. */ -// OBSOLETE if (info_verbose) -// OBSOLETE printf_filtered ("done.\n"); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read in a defined section of a specific object file's symbols. */ -// OBSOLETE static void -// OBSOLETE os9k_read_ofile_symtab (struct partial_symtab *pst) -// OBSOLETE { -// OBSOLETE register struct internal_symstruct *bufp; -// OBSOLETE unsigned char type; -// OBSOLETE unsigned max_symnum; -// OBSOLETE register bfd *abfd; -// OBSOLETE struct objfile *objfile; -// OBSOLETE int sym_offset; /* Offset to start of symbols to read */ -// OBSOLETE CORE_ADDR text_offset; /* Start of text segment for symbols */ -// OBSOLETE int text_size; /* Size of text segment for symbols */ -// OBSOLETE FILE *dbg_file; -// OBSOLETE -// OBSOLETE objfile = pst->objfile; -// OBSOLETE sym_offset = LDSYMOFF (pst); -// OBSOLETE max_symnum = LDSYMCNT (pst); -// OBSOLETE text_offset = pst->textlow; -// OBSOLETE text_size = pst->texthigh - pst->textlow; -// OBSOLETE -// OBSOLETE current_objfile = objfile; -// OBSOLETE subfile_stack = NULL; -// OBSOLETE last_source_file = NULL; -// OBSOLETE -// OBSOLETE abfd = objfile->obfd; -// OBSOLETE dbg_file = objfile->auxf2; -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE /* It is necessary to actually read one symbol *before* the start -// OBSOLETE of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL -// OBSOLETE occurs before the N_SO symbol. -// OBSOLETE Detecting this in read_dbx_symtab -// OBSOLETE would slow down initial readin, so we look for it here instead. */ -// OBSOLETE if (!processing_acc_compilation && sym_offset >= (int) symbol_size) -// OBSOLETE { -// OBSOLETE fseek (objefile->auxf2, sym_offset, SEEK_CUR); -// OBSOLETE fill_sym (objfile->auxf2, abfd); -// OBSOLETE bufp = symbuf; -// OBSOLETE -// OBSOLETE processing_gcc_compilation = 0; -// OBSOLETE if (bufp->n_type == N_TEXT) -// OBSOLETE { -// OBSOLETE if (STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) -// OBSOLETE processing_gcc_compilation = 1; -// OBSOLETE else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) -// OBSOLETE processing_gcc_compilation = 2; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Try to select a C++ demangling based on the compilation unit -// OBSOLETE producer. */ -// OBSOLETE -// OBSOLETE if (processing_gcc_compilation) -// OBSOLETE { -// OBSOLETE if (AUTO_DEMANGLING) -// OBSOLETE { -// OBSOLETE set_demangling_style (GNU_DEMANGLING_STYLE_STRING); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* The N_SO starting this symtab is the first symbol, so we -// OBSOLETE better not check the symbol before it. I'm not this can -// OBSOLETE happen, but it doesn't hurt to check for it. */ -// OBSOLETE bfd_seek (symfile_bfd, sym_offset, SEEK_CUR); -// OBSOLETE processing_gcc_compilation = 0; -// OBSOLETE } -// OBSOLETE #endif /* 0 */ -// OBSOLETE -// OBSOLETE fseek (dbg_file, (long) sym_offset, 0); -// OBSOLETE /* -// OBSOLETE if (bufp->n_type != (unsigned char)N_SYM_SYM) -// OBSOLETE error("First symbol in segment of executable not a source symbol"); -// OBSOLETE */ -// OBSOLETE -// OBSOLETE for (symnum = 0; symnum < max_symnum; symnum++) -// OBSOLETE { -// OBSOLETE QUIT; /* Allow this to be interruptable */ -// OBSOLETE fill_sym (dbg_file, abfd); -// OBSOLETE bufp = symbuf; -// OBSOLETE type = bufp->n_type; -// OBSOLETE -// OBSOLETE os9k_process_one_symbol ((int) type, (int) bufp->n_desc, -// OBSOLETE (CORE_ADDR) bufp->n_value, bufp->n_strx, pst->section_offsets, objfile); -// OBSOLETE -// OBSOLETE /* We skip checking for a new .o or -l file; that should never -// OBSOLETE happen in this routine. */ -// OBSOLETE #if 0 -// OBSOLETE else -// OBSOLETE if (type == N_TEXT) -// OBSOLETE { -// OBSOLETE /* I don't think this code will ever be executed, because -// OBSOLETE the GCC_COMPILED_FLAG_SYMBOL usually is right before -// OBSOLETE the N_SO symbol which starts this source file. -// OBSOLETE However, there is no reason not to accept -// OBSOLETE the GCC_COMPILED_FLAG_SYMBOL anywhere. */ -// OBSOLETE -// OBSOLETE if (STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) -// OBSOLETE processing_gcc_compilation = 1; -// OBSOLETE else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) -// OBSOLETE processing_gcc_compilation = 2; -// OBSOLETE -// OBSOLETE if (AUTO_DEMANGLING) -// OBSOLETE { -// OBSOLETE set_demangling_style (GNU_DEMANGLING_STYLE_STRING); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else if (type & N_EXT || type == (unsigned char) N_TEXT -// OBSOLETE || type == (unsigned char) N_NBTEXT -// OBSOLETE ) -// OBSOLETE { -// OBSOLETE /* Global symbol: see if we came across a dbx defintion for -// OBSOLETE a corresponding symbol. If so, store the value. Remove -// OBSOLETE syms from the chain when their values are stored, but -// OBSOLETE search the whole chain, as there may be several syms from -// OBSOLETE different files with the same name. */ -// OBSOLETE /* This is probably not true. Since the files will be read -// OBSOLETE in one at a time, each reference to a global symbol will -// OBSOLETE be satisfied in each file as it appears. So we skip this -// OBSOLETE section. */ -// OBSOLETE ; -// OBSOLETE } -// OBSOLETE #endif /* 0 */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE current_objfile = NULL; -// OBSOLETE -// OBSOLETE /* In a Solaris elf file, this variable, which comes from the -// OBSOLETE value of the N_SO symbol, will still be 0. Luckily, text_offset, -// OBSOLETE which comes from pst->textlow is correct. */ -// OBSOLETE if (last_source_start_addr == 0) -// OBSOLETE last_source_start_addr = text_offset; -// OBSOLETE pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); -// OBSOLETE end_stabs (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE -// OBSOLETE /* This handles a single symbol from the symbol-file, building symbols -// OBSOLETE into a GDB symtab. It takes these arguments and an implicit argument. -// OBSOLETE -// OBSOLETE TYPE is the type field of the ".stab" symbol entry. -// OBSOLETE DESC is the desc field of the ".stab" entry. -// OBSOLETE VALU is the value field of the ".stab" entry. -// OBSOLETE NAME is the symbol name, in our address space. -// OBSOLETE SECTION_OFFSETS is a set of amounts by which the sections of this object -// OBSOLETE file were relocated when it was loaded into memory. -// OBSOLETE All symbols that refer -// OBSOLETE to memory locations need to be offset by these amounts. -// OBSOLETE OBJFILE is the object file from which we are reading symbols. -// OBSOLETE It is used in end_symtab. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE os9k_process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, -// OBSOLETE struct section_offsets *section_offsets, -// OBSOLETE struct objfile *objfile) -// OBSOLETE { -// OBSOLETE register struct context_stack *new; -// OBSOLETE /* The stab type used for the definition of the last function. -// OBSOLETE N_STSYM or N_GSYM for SunOS4 acc; N_FUN for other compilers. */ -// OBSOLETE static int function_stab_type = 0; -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE /* Something is wrong if we see real data before -// OBSOLETE seeing a source file name. */ -// OBSOLETE if (last_source_file == NULL && type != (unsigned char) N_SO) -// OBSOLETE { -// OBSOLETE /* Ignore any symbols which appear before an N_SO symbol. -// OBSOLETE Currently no one puts symbols there, but we should deal -// OBSOLETE gracefully with the case. A complain()t might be in order, -// OBSOLETE but this should not be an error (). */ -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE #endif /* 0 */ -// OBSOLETE -// OBSOLETE switch (type) -// OBSOLETE { -// OBSOLETE case N_SYM_LBRAC: -// OBSOLETE /* On most machines, the block addresses are relative to the -// OBSOLETE N_SO, the linker did not relocate them (sigh). */ -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE new = push_context (desc, valu); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case N_SYM_RBRAC: -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE new = pop_context (); -// OBSOLETE -// OBSOLETE #if !defined (OS9K_VARIABLES_INSIDE_BLOCK) -// OBSOLETE #define OS9K_VARIABLES_INSIDE_BLOCK(desc, gcc_p) 1 -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE if (!OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation)) -// OBSOLETE local_symbols = new->locals; -// OBSOLETE -// OBSOLETE if (context_stack_depth > 1) -// OBSOLETE { -// OBSOLETE /* This is not the outermost LBRAC...RBRAC pair in the function, -// OBSOLETE its local symbols preceded it, and are the ones just recovered -// OBSOLETE from the context stack. Define the block for them (but don't -// OBSOLETE bother if the block contains no symbols. Should we complain -// OBSOLETE on blocks without symbols? I can't think of any useful purpose -// OBSOLETE for them). */ -// OBSOLETE if (local_symbols != NULL) -// OBSOLETE { -// OBSOLETE /* Muzzle a compiler bug that makes end < start. (which -// OBSOLETE compilers? Is this ever harmful?). */ -// OBSOLETE if (new->start_addr > valu) -// OBSOLETE { -// OBSOLETE complain (&lbrac_rbrac_complaint); -// OBSOLETE new->start_addr = valu; -// OBSOLETE } -// OBSOLETE /* Make a block for the local symbols within. */ -// OBSOLETE finish_block (0, &local_symbols, new->old_blocks, -// OBSOLETE new->start_addr, valu, objfile); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (context_stack_depth == 0) -// OBSOLETE { -// OBSOLETE within_function = 0; -// OBSOLETE /* Make a block for the local symbols within. */ -// OBSOLETE finish_block (new->name, &local_symbols, new->old_blocks, -// OBSOLETE new->start_addr, valu, objfile); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* attach local_symbols to the end of new->locals */ -// OBSOLETE if (!new->locals) -// OBSOLETE new->locals = local_symbols; -// OBSOLETE else -// OBSOLETE { -// OBSOLETE struct pending *p; -// OBSOLETE -// OBSOLETE p = new->locals; -// OBSOLETE while (p->next) -// OBSOLETE p = p->next; -// OBSOLETE p->next = local_symbols; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation)) -// OBSOLETE /* Now pop locals of block just finished. */ -// OBSOLETE local_symbols = new->locals; -// OBSOLETE break; -// OBSOLETE -// OBSOLETE -// OBSOLETE case N_SYM_SLINE: -// OBSOLETE /* This type of "symbol" really just records -// OBSOLETE one line-number -- core-address correspondence. -// OBSOLETE Enter it in the line list for this symbol table. */ -// OBSOLETE /* Relocate for dynamic loading and for ELF acc fn-relative syms. */ -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE /* FIXME: loses if sizeof (char *) > sizeof (int) */ -// OBSOLETE gdb_assert (sizeof (name) <= sizeof (int)); -// OBSOLETE record_line (current_subfile, (int) name, valu); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE /* The following symbol types need to have the appropriate offset added -// OBSOLETE to their value; then we process symbol definitions in the name. */ -// OBSOLETE case N_SYM_SYM: -// OBSOLETE -// OBSOLETE if (name) -// OBSOLETE { -// OBSOLETE char deftype; -// OBSOLETE char *dirn, *n; -// OBSOLETE char *p = strchr (name, ':'); -// OBSOLETE if (p == NULL) -// OBSOLETE deftype = '\0'; -// OBSOLETE else -// OBSOLETE deftype = p[1]; -// OBSOLETE -// OBSOLETE -// OBSOLETE switch (deftype) -// OBSOLETE { -// OBSOLETE case 'S': -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE n = strrchr (name, '/'); -// OBSOLETE if (n != NULL) -// OBSOLETE { -// OBSOLETE *n = '\0'; -// OBSOLETE n++; -// OBSOLETE dirn = name; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE n = name; -// OBSOLETE dirn = NULL; -// OBSOLETE } -// OBSOLETE *p = '\0'; -// OBSOLETE if (symfile_depth++ == 0) -// OBSOLETE { -// OBSOLETE if (last_source_file) -// OBSOLETE { -// OBSOLETE end_symtab (valu, objfile, SECT_OFF_TEXT (objfile)); -// OBSOLETE end_stabs (); -// OBSOLETE } -// OBSOLETE start_stabs (); -// OBSOLETE os9k_stabs = 1; -// OBSOLETE start_symtab (n, dirn, valu); -// OBSOLETE record_debugformat ("OS9"); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE push_subfile (); -// OBSOLETE start_subfile (n, dirn != NULL ? dirn : current_subfile->dirname); -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 'f': -// OBSOLETE case 'F': -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); -// OBSOLETE function_stab_type = type; -// OBSOLETE -// OBSOLETE within_function = 1; -// OBSOLETE new = push_context (0, valu); -// OBSOLETE new->name = define_symbol (valu, name, desc, type, objfile); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 'V': -// OBSOLETE case 'v': -// OBSOLETE valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile)); -// OBSOLETE define_symbol (valu, name, desc, type, objfile); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE define_symbol (valu, name, desc, type, objfile); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case N_SYM_SE: -// OBSOLETE if (--symfile_depth != 0) -// OBSOLETE start_subfile (pop_subfile (), current_subfile->dirname); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE complain (&unknown_symtype_complaint, -// OBSOLETE local_hex_string ((unsigned long) type)); -// OBSOLETE /* FALLTHROUGH */ -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case N_SYM_CMPLR: -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE previous_stab_code = type; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct sym_fns os9k_sym_fns = -// OBSOLETE { -// OBSOLETE bfd_target_os9k_flavour, -// OBSOLETE os9k_new_init, /* sym_new_init: init anything gbl to entire symtab */ -// OBSOLETE os9k_symfile_init, /* sym_init: read initial info, setup for sym_read() */ -// OBSOLETE os9k_symfile_read, /* sym_read: read a symbol file into symtab */ -// OBSOLETE os9k_symfile_finish, /* sym_finish: finished with file, cleanup */ -// OBSOLETE default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */ -// OBSOLETE NULL /* next: pointer to next struct sym_fns */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_os9kread (void) -// OBSOLETE { -// OBSOLETE add_symtab_fns (&os9k_sym_fns); -// OBSOLETE } diff --git a/gdb/osabi.c b/gdb/osabi.c index 7caebf3..47d08a2 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -19,7 +19,10 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" + +#include "gdb_assert.h" #include "gdb_string.h" + #include "osabi.h" #include "elf-bfd.h" @@ -46,6 +49,8 @@ static const char * const gdb_osabi_names[] = "Irix", "LynxOS", "Interix", + "HP/UX ELF", + "HP/UX SOM", "ARM EABI v1", "ARM EABI v2", @@ -68,7 +73,7 @@ gdbarch_osabi_name (enum gdb_osabi osabi) struct gdb_osabi_handler { struct gdb_osabi_handler *next; - enum bfd_architecture arch; + const struct bfd_arch_info *arch_info; enum gdb_osabi osabi; void (*init_osabi)(struct gdbarch_info, struct gdbarch *); }; @@ -76,11 +81,13 @@ struct gdb_osabi_handler static struct gdb_osabi_handler *gdb_osabi_handler_list; void -gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi, +gdbarch_register_osabi (enum bfd_architecture arch, unsigned long machine, + enum gdb_osabi osabi, void (*init_osabi)(struct gdbarch_info, struct gdbarch *)) { struct gdb_osabi_handler **handler_p; + const struct bfd_arch_info *arch_info = bfd_lookup_arch (arch, machine); /* Registering an OS ABI handler for "unknown" is not allowed. */ if (osabi == GDB_OSABI_UNKNOWN) @@ -91,14 +98,16 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi, "OS ABI \"%s\" for architecture %s was made. The handler will " "not be registered", gdbarch_osabi_name (osabi), - bfd_printable_arch_mach (arch, 0)); + bfd_printable_arch_mach (arch, machine)); return; } + gdb_assert (arch_info); + for (handler_p = &gdb_osabi_handler_list; *handler_p != NULL; handler_p = &(*handler_p)->next) { - if ((*handler_p)->arch == arch + if ((*handler_p)->arch_info == arch_info && (*handler_p)->osabi == osabi) { internal_error @@ -106,7 +115,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi, "gdbarch_register_osabi: A handler for OS ABI \"%s\" " "has already been registered for architecture %s", gdbarch_osabi_name (osabi), - bfd_printable_arch_mach (arch, 0)); + arch_info->printable_name); /* If user wants to continue, override previous definition. */ (*handler_p)->init_osabi = init_osabi; return; @@ -116,7 +125,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi, (*handler_p) = (struct gdb_osabi_handler *) xmalloc (sizeof (struct gdb_osabi_handler)); (*handler_p)->next = NULL; - (*handler_p)->arch = arch; + (*handler_p)->arch_info = arch_info; (*handler_p)->osabi = osabi; (*handler_p)->init_osabi = init_osabi; } @@ -228,9 +237,9 @@ void gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch, enum gdb_osabi osabi) { - struct gdb_osabi_handler *handler; - bfd *abfd = info.abfd; const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch); + const struct bfd_arch_info *compatible; + struct gdb_osabi_handler *handler; if (osabi == GDB_OSABI_UNKNOWN) { @@ -242,8 +251,19 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch, for (handler = gdb_osabi_handler_list; handler != NULL; handler = handler->next) { - if (handler->arch == bfd_get_arch (abfd) - && handler->osabi == osabi) + if (handler->osabi != osabi) + continue; + + /* Check whether the machine type and architecture of the + handler are compatible with the desired machine type and + architecture. + + NOTE: kettenis/20021027: There may be more than one machine + type that is compatible with the desired machine type. Right + now we simply return the first match, which is fine for now. + However, we might want to do something smarter in the future. */ + compatible = arch_info->compatible (arch_info, handler->arch_info); + if (compatible == handler->arch_info) { (*handler->init_osabi) (info, gdbarch); return; @@ -404,6 +424,10 @@ generic_elf_osabi_sniffer (bfd *abfd) case ELFOSABI_SOLARIS: osabi = GDB_OSABI_SOLARIS; break; + + case ELFOSABI_HPUX: + osabi = GDB_OSABI_HPUX_ELF; + break; } if (osabi == GDB_OSABI_UNKNOWN) diff --git a/gdb/osabi.h b/gdb/osabi.h index 56bb0a1..ebff831 100644 --- a/gdb/osabi.h +++ b/gdb/osabi.h @@ -42,6 +42,8 @@ enum gdb_osabi GDB_OSABI_IRIX, GDB_OSABI_LYNXOS, GDB_OSABI_INTERIX, + GDB_OSABI_HPUX_ELF, + GDB_OSABI_HPUX_SOM, GDB_OSABI_ARM_EABI_V1, GDB_OSABI_ARM_EABI_V2, @@ -59,9 +61,11 @@ void gdbarch_register_osabi_sniffer (enum bfd_architecture, enum bfd_flavour, enum gdb_osabi (*)(bfd *)); -/* Register a handler for an OS ABI variant for a given architecture. There - should be only one handler for a given OS ABI each architecture family. */ -void gdbarch_register_osabi (enum bfd_architecture, enum gdb_osabi, +/* Register a handler for an OS ABI variant for a given architecture + and machine type. There should be only one handler for a given OS + ABI for each architecture and machine type combination. */ +void gdbarch_register_osabi (enum bfd_architecture, unsigned long, + enum gdb_osabi, void (*)(struct gdbarch_info, struct gdbarch *)); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 15b67e7..c52c0a5 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -206,7 +206,7 @@ static int search_field; /* Object pascal */ %token THIS -%token TRUE FALSE +%token TRUEKEYWORD FALSEKEYWORD %left ',' %left ABOVE_COMMA @@ -294,7 +294,7 @@ exp : exp '.' { search_field = 1; } { while (TYPE_CODE (current_type) == TYPE_CODE_PTR) current_type = TYPE_TARGET_TYPE (current_type); current_type = lookup_struct_elt_type ( - current_type, $4.ptr, false); }; + current_type, $4.ptr, 0); }; } ; exp : exp '[' /* We need to save the current_type value */ @@ -343,7 +343,15 @@ arglist : ; exp : type '(' exp ')' %prec UNARY - { write_exp_elt_opcode (UNOP_CAST); + { if (current_type) + { + /* Allow automatic dereference of classes. */ + if ((TYPE_CODE (current_type) == TYPE_CODE_PTR) + && (TYPE_CODE (TYPE_TARGET_TYPE (current_type)) == TYPE_CODE_CLASS) + && (TYPE_CODE ($1) == TYPE_CODE_CLASS)) + write_exp_elt_opcode (UNOP_IND); + } + write_exp_elt_opcode (UNOP_CAST); write_exp_elt_type ($1); write_exp_elt_opcode (UNOP_CAST); current_type = $1; } @@ -427,13 +435,13 @@ exp : exp ASSIGN exp { write_exp_elt_opcode (BINOP_ASSIGN); } ; -exp : TRUE +exp : TRUEKEYWORD { write_exp_elt_opcode (OP_BOOL); write_exp_elt_longcst ((LONGEST) $1); write_exp_elt_opcode (OP_BOOL); } ; -exp : FALSE +exp : FALSEKEYWORD { write_exp_elt_opcode (OP_BOOL); write_exp_elt_longcst ((LONGEST) $1); write_exp_elt_opcode (OP_BOOL); } @@ -505,8 +513,28 @@ exp : STRING /* Object pascal */ exp : THIS - { write_exp_elt_opcode (OP_THIS); - write_exp_elt_opcode (OP_THIS); } + { + struct value * this_val; + struct type * this_type; + write_exp_elt_opcode (OP_THIS); + write_exp_elt_opcode (OP_THIS); + /* we need type of this */ + this_val = value_of_this (0); + if (this_val) + this_type = this_val->type; + else + this_type = NULL; + if (this_type) + { + if (TYPE_CODE (this_type) == TYPE_CODE_PTR) + { + this_type = TYPE_TARGET_TYPE (this_type); + write_exp_elt_opcode (UNOP_IND); + } + } + + current_type = this_type; + } ; /* end of object pascal. */ @@ -651,7 +679,7 @@ variable: name_not_typename if (this_type) current_type = lookup_struct_elt_type ( this_type, - copy_name($1.stoken), false); + copy_name ($1.stoken), 0); else current_type = NULL; } @@ -695,7 +723,9 @@ type : ptype ; typebase /* Implements (approximately): (type-qualifier)* type-specifier */ - : TYPENAME + : '^' typebase + { $$ = lookup_pointer_type ($2); } + | TYPENAME { $$ = $1.type; } | STRUCT name { $$ = lookup_struct (copy_name ($2), @@ -1351,14 +1381,14 @@ yylex () if (STREQ (uptokstart, "FALSE")) { yylval.lval = 0; - return FALSE; + return FALSEKEYWORD; } break; case 4: if (STREQ (uptokstart, "TRUE")) { yylval.lval = 1; - return TRUE; + return TRUEKEYWORD; } if (STREQ (uptokstart, "SELF")) { diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c index fce8fea..43910da 100644 --- a/gdb/pa64solib.c +++ b/gdb/pa64solib.c @@ -80,7 +80,7 @@ struct so_list struct load_module_desc pa64_solib_desc; struct section_table *sections; struct section_table *sections_end; - boolean loaded; + int loaded; }; static struct so_list *so_list_head; @@ -111,8 +111,8 @@ typedef struct CORE_ADDR dld_flags_addr; LONGEST dld_flags; sec_ptr dyninfo_sect; - boolean have_read_dld_descriptor; - boolean is_valid; + int have_read_dld_descriptor; + int is_valid; CORE_ADDR load_map; CORE_ADDR load_map_addr; struct load_module_desc dld_desc; @@ -127,11 +127,11 @@ static void pa64_solib_sharedlibrary_command (char *, int); static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int); -static boolean read_dld_descriptor (struct target_ops *, int readsyms); +static int read_dld_descriptor (struct target_ops *, int readsyms); -static boolean read_dynamic_info (asection *, dld_cache_t *); +static int read_dynamic_info (asection *, dld_cache_t *); -static void add_to_solist (boolean, char *, int, struct load_module_desc *, +static void add_to_solist (int, char *, int, struct load_module_desc *, CORE_ADDR, struct target_ops *); /* When examining the shared library for debugging information we have to @@ -935,7 +935,7 @@ so_lib_thread_start_addr (struct so_list *so) descriptor. If the library is archive bound, then return zero, else return nonzero. */ -static boolean +static int read_dld_descriptor (struct target_ops *target, int readsyms) { char *dll_path; @@ -1004,7 +1004,7 @@ read_dld_descriptor (struct target_ops *target, int readsyms) which is stored in dld_cache. The routine elf_locate_base in solib.c was used as a model for this. */ -static boolean +static int read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p) { char *buf; @@ -1102,7 +1102,7 @@ pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident) be read from the inferior process at the address load_module_desc_addr. */ static void -add_to_solist (boolean from_tty, char *dll_path, int readsyms, +add_to_solist (int from_tty, char *dll_path, int readsyms, struct load_module_desc *load_module_desc_p, CORE_ADDR load_module_desc_addr, struct target_ops *target) { diff --git a/gdb/parse.c b/gdb/parse.c index f44bcec..cb59833 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -830,7 +830,7 @@ length_of_subexp (register struct expression *expr, register int endpos) args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); break; - case OP_MSGCALL: /* Objective C message (method) call */ + case OP_OBJC_MSGCALL: /* Objective C message (method) call */ oplen = 4; args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); break; @@ -866,8 +866,8 @@ length_of_subexp (register struct expression *expr, register int endpos) /* fall through */ case OP_M2_STRING: case OP_STRING: - case OP_NSSTRING: /* Objective C Foundation Class NSString constant */ - case OP_SELECTOR: /* Objective C "@selector" pseudo-op */ + case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant */ + case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op */ case OP_NAME: case OP_EXPRSTRING: oplen = longest_to_int (expr->elts[endpos - 2].longconst); @@ -906,7 +906,7 @@ length_of_subexp (register struct expression *expr, register int endpos) /* C++ */ case OP_THIS: - case OP_SELF: + case OP_OBJC_SELF: oplen = 2; break; @@ -975,7 +975,7 @@ prefixify_subexp (register struct expression *inexpr, args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst); break; - case OP_MSGCALL: /* Objective C message (method) call */ + case OP_OBJC_MSGCALL: /* Objective C message (method) call */ oplen = 4; args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst); break; @@ -1010,8 +1010,8 @@ prefixify_subexp (register struct expression *inexpr, /* fall through */ case OP_M2_STRING: case OP_STRING: - case OP_NSSTRING: /* Objective C Foundation Class NSString constant */ - case OP_SELECTOR: /* Objective C "@selector" pseudo-op */ + case OP_OBJC_NSSTRING: /* Objective C Foundation Class NSString constant */ + case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op */ case OP_NAME: case OP_EXPRSTRING: oplen = longest_to_int (inexpr->elts[inend - 2].longconst); @@ -1050,7 +1050,7 @@ prefixify_subexp (register struct expression *inexpr, /* C++ */ case OP_THIS: - case OP_SELF: + case OP_OBJC_SELF: oplen = 2; break; diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index b522241..e675384 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -79,6 +79,14 @@ struct symtoken int is_a_field_of_this; }; +struct objc_class_str + { + struct stoken stoken; + struct type *type; + int class; + }; + + /* For parsing of complicated types. An array should be preceded in the list by the size of the array. */ enum type_pieces diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 721e05f..8e5c4f7 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "gdb_string.h" #include "frame.h" #include "inferior.h" #include "gdbcore.h" diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 6adfe29..0f6699e 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -143,10 +143,15 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc); behavior is ever fixed.) PC_IN_SIGTRAMP is called from blockframe.c as well in order to set - the signal_handler_caller flag. Because of our strange definition - of in_sigtramp below, we can't rely on signal_handler_caller + the frame's type (if a SIGTRAMP_FRAME). Because of our strange + definition of in_sigtramp below, we can't rely on the frame's type getting set correctly from within blockframe.c. This is why we - take pains to set it in init_extra_frame_info(). */ + take pains to set it in init_extra_frame_info(). + + NOTE: cagney/2002-11-10: I suspect the real problem here is that + the get_prev_frame() only initializes the frame's type after the + call to INIT_FRAME_INFO. get_prev_frame() should be fixed, this + code shouldn't be working its way around a bug :-(. */ int ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name) @@ -318,14 +323,14 @@ ppc_linux_skip_trampoline_code (CORE_ADDR pc) CORE_ADDR ppc_linux_frame_saved_pc (struct frame_info *fi) { - if (fi->signal_handler_caller) + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) { CORE_ADDR regs_addr = read_memory_integer (fi->frame + PPC_LINUX_REGS_PTR_OFFSET, 4); /* return the NIP in the regs array */ return read_memory_integer (regs_addr + 4 * PPC_LINUX_PT_NIP, 4); } - else if (fi->next && fi->next->signal_handler_caller) + else if (fi->next && (get_frame_type (fi->next) == SIGTRAMP_FRAME)) { CORE_ADDR regs_addr = read_memory_integer (fi->next->frame + PPC_LINUX_REGS_PTR_OFFSET, 4); @@ -347,9 +352,11 @@ ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *fi) this is a signal frame by looking to see if the pc points at trampoline code */ if (ppc_linux_at_sigtramp_return_path (fi->pc)) - fi->signal_handler_caller = 1; + deprecated_set_frame_type (fi, SIGTRAMP_FRAME); else - fi->signal_handler_caller = 0; + /* FIXME: cagney/2002-11-10: Is this double bogus? What + happens if the frame has previously been marked as a dummy? */ + deprecated_set_frame_type (fi, NORMAL_FRAME); } } @@ -367,7 +374,7 @@ ppc_linux_frameless_function_invocation (struct frame_info *fi) void ppc_linux_frame_init_saved_regs (struct frame_info *fi) { - if (fi->signal_handler_caller) + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) { CORE_ADDR regs_addr; int i; @@ -405,7 +412,7 @@ CORE_ADDR ppc_linux_frame_chain (struct frame_info *thisframe) { /* Kernel properly constructs the frame chain for the handler */ - if (thisframe->signal_handler_caller) + if ((get_frame_type (thisframe) == SIGTRAMP_FRAME)) return read_memory_integer ((thisframe)->frame, 4); else return rs6000_frame_chain (thisframe); @@ -719,7 +726,7 @@ ppc_linux_init_abi (struct gdbarch_info info, void _initialize_ppc_linux_tdep (void) { - gdbarch_register_osabi (bfd_arch_powerpc, GDB_OSABI_LINUX, + gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_LINUX, ppc_linux_init_abi); add_core_fns (&ppc_linux_regset_core_fns); } diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c index 3d052a8..e58bb6a 100644 --- a/gdb/ppcnbsd-tdep.c +++ b/gdb/ppcnbsd-tdep.c @@ -219,7 +219,7 @@ ppcnbsd_init_abi (struct gdbarch_info info, void _initialize_ppcnbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_powerpc, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD_ELF, ppcnbsd_init_abi); add_core_fns (&ppcnbsd_core_fns); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 4cab350..9ca17a1 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -43,7 +43,6 @@ #include "ui-out.h" #include "gdb_assert.h" #include "dictionary.h" -#include "disasm.h" extern int asm_demangle; /* Whether to demangle syms in asm printouts */ extern int addressprint; /* Whether to print hex addresses in HLL " */ @@ -628,15 +627,6 @@ build_address_symbolic (CORE_ADDR addr, /* IN */ } } - /* On some targets, add in extra "flag" bits to PC for - disassembly. This should ensure that "rounding errors" in - symbol addresses that are masked for disassembly favour the - the correct symbol. */ - -#ifdef GDB_TARGET_UNMASK_DISAS_PC - addr = GDB_TARGET_UNMASK_DISAS_PC (addr); -#endif - /* First try to find the address in the symbol table, then in the minsyms. Take the closest one. */ @@ -676,14 +666,6 @@ build_address_symbolic (CORE_ADDR addr, /* IN */ if (symbol == NULL && msymbol == NULL) return 1; - /* On some targets, mask out extra "flag" bits from PC for handsome - disassembly. */ - -#ifdef GDB_TARGET_MASK_DISAS_PC - name_location = GDB_TARGET_MASK_DISAS_PC (name_location); - addr = GDB_TARGET_MASK_DISAS_PC (addr); -#endif - /* If the nearest symbol is too far away, don't print anything symbolic. */ /* For when CORE_ADDR is larger than unsigned int, we do math in @@ -1240,14 +1222,8 @@ address_info (char *exp, int from_tty) case LOC_BLOCK: printf_filtered ("a function at address "); -#ifdef GDB_TARGET_MASK_DISAS_PC - print_address_numeric - (load_addr = GDB_TARGET_MASK_DISAS_PC (BLOCK_START (SYMBOL_BLOCK_VALUE (sym))), - 1, gdb_stdout); -#else print_address_numeric (load_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), 1, gdb_stdout); -#endif if (section_is_overlay (section)) { load_addr = overlay_unmapped_address (load_addr, section); diff --git a/gdb/regcache.h b/gdb/regcache.h index de6a321..8dfd2e9 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -159,13 +159,13 @@ extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache simple substitution is required when updating the code. The change, as far as practical, should avoid adding references to global variables (e.g., current_regcache, current_frame, - current_gdbarch or selected_frame) and instead refer to the FRAME - or REGCACHE that has been passed into the containing function as - parameters. Consequently, the change typically involves modifying - the containing function so that it takes a FRAME or REGCACHE - parameter. In the case of an architecture vector method, there - should already be a non-deprecated variant that is parameterized - with FRAME or REGCACHE. */ + current_gdbarch or deprecated_selected_frame) and instead refer to + the FRAME or REGCACHE that has been passed into the containing + function as parameters. Consequently, the change typically + involves modifying the containing function so that it takes a FRAME + or REGCACHE parameter. In the case of an architecture vector + method, there should already be a non-deprecated variant that is + parameterized with FRAME or REGCACHE. */ extern char *deprecated_grub_regcache_for_registers (struct regcache *); extern char *deprecated_grub_regcache_for_register_valid (struct regcache *); diff --git a/gdb/remote-bug.c b/gdb/remote-bug.c deleted file mode 100644 index a6ffb8e..0000000 --- a/gdb/remote-bug.c +++ /dev/null @@ -1,1027 +0,0 @@ -// OBSOLETE /* Remote debugging interface for Motorola's MVME187BUG monitor, an embedded -// OBSOLETE monitor for the m88k. -// OBSOLETE -// OBSOLETE Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -// OBSOLETE 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE Contributed by Cygnus Support. Written by K. Richard Pixley. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include "terminal.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "gdbcmd.h" -// OBSOLETE -// OBSOLETE #include "serial.h" -// OBSOLETE #include "remote-utils.h" -// OBSOLETE -// OBSOLETE /* External data declarations */ -// OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ -// OBSOLETE -// OBSOLETE /* Forward data declarations */ -// OBSOLETE extern struct target_ops bug_ops; /* Forward declaration */ -// OBSOLETE -// OBSOLETE /* Forward function declarations */ -// OBSOLETE static int bug_clear_breakpoints (void); -// OBSOLETE -// OBSOLETE static int bug_read_memory (CORE_ADDR memaddr, -// OBSOLETE unsigned char *myaddr, int len); -// OBSOLETE -// OBSOLETE static int bug_write_memory (CORE_ADDR memaddr, -// OBSOLETE unsigned char *myaddr, int len); -// OBSOLETE -// OBSOLETE /* This variable is somewhat arbitrary. It's here so that it can be -// OBSOLETE set from within a running gdb. */ -// OBSOLETE -// OBSOLETE static int srec_max_retries = 3; -// OBSOLETE -// OBSOLETE /* Each S-record download to the target consists of an S0 header -// OBSOLETE record, some number of S3 data records, and one S7 termination -// OBSOLETE record. I call this download a "frame". Srec_frame says how many -// OBSOLETE bytes will be represented in each frame. */ -// OBSOLETE -// OBSOLETE #define SREC_SIZE 160 -// OBSOLETE static int srec_frame = SREC_SIZE; -// OBSOLETE -// OBSOLETE /* This variable determines how many bytes will be represented in each -// OBSOLETE S3 s-record. */ -// OBSOLETE -// OBSOLETE static int srec_bytes = 40; -// OBSOLETE -// OBSOLETE /* At one point it appeared to me as though the bug monitor could not -// OBSOLETE really be expected to receive two sequential characters at 9600 -// OBSOLETE baud reliably. Echo-pacing is an attempt to force data across the -// OBSOLETE line even in this condition. Specifically, in echo-pace mode, each -// OBSOLETE character is sent one at a time and we look for the echo before -// OBSOLETE sending the next. This is excruciatingly slow. */ -// OBSOLETE -// OBSOLETE static int srec_echo_pace = 0; -// OBSOLETE -// OBSOLETE /* How long to wait after an srec for a possible error message. -// OBSOLETE Similar to the above, I tried sleeping after sending each S3 record -// OBSOLETE in hopes that I might actually see error messages from the bug -// OBSOLETE monitor. This might actually work if we were to use sleep -// OBSOLETE intervals smaller than 1 second. */ -// OBSOLETE -// OBSOLETE static int srec_sleep = 0; -// OBSOLETE -// OBSOLETE /* Every srec_noise records, flub the checksum. This is a debugging -// OBSOLETE feature. Set the variable to something other than 1 in order to -// OBSOLETE inject *deliberate* checksum errors. One might do this if one -// OBSOLETE wanted to test error handling and recovery. */ -// OBSOLETE -// OBSOLETE static int srec_noise = 0; -// OBSOLETE -// OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ -// OBSOLETE -// OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next -// OBSOLETE NEED_ARTIFICIAL_TRAP calls to bug_wait should just return -// OBSOLETE SIGTRAP without actually waiting for anything. */ -// OBSOLETE -// OBSOLETE static int need_artificial_trap = 0; -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Download a file specified in 'args', to the bug. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE bug_load (char *args, int fromtty) -// OBSOLETE { -// OBSOLETE bfd *abfd; -// OBSOLETE asection *s; -// OBSOLETE char buffer[1024]; -// OBSOLETE -// OBSOLETE sr_check_open (); -// OBSOLETE -// OBSOLETE inferior_ptid = null_ptid; -// OBSOLETE abfd = bfd_openr (args, 0); -// OBSOLETE if (!abfd) -// OBSOLETE { -// OBSOLETE printf_filtered ("Unable to open file %s\n", args); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (bfd_check_format (abfd, bfd_object) == 0) -// OBSOLETE { -// OBSOLETE printf_filtered ("File is not an object file\n"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE s = abfd->sections; -// OBSOLETE while (s != (asection *) NULL) -// OBSOLETE { -// OBSOLETE srec_frame = SREC_SIZE; -// OBSOLETE if (s->flags & SEC_LOAD) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE char *buffer = xmalloc (srec_frame); -// OBSOLETE -// OBSOLETE printf_filtered ("%s\t: 0x%4lx .. 0x%4lx ", s->name, s->vma, s->vma + s->_raw_size); -// OBSOLETE gdb_flush (gdb_stdout); -// OBSOLETE for (i = 0; i < s->_raw_size; i += srec_frame) -// OBSOLETE { -// OBSOLETE if (srec_frame > s->_raw_size - i) -// OBSOLETE srec_frame = s->_raw_size - i; -// OBSOLETE -// OBSOLETE bfd_get_section_contents (abfd, s, buffer, i, srec_frame); -// OBSOLETE bug_write_memory (s->vma + i, buffer, srec_frame); -// OBSOLETE printf_filtered ("*"); -// OBSOLETE gdb_flush (gdb_stdout); -// OBSOLETE } -// OBSOLETE printf_filtered ("\n"); -// OBSOLETE xfree (buffer); -// OBSOLETE } -// OBSOLETE s = s->next; -// OBSOLETE } -// OBSOLETE sprintf (buffer, "rs ip %lx", (unsigned long) abfd->start_address); -// OBSOLETE sr_write_cr (buffer); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE static char * -// OBSOLETE get_word (char **p) -// OBSOLETE { -// OBSOLETE char *s = *p; -// OBSOLETE char *word; -// OBSOLETE char *copy; -// OBSOLETE size_t len; -// OBSOLETE -// OBSOLETE while (isspace (*s)) -// OBSOLETE s++; -// OBSOLETE -// OBSOLETE word = s; -// OBSOLETE -// OBSOLETE len = 0; -// OBSOLETE -// OBSOLETE while (*s && !isspace (*s)) -// OBSOLETE { -// OBSOLETE s++; -// OBSOLETE len++; -// OBSOLETE -// OBSOLETE } -// OBSOLETE copy = xmalloc (len + 1); -// OBSOLETE memcpy (copy, word, len); -// OBSOLETE copy[len] = 0; -// OBSOLETE *p = s; -// OBSOLETE return copy; -// OBSOLETE } -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE static struct gr_settings bug_settings = -// OBSOLETE { -// OBSOLETE "Bug>", /* prompt */ -// OBSOLETE &bug_ops, /* ops */ -// OBSOLETE bug_clear_breakpoints, /* clear_all_breakpoints */ -// OBSOLETE gr_generic_checkin, /* checkin */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static char *cpu_check_strings[] = -// OBSOLETE { -// OBSOLETE "=", -// OBSOLETE "Invalid Register", -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE bug_open (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE if (args == NULL) -// OBSOLETE args = ""; -// OBSOLETE -// OBSOLETE gr_open (args, from_tty, &bug_settings); -// OBSOLETE /* decide *now* whether we are on an 88100 or an 88110 */ -// OBSOLETE sr_write_cr ("rs cr06"); -// OBSOLETE sr_expect ("rs cr06"); -// OBSOLETE -// OBSOLETE switch (gr_multi_scan (cpu_check_strings, 0)) -// OBSOLETE { -// OBSOLETE case 0: /* this is an m88100 */ -// OBSOLETE target_is_m88110 = 0; -// OBSOLETE break; -// OBSOLETE case 1: /* this is an m88110 */ -// OBSOLETE target_is_m88110 = 1; -// OBSOLETE break; -// OBSOLETE default: -// OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Tell the remote machine to resume. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE bug_resume (ptid_t ptid, int step, enum target_signal sig) -// OBSOLETE { -// OBSOLETE if (step) -// OBSOLETE { -// OBSOLETE sr_write_cr ("t"); -// OBSOLETE -// OBSOLETE /* Force the next bug_wait to return a trap. Not doing anything -// OBSOLETE about I/O from the target means that the user has to type -// OBSOLETE "continue" to see any. FIXME, this should be fixed. */ -// OBSOLETE need_artificial_trap = 1; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE sr_write_cr ("g"); -// OBSOLETE -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Wait until the remote machine stops, then return, -// OBSOLETE storing status in STATUS just as `wait' would. */ -// OBSOLETE -// OBSOLETE static char *wait_strings[] = -// OBSOLETE { -// OBSOLETE "At Breakpoint", -// OBSOLETE "Exception: Data Access Fault (Local Bus Timeout)", -// OBSOLETE "\r8??\?-Bug>", /* The '\?' avoids creating a trigraph */ -// OBSOLETE "\r197-Bug>", -// OBSOLETE NULL, -// OBSOLETE }; -// OBSOLETE -// OBSOLETE ptid_t -// OBSOLETE bug_wait (ptid_t ptid, struct target_waitstatus *status) -// OBSOLETE { -// OBSOLETE int old_timeout = sr_get_timeout (); -// OBSOLETE int old_immediate_quit = immediate_quit; -// OBSOLETE -// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; -// OBSOLETE status->value.integer = 0; -// OBSOLETE -// OBSOLETE /* read off leftovers from resume so that the rest can be passed -// OBSOLETE back out as stdout. */ -// OBSOLETE if (need_artificial_trap == 0) -// OBSOLETE { -// OBSOLETE sr_expect ("Effective address: "); -// OBSOLETE (void) sr_get_hex_word (); -// OBSOLETE sr_expect ("\r\n"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE sr_set_timeout (-1); /* Don't time out -- user program is running. */ -// OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ -// OBSOLETE -// OBSOLETE switch (gr_multi_scan (wait_strings, need_artificial_trap == 0)) -// OBSOLETE { -// OBSOLETE case 0: /* breakpoint case */ -// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; -// OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; -// OBSOLETE /* user output from the target can be discarded here. (?) */ -// OBSOLETE gr_expect_prompt (); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 1: /* bus error */ -// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; -// OBSOLETE status->value.sig = TARGET_SIGNAL_BUS; -// OBSOLETE /* user output from the target can be discarded here. (?) */ -// OBSOLETE gr_expect_prompt (); -// OBSOLETE break; -// OBSOLETE -// OBSOLETE case 2: /* normal case */ -// OBSOLETE case 3: -// OBSOLETE if (need_artificial_trap != 0) -// OBSOLETE { -// OBSOLETE /* stepping */ -// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; -// OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; -// OBSOLETE need_artificial_trap--; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* exit case */ -// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; -// OBSOLETE status->value.integer = 0; -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE case -1: /* trouble */ -// OBSOLETE default: -// OBSOLETE fprintf_filtered (gdb_stderr, -// OBSOLETE "Trouble reading target during wait\n"); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE -// OBSOLETE sr_set_timeout (old_timeout); -// OBSOLETE immediate_quit = old_immediate_quit; -// OBSOLETE return inferior_ptid; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the name of register number REGNO -// OBSOLETE in the form input and output by bug. -// OBSOLETE -// OBSOLETE Returns a pointer to a static buffer containing the answer. */ -// OBSOLETE static char * -// OBSOLETE get_reg_name (int regno) -// OBSOLETE { -// OBSOLETE static char *rn[] = -// OBSOLETE { -// OBSOLETE "r00", "r01", "r02", "r03", "r04", "r05", "r06", "r07", -// OBSOLETE "r08", "r09", "r10", "r11", "r12", "r13", "r14", "r15", -// OBSOLETE "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", -// OBSOLETE "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", -// OBSOLETE -// OBSOLETE /* these get confusing because we omit a few and switch some ordering around. */ -// OBSOLETE -// OBSOLETE "cr01", /* 32 = psr */ -// OBSOLETE "fcr62", /* 33 = fpsr */ -// OBSOLETE "fcr63", /* 34 = fpcr */ -// OBSOLETE "ip", /* this is something of a cheat. */ -// OBSOLETE /* 35 = sxip */ -// OBSOLETE "cr05", /* 36 = snip */ -// OBSOLETE "cr06", /* 37 = sfip */ -// OBSOLETE -// OBSOLETE "x00", "x01", "x02", "x03", "x04", "x05", "x06", "x07", -// OBSOLETE "x08", "x09", "x10", "x11", "x12", "x13", "x14", "x15", -// OBSOLETE "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", -// OBSOLETE "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", -// OBSOLETE }; -// OBSOLETE -// OBSOLETE return rn[regno]; -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if 0 /* not currently used */ -// OBSOLETE /* Read from remote while the input matches STRING. Return zero on -// OBSOLETE success, -1 on failure. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE bug_scan (char *s) -// OBSOLETE { -// OBSOLETE int c; -// OBSOLETE -// OBSOLETE while (*s) -// OBSOLETE { -// OBSOLETE c = sr_readchar (); -// OBSOLETE if (c != *s++) -// OBSOLETE { -// OBSOLETE fflush (stdout); -// OBSOLETE printf ("\nNext character is '%c' - %d and s is \"%s\".\n", c, c, --s); -// OBSOLETE return (-1); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE #endif /* never */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE bug_srec_write_cr (char *s) -// OBSOLETE { -// OBSOLETE char *p = s; -// OBSOLETE -// OBSOLETE if (srec_echo_pace) -// OBSOLETE for (p = s; *p; ++p) -// OBSOLETE { -// OBSOLETE if (sr_get_debug () > 0) -// OBSOLETE printf ("%c", *p); -// OBSOLETE -// OBSOLETE do -// OBSOLETE serial_write (sr_get_desc (), p, 1); -// OBSOLETE while (sr_pollchar () != *p); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE sr_write_cr (s); -// OBSOLETE /* return(bug_scan (s) || bug_scan ("\n")); */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store register REGNO, or all if REGNO == -1. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE bug_fetch_register (int regno) -// OBSOLETE { -// OBSOLETE sr_check_open (); -// OBSOLETE -// OBSOLETE if (regno == -1) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE for (i = 0; i < NUM_REGS; ++i) -// OBSOLETE bug_fetch_register (i); -// OBSOLETE } -// OBSOLETE else if (target_is_m88110 && regno == SFIP_REGNUM) -// OBSOLETE { -// OBSOLETE /* m88110 has no sfip. */ -// OBSOLETE long l = 0; -// OBSOLETE supply_register (regno, (char *) &l); -// OBSOLETE } -// OBSOLETE else if (regno < XFP_REGNUM) -// OBSOLETE { -// OBSOLETE char buffer[MAX_REGISTER_RAW_SIZE]; -// OBSOLETE -// OBSOLETE sr_write ("rs ", 3); -// OBSOLETE sr_write_cr (get_reg_name (regno)); -// OBSOLETE sr_expect ("="); -// OBSOLETE store_unsigned_integer (buffer, REGISTER_RAW_SIZE (regno), -// OBSOLETE sr_get_hex_word ()); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE supply_register (regno, buffer); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Float register so we need to parse a strange data format. */ -// OBSOLETE long p; -// OBSOLETE unsigned char fpreg_buf[10]; -// OBSOLETE -// OBSOLETE sr_write ("rs ", 3); -// OBSOLETE sr_write (get_reg_name (regno), strlen (get_reg_name (regno))); -// OBSOLETE sr_write_cr (";d"); -// OBSOLETE sr_expect ("rs"); -// OBSOLETE sr_expect (get_reg_name (regno)); -// OBSOLETE sr_expect (";d"); -// OBSOLETE sr_expect ("="); -// OBSOLETE -// OBSOLETE /* sign */ -// OBSOLETE p = sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[0] = p << 7; -// OBSOLETE -// OBSOLETE /* exponent */ -// OBSOLETE sr_expect ("_"); -// OBSOLETE p = sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[0] += (p << 4); -// OBSOLETE fpreg_buf[0] += sr_get_hex_digit (1); -// OBSOLETE -// OBSOLETE fpreg_buf[1] = sr_get_hex_digit (1) << 4; -// OBSOLETE -// OBSOLETE /* fraction */ -// OBSOLETE sr_expect ("_"); -// OBSOLETE fpreg_buf[1] += sr_get_hex_digit (1); -// OBSOLETE -// OBSOLETE fpreg_buf[2] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[3] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[4] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[5] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[6] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[7] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1); -// OBSOLETE fpreg_buf[8] = 0; -// OBSOLETE fpreg_buf[9] = 0; -// OBSOLETE -// OBSOLETE gr_expect_prompt (); -// OBSOLETE supply_register (regno, fpreg_buf); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store register REGNO, or all if REGNO == -1. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE bug_store_register (int regno) -// OBSOLETE { -// OBSOLETE char buffer[1024]; -// OBSOLETE sr_check_open (); -// OBSOLETE -// OBSOLETE if (regno == -1) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE for (i = 0; i < NUM_REGS; ++i) -// OBSOLETE bug_store_register (i); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE char *regname; -// OBSOLETE -// OBSOLETE regname = get_reg_name (regno); -// OBSOLETE -// OBSOLETE if (target_is_m88110 && regno == SFIP_REGNUM) -// OBSOLETE return; -// OBSOLETE else if (regno < XFP_REGNUM) -// OBSOLETE sprintf (buffer, "rs %s %08lx", -// OBSOLETE regname, -// OBSOLETE (long) read_register (regno)); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE unsigned char *fpreg_buf = -// OBSOLETE (unsigned char *) ®isters[REGISTER_BYTE (regno)]; -// OBSOLETE -// OBSOLETE sprintf (buffer, "rs %s %1x_%02x%1x_%1x%02x%02x%02x%02x%02x%02x;d", -// OBSOLETE regname, -// OBSOLETE /* sign */ -// OBSOLETE (fpreg_buf[0] >> 7) & 0xf, -// OBSOLETE /* exponent */ -// OBSOLETE fpreg_buf[0] & 0x7f, -// OBSOLETE (fpreg_buf[1] >> 8) & 0xf, -// OBSOLETE /* fraction */ -// OBSOLETE fpreg_buf[1] & 0xf, -// OBSOLETE fpreg_buf[2], -// OBSOLETE fpreg_buf[3], -// OBSOLETE fpreg_buf[4], -// OBSOLETE fpreg_buf[5], -// OBSOLETE fpreg_buf[6], -// OBSOLETE fpreg_buf[7]); -// OBSOLETE } -// OBSOLETE -// OBSOLETE sr_write_cr (buffer); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Transfer LEN bytes between GDB address MYADDR and target address -// OBSOLETE MEMADDR. If WRITE is non-zero, transfer them to the target, -// OBSOLETE otherwise transfer them from the target. TARGET is unused. -// OBSOLETE -// OBSOLETE Returns the number of bytes transferred. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE bug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, -// OBSOLETE struct mem_attrib *attrib, struct target_ops *target) -// OBSOLETE { -// OBSOLETE int res; -// OBSOLETE -// OBSOLETE if (len <= 0) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE if (write) -// OBSOLETE res = bug_write_memory (memaddr, myaddr, len); -// OBSOLETE else -// OBSOLETE res = bug_read_memory (memaddr, myaddr, len); -// OBSOLETE -// OBSOLETE return res; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE start_load (void) -// OBSOLETE { -// OBSOLETE char *command; -// OBSOLETE -// OBSOLETE command = (srec_echo_pace ? "lo 0 ;x" : "lo 0"); -// OBSOLETE -// OBSOLETE sr_write_cr (command); -// OBSOLETE sr_expect (command); -// OBSOLETE sr_expect ("\r\n"); -// OBSOLETE bug_srec_write_cr ("S0030000FC"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* This is an extremely vulnerable and fragile function. I've made -// OBSOLETE considerable attempts to make this deterministic, but I've -// OBSOLETE certainly forgotten something. The trouble is that S-records are -// OBSOLETE only a partial file format, not a protocol. Worse, apparently the -// OBSOLETE m88k bug monitor does not run in real time while receiving -// OBSOLETE S-records. Hence, we must pay excruciating attention to when and -// OBSOLETE where error messages are returned, and what has actually been sent. -// OBSOLETE -// OBSOLETE Each call represents a chunk of memory to be sent to the target. -// OBSOLETE We break that chunk into an S0 header record, some number of S3 -// OBSOLETE data records each containing srec_bytes, and an S7 termination -// OBSOLETE record. */ -// OBSOLETE -// OBSOLETE static char *srecord_strings[] = -// OBSOLETE { -// OBSOLETE "S-RECORD", -// OBSOLETE "-Bug>", -// OBSOLETE NULL, -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static int -// OBSOLETE bug_write_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -// OBSOLETE { -// OBSOLETE int done; -// OBSOLETE int checksum; -// OBSOLETE int x; -// OBSOLETE int retries; -// OBSOLETE char *buffer = alloca ((srec_bytes + 8) << 1); -// OBSOLETE -// OBSOLETE retries = 0; -// OBSOLETE -// OBSOLETE do -// OBSOLETE { -// OBSOLETE done = 0; -// OBSOLETE -// OBSOLETE if (retries > srec_max_retries) -// OBSOLETE return (-1); -// OBSOLETE -// OBSOLETE if (retries > 0) -// OBSOLETE { -// OBSOLETE if (sr_get_debug () > 0) -// OBSOLETE printf ("\n\n"); -// OBSOLETE -// OBSOLETE /* This gr_expect_prompt call is extremely important. Without -// OBSOLETE it, we will tend to resend our packet so fast that it -// OBSOLETE will arrive before the bug monitor is ready to receive -// OBSOLETE it. This would lead to a very ugly resend loop. */ -// OBSOLETE -// OBSOLETE gr_expect_prompt (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE start_load (); -// OBSOLETE -// OBSOLETE while (done < len) -// OBSOLETE { -// OBSOLETE int thisgo; -// OBSOLETE int idx; -// OBSOLETE char *buf = buffer; -// OBSOLETE CORE_ADDR address; -// OBSOLETE -// OBSOLETE checksum = 0; -// OBSOLETE thisgo = len - done; -// OBSOLETE if (thisgo > srec_bytes) -// OBSOLETE thisgo = srec_bytes; -// OBSOLETE -// OBSOLETE address = memaddr + done; -// OBSOLETE sprintf (buf, "S3%02X%08lX", thisgo + 4 + 1, (long) address); -// OBSOLETE buf += 12; -// OBSOLETE -// OBSOLETE checksum += (thisgo + 4 + 1 -// OBSOLETE + (address & 0xff) -// OBSOLETE + ((address >> 8) & 0xff) -// OBSOLETE + ((address >> 16) & 0xff) -// OBSOLETE + ((address >> 24) & 0xff)); -// OBSOLETE -// OBSOLETE for (idx = 0; idx < thisgo; idx++) -// OBSOLETE { -// OBSOLETE sprintf (buf, "%02X", myaddr[idx + done]); -// OBSOLETE checksum += myaddr[idx + done]; -// OBSOLETE buf += 2; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (srec_noise > 0) -// OBSOLETE { -// OBSOLETE /* FIXME-NOW: insert a deliberate error every now and then. -// OBSOLETE This is intended for testing/debugging the error handling -// OBSOLETE stuff. */ -// OBSOLETE static int counter = 0; -// OBSOLETE if (++counter > srec_noise) -// OBSOLETE { -// OBSOLETE counter = 0; -// OBSOLETE ++checksum; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE sprintf (buf, "%02X", ~checksum & 0xff); -// OBSOLETE bug_srec_write_cr (buffer); -// OBSOLETE -// OBSOLETE if (srec_sleep != 0) -// OBSOLETE sleep (srec_sleep); -// OBSOLETE -// OBSOLETE /* This pollchar is probably redundant to the gr_multi_scan -// OBSOLETE below. Trouble is, we can't be sure when or where an -// OBSOLETE error message will appear. Apparently, when running at -// OBSOLETE full speed from a typical sun4, error messages tend to -// OBSOLETE appear to arrive only *after* the s7 record. */ -// OBSOLETE -// OBSOLETE if ((x = sr_pollchar ()) != 0) -// OBSOLETE { -// OBSOLETE if (sr_get_debug () > 0) -// OBSOLETE printf ("\n\n"); -// OBSOLETE -// OBSOLETE ++retries; -// OBSOLETE -// OBSOLETE /* flush any remaining input and verify that we are back -// OBSOLETE at the prompt level. */ -// OBSOLETE gr_expect_prompt (); -// OBSOLETE /* start all over again. */ -// OBSOLETE start_load (); -// OBSOLETE done = 0; -// OBSOLETE continue; -// OBSOLETE } -// OBSOLETE -// OBSOLETE done += thisgo; -// OBSOLETE } -// OBSOLETE -// OBSOLETE bug_srec_write_cr ("S7060000000000F9"); -// OBSOLETE ++retries; -// OBSOLETE -// OBSOLETE /* Having finished the load, we need to figure out whether we -// OBSOLETE had any errors. */ -// OBSOLETE } -// OBSOLETE while (gr_multi_scan (srecord_strings, 0) == 0);; -// OBSOLETE -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR -// OBSOLETE to inferior's memory at MEMADDR. Returns errno value. -// OBSOLETE * sb/sh instructions don't work on unaligned addresses, when TU=1. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result -// OBSOLETE at debugger address MYADDR. Returns errno value. */ -// OBSOLETE static int -// OBSOLETE bug_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -// OBSOLETE { -// OBSOLETE char request[100]; -// OBSOLETE char *buffer; -// OBSOLETE char *p; -// OBSOLETE char type; -// OBSOLETE char size; -// OBSOLETE unsigned char c; -// OBSOLETE unsigned int inaddr; -// OBSOLETE unsigned int checksum; -// OBSOLETE -// OBSOLETE sprintf (request, "du 0 %lx:&%d", (long) memaddr, len); -// OBSOLETE sr_write_cr (request); -// OBSOLETE -// OBSOLETE p = buffer = alloca (len); -// OBSOLETE -// OBSOLETE /* scan up through the header */ -// OBSOLETE sr_expect ("S0030000FC"); -// OBSOLETE -// OBSOLETE while (p < buffer + len) -// OBSOLETE { -// OBSOLETE /* scan off any white space. */ -// OBSOLETE while (sr_readchar () != 'S');; -// OBSOLETE -// OBSOLETE /* what kind of s-rec? */ -// OBSOLETE type = sr_readchar (); -// OBSOLETE -// OBSOLETE /* scan record size */ -// OBSOLETE sr_get_hex_byte (&size); -// OBSOLETE checksum = size; -// OBSOLETE --size; -// OBSOLETE inaddr = 0; -// OBSOLETE -// OBSOLETE switch (type) -// OBSOLETE { -// OBSOLETE case '7': -// OBSOLETE case '8': -// OBSOLETE case '9': -// OBSOLETE goto done; -// OBSOLETE -// OBSOLETE case '3': -// OBSOLETE sr_get_hex_byte (&c); -// OBSOLETE inaddr = (inaddr << 8) + c; -// OBSOLETE checksum += c; -// OBSOLETE --size; -// OBSOLETE /* intentional fall through */ -// OBSOLETE case '2': -// OBSOLETE sr_get_hex_byte (&c); -// OBSOLETE inaddr = (inaddr << 8) + c; -// OBSOLETE checksum += c; -// OBSOLETE --size; -// OBSOLETE /* intentional fall through */ -// OBSOLETE case '1': -// OBSOLETE sr_get_hex_byte (&c); -// OBSOLETE inaddr = (inaddr << 8) + c; -// OBSOLETE checksum += c; -// OBSOLETE --size; -// OBSOLETE sr_get_hex_byte (&c); -// OBSOLETE inaddr = (inaddr << 8) + c; -// OBSOLETE checksum += c; -// OBSOLETE --size; -// OBSOLETE break; -// OBSOLETE -// OBSOLETE default: -// OBSOLETE /* bonk */ -// OBSOLETE error ("reading s-records."); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (inaddr < memaddr -// OBSOLETE || (memaddr + len) < (inaddr + size)) -// OBSOLETE error ("srec out of memory range."); -// OBSOLETE -// OBSOLETE if (p != buffer + inaddr - memaddr) -// OBSOLETE error ("srec out of sequence."); -// OBSOLETE -// OBSOLETE for (; size; --size, ++p) -// OBSOLETE { -// OBSOLETE sr_get_hex_byte (p); -// OBSOLETE checksum += *p; -// OBSOLETE } -// OBSOLETE -// OBSOLETE sr_get_hex_byte (&c); -// OBSOLETE if (c != (~checksum & 0xff)) -// OBSOLETE error ("bad s-rec checksum"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE done: -// OBSOLETE gr_expect_prompt (); -// OBSOLETE if (p != buffer + len) -// OBSOLETE return (1); -// OBSOLETE -// OBSOLETE memcpy (myaddr, buffer, len); -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define MAX_BREAKS 16 -// OBSOLETE static int num_brkpts = 0; -// OBSOLETE -// OBSOLETE /* Insert a breakpoint at ADDR. SAVE is normally the address of the -// OBSOLETE pattern buffer where the instruction that the breakpoint overwrites -// OBSOLETE is saved. It is unused here since the bug is responsible for -// OBSOLETE saving/restoring the original instruction. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE bug_insert_breakpoint (CORE_ADDR addr, char *save) -// OBSOLETE { -// OBSOLETE sr_check_open (); -// OBSOLETE -// OBSOLETE if (num_brkpts < MAX_BREAKS) -// OBSOLETE { -// OBSOLETE char buffer[100]; -// OBSOLETE -// OBSOLETE num_brkpts++; -// OBSOLETE sprintf (buffer, "br %lx", (long) addr); -// OBSOLETE sr_write_cr (buffer); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fprintf_filtered (gdb_stderr, -// OBSOLETE "Too many break points, break point not installed\n"); -// OBSOLETE return (1); -// OBSOLETE } -// OBSOLETE -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Remove a breakpoint at ADDR. SAVE is normally the previously -// OBSOLETE saved pattern, but is unused here since the bug is responsible -// OBSOLETE for saving/restoring instructions. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE bug_remove_breakpoint (CORE_ADDR addr, char *save) -// OBSOLETE { -// OBSOLETE if (num_brkpts > 0) -// OBSOLETE { -// OBSOLETE char buffer[100]; -// OBSOLETE -// OBSOLETE num_brkpts--; -// OBSOLETE sprintf (buffer, "nobr %lx", (long) addr); -// OBSOLETE sr_write_cr (buffer); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE -// OBSOLETE } -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Clear the bugs notion of what the break points are */ -// OBSOLETE static int -// OBSOLETE bug_clear_breakpoints (void) -// OBSOLETE { -// OBSOLETE -// OBSOLETE if (sr_is_open ()) -// OBSOLETE { -// OBSOLETE sr_write_cr ("nobr"); -// OBSOLETE sr_expect ("nobr"); -// OBSOLETE gr_expect_prompt (); -// OBSOLETE } -// OBSOLETE num_brkpts = 0; -// OBSOLETE return (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE struct target_ops bug_ops; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE init_bug_ops (void) -// OBSOLETE { -// OBSOLETE bug_ops.to_shortname = "bug"; -// OBSOLETE "Remote BUG monitor", -// OBSOLETE bug_ops.to_longname = "Use the mvme187 board running the BUG monitor connected by a serial line."; -// OBSOLETE bug_ops.to_doc = " "; -// OBSOLETE bug_ops.to_open = bug_open; -// OBSOLETE bug_ops.to_close = gr_close; -// OBSOLETE bug_ops.to_attach = 0; -// OBSOLETE bug_ops.to_post_attach = NULL; -// OBSOLETE bug_ops.to_require_attach = NULL; -// OBSOLETE bug_ops.to_detach = gr_detach; -// OBSOLETE bug_ops.to_require_detach = NULL; -// OBSOLETE bug_ops.to_resume = bug_resume; -// OBSOLETE bug_ops.to_wait = bug_wait; -// OBSOLETE bug_ops.to_post_wait = NULL; -// OBSOLETE bug_ops.to_fetch_registers = bug_fetch_register; -// OBSOLETE bug_ops.to_store_registers = bug_store_register; -// OBSOLETE bug_ops.to_prepare_to_store = gr_prepare_to_store; -// OBSOLETE bug_ops.to_xfer_memory = bug_xfer_memory; -// OBSOLETE bug_ops.to_files_info = gr_files_info; -// OBSOLETE bug_ops.to_insert_breakpoint = bug_insert_breakpoint; -// OBSOLETE bug_ops.to_remove_breakpoint = bug_remove_breakpoint; -// OBSOLETE bug_ops.to_terminal_init = 0; -// OBSOLETE bug_ops.to_terminal_inferior = 0; -// OBSOLETE bug_ops.to_terminal_ours_for_output = 0; -// OBSOLETE bug_ops.to_terminal_ours = 0; -// OBSOLETE bug_ops.to_terminal_info = 0; -// OBSOLETE bug_ops.to_kill = gr_kill; -// OBSOLETE bug_ops.to_load = bug_load; -// OBSOLETE bug_ops.to_lookup_symbol = 0; -// OBSOLETE bug_ops.to_create_inferior = gr_create_inferior; -// OBSOLETE bug_ops.to_post_startup_inferior = NULL; -// OBSOLETE bug_ops.to_acknowledge_created_inferior = NULL; -// OBSOLETE bug_ops.to_clone_and_follow_inferior = NULL; -// OBSOLETE bug_ops.to_post_follow_inferior_by_clone = NULL; -// OBSOLETE bug_ops.to_insert_fork_catchpoint = NULL; -// OBSOLETE bug_ops.to_remove_fork_catchpoint = NULL; -// OBSOLETE bug_ops.to_insert_vfork_catchpoint = NULL; -// OBSOLETE bug_ops.to_remove_vfork_catchpoint = NULL; -// OBSOLETE bug_ops.to_has_forked = NULL; -// OBSOLETE bug_ops.to_has_vforked = NULL; -// OBSOLETE bug_ops.to_can_follow_vfork_prior_to_exec = NULL; -// OBSOLETE bug_ops.to_post_follow_vfork = NULL; -// OBSOLETE bug_ops.to_insert_exec_catchpoint = NULL; -// OBSOLETE bug_ops.to_remove_exec_catchpoint = NULL; -// OBSOLETE bug_ops.to_has_execd = NULL; -// OBSOLETE bug_ops.to_reported_exec_events_per_exec_call = NULL; -// OBSOLETE bug_ops.to_has_exited = NULL; -// OBSOLETE bug_ops.to_mourn_inferior = gr_mourn; -// OBSOLETE bug_ops.to_can_run = 0; -// OBSOLETE bug_ops.to_notice_signals = 0; -// OBSOLETE bug_ops.to_thread_alive = 0; -// OBSOLETE bug_ops.to_stop = 0; -// OBSOLETE bug_ops.to_pid_to_exec_file = NULL; -// OBSOLETE bug_ops.to_stratum = process_stratum; -// OBSOLETE bug_ops.DONT_USE = 0; -// OBSOLETE bug_ops.to_has_all_memory = 1; -// OBSOLETE bug_ops.to_has_memory = 1; -// OBSOLETE bug_ops.to_has_stack = 1; -// OBSOLETE bug_ops.to_has_registers = 0; -// OBSOLETE bug_ops.to_has_execution = 0; -// OBSOLETE bug_ops.to_sections = 0; -// OBSOLETE bug_ops.to_sections_end = 0; -// OBSOLETE bug_ops.to_magic = OPS_MAGIC; /* Always the last thing */ -// OBSOLETE } /* init_bug_ops */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_remote_bug (void) -// OBSOLETE { -// OBSOLETE init_bug_ops (); -// OBSOLETE add_target (&bug_ops); -// OBSOLETE -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-bytes", class_support, var_uinteger, -// OBSOLETE (char *) &srec_bytes, -// OBSOLETE "\ -// OBSOLETE Set the number of bytes represented in each S-record.\n\ -// OBSOLETE This affects the communication protocol with the remote target.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-max-retries", class_support, var_uinteger, -// OBSOLETE (char *) &srec_max_retries, -// OBSOLETE "\ -// OBSOLETE Set the number of retries for shipping S-records.\n\ -// OBSOLETE This affects the communication protocol with the remote target.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE /* This needs to set SREC_SIZE, not srec_frame which gets changed at the -// OBSOLETE end of a download. But do we need the option at all? */ -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-frame", class_support, var_uinteger, -// OBSOLETE (char *) &srec_frame, -// OBSOLETE "\ -// OBSOLETE Set the number of bytes in an S-record frame.\n\ -// OBSOLETE This affects the communication protocol with the remote target.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE #endif /* 0 */ -// OBSOLETE -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-noise", class_support, var_zinteger, -// OBSOLETE (char *) &srec_noise, -// OBSOLETE "\ -// OBSOLETE Set number of S-record to send before deliberately flubbing a checksum.\n\ -// OBSOLETE Zero means flub none at all. This affects the communication protocol\n\ -// OBSOLETE with the remote target.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-sleep", class_support, var_zinteger, -// OBSOLETE (char *) &srec_sleep, -// OBSOLETE "\ -// OBSOLETE Set number of seconds to sleep after an S-record for a possible error message to arrive.\n\ -// OBSOLETE This affects the communication protocol with the remote target.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set -// OBSOLETE (add_set_cmd ("srec-echo-pace", class_support, var_boolean, -// OBSOLETE (char *) &srec_echo_pace, -// OBSOLETE "\ -// OBSOLETE Set echo-verification.\n\ -// OBSOLETE When on, use verification by echo when downloading S-records. This is\n\ -// OBSOLETE much slower, but generally more reliable.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE } diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 33e5c00..49909b1 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -629,9 +629,7 @@ e7000_start_remote (void *dummy) flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - set_current_frame (create_new_frame (read_fp (), stop_pc)); - select_frame (get_current_frame ()); - print_stack_frame (selected_frame, -1, 1); + print_stack_frame (get_selected_frame (), -1, 1); return 1; } diff --git a/gdb/remote-est.c b/gdb/remote-est.c index 0a1d7af..93eddc9 100644 --- a/gdb/remote-est.c +++ b/gdb/remote-est.c @@ -30,6 +30,8 @@ #include "serial.h" #include "regcache.h" +#include "m68k-tdep.h" + static void est_open (char *args, int from_tty); static void @@ -55,12 +57,12 @@ est_supply_register (char *regname, int regnamelen, char *val, int vallen) case 'D': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + D0_REGNUM; + regno = regname[1] - '0' + M68K_D0_REGNUM; break; case 'A': if (regname[1] < '0' || regname[1] > '7') return; - regno = regname[1] - '0' + A0_REGNUM; + regno = regname[1] - '0' + M68K_A0_REGNUM; break; default: return; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index abd590b..044746d 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1494,8 +1494,10 @@ mips_initialize (void) the request itself succeeds or fails. */ mips_request ('r', 0, 0, &err, mips_receive_wait, NULL); - set_current_frame (create_new_frame (read_fp (), read_pc ())); - select_frame (get_current_frame ()); + /* FIXME: cagney/2002-11-29: Force the update of selected frame. + This shouldn't be necessary, only many many places still refer to + selected_frame directly (instead of using get_selected_frame(). */ + get_selected_frame (); /* Hack!!! */ } /* Open a connection to the remote board. */ @@ -1612,17 +1614,15 @@ device is attached to the target board (e.g., /dev/ttya).\n" if (ptype) mips_set_processor_type_command (xstrdup (ptype), 0); -/* This is really the job of start_remote however, that makes an assumption - that the target is about to print out a status message of some sort. That - doesn't happen here (in fact, it may not be possible to get the monitor to - send the appropriate packet). */ + /* This is really the job of start_remote however, that makes an + assumption that the target is about to print out a status message + of some sort. That doesn't happen here (in fact, it may not be + possible to get the monitor to send the appropriate packet). */ flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - set_current_frame (create_new_frame (read_fp (), stop_pc)); - select_frame (get_current_frame ()); - print_stack_frame (selected_frame, -1, 1); + print_stack_frame (get_selected_frame (), -1, 1); xfree (serial_port_name); } diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c deleted file mode 100644 index ffbe7d8..0000000 --- a/gdb/remote-nindy.c +++ /dev/null @@ -1,762 +0,0 @@ -// OBSOLETE /* Memory-access and commands for remote NINDY process, for GDB. -// OBSOLETE -// OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, -// OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE Contributed by Intel Corporation. Modified from remote.c by Chris Benenati. -// OBSOLETE -// OBSOLETE GDB is distributed in the hope that it will be useful, but WITHOUT ANY -// OBSOLETE WARRANTY. No author or distributor accepts responsibility to anyone -// OBSOLETE for the consequences of using it or for whether it serves any -// OBSOLETE particular purpose or works at all, unless he says so in writing. -// OBSOLETE Refer to the GDB General Public License for full details. -// OBSOLETE -// OBSOLETE Everyone is granted permission to copy, modify and redistribute GDB, -// OBSOLETE but only under the conditions described in the GDB General Public -// OBSOLETE License. A copy of this license is supposed to have been given to you -// OBSOLETE along with GDB so you can know your rights and responsibilities. It -// OBSOLETE should be in a file named COPYING. Among other things, the copyright -// OBSOLETE notice and this notice must be preserved on all copies. -// OBSOLETE -// OBSOLETE In other words, go ahead and share GDB, but don't try to stop -// OBSOLETE anyone else from sharing it farther. Help stamp out software hoarding! */ -// OBSOLETE -// OBSOLETE /* -// OBSOLETE Except for the data cache routines, this file bears little resemblence -// OBSOLETE to remote.c. A new (although similar) protocol has been specified, and -// OBSOLETE portions of the code are entirely dependent on having an i80960 with a -// OBSOLETE NINDY ROM monitor at the other end of the line. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /***************************************************************************** -// OBSOLETE * -// OBSOLETE * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR. -// OBSOLETE * -// OBSOLETE * -// OBSOLETE * MODES OF OPERATION -// OBSOLETE * ----- -- --------- -// OBSOLETE * -// OBSOLETE * As far as NINDY is concerned, GDB is always in one of two modes: command -// OBSOLETE * mode or passthrough mode. -// OBSOLETE * -// OBSOLETE * In command mode (the default) pre-defined packets containing requests -// OBSOLETE * are sent by GDB to NINDY. NINDY never talks except in reponse to a request. -// OBSOLETE * -// OBSOLETE * Once the the user program is started, GDB enters passthrough mode, to give -// OBSOLETE * the user program access to the terminal. GDB remains in this mode until -// OBSOLETE * NINDY indicates that the program has stopped. -// OBSOLETE * -// OBSOLETE * -// OBSOLETE * PASSTHROUGH MODE -// OBSOLETE * ----------- ---- -// OBSOLETE * -// OBSOLETE * GDB writes all input received from the keyboard directly to NINDY, and writes -// OBSOLETE * all characters received from NINDY directly to the monitor. -// OBSOLETE * -// OBSOLETE * Keyboard input is neither buffered nor echoed to the monitor. -// OBSOLETE * -// OBSOLETE * GDB remains in passthrough mode until NINDY sends a single ^P character, -// OBSOLETE * to indicate that the user process has stopped. -// OBSOLETE * -// OBSOLETE * Note: -// OBSOLETE * GDB assumes NINDY performs a 'flushreg' when the user program stops. -// OBSOLETE * -// OBSOLETE * -// OBSOLETE * COMMAND MODE -// OBSOLETE * ------- ---- -// OBSOLETE * -// OBSOLETE * All info (except for message ack and nak) is transferred between gdb -// OBSOLETE * and the remote processor in messages of the following format: -// OBSOLETE * -// OBSOLETE * # -// OBSOLETE * -// OBSOLETE * where -// OBSOLETE * # is a literal character -// OBSOLETE * -// OBSOLETE * ASCII information; all numeric information is in the -// OBSOLETE * form of hex digits ('0'-'9' and lowercase 'a'-'f'). -// OBSOLETE * -// OBSOLETE * -// OBSOLETE * is a pair of ASCII hex digits representing an 8-bit -// OBSOLETE * checksum formed by adding together each of the -// OBSOLETE * characters in . -// OBSOLETE * -// OBSOLETE * The receiver of a message always sends a single character to the sender -// OBSOLETE * to indicate that the checksum was good ('+') or bad ('-'); the sender -// OBSOLETE * re-transmits the entire message over until a '+' is received. -// OBSOLETE * -// OBSOLETE * In response to a command NINDY always sends back either data or -// OBSOLETE * a result code of the form "Xnn", where "nn" are hex digits and "X00" -// OBSOLETE * means no errors. (Exceptions: the "s" and "c" commands don't respond.) -// OBSOLETE * -// OBSOLETE * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A -// OBSOLETE * FULL DESCRIPTION OF LEGAL COMMANDS. -// OBSOLETE * -// OBSOLETE * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST -// OBSOLETE * OF STOP CODES. -// OBSOLETE * -// OBSOLETE ***************************************************************************/ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "bfd.h" -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "command.h" -// OBSOLETE #include "floatformat.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include "serial.h" -// OBSOLETE #include "nindy-share/env.h" -// OBSOLETE #include "nindy-share/stop.h" -// OBSOLETE #include "remote-utils.h" -// OBSOLETE -// OBSOLETE extern int unlink (); -// OBSOLETE extern char *getenv (); -// OBSOLETE extern char *mktemp (); -// OBSOLETE -// OBSOLETE extern void generic_mourn_inferior (); -// OBSOLETE -// OBSOLETE extern struct target_ops nindy_ops; -// OBSOLETE extern FILE *instream; -// OBSOLETE -// OBSOLETE extern char ninStopWhy (); -// OBSOLETE extern int ninMemGet (); -// OBSOLETE extern int ninMemPut (); -// OBSOLETE -// OBSOLETE int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */ -// OBSOLETE int nindy_old_protocol; /* nonzero if want to use old protocol */ -// OBSOLETE char *nindy_ttyname; /* name of tty to talk to nindy on, or null */ -// OBSOLETE -// OBSOLETE #define DLE '\020' /* Character NINDY sends to indicate user program has -// OBSOLETE * halted. */ -// OBSOLETE #define TRUE 1 -// OBSOLETE #define FALSE 0 -// OBSOLETE -// OBSOLETE /* From nindy-share/nindy.c. */ -// OBSOLETE extern struct serial *nindy_serial; -// OBSOLETE -// OBSOLETE static int have_regs = 0; /* 1 iff regs read since i960 last halted */ -// OBSOLETE static int regs_changed = 0; /* 1 iff regs were modified since last read */ -// OBSOLETE -// OBSOLETE extern char *exists (); -// OBSOLETE -// OBSOLETE static void nindy_fetch_registers (int); -// OBSOLETE -// OBSOLETE static void nindy_store_registers (int); -// OBSOLETE -// OBSOLETE static char *savename; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_close (int quitting) -// OBSOLETE { -// OBSOLETE if (nindy_serial != NULL) -// OBSOLETE serial_close (nindy_serial); -// OBSOLETE nindy_serial = NULL; -// OBSOLETE -// OBSOLETE if (savename) -// OBSOLETE xfree (savename); -// OBSOLETE savename = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Open a connection to a remote debugger. -// OBSOLETE FIXME, there should be "set" commands for the options that are -// OBSOLETE now specified with gdb command-line options (old_protocol, -// OBSOLETE and initial_brk). */ -// OBSOLETE void -// OBSOLETE nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */ -// OBSOLETE int from_tty) -// OBSOLETE { -// OBSOLETE char baudrate[1024]; -// OBSOLETE -// OBSOLETE if (!name) -// OBSOLETE error_no_arg ("serial port device name"); -// OBSOLETE -// OBSOLETE target_preopen (from_tty); -// OBSOLETE -// OBSOLETE nindy_close (0); -// OBSOLETE -// OBSOLETE have_regs = regs_changed = 0; -// OBSOLETE -// OBSOLETE /* Allow user to interrupt the following -- we could hang if there's -// OBSOLETE no NINDY at the other end of the remote tty. */ -// OBSOLETE immediate_quit++; -// OBSOLETE /* If baud_rate is -1, then ninConnect will not recognize the baud rate -// OBSOLETE and will deal with the situation in a (more or less) reasonable -// OBSOLETE fashion. */ -// OBSOLETE sprintf (baudrate, "%d", baud_rate); -// OBSOLETE ninConnect (name, baudrate, -// OBSOLETE nindy_initial_brk, !from_tty, nindy_old_protocol); -// OBSOLETE immediate_quit--; -// OBSOLETE -// OBSOLETE if (nindy_serial == NULL) -// OBSOLETE { -// OBSOLETE perror_with_name (name); -// OBSOLETE } -// OBSOLETE -// OBSOLETE savename = savestring (name, strlen (name)); -// OBSOLETE push_target (&nindy_ops); -// OBSOLETE -// OBSOLETE target_fetch_registers (-1); -// OBSOLETE -// OBSOLETE init_thread_list (); -// OBSOLETE init_wait_for_inferior (); -// OBSOLETE clear_proceed_status (); -// OBSOLETE normal_stop (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* User-initiated quit of nindy operations. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_detach (char *name, int from_tty) -// OBSOLETE { -// OBSOLETE if (name) -// OBSOLETE error ("Too many arguments"); -// OBSOLETE pop_target (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_files_info (void) -// OBSOLETE { -// OBSOLETE /* FIXME: this lies about the baud rate if we autobauded. */ -// OBSOLETE printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename, -// OBSOLETE baud_rate, -// OBSOLETE nindy_old_protocol ? " in old protocol" : "", -// OBSOLETE nindy_initial_brk ? " with initial break" : ""); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the number of characters in the buffer BUF before -// OBSOLETE the first DLE character. N is maximum number of characters to -// OBSOLETE consider. */ -// OBSOLETE -// OBSOLETE static -// OBSOLETE int -// OBSOLETE non_dle (char *buf, int n) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE for (i = 0; i < n; i++) -// OBSOLETE { -// OBSOLETE if (buf[i] == DLE) -// OBSOLETE { -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE return i; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Tell the remote machine to resume. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE nindy_resume (ptid_t ptid, int step, enum target_signal siggnal) -// OBSOLETE { -// OBSOLETE if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal) -// OBSOLETE warning ("Can't send signals to remote NINDY targets."); -// OBSOLETE -// OBSOLETE if (regs_changed) -// OBSOLETE { -// OBSOLETE nindy_store_registers (-1); -// OBSOLETE regs_changed = 0; -// OBSOLETE } -// OBSOLETE have_regs = 0; -// OBSOLETE ninGo (step); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* FIXME, we can probably use the normal terminal_inferior stuff here. -// OBSOLETE We have to do terminal_inferior and then set up the passthrough -// OBSOLETE settings initially. Thereafter, terminal_ours and terminal_inferior -// OBSOLETE will automatically swap the settings around for us. */ -// OBSOLETE -// OBSOLETE struct clean_up_tty_args -// OBSOLETE { -// OBSOLETE serial_ttystate state; -// OBSOLETE struct serial *serial; -// OBSOLETE }; -// OBSOLETE static struct clean_up_tty_args tty_args; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE clean_up_tty (PTR ptrarg) -// OBSOLETE { -// OBSOLETE struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg; -// OBSOLETE serial_set_tty_state (args->serial, args->state); -// OBSOLETE xfree (args->state); -// OBSOLETE warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Recover from ^Z or ^C while remote process is running */ -// OBSOLETE static void (*old_ctrlc) (); -// OBSOLETE #ifdef SIGTSTP -// OBSOLETE static void (*old_ctrlz) (); -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE static void -// OBSOLETE clean_up_int (void) -// OBSOLETE { -// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state); -// OBSOLETE xfree (tty_args.state); -// OBSOLETE -// OBSOLETE signal (SIGINT, old_ctrlc); -// OBSOLETE #ifdef SIGTSTP -// OBSOLETE signal (SIGTSTP, old_ctrlz); -// OBSOLETE #endif -// OBSOLETE error ("\n\nYou may need to reset the 80960 and/or reload your program.\n"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Wait until the remote machine stops. While waiting, operate in passthrough -// OBSOLETE * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from -// OBSOLETE * stdin to NINDY. -// OBSOLETE * -// OBSOLETE * Return to caller, storing status in 'status' just as `wait' would. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static ptid_t -// OBSOLETE nindy_wait (ptid_t ptid, struct target_waitstatus *status) -// OBSOLETE { -// OBSOLETE fd_set fds; -// OBSOLETE int c; -// OBSOLETE char buf[2]; -// OBSOLETE int i, n; -// OBSOLETE unsigned char stop_exit; -// OBSOLETE unsigned char stop_code; -// OBSOLETE struct cleanup *old_cleanups; -// OBSOLETE long ip_value, fp_value, sp_value; /* Reg values from stop */ -// OBSOLETE -// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; -// OBSOLETE status->value.integer = 0; -// OBSOLETE -// OBSOLETE /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */ -// OBSOLETE -// OBSOLETE /* Save current tty attributes, and restore them when done. */ -// OBSOLETE tty_args.serial = serial_fdopen (0); -// OBSOLETE tty_args.state = serial_get_tty_state (tty_args.serial); -// OBSOLETE old_ctrlc = signal (SIGINT, clean_up_int); -// OBSOLETE #ifdef SIGTSTP -// OBSOLETE old_ctrlz = signal (SIGTSTP, clean_up_int); -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE old_cleanups = make_cleanup (clean_up_tty, &tty_args); -// OBSOLETE -// OBSOLETE /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret -// OBSOLETE and perform echo. */ -// OBSOLETE /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close -// OBSOLETE enough. */ -// OBSOLETE serial_raw (tty_args.serial); -// OBSOLETE -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE /* Input on remote */ -// OBSOLETE c = serial_readchar (nindy_serial, -1); -// OBSOLETE if (c == SERIAL_ERROR) -// OBSOLETE { -// OBSOLETE error ("Cannot read from serial line"); -// OBSOLETE } -// OBSOLETE else if (c == 0x1b) /* ESC */ -// OBSOLETE { -// OBSOLETE c = serial_readchar (nindy_serial, -1); -// OBSOLETE c &= ~0x40; -// OBSOLETE } -// OBSOLETE else if (c != 0x10) /* DLE */ -// OBSOLETE /* Write out any characters preceding DLE */ -// OBSOLETE { -// OBSOLETE buf[0] = (char) c; -// OBSOLETE write (1, buf, 1); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE stop_exit = ninStopWhy (&stop_code, -// OBSOLETE &ip_value, &fp_value, &sp_value); -// OBSOLETE if (!stop_exit && (stop_code == STOP_SRQ)) -// OBSOLETE { -// OBSOLETE immediate_quit++; -// OBSOLETE ninSrq (); -// OBSOLETE immediate_quit--; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* Get out of loop */ -// OBSOLETE supply_register (IP_REGNUM, -// OBSOLETE (char *) &ip_value); -// OBSOLETE supply_register (FP_REGNUM, -// OBSOLETE (char *) &fp_value); -// OBSOLETE supply_register (SP_REGNUM, -// OBSOLETE (char *) &sp_value); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE serial_set_tty_state (tty_args.serial, tty_args.state); -// OBSOLETE xfree (tty_args.state); -// OBSOLETE discard_cleanups (old_cleanups); -// OBSOLETE -// OBSOLETE if (stop_exit) -// OBSOLETE { -// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; -// OBSOLETE status->value.integer = stop_code; -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE /* nindy has some special stop code need to be handled */ -// OBSOLETE if (stop_code == STOP_GDB_BPT) -// OBSOLETE stop_code = TRACE_STEP; -// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; -// OBSOLETE status->value.sig = i960_fault_to_signal (stop_code); -// OBSOLETE } -// OBSOLETE return inferior_ptid; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read the remote registers into the block REGS. */ -// OBSOLETE -// OBSOLETE /* This is the block that ninRegsGet and ninRegsPut handles. */ -// OBSOLETE struct nindy_regs -// OBSOLETE { -// OBSOLETE char local_regs[16 * 4]; -// OBSOLETE char global_regs[16 * 4]; -// OBSOLETE char pcw_acw[2 * 4]; -// OBSOLETE char ip[4]; -// OBSOLETE char tcw[4]; -// OBSOLETE char fp_as_double[4 * 8]; -// OBSOLETE }; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_fetch_registers (int regno) -// OBSOLETE { -// OBSOLETE struct nindy_regs nindy_regs; -// OBSOLETE int regnum; -// OBSOLETE -// OBSOLETE immediate_quit++; -// OBSOLETE ninRegsGet ((char *) &nindy_regs); -// OBSOLETE immediate_quit--; -// OBSOLETE -// OBSOLETE memcpy (®isters[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4); -// OBSOLETE memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8); -// OBSOLETE -// OBSOLETE registers_fetched (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_prepare_to_store (void) -// OBSOLETE { -// OBSOLETE /* Fetch all regs if they aren't already here. */ -// OBSOLETE read_register_bytes (0, NULL, REGISTER_BYTES); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_store_registers (int regno) -// OBSOLETE { -// OBSOLETE struct nindy_regs nindy_regs; -// OBSOLETE int regnum; -// OBSOLETE -// OBSOLETE memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * 4); -// OBSOLETE memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * 4); -// OBSOLETE memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2 * 4); -// OBSOLETE memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1 * 4); -// OBSOLETE memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1 * 4); -// OBSOLETE memcpy (nindy_regs.fp_as_double, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8 * 4); -// OBSOLETE -// OBSOLETE immediate_quit++; -// OBSOLETE ninRegsPut ((char *) &nindy_regs); -// OBSOLETE immediate_quit--; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Copy LEN bytes to or from inferior's memory starting at MEMADDR -// OBSOLETE to debugger memory starting at MYADDR. Copy to inferior if -// OBSOLETE SHOULD_WRITE is nonzero. Returns the length copied. TARGET is -// OBSOLETE unused. */ -// OBSOLETE -// OBSOLETE int -// OBSOLETE nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, -// OBSOLETE int should_write, struct mem_attrib *attrib, -// OBSOLETE struct target_ops *target) -// OBSOLETE { -// OBSOLETE int res; -// OBSOLETE -// OBSOLETE if (len <= 0) -// OBSOLETE return 0; -// OBSOLETE -// OBSOLETE if (should_write) -// OBSOLETE res = ninMemPut (memaddr, myaddr, len); -// OBSOLETE else -// OBSOLETE res = ninMemGet (memaddr, myaddr, len); -// OBSOLETE -// OBSOLETE return res; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_create_inferior (char *execfile, char *args, char **env) -// OBSOLETE { -// OBSOLETE int entry_pt; -// OBSOLETE int pid; -// OBSOLETE -// OBSOLETE if (args && *args) -// OBSOLETE error ("Can't pass arguments to remote NINDY process"); -// OBSOLETE -// OBSOLETE if (execfile == 0 || exec_bfd == 0) -// OBSOLETE error ("No executable file specified"); -// OBSOLETE -// OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd); -// OBSOLETE -// OBSOLETE pid = 42; -// OBSOLETE -// OBSOLETE /* The "process" (board) is already stopped awaiting our commands, and -// OBSOLETE the program is already downloaded. We just set its PC and go. */ -// OBSOLETE -// OBSOLETE inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */ -// OBSOLETE -// OBSOLETE clear_proceed_status (); -// OBSOLETE -// OBSOLETE /* Tell wait_for_inferior that we've started a new process. */ -// OBSOLETE init_wait_for_inferior (); -// OBSOLETE -// OBSOLETE /* Set up the "saved terminal modes" of the inferior -// OBSOLETE based on what modes we are starting it with. */ -// OBSOLETE target_terminal_init (); -// OBSOLETE -// OBSOLETE /* Install inferior's terminal modes. */ -// OBSOLETE target_terminal_inferior (); -// OBSOLETE -// OBSOLETE /* insert_step_breakpoint (); FIXME, do we need this? */ -// OBSOLETE /* Let 'er rip... */ -// OBSOLETE proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE reset_command (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE if (nindy_serial == NULL) -// OBSOLETE { -// OBSOLETE error ("No target system to reset -- use 'target nindy' command."); -// OBSOLETE } -// OBSOLETE if (query ("Really reset the target system?", 0, 0)) -// OBSOLETE { -// OBSOLETE serial_send_break (nindy_serial); -// OBSOLETE tty_flush (nindy_serial); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE nindy_kill (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE return; /* Ignore attempts to kill target system */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Clean up when a program exits. -// OBSOLETE -// OBSOLETE The program actually lives on in the remote processor's RAM, and may be -// OBSOLETE run again without a download. Don't leave it full of breakpoint -// OBSOLETE instructions. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE nindy_mourn_inferior (void) -// OBSOLETE { -// OBSOLETE remove_breakpoints (); -// OBSOLETE unpush_target (&nindy_ops); -// OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Pass the args the way catch_errors wants them. */ -// OBSOLETE static int -// OBSOLETE nindy_open_stub (char *arg) -// OBSOLETE { -// OBSOLETE nindy_open (arg, 1); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nindy_load (char *filename, int from_tty) -// OBSOLETE { -// OBSOLETE asection *s; -// OBSOLETE /* Can't do unix style forking on a VMS system, so we'll use bfd to do -// OBSOLETE all the work for us -// OBSOLETE */ -// OBSOLETE -// OBSOLETE bfd *file = bfd_openr (filename, 0); -// OBSOLETE if (!file) -// OBSOLETE { -// OBSOLETE perror_with_name (filename); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (!bfd_check_format (file, bfd_object)) -// OBSOLETE { -// OBSOLETE error ("can't prove it's an object file\n"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE for (s = file->sections; s; s = s->next) -// OBSOLETE { -// OBSOLETE if (s->flags & SEC_LOAD) -// OBSOLETE { -// OBSOLETE char *buffer = xmalloc (s->_raw_size); -// OBSOLETE bfd_get_section_contents (file, s, buffer, 0, s->_raw_size); -// OBSOLETE printf ("Loading section %s, size %x vma %x\n", -// OBSOLETE s->name, -// OBSOLETE s->_raw_size, -// OBSOLETE s->vma); -// OBSOLETE ninMemPut (s->vma, buffer, s->_raw_size); -// OBSOLETE xfree (buffer); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE bfd_close (file); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static int -// OBSOLETE load_stub (char *arg) -// OBSOLETE { -// OBSOLETE target_load (arg, 1); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* This routine is run as a hook, just before the main command loop is -// OBSOLETE entered. If gdb is configured for the i960, but has not had its -// OBSOLETE nindy target specified yet, this will loop prompting the user to do so. -// OBSOLETE -// OBSOLETE Unlike the loop provided by Intel, we actually let the user get out -// OBSOLETE of this with a RETURN. This is useful when e.g. simply examining -// OBSOLETE an i960 object file on the host system. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE nindy_before_main_loop (void) -// OBSOLETE { -// OBSOLETE char ttyname[100]; -// OBSOLETE char *p, *p2; -// OBSOLETE -// OBSOLETE while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */ -// OBSOLETE { /* remote tty not specified yet */ -// OBSOLETE if (instream == stdin) -// OBSOLETE { -// OBSOLETE printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: "); -// OBSOLETE gdb_flush (gdb_stdout); -// OBSOLETE } -// OBSOLETE fgets (ttyname, sizeof (ttyname) - 1, stdin); -// OBSOLETE -// OBSOLETE /* Strip leading and trailing whitespace */ -// OBSOLETE for (p = ttyname; isspace (*p); p++) -// OBSOLETE { -// OBSOLETE ; -// OBSOLETE } -// OBSOLETE if (*p == '\0') -// OBSOLETE { -// OBSOLETE return; /* User just hit spaces or return, wants out */ -// OBSOLETE } -// OBSOLETE for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++) -// OBSOLETE { -// OBSOLETE ; -// OBSOLETE } -// OBSOLETE *p2 = '\0'; -// OBSOLETE if (STREQ ("quit", p)) -// OBSOLETE { -// OBSOLETE exit (1); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL)) -// OBSOLETE { -// OBSOLETE /* Now that we have a tty open for talking to the remote machine, -// OBSOLETE download the executable file if one was specified. */ -// OBSOLETE if (exec_bfd) -// OBSOLETE { -// OBSOLETE catch_errors (load_stub, bfd_get_filename (exec_bfd), "", -// OBSOLETE RETURN_MASK_ALL); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Define the target subroutine names */ -// OBSOLETE -// OBSOLETE struct target_ops nindy_ops; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE init_nindy_ops (void) -// OBSOLETE { -// OBSOLETE nindy_ops.to_shortname = "nindy"; -// OBSOLETE "Remote serial target in i960 NINDY-specific protocol", -// OBSOLETE nindy_ops.to_longname = "Use a remote i960 system running NINDY connected by a serial line.\n\ -// OBSOLETE Specify the name of the device the serial line is connected to.\n\ -// OBSOLETE The speed (baud rate), whether to use the old NINDY protocol,\n\ -// OBSOLETE and whether to send a break on startup, are controlled by options\n\ -// OBSOLETE specified when you started GDB."; -// OBSOLETE nindy_ops.to_doc = ""; -// OBSOLETE nindy_ops.to_open = nindy_open; -// OBSOLETE nindy_ops.to_close = nindy_close; -// OBSOLETE nindy_ops.to_attach = 0; -// OBSOLETE nindy_ops.to_post_attach = NULL; -// OBSOLETE nindy_ops.to_require_attach = NULL; -// OBSOLETE nindy_ops.to_detach = nindy_detach; -// OBSOLETE nindy_ops.to_require_detach = NULL; -// OBSOLETE nindy_ops.to_resume = nindy_resume; -// OBSOLETE nindy_ops.to_wait = nindy_wait; -// OBSOLETE nindy_ops.to_post_wait = NULL; -// OBSOLETE nindy_ops.to_fetch_registers = nindy_fetch_registers; -// OBSOLETE nindy_ops.to_store_registers = nindy_store_registers; -// OBSOLETE nindy_ops.to_prepare_to_store = nindy_prepare_to_store; -// OBSOLETE nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory; -// OBSOLETE nindy_ops.to_files_info = nindy_files_info; -// OBSOLETE nindy_ops.to_insert_breakpoint = memory_insert_breakpoint; -// OBSOLETE nindy_ops.to_remove_breakpoint = memory_remove_breakpoint; -// OBSOLETE nindy_ops.to_terminal_init = 0; -// OBSOLETE nindy_ops.to_terminal_inferior = 0; -// OBSOLETE nindy_ops.to_terminal_ours_for_output = 0; -// OBSOLETE nindy_ops.to_terminal_ours = 0; -// OBSOLETE nindy_ops.to_terminal_info = 0; /* Terminal crud */ -// OBSOLETE nindy_ops.to_kill = nindy_kill; -// OBSOLETE nindy_ops.to_load = nindy_load; -// OBSOLETE nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */ -// OBSOLETE nindy_ops.to_create_inferior = nindy_create_inferior; -// OBSOLETE nindy_ops.to_post_startup_inferior = NULL; -// OBSOLETE nindy_ops.to_acknowledge_created_inferior = NULL; -// OBSOLETE nindy_ops.to_clone_and_follow_inferior = NULL; -// OBSOLETE nindy_ops.to_post_follow_inferior_by_clone = NULL; -// OBSOLETE nindy_ops.to_insert_fork_catchpoint = NULL; -// OBSOLETE nindy_ops.to_remove_fork_catchpoint = NULL; -// OBSOLETE nindy_ops.to_insert_vfork_catchpoint = NULL; -// OBSOLETE nindy_ops.to_remove_vfork_catchpoint = NULL; -// OBSOLETE nindy_ops.to_has_forked = NULL; -// OBSOLETE nindy_ops.to_has_vforked = NULL; -// OBSOLETE nindy_ops.to_can_follow_vfork_prior_to_exec = NULL; -// OBSOLETE nindy_ops.to_post_follow_vfork = NULL; -// OBSOLETE nindy_ops.to_insert_exec_catchpoint = NULL; -// OBSOLETE nindy_ops.to_remove_exec_catchpoint = NULL; -// OBSOLETE nindy_ops.to_has_execd = NULL; -// OBSOLETE nindy_ops.to_reported_exec_events_per_exec_call = NULL; -// OBSOLETE nindy_ops.to_has_exited = NULL; -// OBSOLETE nindy_ops.to_mourn_inferior = nindy_mourn_inferior; -// OBSOLETE nindy_ops.to_can_run = 0; /* can_run */ -// OBSOLETE nindy_ops.to_notice_signals = 0; /* notice_signals */ -// OBSOLETE nindy_ops.to_thread_alive = 0; /* to_thread_alive */ -// OBSOLETE nindy_ops.to_stop = 0; /* to_stop */ -// OBSOLETE nindy_ops.to_pid_to_exec_file = NULL; -// OBSOLETE nindy_ops.to_stratum = process_stratum; -// OBSOLETE nindy_ops.DONT_USE = 0; /* next */ -// OBSOLETE nindy_ops.to_has_all_memory = 1; -// OBSOLETE nindy_ops.to_has_memory = 1; -// OBSOLETE nindy_ops.to_has_stack = 1; -// OBSOLETE nindy_ops.to_has_registers = 1; -// OBSOLETE nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */ -// OBSOLETE nindy_ops.to_sections = 0; -// OBSOLETE nindy_ops.to_sections_end = 0; /* Section pointers */ -// OBSOLETE nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_nindy (void) -// OBSOLETE { -// OBSOLETE init_nindy_ops (); -// OBSOLETE add_target (&nindy_ops); -// OBSOLETE add_com ("reset", class_obscure, reset_command, -// OBSOLETE "Send a 'break' to the remote target system.\n\ -// OBSOLETE Only useful if the target has been equipped with a circuit\n\ -// OBSOLETE to perform a hard reset when a break is detected."); -// OBSOLETE } diff --git a/gdb/remote-nrom.c b/gdb/remote-nrom.c deleted file mode 100644 index 31336b6..0000000 --- a/gdb/remote-nrom.c +++ /dev/null @@ -1,351 +0,0 @@ -// OBSOLETE /* Remote debugging with the XLNT Designs, Inc (XDI) NetROM. -// OBSOLETE Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE Contributed by: -// OBSOLETE Roger Moyers -// OBSOLETE XLNT Designs, Inc. -// OBSOLETE 15050 Avenue of Science, Suite 106 -// OBSOLETE San Diego, CA 92128 -// OBSOLETE (619)487-9320 -// OBSOLETE roger@xlnt.com -// OBSOLETE Adapted from work done at Cygnus Support in remote-nindy.c, -// OBSOLETE later merged in by Stan Shebs at Cygnus. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdbcmd.h" -// OBSOLETE #include "serial.h" -// OBSOLETE #include "target.h" -// OBSOLETE -// OBSOLETE /* Default ports used to talk with the NetROM. */ -// OBSOLETE -// OBSOLETE #define DEFAULT_NETROM_LOAD_PORT 1236 -// OBSOLETE #define DEFAULT_NETROM_CONTROL_PORT 1237 -// OBSOLETE -// OBSOLETE static void nrom_close (int quitting); -// OBSOLETE -// OBSOLETE /* New commands. */ -// OBSOLETE -// OBSOLETE static void nrom_passthru (char *, int); -// OBSOLETE -// OBSOLETE /* We talk to the NetROM over these sockets. */ -// OBSOLETE -// OBSOLETE static struct serial *load_desc = NULL; -// OBSOLETE static struct serial *ctrl_desc = NULL; -// OBSOLETE -// OBSOLETE static int load_port = DEFAULT_NETROM_LOAD_PORT; -// OBSOLETE static int control_port = DEFAULT_NETROM_CONTROL_PORT; -// OBSOLETE -// OBSOLETE static char nrom_hostname[100]; -// OBSOLETE -// OBSOLETE /* Forward data declaration. */ -// OBSOLETE -// OBSOLETE extern struct target_ops nrom_ops; -// OBSOLETE -// OBSOLETE /* Scan input from the remote system, until STRING is found. Print chars that -// OBSOLETE don't match. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE expect (char *string) -// OBSOLETE { -// OBSOLETE char *p = string; -// OBSOLETE int c; -// OBSOLETE -// OBSOLETE immediate_quit++; -// OBSOLETE -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE c = serial_readchar (ctrl_desc, 5); -// OBSOLETE -// OBSOLETE if (c == *p++) -// OBSOLETE { -// OBSOLETE if (*p == '\0') -// OBSOLETE { -// OBSOLETE immediate_quit--; -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE fputc_unfiltered (c, gdb_stdout); -// OBSOLETE p = string; -// OBSOLETE if (c == *p) -// OBSOLETE p++; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_kill (void) -// OBSOLETE { -// OBSOLETE nrom_close (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static struct serial * -// OBSOLETE open_socket (char *name, int port) -// OBSOLETE { -// OBSOLETE char sockname[100]; -// OBSOLETE struct serial *desc; -// OBSOLETE -// OBSOLETE sprintf (sockname, "%s:%d", name, port); -// OBSOLETE desc = serial_open (sockname); -// OBSOLETE if (!desc) -// OBSOLETE perror_with_name (sockname); -// OBSOLETE -// OBSOLETE return desc; -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE load_cleanup (void) -// OBSOLETE { -// OBSOLETE serial_close (load_desc); -// OBSOLETE load_desc = NULL; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Download a file specified in ARGS to the netROM. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_load (char *args, int fromtty) -// OBSOLETE { -// OBSOLETE int fd, rd_amt, fsize; -// OBSOLETE bfd *pbfd; -// OBSOLETE asection *section; -// OBSOLETE char *downloadstring = "download 0\n"; -// OBSOLETE struct cleanup *old_chain; -// OBSOLETE -// OBSOLETE /* Tell the netrom to get ready to download. */ -// OBSOLETE if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring))) -// OBSOLETE error ("nrom_load: control_send() of `%s' failed", downloadstring); -// OBSOLETE -// OBSOLETE expect ("Waiting for a connection...\n"); -// OBSOLETE -// OBSOLETE load_desc = open_socket (nrom_hostname, load_port); -// OBSOLETE -// OBSOLETE old_chain = make_cleanup (load_cleanup, 0); -// OBSOLETE -// OBSOLETE pbfd = bfd_openr (args, 0); -// OBSOLETE -// OBSOLETE if (pbfd) -// OBSOLETE { -// OBSOLETE make_cleanup (bfd_close, pbfd); -// OBSOLETE -// OBSOLETE if (!bfd_check_format (pbfd, bfd_object)) -// OBSOLETE error ("\"%s\": not in executable format: %s", -// OBSOLETE args, bfd_errmsg (bfd_get_error ())); -// OBSOLETE -// OBSOLETE for (section = pbfd->sections; section; section = section->next) -// OBSOLETE { -// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC) -// OBSOLETE { -// OBSOLETE bfd_vma section_address; -// OBSOLETE unsigned long section_size; -// OBSOLETE const char *section_name; -// OBSOLETE -// OBSOLETE section_name = bfd_get_section_name (pbfd, section); -// OBSOLETE section_address = bfd_get_section_vma (pbfd, section); -// OBSOLETE section_size = bfd_section_size (pbfd, section); -// OBSOLETE -// OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) -// OBSOLETE { -// OBSOLETE file_ptr fptr; -// OBSOLETE -// OBSOLETE printf_filtered ("[Loading section %s at %x (%d bytes)]\n", -// OBSOLETE section_name, section_address, -// OBSOLETE section_size); -// OBSOLETE -// OBSOLETE fptr = 0; -// OBSOLETE -// OBSOLETE while (section_size > 0) -// OBSOLETE { -// OBSOLETE char buffer[1024]; -// OBSOLETE int count; -// OBSOLETE -// OBSOLETE count = min (section_size, 1024); -// OBSOLETE -// OBSOLETE bfd_get_section_contents (pbfd, section, buffer, fptr, -// OBSOLETE count); -// OBSOLETE -// OBSOLETE serial_write (load_desc, buffer, count); -// OBSOLETE section_address += count; -// OBSOLETE fptr += count; -// OBSOLETE section_size -= count; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE /* BSS and such */ -// OBSOLETE { -// OBSOLETE printf_filtered ("[section %s: not loading]\n", -// OBSOLETE section_name); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE error ("\"%s\": Could not open", args); -// OBSOLETE -// OBSOLETE do_cleanups (old_chain); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Open a connection to the remote NetROM devices. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_open (char *name, int from_tty) -// OBSOLETE { -// OBSOLETE int errn; -// OBSOLETE -// OBSOLETE if (!name || strchr (name, '/') || strchr (name, ':')) -// OBSOLETE error ( -// OBSOLETE "To open a NetROM connection, you must specify the hostname\n\ -// OBSOLETE or IP address of the NetROM device you wish to use."); -// OBSOLETE -// OBSOLETE strcpy (nrom_hostname, name); -// OBSOLETE -// OBSOLETE target_preopen (from_tty); -// OBSOLETE -// OBSOLETE unpush_target (&nrom_ops); -// OBSOLETE -// OBSOLETE ctrl_desc = open_socket (nrom_hostname, control_port); -// OBSOLETE -// OBSOLETE push_target (&nrom_ops); -// OBSOLETE -// OBSOLETE if (from_tty) -// OBSOLETE printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Close out all files and local state before this target loses control. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_close (int quitting) -// OBSOLETE { -// OBSOLETE if (load_desc) -// OBSOLETE serial_close (load_desc); -// OBSOLETE if (ctrl_desc) -// OBSOLETE serial_close (ctrl_desc); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Pass arguments directly to the NetROM. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_passthru (char *args, int fromtty) -// OBSOLETE { -// OBSOLETE char buf[1024]; -// OBSOLETE -// OBSOLETE sprintf (buf, "%s\n", args); -// OBSOLETE if (serial_write (ctrl_desc, buf, strlen (buf))) -// OBSOLETE error ("nrom_reset: control_send() of `%s'failed", args); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE nrom_mourn (void) -// OBSOLETE { -// OBSOLETE unpush_target (&nrom_ops); -// OBSOLETE generic_mourn_inferior (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Define the target vector. */ -// OBSOLETE -// OBSOLETE struct target_ops nrom_ops; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE init_nrom_ops (void) -// OBSOLETE { -// OBSOLETE nrom_ops.to_shortname = "nrom"; -// OBSOLETE nrom_ops.to_longname = "Remote XDI `NetROM' target"; -// OBSOLETE nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet"; -// OBSOLETE nrom_ops.to_open = nrom_open; -// OBSOLETE nrom_ops.to_close = nrom_close; -// OBSOLETE nrom_ops.to_attach = NULL; -// OBSOLETE nrom_ops.to_post_attach = NULL; -// OBSOLETE nrom_ops.to_require_attach = NULL; -// OBSOLETE nrom_ops.to_detach = NULL; -// OBSOLETE nrom_ops.to_require_detach = NULL; -// OBSOLETE nrom_ops.to_resume = NULL; -// OBSOLETE nrom_ops.to_wait = NULL; -// OBSOLETE nrom_ops.to_post_wait = NULL; -// OBSOLETE nrom_ops.to_fetch_registers = NULL; -// OBSOLETE nrom_ops.to_store_registers = NULL; -// OBSOLETE nrom_ops.to_prepare_to_store = NULL; -// OBSOLETE nrom_ops.to_xfer_memory = NULL; -// OBSOLETE nrom_ops.to_files_info = NULL; -// OBSOLETE nrom_ops.to_insert_breakpoint = NULL; -// OBSOLETE nrom_ops.to_remove_breakpoint = NULL; -// OBSOLETE nrom_ops.to_terminal_init = NULL; -// OBSOLETE nrom_ops.to_terminal_inferior = NULL; -// OBSOLETE nrom_ops.to_terminal_ours_for_output = NULL; -// OBSOLETE nrom_ops.to_terminal_ours = NULL; -// OBSOLETE nrom_ops.to_terminal_info = NULL; -// OBSOLETE nrom_ops.to_kill = nrom_kill; -// OBSOLETE nrom_ops.to_load = nrom_load; -// OBSOLETE nrom_ops.to_lookup_symbol = NULL; -// OBSOLETE nrom_ops.to_create_inferior = NULL; -// OBSOLETE nrom_ops.to_post_startup_inferior = NULL; -// OBSOLETE nrom_ops.to_acknowledge_created_inferior = NULL; -// OBSOLETE nrom_ops.to_clone_and_follow_inferior = NULL; -// OBSOLETE nrom_ops.to_post_follow_inferior_by_clone = NULL; -// OBSOLETE nrom_ops.to_insert_fork_catchpoint = NULL; -// OBSOLETE nrom_ops.to_remove_fork_catchpoint = NULL; -// OBSOLETE nrom_ops.to_insert_vfork_catchpoint = NULL; -// OBSOLETE nrom_ops.to_remove_vfork_catchpoint = NULL; -// OBSOLETE nrom_ops.to_has_forked = NULL; -// OBSOLETE nrom_ops.to_has_vforked = NULL; -// OBSOLETE nrom_ops.to_can_follow_vfork_prior_to_exec = NULL; -// OBSOLETE nrom_ops.to_post_follow_vfork = NULL; -// OBSOLETE nrom_ops.to_insert_exec_catchpoint = NULL; -// OBSOLETE nrom_ops.to_remove_exec_catchpoint = NULL; -// OBSOLETE nrom_ops.to_has_execd = NULL; -// OBSOLETE nrom_ops.to_reported_exec_events_per_exec_call = NULL; -// OBSOLETE nrom_ops.to_has_exited = NULL; -// OBSOLETE nrom_ops.to_mourn_inferior = nrom_mourn; -// OBSOLETE nrom_ops.to_can_run = NULL; -// OBSOLETE nrom_ops.to_notice_signals = 0; -// OBSOLETE nrom_ops.to_thread_alive = 0; -// OBSOLETE nrom_ops.to_stop = 0; -// OBSOLETE nrom_ops.to_pid_to_exec_file = NULL; -// OBSOLETE nrom_ops.to_stratum = download_stratum; -// OBSOLETE nrom_ops.DONT_USE = NULL; -// OBSOLETE nrom_ops.to_has_all_memory = 1; -// OBSOLETE nrom_ops.to_has_memory = 1; -// OBSOLETE nrom_ops.to_has_stack = 1; -// OBSOLETE nrom_ops.to_has_registers = 1; -// OBSOLETE nrom_ops.to_has_execution = 0; -// OBSOLETE nrom_ops.to_sections = NULL; -// OBSOLETE nrom_ops.to_sections_end = NULL; -// OBSOLETE nrom_ops.to_magic = OPS_MAGIC; -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_remote_nrom (void) -// OBSOLETE { -// OBSOLETE init_nrom_ops (); -// OBSOLETE add_target (&nrom_ops); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port, -// OBSOLETE "Set the port to use for NetROM downloads\n", &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port, -// OBSOLETE "Set the port to use for NetROM debugger services\n", &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_cmd ("nrom", no_class, nrom_passthru, -// OBSOLETE "Pass arguments as command to NetROM", -// OBSOLETE &cmdlist); -// OBSOLETE } diff --git a/gdb/remote-os9k.c b/gdb/remote-os9k.c deleted file mode 100644 index 5a7dd34..0000000 --- a/gdb/remote-os9k.c +++ /dev/null @@ -1,1234 +0,0 @@ -// OBSOLETE /* Remote debugging interface for boot monitors, for GDB. -// OBSOLETE -// OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, -// OBSOLETE 2000, 2001, 2002 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* This file was derived from remote-eb.c, which did a similar job, but for -// OBSOLETE an AMD-29K running EBMON. That file was in turn derived from remote.c -// OBSOLETE as mentioned in the following comment (left in for comic relief): -// OBSOLETE -// OBSOLETE "This is like remote.c but is for a different situation-- -// OBSOLETE having a PC running os9000 hook up with a unix machine with -// OBSOLETE a serial line, and running ctty com2 on the PC. os9000 has a debug -// OBSOLETE monitor called ROMBUG running. Not to mention that the PC -// OBSOLETE has PC/NFS, so it can access the same executables that gdb can, -// OBSOLETE over the net in real time." -// OBSOLETE -// OBSOLETE In reality, this module talks to a debug monitor called 'ROMBUG', which -// OBSOLETE We communicate with ROMBUG via a direct serial line, the network version -// OBSOLETE of ROMBUG is not available yet. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE /* FIXME This file needs to be rewritten if it's to work again, either -// OBSOLETE to self-contained or to use the new monitor interface. */ -// OBSOLETE -// OBSOLETE #include "defs.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include -// OBSOLETE #include "command.h" -// OBSOLETE #include "serial.h" -// OBSOLETE #include "monitor.h" -// OBSOLETE #include "remote-utils.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "symfile.h" -// OBSOLETE #include "objfiles.h" -// OBSOLETE #include "gdb-stabs.h" -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE struct cmd_list_element *showlist; -// OBSOLETE extern struct target_ops rombug_ops; /* Forward declaration */ -// OBSOLETE extern struct monitor_ops rombug_cmds; /* Forward declaration */ -// OBSOLETE extern struct cmd_list_element *setlist; -// OBSOLETE extern struct cmd_list_element *unsetlist; -// OBSOLETE extern int attach_flag; -// OBSOLETE -// OBSOLETE static void rombug_close (); -// OBSOLETE static void rombug_fetch_register (); -// OBSOLETE static void rombug_fetch_registers (); -// OBSOLETE static void rombug_store_register (); -// OBSOLETE #if 0 -// OBSOLETE static int sr_get_debug (); /* flag set by "set remotedebug" */ -// OBSOLETE #endif -// OBSOLETE static int hashmark; /* flag set by "set hash" */ -// OBSOLETE static int rombug_is_open = 0; -// OBSOLETE -// OBSOLETE /* FIXME: Replace with sr_get_debug (). */ -// OBSOLETE #define LOG_FILE "monitor.log" -// OBSOLETE FILE *log_file; -// OBSOLETE static int monitor_log = 0; -// OBSOLETE static int tty_xon = 0; -// OBSOLETE static int tty_xoff = 0; -// OBSOLETE -// OBSOLETE static int timeout = 10; -// OBSOLETE static int is_trace_mode = 0; -// OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to NULL */ -// OBSOLETE static struct serial *monitor_desc = NULL; -// OBSOLETE -// OBSOLETE static CORE_ADDR bufaddr = 0; -// OBSOLETE static int buflen = 0; -// OBSOLETE static char readbuf[16]; -// OBSOLETE -// OBSOLETE /* Send data to monitor. Works just like printf. */ -// OBSOLETE static void -// OBSOLETE printf_monitor (char *pattern,...) -// OBSOLETE { -// OBSOLETE va_list args; -// OBSOLETE char buf[200]; -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE va_start (args, pattern); -// OBSOLETE -// OBSOLETE vsprintf (buf, pattern, args); -// OBSOLETE va_end (args); -// OBSOLETE -// OBSOLETE if (serial_write (monitor_desc, buf, strlen (buf))) -// OBSOLETE fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n", -// OBSOLETE safe_strerror (errno)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read a character from the remote system, doing all the fancy timeout stuff */ -// OBSOLETE static int -// OBSOLETE readchar (int timeout) -// OBSOLETE { -// OBSOLETE int c; -// OBSOLETE -// OBSOLETE c = serial_readchar (monitor_desc, timeout); -// OBSOLETE -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE putchar (c & 0x7f); -// OBSOLETE -// OBSOLETE if (monitor_log && isascii (c)) -// OBSOLETE putc (c & 0x7f, log_file); -// OBSOLETE -// OBSOLETE if (c >= 0) -// OBSOLETE return c & 0x7f; -// OBSOLETE -// OBSOLETE if (c == SERIAL_TIMEOUT) -// OBSOLETE { -// OBSOLETE if (timeout == 0) -// OBSOLETE return c; /* Polls shouldn't generate timeout errors */ -// OBSOLETE -// OBSOLETE error ("Timeout reading from remote system."); -// OBSOLETE } -// OBSOLETE -// OBSOLETE perror_with_name ("remote-monitor"); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Scan input from the remote system, until STRING is found. If DISCARD is -// OBSOLETE non-zero, then discard non-matching input, else print it out. -// OBSOLETE Let the user break out immediately. */ -// OBSOLETE static void -// OBSOLETE expect (char *string, int discard) -// OBSOLETE { -// OBSOLETE char *p = string; -// OBSOLETE int c; -// OBSOLETE -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("Expecting \"%s\"\n", string); -// OBSOLETE -// OBSOLETE immediate_quit++; -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE c = readchar (timeout); -// OBSOLETE if (!isascii (c)) -// OBSOLETE continue; -// OBSOLETE if (c == *p++) -// OBSOLETE { -// OBSOLETE if (*p == '\0') -// OBSOLETE { -// OBSOLETE immediate_quit--; -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("\nMatched\n"); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (!discard) -// OBSOLETE { -// OBSOLETE fwrite (string, 1, (p - 1) - string, stdout); -// OBSOLETE putchar ((char) c); -// OBSOLETE fflush (stdout); -// OBSOLETE } -// OBSOLETE p = string; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Keep discarding input until we see the ROMBUG prompt. -// OBSOLETE -// OBSOLETE The convention for dealing with the prompt is that you -// OBSOLETE o give your command -// OBSOLETE o *then* wait for the prompt. -// OBSOLETE -// OBSOLETE Thus the last thing that a procedure does with the serial line -// OBSOLETE will be an expect_prompt(). Exception: rombug_resume does not -// OBSOLETE wait for the prompt, because the terminal is being handed over -// OBSOLETE to the inferior. However, the next thing which happens after that -// OBSOLETE is a rombug_wait which does wait for the prompt. -// OBSOLETE Note that this includes abnormal exit, e.g. error(). This is -// OBSOLETE necessary to prevent getting into states from which we can't -// OBSOLETE recover. */ -// OBSOLETE static void -// OBSOLETE expect_prompt (int discard) -// OBSOLETE { -// OBSOLETE if (monitor_log) -// OBSOLETE /* This is a convenient place to do this. The idea is to do it often -// OBSOLETE enough that we never lose much data if we terminate abnormally. */ -// OBSOLETE fflush (log_file); -// OBSOLETE -// OBSOLETE if (is_trace_mode) -// OBSOLETE { -// OBSOLETE expect ("trace", discard); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE expect (PROMPT, discard); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Get a hex digit from the remote system & return its value. -// OBSOLETE If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */ -// OBSOLETE static int -// OBSOLETE get_hex_digit (int ignore_space) -// OBSOLETE { -// OBSOLETE int ch; -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE ch = readchar (timeout); -// OBSOLETE if (ch >= '0' && ch <= '9') -// OBSOLETE return ch - '0'; -// OBSOLETE else if (ch >= 'A' && ch <= 'F') -// OBSOLETE return ch - 'A' + 10; -// OBSOLETE else if (ch >= 'a' && ch <= 'f') -// OBSOLETE return ch - 'a' + 10; -// OBSOLETE else if (ch == ' ' && ignore_space) -// OBSOLETE ; -// OBSOLETE else -// OBSOLETE { -// OBSOLETE expect_prompt (1); -// OBSOLETE error ("Invalid hex digit from remote system."); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Get a byte from monitor and put it in *BYT. Accept any number -// OBSOLETE leading spaces. */ -// OBSOLETE static void -// OBSOLETE get_hex_byte (char *byt) -// OBSOLETE { -// OBSOLETE int val; -// OBSOLETE -// OBSOLETE val = get_hex_digit (1) << 4; -// OBSOLETE val |= get_hex_digit (0); -// OBSOLETE *byt = val; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Get N 32-bit words from remote, each preceded by a space, -// OBSOLETE and put them in registers starting at REGNO. */ -// OBSOLETE static void -// OBSOLETE get_hex_regs (int n, int regno) -// OBSOLETE { -// OBSOLETE long val; -// OBSOLETE int i; -// OBSOLETE unsigned char b; -// OBSOLETE -// OBSOLETE for (i = 0; i < n; i++) -// OBSOLETE { -// OBSOLETE int j; -// OBSOLETE -// OBSOLETE val = 0; -// OBSOLETE for (j = 0; j < 4; j++) -// OBSOLETE { -// OBSOLETE get_hex_byte (&b); -// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) -// OBSOLETE val = (val << 8) + b; -// OBSOLETE else -// OBSOLETE val = val + (b << (j * 8)); -// OBSOLETE } -// OBSOLETE supply_register (regno++, (char *) &val); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* This is called not only when we first attach, but also when the -// OBSOLETE user types "run" after having attached. */ -// OBSOLETE static void -// OBSOLETE rombug_create_inferior (char *execfile, char *args, char **env) -// OBSOLETE { -// OBSOLETE int entry_pt; -// OBSOLETE -// OBSOLETE if (args && *args) -// OBSOLETE error ("Can't pass arguments to remote ROMBUG process"); -// OBSOLETE -// OBSOLETE if (execfile == 0 || exec_bfd == 0) -// OBSOLETE error ("No executable file specified"); -// OBSOLETE -// OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd); -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fputs ("\nIn Create_inferior()", log_file); -// OBSOLETE -// OBSOLETE -// OBSOLETE /* The "process" (board) is already stopped awaiting our commands, and -// OBSOLETE the program is already downloaded. We just set its PC and go. */ -// OBSOLETE -// OBSOLETE init_wait_for_inferior (); -// OBSOLETE proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Open a connection to a remote debugger. -// OBSOLETE NAME is the filename used for communication. */ -// OBSOLETE -// OBSOLETE static char dev_name[100]; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_open (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE if (args == NULL) -// OBSOLETE error ("Use `target RomBug DEVICE-NAME' to use a serial port, or \n\ -// OBSOLETE `target RomBug HOST-NAME:PORT-NUMBER' to use a network connection."); -// OBSOLETE -// OBSOLETE target_preopen (from_tty); -// OBSOLETE -// OBSOLETE if (rombug_is_open) -// OBSOLETE unpush_target (&rombug_ops); -// OBSOLETE -// OBSOLETE strcpy (dev_name, args); -// OBSOLETE monitor_desc = serial_open (dev_name); -// OBSOLETE if (monitor_desc == NULL) -// OBSOLETE perror_with_name (dev_name); -// OBSOLETE -// OBSOLETE /* if baud rate is set by 'set remotebaud' */ -// OBSOLETE if (serial_setbaudrate (monitor_desc, sr_get_baud_rate ())) -// OBSOLETE { -// OBSOLETE serial_close (monitor_desc); -// OBSOLETE perror_with_name ("RomBug"); -// OBSOLETE } -// OBSOLETE serial_raw (monitor_desc); -// OBSOLETE if (tty_xon || tty_xoff) -// OBSOLETE { -// OBSOLETE struct hardware_ttystate -// OBSOLETE { -// OBSOLETE struct termios t; -// OBSOLETE } -// OBSOLETE *tty_s; -// OBSOLETE -// OBSOLETE tty_s = (struct hardware_ttystate *) serial_get_tty_state (monitor_desc); -// OBSOLETE if (tty_xon) -// OBSOLETE tty_s->t.c_iflag |= IXON; -// OBSOLETE if (tty_xoff) -// OBSOLETE tty_s->t.c_iflag |= IXOFF; -// OBSOLETE serial_set_tty_state (monitor_desc, (serial_ttystate) tty_s); -// OBSOLETE } -// OBSOLETE -// OBSOLETE rombug_is_open = 1; -// OBSOLETE -// OBSOLETE log_file = fopen (LOG_FILE, "w"); -// OBSOLETE if (log_file == NULL) -// OBSOLETE perror_with_name (LOG_FILE); -// OBSOLETE -// OBSOLETE push_monitor (&rombug_cmds); -// OBSOLETE printf_monitor ("\r"); /* CR wakes up monitor */ -// OBSOLETE expect_prompt (1); -// OBSOLETE push_target (&rombug_ops); -// OBSOLETE attach_flag = 1; -// OBSOLETE -// OBSOLETE if (from_tty) -// OBSOLETE printf ("Remote %s connected to %s\n", target_shortname, -// OBSOLETE dev_name); -// OBSOLETE -// OBSOLETE rombug_fetch_registers (); -// OBSOLETE -// OBSOLETE printf_monitor ("ov e \r"); -// OBSOLETE expect_prompt (1); -// OBSOLETE bufaddr = 0; -// OBSOLETE buflen = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Close out all files and local state before this target loses control. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_close (int quitting) -// OBSOLETE { -// OBSOLETE if (rombug_is_open) -// OBSOLETE { -// OBSOLETE serial_close (monitor_desc); -// OBSOLETE monitor_desc = NULL; -// OBSOLETE rombug_is_open = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (log_file) -// OBSOLETE { -// OBSOLETE if (ferror (log_file)) -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Error writing log file.\n"); -// OBSOLETE if (fclose (log_file) != 0) -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Error closing log file.\n"); -// OBSOLETE log_file = 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE int -// OBSOLETE rombug_link (char *mod_name, CORE_ADDR *text_reloc) -// OBSOLETE { -// OBSOLETE int i, j; -// OBSOLETE unsigned long val; -// OBSOLETE unsigned char b; -// OBSOLETE -// OBSOLETE printf_monitor ("l %s \r", mod_name); -// OBSOLETE expect_prompt (1); -// OBSOLETE printf_monitor (".r \r"); -// OBSOLETE expect (REG_DELIM, 1); -// OBSOLETE for (i = 0; i <= 7; i++) -// OBSOLETE { -// OBSOLETE val = 0; -// OBSOLETE for (j = 0; j < 4; j++) -// OBSOLETE { -// OBSOLETE get_hex_byte (&b); -// OBSOLETE val = (val << 8) + b; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE expect_prompt (1); -// OBSOLETE *text_reloc = val; -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Terminate the open connection to the remote debugger. -// OBSOLETE Use this when you want to detach and do something else -// OBSOLETE with your gdb. */ -// OBSOLETE static void -// OBSOLETE rombug_detach (int from_tty) -// OBSOLETE { -// OBSOLETE if (attach_flag) -// OBSOLETE { -// OBSOLETE printf_monitor (GO_CMD); -// OBSOLETE attach_flag = 0; -// OBSOLETE } -// OBSOLETE pop_target (); /* calls rombug_close to do the real work */ -// OBSOLETE if (from_tty) -// OBSOLETE printf ("Ending remote %s debugging\n", target_shortname); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Tell the remote machine to resume. -// OBSOLETE */ -// OBSOLETE static void -// OBSOLETE rombug_resume (ptid_t ptid, int step, enum target_signal sig) -// OBSOLETE { -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Resume (step=%d, sig=%d)\n", step, sig); -// OBSOLETE -// OBSOLETE if (step) -// OBSOLETE { -// OBSOLETE is_trace_mode = 1; -// OBSOLETE printf_monitor (STEP_CMD); -// OBSOLETE /* wait for the echo. ** -// OBSOLETE expect (STEP_CMD, 1); -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE printf_monitor (GO_CMD); -// OBSOLETE /* swallow the echo. ** -// OBSOLETE expect (GO_CMD, 1); -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE bufaddr = 0; -// OBSOLETE buflen = 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Wait until the remote machine stops, then return, -// OBSOLETE * storing status in status just as `wait' would. -// OBSOLETE */ -// OBSOLETE -// OBSOLETE static ptid * -// OBSOLETE rombug_wait (ptid_t ptid, struct target_waitstatus *status) -// OBSOLETE { -// OBSOLETE int old_timeout = timeout; -// OBSOLETE struct section_offsets *offs; -// OBSOLETE CORE_ADDR addr, pc; -// OBSOLETE struct obj_section *obj_sec; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fputs ("\nIn wait ()", log_file); -// OBSOLETE -// OBSOLETE status->kind = TARGET_WAITKIND_EXITED; -// OBSOLETE status->value.integer = 0; -// OBSOLETE -// OBSOLETE timeout = -1; /* Don't time out -- user program is running. */ -// OBSOLETE expect ("eax:", 0); /* output any message before register display */ -// OBSOLETE expect_prompt (1); /* Wait for prompt, outputting extraneous text */ -// OBSOLETE -// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; -// OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; -// OBSOLETE timeout = old_timeout; -// OBSOLETE rombug_fetch_registers (); -// OBSOLETE bufaddr = 0; -// OBSOLETE buflen = 0; -// OBSOLETE pc = read_register (PC_REGNUM); -// OBSOLETE addr = read_register (DATABASE_REG); -// OBSOLETE obj_sec = find_pc_section (pc); -// OBSOLETE if (obj_sec != NULL) -// OBSOLETE { -// OBSOLETE if (obj_sec->objfile != symfile_objfile) -// OBSOLETE new_symfile_objfile (obj_sec->objfile, 1, 0); -// OBSOLETE offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS); -// OBSOLETE memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS); -// OBSOLETE offs->offsets[SECT_OFF_DATA (symfile_objfile)] = addr; -// OBSOLETE offs->offsets[SECT_OFF_BSS (symfile_objfile)] = addr; -// OBSOLETE -// OBSOLETE objfile_relocate (symfile_objfile, offs); -// OBSOLETE } -// OBSOLETE -// OBSOLETE return inferior_ptid; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Return the name of register number regno in the form input and output by -// OBSOLETE monitor. Currently, register_names just happens to contain exactly what -// OBSOLETE monitor wants. Lets take advantage of that just as long as possible! */ -// OBSOLETE -// OBSOLETE static char * -// OBSOLETE get_reg_name (int regno) -// OBSOLETE { -// OBSOLETE static char buf[50]; -// OBSOLETE char *p; -// OBSOLETE char *b; -// OBSOLETE -// OBSOLETE b = buf; -// OBSOLETE -// OBSOLETE if (regno < 0) -// OBSOLETE return (""); -// OBSOLETE /* -// OBSOLETE for (p = REGISTER_NAME (regno); *p; p++) -// OBSOLETE *b++ = toupper(*p); -// OBSOLETE *b = '\000'; -// OBSOLETE */ -// OBSOLETE p = (char *) REGISTER_NAME (regno); -// OBSOLETE return p; -// OBSOLETE /* -// OBSOLETE return buf; -// OBSOLETE */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* read the remote registers into the block regs. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_fetch_registers (void) -// OBSOLETE { -// OBSOLETE int regno, j, i; -// OBSOLETE long val; -// OBSOLETE unsigned char b; -// OBSOLETE -// OBSOLETE printf_monitor (GET_REG); -// OBSOLETE expect ("eax:", 1); -// OBSOLETE expect ("\n", 1); -// OBSOLETE get_hex_regs (1, 0); -// OBSOLETE get_hex_regs (1, 3); -// OBSOLETE get_hex_regs (1, 1); -// OBSOLETE get_hex_regs (1, 2); -// OBSOLETE get_hex_regs (1, 6); -// OBSOLETE get_hex_regs (1, 7); -// OBSOLETE get_hex_regs (1, 5); -// OBSOLETE get_hex_regs (1, 4); -// OBSOLETE for (regno = 8; regno <= 15; regno++) -// OBSOLETE { -// OBSOLETE expect (REG_DELIM, 1); -// OBSOLETE if (regno >= 8 && regno <= 13) -// OBSOLETE { -// OBSOLETE val = 0; -// OBSOLETE for (j = 0; j < 2; j++) -// OBSOLETE { -// OBSOLETE get_hex_byte (&b); -// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) -// OBSOLETE val = (val << 8) + b; -// OBSOLETE else -// OBSOLETE val = val + (b << (j * 8)); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (regno == 8) -// OBSOLETE i = 10; -// OBSOLETE if (regno >= 9 && regno <= 12) -// OBSOLETE i = regno + 3; -// OBSOLETE if (regno == 13) -// OBSOLETE i = 11; -// OBSOLETE supply_register (i, (char *) &val); -// OBSOLETE } -// OBSOLETE else if (regno == 14) -// OBSOLETE { -// OBSOLETE get_hex_regs (1, PC_REGNUM); -// OBSOLETE } -// OBSOLETE else if (regno == 15) -// OBSOLETE { -// OBSOLETE get_hex_regs (1, 9); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE val = 0; -// OBSOLETE supply_register (regno, (char *) &val); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Fetch register REGNO, or all registers if REGNO is -1. -// OBSOLETE Returns errno value. */ -// OBSOLETE static void -// OBSOLETE rombug_fetch_register (int regno) -// OBSOLETE { -// OBSOLETE int val, j; -// OBSOLETE unsigned char b; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE { -// OBSOLETE fprintf (log_file, "\nIn Fetch Register (reg=%s)\n", get_reg_name (regno)); -// OBSOLETE fflush (log_file); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (regno < 0) -// OBSOLETE { -// OBSOLETE rombug_fetch_registers (); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE char *name = get_reg_name (regno); -// OBSOLETE printf_monitor (GET_REG); -// OBSOLETE if (regno >= 10 && regno <= 15) -// OBSOLETE { -// OBSOLETE expect ("\n", 1); -// OBSOLETE expect ("\n", 1); -// OBSOLETE expect (name, 1); -// OBSOLETE expect (REG_DELIM, 1); -// OBSOLETE val = 0; -// OBSOLETE for (j = 0; j < 2; j++) -// OBSOLETE { -// OBSOLETE get_hex_byte (&b); -// OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) -// OBSOLETE val = (val << 8) + b; -// OBSOLETE else -// OBSOLETE val = val + (b << (j * 8)); -// OBSOLETE } -// OBSOLETE supply_register (regno, (char *) &val); -// OBSOLETE } -// OBSOLETE else if (regno == 8 || regno == 9) -// OBSOLETE { -// OBSOLETE expect ("\n", 1); -// OBSOLETE expect ("\n", 1); -// OBSOLETE expect ("\n", 1); -// OBSOLETE expect (name, 1); -// OBSOLETE expect (REG_DELIM, 1); -// OBSOLETE get_hex_regs (1, regno); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE { -// OBSOLETE expect (name, 1); -// OBSOLETE expect (REG_DELIM, 1); -// OBSOLETE expect ("\n", 1); -// OBSOLETE get_hex_regs (1, 0); -// OBSOLETE get_hex_regs (1, 3); -// OBSOLETE get_hex_regs (1, 1); -// OBSOLETE get_hex_regs (1, 2); -// OBSOLETE get_hex_regs (1, 6); -// OBSOLETE get_hex_regs (1, 7); -// OBSOLETE get_hex_regs (1, 5); -// OBSOLETE get_hex_regs (1, 4); -// OBSOLETE } -// OBSOLETE expect_prompt (1); -// OBSOLETE } -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store the remote registers from the contents of the block REGS. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_store_registers (void) -// OBSOLETE { -// OBSOLETE int regno; -// OBSOLETE -// OBSOLETE for (regno = 0; regno <= PC_REGNUM; regno++) -// OBSOLETE rombug_store_register (regno); -// OBSOLETE -// OBSOLETE registers_changed (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store register REGNO, or all if REGNO == 0. -// OBSOLETE return errno value. */ -// OBSOLETE static void -// OBSOLETE rombug_store_register (int regno) -// OBSOLETE { -// OBSOLETE char *name; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Store_register (regno=%d)\n", regno); -// OBSOLETE -// OBSOLETE if (regno == -1) -// OBSOLETE rombug_store_registers (); -// OBSOLETE else -// OBSOLETE { -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("Setting register %s to 0x%x\n", get_reg_name (regno), read_register (regno)); -// OBSOLETE -// OBSOLETE name = get_reg_name (regno); -// OBSOLETE if (name == 0) -// OBSOLETE return; -// OBSOLETE printf_monitor (SET_REG, name, read_register (regno)); -// OBSOLETE -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Get ready to modify the registers array. On machines which store -// OBSOLETE individual registers, this doesn't need to do anything. On machines -// OBSOLETE which store all the registers in one fell swoop, this makes sure -// OBSOLETE that registers contains all the registers from the program being -// OBSOLETE debugged. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_prepare_to_store (void) -// OBSOLETE { -// OBSOLETE /* Do nothing, since we can store individual regs */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_files_info (void) -// OBSOLETE { -// OBSOLETE printf ("\tAttached to %s at %d baud.\n", -// OBSOLETE dev_name, sr_get_baud_rate ()); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR -// OBSOLETE to inferior's memory at MEMADDR. Returns length moved. */ -// OBSOLETE static int -// OBSOLETE rombug_write_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE char buf[10]; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Write_inferior_memory (memaddr=%x, len=%d)\n", memaddr, len); -// OBSOLETE -// OBSOLETE printf_monitor (MEM_SET_CMD, memaddr); -// OBSOLETE for (i = 0; i < len; i++) -// OBSOLETE { -// OBSOLETE expect (CMD_DELIM, 1); -// OBSOLETE printf_monitor ("%x \r", myaddr[i]); -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("\nSet 0x%x to 0x%x\n", memaddr + i, myaddr[i]); -// OBSOLETE } -// OBSOLETE expect (CMD_DELIM, 1); -// OBSOLETE if (CMD_END) -// OBSOLETE printf_monitor (CMD_END); -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE -// OBSOLETE bufaddr = 0; -// OBSOLETE buflen = 0; -// OBSOLETE return len; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result -// OBSOLETE at debugger address MYADDR. Returns length moved. */ -// OBSOLETE static int -// OBSOLETE rombug_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) -// OBSOLETE { -// OBSOLETE int i, j; -// OBSOLETE -// OBSOLETE /* Number of bytes read so far. */ -// OBSOLETE int count; -// OBSOLETE -// OBSOLETE /* Starting address of this pass. */ -// OBSOLETE unsigned long startaddr; -// OBSOLETE -// OBSOLETE /* Number of bytes to read in this pass. */ -// OBSOLETE int len_this_pass; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Read_inferior_memory (memaddr=%x, len=%d)\n", memaddr, len); -// OBSOLETE -// OBSOLETE /* Note that this code works correctly if startaddr is just less -// OBSOLETE than UINT_MAX (well, really CORE_ADDR_MAX if there was such a -// OBSOLETE thing). That is, something like -// OBSOLETE rombug_read_bytes (CORE_ADDR_MAX - 4, foo, 4) -// OBSOLETE works--it never adds len To memaddr and gets 0. */ -// OBSOLETE /* However, something like -// OBSOLETE rombug_read_bytes (CORE_ADDR_MAX - 3, foo, 4) -// OBSOLETE doesn't need to work. Detect it and give up if there's an attempt -// OBSOLETE to do that. */ -// OBSOLETE if (((memaddr - 1) + len) < memaddr) -// OBSOLETE { -// OBSOLETE errno = EIO; -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE if (bufaddr <= memaddr && (memaddr + len) <= (bufaddr + buflen)) -// OBSOLETE { -// OBSOLETE memcpy (myaddr, &readbuf[memaddr - bufaddr], len); -// OBSOLETE return len; -// OBSOLETE } -// OBSOLETE -// OBSOLETE startaddr = memaddr; -// OBSOLETE count = 0; -// OBSOLETE while (count < len) -// OBSOLETE { -// OBSOLETE len_this_pass = 16; -// OBSOLETE if ((startaddr % 16) != 0) -// OBSOLETE len_this_pass -= startaddr % 16; -// OBSOLETE if (len_this_pass > (len - count)) -// OBSOLETE len_this_pass = (len - count); -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("\nDisplay %d bytes at %x\n", len_this_pass, startaddr); -// OBSOLETE -// OBSOLETE printf_monitor (MEM_DIS_CMD, startaddr, 8); -// OBSOLETE expect ("- ", 1); -// OBSOLETE for (i = 0; i < 16; i++) -// OBSOLETE { -// OBSOLETE get_hex_byte (&readbuf[i]); -// OBSOLETE } -// OBSOLETE bufaddr = startaddr; -// OBSOLETE buflen = 16; -// OBSOLETE memcpy (&myaddr[count], readbuf, len_this_pass); -// OBSOLETE count += len_this_pass; -// OBSOLETE startaddr += len_this_pass; -// OBSOLETE expect (CMD_DELIM, 1); -// OBSOLETE } -// OBSOLETE if (CMD_END) -// OBSOLETE printf_monitor (CMD_END); -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE -// OBSOLETE return len; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Transfer LEN bytes between GDB address MYADDR and target address -// OBSOLETE MEMADDR. If WRITE is non-zero, transfer them to the target, -// OBSOLETE otherwise transfer them from the target. TARGET is unused. -// OBSOLETE -// OBSOLETE Returns the number of bytes transferred. */ -// OBSOLETE -// OBSOLETE static int -// OBSOLETE rombug_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, -// OBSOLETE int write, struct mem_attrib *attrib, -// OBSOLETE struct target_ops *target) -// OBSOLETE { -// OBSOLETE if (write) -// OBSOLETE return rombug_write_inferior_memory (memaddr, myaddr, len); -// OBSOLETE else -// OBSOLETE return rombug_read_inferior_memory (memaddr, myaddr, len); -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_kill (char *args, int from_tty) -// OBSOLETE { -// OBSOLETE return; /* ignore attempts to kill target system */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Clean up when a program exits. -// OBSOLETE The program actually lives on in the remote processor's RAM, and may be -// OBSOLETE run again without a download. Don't leave it full of breakpoint -// OBSOLETE instructions. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_mourn_inferior (void) -// OBSOLETE { -// OBSOLETE remove_breakpoints (); -// OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE #define MAX_MONITOR_BREAKPOINTS 16 -// OBSOLETE -// OBSOLETE static CORE_ADDR breakaddr[MAX_MONITOR_BREAKPOINTS] = -// OBSOLETE {0}; -// OBSOLETE -// OBSOLETE static int -// OBSOLETE rombug_insert_breakpoint (CORE_ADDR addr, char *shadow) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE CORE_ADDR bp_addr = addr; -// OBSOLETE int bp_size = 0; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Insert_breakpoint (addr=%x)\n", addr); -// OBSOLETE BREAKPOINT_FROM_PC (&bp_addr, &bp_size); -// OBSOLETE -// OBSOLETE for (i = 0; i <= MAX_MONITOR_BREAKPOINTS; i++) -// OBSOLETE if (breakaddr[i] == 0) -// OBSOLETE { -// OBSOLETE breakaddr[i] = addr; -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("Breakpoint at %x\n", addr); -// OBSOLETE rombug_read_inferior_memory (bp_addr, shadow, bp_size); -// OBSOLETE printf_monitor (SET_BREAK_CMD, addr); -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for monitor\n"); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * _remove_breakpoint -- Tell the monitor to remove a breakpoint -// OBSOLETE */ -// OBSOLETE static int -// OBSOLETE rombug_remove_breakpoint (CORE_ADDR addr, char *shadow) -// OBSOLETE { -// OBSOLETE int i; -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn Remove_breakpoint (addr=%x)\n", addr); -// OBSOLETE -// OBSOLETE for (i = 0; i < MAX_MONITOR_BREAKPOINTS; i++) -// OBSOLETE if (breakaddr[i] == addr) -// OBSOLETE { -// OBSOLETE breakaddr[i] = 0; -// OBSOLETE printf_monitor (CLR_BREAK_CMD, addr); -// OBSOLETE is_trace_mode = 0; -// OBSOLETE expect_prompt (1); -// OBSOLETE return 0; -// OBSOLETE } -// OBSOLETE -// OBSOLETE fprintf_unfiltered (gdb_stderr, -// OBSOLETE "Can't find breakpoint associated with 0x%x\n", addr); -// OBSOLETE return 1; -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Load a file. This is usually an srecord, which is ascii. No -// OBSOLETE protocol, just sent line by line. */ -// OBSOLETE -// OBSOLETE #define DOWNLOAD_LINE_SIZE 100 -// OBSOLETE static void -// OBSOLETE rombug_load (char *arg) -// OBSOLETE { -// OBSOLETE /* this part comment out for os9* */ -// OBSOLETE #if 0 -// OBSOLETE FILE *download; -// OBSOLETE char buf[DOWNLOAD_LINE_SIZE]; -// OBSOLETE int i, bytes_read; -// OBSOLETE -// OBSOLETE if (sr_get_debug ()) -// OBSOLETE printf ("Loading %s to monitor\n", arg); -// OBSOLETE -// OBSOLETE download = fopen (arg, "r"); -// OBSOLETE if (download == NULL) -// OBSOLETE { -// OBSOLETE error (sprintf (buf, "%s Does not exist", arg)); -// OBSOLETE return; -// OBSOLETE } -// OBSOLETE -// OBSOLETE printf_monitor (LOAD_CMD); -// OBSOLETE /* expect ("Waiting for S-records from host... ", 1); */ -// OBSOLETE -// OBSOLETE while (!feof (download)) -// OBSOLETE { -// OBSOLETE bytes_read = fread (buf, sizeof (char), DOWNLOAD_LINE_SIZE, download); -// OBSOLETE if (hashmark) -// OBSOLETE { -// OBSOLETE putchar ('.'); -// OBSOLETE fflush (stdout); -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (serial_write (monitor_desc, buf, bytes_read)) -// OBSOLETE { -// OBSOLETE fprintf_unfiltered (gdb_stderr, -// OBSOLETE "serial_write failed: (while downloading) %s\n", -// OBSOLETE safe_strerror (errno)); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE i = 0; -// OBSOLETE while (i++ <= 200000) -// OBSOLETE { -// OBSOLETE }; /* Ugly HACK, probably needs flow control */ -// OBSOLETE if (bytes_read < DOWNLOAD_LINE_SIZE) -// OBSOLETE { -// OBSOLETE if (!feof (download)) -// OBSOLETE error ("Only read %d bytes\n", bytes_read); -// OBSOLETE break; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (hashmark) -// OBSOLETE { -// OBSOLETE putchar ('\n'); -// OBSOLETE } -// OBSOLETE if (!feof (download)) -// OBSOLETE error ("Never got EOF while downloading"); -// OBSOLETE fclose (download); -// OBSOLETE #endif /* 0 */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Put a command string, in args, out to MONITOR. -// OBSOLETE Output from MONITOR is placed on the users terminal until the prompt -// OBSOLETE is seen. */ -// OBSOLETE -// OBSOLETE static void -// OBSOLETE rombug_command (char *args, int fromtty) -// OBSOLETE { -// OBSOLETE if (monitor_desc == NULL) -// OBSOLETE error ("monitor target not open."); -// OBSOLETE -// OBSOLETE if (monitor_log) -// OBSOLETE fprintf (log_file, "\nIn command (args=%s)\n", args); -// OBSOLETE -// OBSOLETE if (!args) -// OBSOLETE error ("Missing command."); -// OBSOLETE -// OBSOLETE printf_monitor ("%s\r", args); -// OBSOLETE expect_prompt (0); -// OBSOLETE } -// OBSOLETE -// OBSOLETE #if 0 -// OBSOLETE /* Connect the user directly to MONITOR. This command acts just like the -// OBSOLETE 'cu' or 'tip' command. Use ~. or ~^D to break out. */ -// OBSOLETE -// OBSOLETE static struct ttystate ttystate; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE cleanup_tty (void) -// OBSOLETE { -// OBSOLETE printf ("\r\n[Exiting connect mode]\r\n"); -// OBSOLETE /*serial_restore(0, &ttystate); */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE static void -// OBSOLETE connect_command (char *args, int fromtty) -// OBSOLETE { -// OBSOLETE fd_set readfds; -// OBSOLETE int numfds; -// OBSOLETE int c; -// OBSOLETE char cur_esc = 0; -// OBSOLETE -// OBSOLETE dont_repeat (); -// OBSOLETE -// OBSOLETE if (monitor_desc == NULL) -// OBSOLETE error ("monitor target not open."); -// OBSOLETE -// OBSOLETE if (args) -// OBSOLETE fprintf ("This command takes no args. They have been ignored.\n"); -// OBSOLETE -// OBSOLETE printf ("[Entering connect mode. Use ~. or ~^D to escape]\n"); -// OBSOLETE -// OBSOLETE serial_raw (0, &ttystate); -// OBSOLETE -// OBSOLETE make_cleanup (cleanup_tty, 0); -// OBSOLETE -// OBSOLETE FD_ZERO (&readfds); -// OBSOLETE -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE do -// OBSOLETE { -// OBSOLETE FD_SET (0, &readfds); -// OBSOLETE FD_SET (deprecated_serial_fd (monitor_desc), &readfds); -// OBSOLETE numfds = select (sizeof (readfds) * 8, &readfds, 0, 0, 0); -// OBSOLETE } -// OBSOLETE while (numfds == 0); -// OBSOLETE -// OBSOLETE if (numfds < 0) -// OBSOLETE perror_with_name ("select"); -// OBSOLETE -// OBSOLETE if (FD_ISSET (0, &readfds)) -// OBSOLETE { /* tty input, send to monitor */ -// OBSOLETE c = getchar (); -// OBSOLETE if (c < 0) -// OBSOLETE perror_with_name ("connect"); -// OBSOLETE -// OBSOLETE printf_monitor ("%c", c); -// OBSOLETE switch (cur_esc) -// OBSOLETE { -// OBSOLETE case 0: -// OBSOLETE if (c == '\r') -// OBSOLETE cur_esc = c; -// OBSOLETE break; -// OBSOLETE case '\r': -// OBSOLETE if (c == '~') -// OBSOLETE cur_esc = c; -// OBSOLETE else -// OBSOLETE cur_esc = 0; -// OBSOLETE break; -// OBSOLETE case '~': -// OBSOLETE if (c == '.' || c == '\004') -// OBSOLETE return; -// OBSOLETE else -// OBSOLETE cur_esc = 0; -// OBSOLETE } -// OBSOLETE } -// OBSOLETE -// OBSOLETE if (FD_ISSET (deprecated_serial_fd (monitor_desc), &readfds)) -// OBSOLETE { -// OBSOLETE while (1) -// OBSOLETE { -// OBSOLETE c = readchar (0); -// OBSOLETE if (c < 0) -// OBSOLETE break; -// OBSOLETE putchar (c); -// OBSOLETE } -// OBSOLETE fflush (stdout); -// OBSOLETE } -// OBSOLETE } -// OBSOLETE } -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* -// OBSOLETE * Define the monitor command strings. Since these are passed directly -// OBSOLETE * through to a printf style function, we need can include formatting -// OBSOLETE * strings. We also need a CR or LF on the end. -// OBSOLETE */ -// OBSOLETE #warning FIXME: monitor interface pattern strings, stale struct decl -// OBSOLETE struct monitor_ops rombug_cmds = -// OBSOLETE { -// OBSOLETE "g \r", /* execute or usually GO command */ -// OBSOLETE "g \r", /* continue command */ -// OBSOLETE "t \r", /* single step */ -// OBSOLETE "b %x\r", /* set a breakpoint */ -// OBSOLETE "k %x\r", /* clear a breakpoint */ -// OBSOLETE "c %x\r", /* set memory to a value */ -// OBSOLETE "d %x %d\r", /* display memory */ -// OBSOLETE "$%08X", /* prompt memory commands use */ -// OBSOLETE ".%s %x\r", /* set a register */ -// OBSOLETE ":", /* delimiter between registers */ -// OBSOLETE ". \r", /* read a register */ -// OBSOLETE "mf \r", /* download command */ -// OBSOLETE "RomBug: ", /* monitor command prompt */ -// OBSOLETE ": ", /* end-of-command delimitor */ -// OBSOLETE ".\r" /* optional command terminator */ -// OBSOLETE }; -// OBSOLETE -// OBSOLETE struct target_ops rombug_ops; -// OBSOLETE -// OBSOLETE static void -// OBSOLETE init_rombug_ops (void) -// OBSOLETE { -// OBSOLETE rombug_ops.to_shortname = "rombug"; -// OBSOLETE rombug_ops.to_longname = "Microware's ROMBUG debug monitor"; -// OBSOLETE rombug_ops.to_doc = "Use a remote computer running the ROMBUG debug monitor.\n\ -// OBSOLETE Specify the serial device it is connected to (e.g. /dev/ttya).", -// OBSOLETE rombug_ops.to_open = rombug_open; -// OBSOLETE rombug_ops.to_close = rombug_close; -// OBSOLETE rombug_ops.to_attach = 0; -// OBSOLETE rombug_ops.to_post_attach = NULL; -// OBSOLETE rombug_ops.to_require_attach = NULL; -// OBSOLETE rombug_ops.to_detach = rombug_detach; -// OBSOLETE rombug_ops.to_require_detach = NULL; -// OBSOLETE rombug_ops.to_resume = rombug_resume; -// OBSOLETE rombug_ops.to_wait = rombug_wait; -// OBSOLETE rombug_ops.to_post_wait = NULL; -// OBSOLETE rombug_ops.to_fetch_registers = rombug_fetch_register; -// OBSOLETE rombug_ops.to_store_registers = rombug_store_register; -// OBSOLETE rombug_ops.to_prepare_to_store = rombug_prepare_to_store; -// OBSOLETE rombug_ops.to_xfer_memory = rombug_xfer_inferior_memory; -// OBSOLETE rombug_ops.to_files_info = rombug_files_info; -// OBSOLETE rombug_ops.to_insert_breakpoint = rombug_insert_breakpoint; -// OBSOLETE rombug_ops.to_remove_breakpoint = rombug_remove_breakpoint; /* Breakpoints */ -// OBSOLETE rombug_ops.to_terminal_init = 0; -// OBSOLETE rombug_ops.to_terminal_inferior = 0; -// OBSOLETE rombug_ops.to_terminal_ours_for_output = 0; -// OBSOLETE rombug_ops.to_terminal_ours = 0; -// OBSOLETE rombug_ops.to_terminal_info = 0; /* Terminal handling */ -// OBSOLETE rombug_ops.to_kill = rombug_kill; -// OBSOLETE rombug_ops.to_load = rombug_load; /* load */ -// OBSOLETE rombug_ops.to_lookup_symbol = rombug_link; /* lookup_symbol */ -// OBSOLETE rombug_ops.to_create_inferior = rombug_create_inferior; -// OBSOLETE rombug_ops.to_post_startup_inferior = NULL; -// OBSOLETE rombug_ops.to_acknowledge_created_inferior = NULL; -// OBSOLETE rombug_ops.to_clone_and_follow_inferior = NULL; -// OBSOLETE rombug_ops.to_post_follow_inferior_by_clone = NULL; -// OBSOLETE rombug_ops.to_insert_fork_catchpoint = NULL; -// OBSOLETE rombug_ops.to_remove_fork_catchpoint = NULL; -// OBSOLETE rombug_ops.to_insert_vfork_catchpoint = NULL; -// OBSOLETE rombug_ops.to_remove_vfork_catchpoint = NULL; -// OBSOLETE rombug_ops.to_has_forked = NULL; -// OBSOLETE rombug_ops.to_has_vforked = NULL; -// OBSOLETE rombug_ops.to_can_follow_vfork_prior_to_exec = NULL; -// OBSOLETE rombug_ops.to_post_follow_vfork = NULL; -// OBSOLETE rombug_ops.to_insert_exec_catchpoint = NULL; -// OBSOLETE rombug_ops.to_remove_exec_catchpoint = NULL; -// OBSOLETE rombug_ops.to_has_execd = NULL; -// OBSOLETE rombug_ops.to_reported_exec_events_per_exec_call = NULL; -// OBSOLETE rombug_ops.to_has_exited = NULL; -// OBSOLETE rombug_ops.to_mourn_inferior = rombug_mourn_inferior; -// OBSOLETE rombug_ops.to_can_run = 0; /* can_run */ -// OBSOLETE rombug_ops.to_notice_signals = 0; /* notice_signals */ -// OBSOLETE rombug_ops.to_thread_alive = 0; -// OBSOLETE rombug_ops.to_stop = 0; /* to_stop */ -// OBSOLETE rombug_ops.to_pid_to_exec_file = NULL; -// OBSOLETE rombug_ops.to_stratum = process_stratum; -// OBSOLETE rombug_ops.DONT_USE = 0; /* next */ -// OBSOLETE rombug_ops.to_has_all_memory = 1; -// OBSOLETE rombug_ops.to_has_memory = 1; -// OBSOLETE rombug_ops.to_has_stack = 1; -// OBSOLETE rombug_ops.to_has_registers = 1; -// OBSOLETE rombug_ops.to_has_execution = 1; /* has execution */ -// OBSOLETE rombug_ops.to_sections = 0; -// OBSOLETE rombug_ops.to_sections_end = 0; /* Section pointers */ -// OBSOLETE rombug_ops.to_magic = OPS_MAGIC; /* Always the last thing */ -// OBSOLETE } -// OBSOLETE -// OBSOLETE void -// OBSOLETE _initialize_remote_os9k (void) -// OBSOLETE { -// OBSOLETE init_rombug_ops (); -// OBSOLETE add_target (&rombug_ops); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("hash", no_class, var_boolean, (char *) &hashmark, -// OBSOLETE "Set display of activity while downloading a file.\nWhen enabled, a period \'.\' is displayed.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("timeout", no_class, var_zinteger, -// OBSOLETE (char *) &timeout, -// OBSOLETE "Set timeout in seconds for remote MIPS serial I/O.", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("remotelog", no_class, var_zinteger, -// OBSOLETE (char *) &monitor_log, -// OBSOLETE "Set monitor activity log on(=1) or off(=0).", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("remotexon", no_class, var_zinteger, -// OBSOLETE (char *) &tty_xon, -// OBSOLETE "Set remote tty line XON control", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_show_from_set ( -// OBSOLETE add_set_cmd ("remotexoff", no_class, var_zinteger, -// OBSOLETE (char *) &tty_xoff, -// OBSOLETE "Set remote tty line XOFF control", -// OBSOLETE &setlist), -// OBSOLETE &showlist); -// OBSOLETE -// OBSOLETE add_com ("rombug ", class_obscure, rombug_command, -// OBSOLETE "Send a command to the debug monitor."); -// OBSOLETE #if 0 -// OBSOLETE add_com ("connect", class_obscure, connect_command, -// OBSOLETE "Connect the terminal directly up to a serial based command monitor.\nUse ~. or ~^D to break out."); -// OBSOLETE #endif -// OBSOLETE } diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c index 20ed516..3f956e7 100644 --- a/gdb/remote-rdp.c +++ b/gdb/remote-rdp.c @@ -1163,9 +1163,7 @@ remote_rdp_open (char *args, int from_tty) flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - set_current_frame (create_new_frame (read_fp (), stop_pc)); - select_frame (get_current_frame ()); - print_stack_frame (selected_frame, -1, 1); + print_stack_frame (get_selected_frame (), -1, 1); } diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index 0bd8c52..39d18e4 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -820,9 +820,6 @@ net_get_symbols (ldtabl *pLoadTable) Returns status of symbol read on target side (0=success, -1=fail) Returns -1 and complain()s if rpc fails. */ -struct deprecated_complaint cant_contact_target = -{"Lost contact with VxWorks target", 0, 0}; - static int vx_lookup_symbol (char *name, /* symbol name */ CORE_ADDR *pAddr) @@ -837,7 +834,7 @@ vx_lookup_symbol (char *name, /* symbol name */ xdr_SYMBOL_ADDR, &symbolAddr); if (status != RPC_SUCCESS) { - complain (&cant_contact_target); + complaint (&symfile_complaints, "Lost contact with VxWorks target"); return -1; } diff --git a/gdb/remote-vx960.c b/gdb/remote-vx960.c deleted file mode 100644 index 87435da..0000000 --- a/gdb/remote-vx960.c +++ /dev/null @@ -1,160 +0,0 @@ -// OBSOLETE /* i80960-dependent portions of the RPC protocol -// OBSOLETE used with a VxWorks target -// OBSOLETE -// OBSOLETE Contributed by Wind River Systems. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include "defs.h" -// OBSOLETE -// OBSOLETE #include "vx-share/regPacket.h" -// OBSOLETE #include "frame.h" -// OBSOLETE #include "inferior.h" -// OBSOLETE #include "target.h" -// OBSOLETE #include "gdbcore.h" -// OBSOLETE #include "command.h" -// OBSOLETE #include "symtab.h" -// OBSOLETE #include "symfile.h" /* for struct complaint */ -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE #include "gdb_string.h" -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE #ifdef _AIX /* IBM claims "void *malloc()" not char * */ -// OBSOLETE #define malloc bogon_malloc -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #include -// OBSOLETE #include /* UTek's doesn't #incl this */ -// OBSOLETE #include -// OBSOLETE #include "vx-share/ptrace.h" -// OBSOLETE #include "vx-share/xdr_ptrace.h" -// OBSOLETE #include "vx-share/xdr_ld.h" -// OBSOLETE #include "vx-share/xdr_rdb.h" -// OBSOLETE #include "vx-share/dbgRpcLib.h" -// OBSOLETE -// OBSOLETE /* get rid of value.h if possible */ -// OBSOLETE #include -// OBSOLETE #include -// OBSOLETE -// OBSOLETE /* Flag set if target has fpu */ -// OBSOLETE -// OBSOLETE extern int target_has_fp; -// OBSOLETE -// OBSOLETE /* 960 floating point format descriptor, from "i960-tdep.c." */ -// OBSOLETE -// OBSOLETE extern struct ext_format ext_format_i960; -// OBSOLETE -// OBSOLETE /* Generic register read/write routines in remote-vx.c. */ -// OBSOLETE -// OBSOLETE extern void net_read_registers (); -// OBSOLETE extern void net_write_registers (); -// OBSOLETE -// OBSOLETE /* Read a register or registers from the VxWorks target. -// OBSOLETE REGNO is the register to read, or -1 for all; currently, -// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE vx_read_register (int regno) -// OBSOLETE { -// OBSOLETE char i960_greg_packet[I960_GREG_PLEN]; -// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN]; -// OBSOLETE -// OBSOLETE /* Get general-purpose registers. When copying values into -// OBSOLETE registers [], don't assume that a location in registers [] -// OBSOLETE is properly aligned for the target data type. */ -// OBSOLETE -// OBSOLETE net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS); -// OBSOLETE -// OBSOLETE bcopy (&i960_greg_packet[I960_R_R0], -// OBSOLETE ®isters[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE); -// OBSOLETE bcopy (&i960_greg_packet[I960_R_G0], -// OBSOLETE ®isters[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE); -// OBSOLETE bcopy (&i960_greg_packet[I960_R_PCW], -// OBSOLETE ®isters[REGISTER_BYTE (PCW_REGNUM)], sizeof (int)); -// OBSOLETE bcopy (&i960_greg_packet[I960_R_ACW], -// OBSOLETE ®isters[REGISTER_BYTE (ACW_REGNUM)], sizeof (int)); -// OBSOLETE bcopy (&i960_greg_packet[I960_R_TCW], -// OBSOLETE ®isters[REGISTER_BYTE (TCW_REGNUM)], sizeof (int)); -// OBSOLETE -// OBSOLETE /* If the target has floating point registers, fetch them. -// OBSOLETE Otherwise, zero the floating point register values in -// OBSOLETE registers[] for good measure, even though we might not -// OBSOLETE need to. */ -// OBSOLETE -// OBSOLETE if (target_has_fp) -// OBSOLETE { -// OBSOLETE net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN, -// OBSOLETE PTRACE_GETFPREGS); -// OBSOLETE bcopy (&i960_fpreg_packet[I960_R_FP0], -// OBSOLETE ®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); -// OBSOLETE } -// OBSOLETE else -// OBSOLETE bzero (®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); -// OBSOLETE -// OBSOLETE /* Mark the register cache valid. */ -// OBSOLETE -// OBSOLETE registers_fetched (); -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Store a register or registers into the VxWorks target. -// OBSOLETE REGNO is the register to store, or -1 for all; currently, -// OBSOLETE it is ignored. FIXME look at regno to improve efficiency. */ -// OBSOLETE -// OBSOLETE void -// OBSOLETE vx_write_register (int regno) -// OBSOLETE { -// OBSOLETE char i960_greg_packet[I960_GREG_PLEN]; -// OBSOLETE char i960_fpreg_packet[I960_FPREG_PLEN]; -// OBSOLETE -// OBSOLETE /* Store floating-point registers. When copying values from -// OBSOLETE registers [], don't assume that a location in registers [] -// OBSOLETE is properly aligned for the target data type. */ -// OBSOLETE -// OBSOLETE bcopy (®isters[REGISTER_BYTE (R0_REGNUM)], -// OBSOLETE &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE); -// OBSOLETE bcopy (®isters[REGISTER_BYTE (G0_REGNUM)], -// OBSOLETE &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE); -// OBSOLETE bcopy (®isters[REGISTER_BYTE (PCW_REGNUM)], -// OBSOLETE &i960_greg_packet[I960_R_PCW], sizeof (int)); -// OBSOLETE bcopy (®isters[REGISTER_BYTE (ACW_REGNUM)], -// OBSOLETE &i960_greg_packet[I960_R_ACW], sizeof (int)); -// OBSOLETE bcopy (®isters[REGISTER_BYTE (TCW_REGNUM)], -// OBSOLETE &i960_greg_packet[I960_R_TCW], sizeof (int)); -// OBSOLETE -// OBSOLETE net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS); -// OBSOLETE -// OBSOLETE /* Store floating point registers if the target has them. */ -// OBSOLETE -// OBSOLETE if (target_has_fp) -// OBSOLETE { -// OBSOLETE bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], -// OBSOLETE &i960_fpreg_packet[I960_R_FP0], -// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4); -// OBSOLETE -// OBSOLETE net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN, -// OBSOLETE PTRACE_SETFPREGS); -// OBSOLETE } -// OBSOLETE } diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c index cc0586f..c065a87 100644 --- a/gdb/rom68k-rom.c +++ b/gdb/rom68k-rom.c @@ -27,6 +27,8 @@ #include "regcache.h" #include "value.h" +#include "m68k-tdep.h" + static void rom68k_open (char *args, int from_tty); /* Return true if C is a hex digit. @@ -129,13 +131,13 @@ rom68k_supply_register (char *regname, int regnamelen, char *val, int vallen) case 'D': if (regname[1] != 'R') break; - regno = D0_REGNUM; + regno = M68K_D0_REGNUM; numregs = 8; break; case 'A': if (regname[1] != 'R') break; - regno = A0_REGNUM; + regno = M68K_A0_REGNUM; numregs = 7; break; } diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 26f5e4c..98cf2d9 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -166,16 +166,16 @@ struct frame_extra_info void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *fi) { - fi->extra_info = (struct frame_extra_info *) - frame_obstack_alloc (sizeof (struct frame_extra_info)); - fi->extra_info->initial_sp = 0; - if (fi->next != (CORE_ADDR) 0 - && fi->pc < TEXT_SEGMENT_BASE) + struct frame_extra_info *extra_info = + frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); + extra_info->initial_sp = 0; + if (get_next_frame (fi) != NULL + && get_frame_pc (fi) < TEXT_SEGMENT_BASE) /* We're in get_prev_frame */ /* and this is a special signal frame. */ /* (fi->pc will be some low address in the kernel, */ /* to which the signal handler returns). */ - fi->signal_handler_caller = 1; + deprecated_set_frame_type (fi, SIGTRAMP_FRAME); } /* Put here the code to store, into a struct frame_saved_regs, @@ -197,8 +197,9 @@ rs6000_frame_init_saved_regs (struct frame_info *fi) static CORE_ADDR rs6000_frame_args_address (struct frame_info *fi) { - if (fi->extra_info->initial_sp != 0) - return fi->extra_info->initial_sp; + struct frame_extra_info *extra_info = get_frame_extra_info (fi); + if (extra_info->initial_sp != 0) + return extra_info->initial_sp; else return frame_initial_stack_address (fi); } @@ -261,7 +262,7 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety) fi = get_current_frame (); if (fi != NULL) - dest = read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, + dest = read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET, gdbarch_tdep (current_gdbarch)->wordsize); } } @@ -956,9 +957,11 @@ rs6000_pop_frame (void) int ii, wordsize; pc = read_pc (); - sp = FRAME_FP (frame); + sp = get_frame_base (frame); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), + get_frame_base (frame), + get_frame_base (frame))) { generic_pop_dummy_frame (); flush_cached_frames (); @@ -972,8 +975,8 @@ rs6000_pop_frame (void) still in the link register, otherwise walk the frames and retrieve the saved %pc value in the previous frame. */ - addr = get_pc_function_start (frame->pc); - (void) skip_prologue (addr, frame->pc, &fdata); + addr = get_pc_function_start (get_frame_pc (frame)); + (void) skip_prologue (addr, get_frame_pc (frame), &fdata); wordsize = gdbarch_tdep (current_gdbarch)->wordsize; if (fdata.frameless) @@ -1477,10 +1480,11 @@ rs6000_frameless_function_invocation (struct frame_info *fi) /* Don't even think about framelessness except on the innermost frame or if the function was interrupted by a signal. */ - if (fi->next != NULL && !fi->next->signal_handler_caller) + if (get_next_frame (fi) != NULL + && !(get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) return 0; - func_start = get_pc_function_start (fi->pc); + func_start = get_pc_function_start (get_frame_pc (fi)); /* If we failed to find the start of the function, it is a mistake to inspect the instructions. */ @@ -1491,13 +1495,13 @@ rs6000_frameless_function_invocation (struct frame_info *fi) 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. */ - if (fi->pc == 0) + if (get_frame_pc (fi) == 0) return 1; else return 0; } - (void) skip_prologue (func_start, fi->pc, &fdata); + (void) skip_prologue (func_start, get_frame_pc (fi), &fdata); return fdata.frameless; } @@ -1511,27 +1515,32 @@ rs6000_frame_saved_pc (struct frame_info *fi) struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int wordsize = tdep->wordsize; - if (fi->signal_handler_caller) - return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize); + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) + return read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET, + wordsize); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) - return deprecated_read_register_dummy (fi->pc, fi->frame, PC_REGNUM); + if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), + get_frame_base (fi), + get_frame_base (fi))) + return deprecated_read_register_dummy (get_frame_pc (fi), + get_frame_base (fi), PC_REGNUM); - func_start = get_pc_function_start (fi->pc); + func_start = get_pc_function_start (get_frame_pc (fi)); /* If we failed to find the start of the function, it is a mistake to inspect the instructions. */ if (!func_start) return 0; - (void) skip_prologue (func_start, fi->pc, &fdata); + (void) skip_prologue (func_start, get_frame_pc (fi), &fdata); - if (fdata.lr_offset == 0 && fi->next != NULL) + if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL) { - if (fi->next->signal_handler_caller) - return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET, + if ((get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) + return read_memory_addr ((get_frame_base (get_next_frame (fi)) + + SIG_FRAME_LR_OFFSET), wordsize); - else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0)) + else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0)) /* The link register wasn't saved by this frame and the next (inner, newer) frame is a dummy. Get the link register value by unwinding it from that [dummy] frame. */ @@ -1564,13 +1573,14 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch); int wordsize = tdep->wordsize; - if (fi->saved_regs) + if (get_frame_saved_regs (fi)) return; if (fdatap == NULL) { fdatap = &work_fdata; - (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, fdatap); + (void) skip_prologue (get_pc_function_start (get_frame_pc (fi)), + get_frame_pc (fi), fdatap); } frame_saved_regs_zalloc (fi); @@ -1606,7 +1616,7 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) CORE_ADDR fpr_addr = frame_addr + fdatap->fpr_offset; for (i = fdatap->saved_fpr; i < 32; i++) { - fi->saved_regs[FP0_REGNUM + i] = fpr_addr; + get_frame_saved_regs (fi)[FP0_REGNUM + i] = fpr_addr; fpr_addr += 8; } } @@ -1620,7 +1630,7 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) CORE_ADDR gpr_addr = frame_addr + fdatap->gpr_offset; for (i = fdatap->saved_gpr; i < 32; i++) { - fi->saved_regs[i] = gpr_addr; + get_frame_saved_regs (fi)[i] = gpr_addr; gpr_addr += wordsize; } } @@ -1635,7 +1645,7 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) CORE_ADDR vr_addr = frame_addr + fdatap->vr_offset; for (i = fdatap->saved_vr; i < 32; i++) { - fi->saved_regs[tdep->ppc_vr0_regnum + i] = vr_addr; + get_frame_saved_regs (fi)[tdep->ppc_vr0_regnum + i] = vr_addr; vr_addr += REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum); } } @@ -1651,8 +1661,8 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) CORE_ADDR ev_addr = frame_addr + fdatap->ev_offset; for (i = fdatap->saved_ev; i < 32; i++) { - fi->saved_regs[tdep->ppc_ev0_regnum + i] = ev_addr; - fi->saved_regs[tdep->ppc_gp0_regnum + i] = ev_addr + 4; + get_frame_saved_regs (fi)[tdep->ppc_ev0_regnum + i] = ev_addr; + get_frame_saved_regs (fi)[tdep->ppc_gp0_regnum + i] = ev_addr + 4; ev_addr += REGISTER_RAW_SIZE (tdep->ppc_ev0_regnum); } } @@ -1661,17 +1671,17 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) /* If != 0, fdatap->cr_offset is the offset from the frame that holds the CR. */ if (fdatap->cr_offset != 0) - fi->saved_regs[tdep->ppc_cr_regnum] = frame_addr + fdatap->cr_offset; + get_frame_saved_regs (fi)[tdep->ppc_cr_regnum] = frame_addr + fdatap->cr_offset; /* If != 0, fdatap->lr_offset is the offset from the frame that holds the LR. */ if (fdatap->lr_offset != 0) - fi->saved_regs[tdep->ppc_lr_regnum] = frame_addr + fdatap->lr_offset; + get_frame_saved_regs (fi)[tdep->ppc_lr_regnum] = frame_addr + fdatap->lr_offset; /* If != 0, fdatap->vrsave_offset is the offset from the frame that holds the VRSAVE. */ if (fdatap->vrsave_offset != 0) - fi->saved_regs[tdep->ppc_vrsave_regnum] = frame_addr + fdatap->vrsave_offset; + get_frame_saved_regs (fi)[tdep->ppc_vrsave_regnum] = frame_addr + fdatap->vrsave_offset; } /* Return the address of a frame. This is the inital %sp value when the frame @@ -1688,17 +1698,18 @@ frame_initial_stack_address (struct frame_info *fi) /* If the initial stack pointer (frame address) of this frame is known, just return it. */ - if (fi->extra_info->initial_sp) - return fi->extra_info->initial_sp; + if (get_frame_extra_info (fi)->initial_sp) + return get_frame_extra_info (fi)->initial_sp; /* Find out if this function is using an alloca register. */ - (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, &fdata); + (void) skip_prologue (get_pc_function_start (get_frame_pc (fi)), + get_frame_pc (fi), &fdata); /* If saved registers of this frame are not known yet, read and cache them. */ - if (!fi->saved_regs) + if (!get_frame_saved_regs (fi)) frame_get_saved_regs (fi, &fdata); /* If no alloca register used, then fi->frame is the value of the %sp for @@ -1706,8 +1717,8 @@ frame_initial_stack_address (struct frame_info *fi) if (fdata.alloca_reg < 0) { - fi->extra_info->initial_sp = fi->frame; - return fi->extra_info->initial_sp; + get_frame_extra_info (fi)->initial_sp = get_frame_base (fi); + return get_frame_extra_info (fi)->initial_sp; } /* There is an alloca register, use its value, in the current frame, @@ -1716,7 +1727,7 @@ frame_initial_stack_address (struct frame_info *fi) char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE); if (frame_register_read (fi, fdata.alloca_reg, tmpbuf)) { - fi->extra_info->initial_sp + get_frame_extra_info (fi)->initial_sp = extract_unsigned_integer (tmpbuf, REGISTER_RAW_SIZE (fdata.alloca_reg)); } @@ -1724,9 +1735,9 @@ frame_initial_stack_address (struct frame_info *fi) /* NOTE: cagney/2002-04-17: At present the only time frame_register_read will fail is when the register isn't available. If that does happen, use the frame. */ - fi->extra_info->initial_sp = fi->frame; + get_frame_extra_info (fi)->initial_sp = get_frame_base (fi); } - return fi->extra_info->initial_sp; + return get_frame_extra_info (fi)->initial_sp; } /* Describe the pointer in each stack frame to the previous stack frame @@ -1744,26 +1755,28 @@ rs6000_frame_chain (struct frame_info *thisframe) CORE_ADDR fp, fpp, lr; int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; - if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), + get_frame_base (thisframe), + get_frame_base (thisframe))) /* A dummy frame always correctly chains back to the previous frame. */ - return read_memory_addr ((thisframe)->frame, wordsize); + return read_memory_addr (get_frame_base (thisframe), wordsize); - if (inside_entry_file (thisframe->pc) || - thisframe->pc == entry_point_address ()) + if (inside_entry_file (get_frame_pc (thisframe)) + || get_frame_pc (thisframe) == entry_point_address ()) return 0; - if (thisframe->signal_handler_caller) - fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET, - wordsize); - else if (thisframe->next != NULL - && thisframe->next->signal_handler_caller + if ((get_frame_type (thisframe) == SIGTRAMP_FRAME)) + fp = read_memory_addr (get_frame_base (thisframe) + SIG_FRAME_FP_OFFSET, + wordsize); + else if (get_next_frame (thisframe) != NULL + && (get_frame_type (get_next_frame (thisframe)) == SIGTRAMP_FRAME) && FRAMELESS_FUNCTION_INVOCATION (thisframe)) /* A frameless function interrupted by a signal did not change the frame pointer. */ - fp = FRAME_FP (thisframe); + fp = get_frame_base (thisframe); else - fp = read_memory_addr ((thisframe)->frame, wordsize); + fp = read_memory_addr (get_frame_base (thisframe), wordsize); return fp; } @@ -2880,17 +2893,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_char_signed (gdbarch, 0); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy); set_gdbarch_frame_align (gdbarch, rs6000_frame_align); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 94defe5..964c23a 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -881,25 +881,24 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi, for the moment. For some reason the blockframe.c calls us with fi->next->fromleaf so this seems of little use to us. */ -void +CORE_ADDR s390_init_frame_pc_first (int next_fromleaf, struct frame_info *fi) { CORE_ADDR sigcaller_pc; - - fi->pc = 0; + CORE_ADDR pc = 0; if (next_fromleaf) { - fi->pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM)); + pc = ADDR_BITS_REMOVE (read_register (S390_RETADDR_REGNUM)); /* fix signal handlers */ } - else if (fi->next && fi->next->pc) - fi->pc = s390_frame_saved_pc_nofix (fi->next); - if (fi->pc && fi->next && fi->next->frame && - s390_is_sigreturn (fi->pc, fi->next, NULL, &sigcaller_pc)) + else if (get_next_frame (fi) && get_frame_pc (get_next_frame (fi))) + pc = s390_frame_saved_pc_nofix (get_next_frame (fi)); + if (pc && get_next_frame (fi) && get_frame_base (get_next_frame (fi)) + && s390_is_sigreturn (pc, get_next_frame (fi), NULL, &sigcaller_pc)) { - fi->pc = sigcaller_pc; + pc = sigcaller_pc; } - + return pc; } void @@ -1001,8 +1000,8 @@ s390_frame_saved_pc (struct frame_info *fi) -/* We want backtraces out of signal handlers so we don't - set thisframe->signal_handler_caller to 1 */ +/* We want backtraces out of signal handlers so we don't set + (get_frame_type (thisframe) == SIGTRAMP_FRAME) to 1 */ CORE_ADDR s390_frame_chain (struct frame_info *thisframe) @@ -1762,6 +1761,10 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Yes: create a new gdbarch for the specified machine type. */ gdbarch = gdbarch_alloc (&info, NULL); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + set_gdbarch_believe_pcc_promotion (gdbarch, 0); set_gdbarch_char_signed (gdbarch, 0); @@ -1790,7 +1793,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc); set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue); set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info); - set_gdbarch_init_frame_pc_first (gdbarch, s390_init_frame_pc_first); + set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first); set_gdbarch_read_fp (gdbarch, s390_read_fp); /* This function that tells us whether the function invocation represented by FI does not have a frame on the stack associated with it. If it @@ -1811,7 +1814,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, S390_NUM_REGS); set_gdbarch_cannot_fetch_register (gdbarch, s390_cannot_fetch_register); set_gdbarch_cannot_store_register (gdbarch, s390_cannot_fetch_register); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_use_struct_convention (gdbarch, s390_use_struct_convention); set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid); set_gdbarch_register_name (gdbarch, s390_register_name); @@ -1823,12 +1825,10 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Parameters for inferior function calls. */ set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_arguments (gdbarch, s390_push_arguments); set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 3d6c488..dc68b15 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -918,19 +918,20 @@ gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info) return print_insn_sh (memaddr, info); } -/* Given a GDB frame, determine the address of the calling function's frame. - This will be used to create a new GDB frame struct, and then - INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. +/* 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 DEPRECATED_INIT_FRAME_PC will be + called for the new frame. For us, the frame address is its stack pointer value, so we look up the function prologue to determine the caller's sp value, and return it. */ static CORE_ADDR sh_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->pc && !inside_entry_file (frame->pc)) - return read_memory_integer (FRAME_FP (frame) + frame->extra_info->f_offset, 4); + return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, 4); else return 0; } @@ -965,7 +966,7 @@ translate_insn_rn (int rn, int media_mode) static CORE_ADDR sh64_frame_chain (struct frame_info *frame) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) return frame->frame; /* dummy frame same as caller's frame */ if (frame->pc && !inside_entry_file (frame->pc)) { @@ -975,7 +976,7 @@ sh64_frame_chain (struct frame_info *frame) size = 4; else size = REGISTER_RAW_SIZE (translate_insn_rn (FP_REGNUM, media_mode)); - return read_memory_integer (FRAME_FP (frame) + frame->extra_info->f_offset, size); + return read_memory_integer (get_frame_base (frame) + frame->extra_info->f_offset, size); } else return 0; @@ -990,7 +991,7 @@ static CORE_ADDR sh_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) /* When the caller requests PR from the dummy frame, we return PC because that's where the previous routine appears to have done a call from. */ return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); @@ -1012,7 +1013,7 @@ sh64_get_saved_pr (struct frame_info *fi, int pr_regnum) int media_mode = 0; for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) /* When the caller requests PR from the dummy frame, we return PC because that's where the previous routine appears to have done a call from. */ return deprecated_read_register_dummy (fi->pc, fi->frame, pr_regnum); @@ -1725,7 +1726,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1757,7 +1758,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi) if (fi->next) fi->pc = FRAME_SAVED_PC (fi->next); - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* We need to setup fi->frame here because run_stack_dummy gets it wrong by assuming it's always FP. */ @@ -1814,7 +1815,7 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, while (frame && ((frame = frame->next) != NULL)) { - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) { if (lval) /* found it in a CALL_DUMMY frame */ *lval = not_lval; @@ -1908,11 +1909,11 @@ sh_pop_frame (void) register CORE_ADDR fp; register int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { - fp = FRAME_FP (frame); + fp = get_frame_base (frame); FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame */ @@ -1938,11 +1939,11 @@ sh64_pop_frame (void) int media_mode = pc_is_isa32 (frame->pc); - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { - fp = FRAME_FP (frame); + fp = get_frame_base (frame); FRAME_INIT_SAVED_REGS (frame); /* Copy regs from where they were saved in the frame */ @@ -2937,7 +2938,7 @@ sh64_show_compact_regs (void) static void sh64_show_regs (void) { - if (pc_is_isa32 (selected_frame->pc)) + if (pc_is_isa32 (deprecated_selected_frame->pc)) sh64_show_media_regs (); else sh64_show_compact_regs (); @@ -3919,7 +3920,7 @@ sh_do_fp_register (int regnum) raw_buffer = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM)); /* Get the data in raw format. */ - if (!frame_register_read (selected_frame, regnum, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum)); /* Get the register as a number */ @@ -4001,7 +4002,7 @@ sh_do_register (int regnum) print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout); /* Get the data in raw format. */ - if (!frame_register_read (selected_frame, regnum, raw_buffer)) + if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) printf_filtered ("*value not available*\n"); val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0, 0, @@ -4112,7 +4113,7 @@ sh_compact_do_registers_info (int regnum, int fpregs) void sh64_do_registers_info (int regnum, int fpregs) { - if (pc_is_isa32 (selected_frame->pc)) + if (pc_is_isa32 (deprecated_selected_frame->pc)) sh_do_registers_info (regnum, fpregs); else sh_compact_do_registers_info (regnum, fpregs); @@ -4241,6 +4242,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = XMALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->osabi = osabi; /* Initialize the register numbers that are not common to all the @@ -4560,14 +4565,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT); - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); /*???*/ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_words (gdbarch, sh_call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (sh_call_dummy_words)); set_gdbarch_call_dummy_p (gdbarch, 1); @@ -4589,8 +4591,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); set_gdbarch_frame_saved_pc (gdbarch, sh_frame_saved_pc); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_saved_pc_after_call (gdbarch, sh_saved_pc_after_call); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_believe_pcc_promotion (gdbarch, 1); diff --git a/gdb/shnbsd-tdep.c b/gdb/shnbsd-tdep.c index b67884d..d2f042a 100644 --- a/gdb/shnbsd-tdep.c +++ b/gdb/shnbsd-tdep.c @@ -188,5 +188,6 @@ _initialize_shnbsd_tdep (void) add_core_fns (&shnbsd_core_fns); add_core_fns (&shnbsd_elfcore_fns); - gdbarch_register_osabi (bfd_arch_sh, GDB_OSABI_NETBSD_ELF, shnbsd_init_abi); + gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD_ELF, + shnbsd_init_abi); } diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 78161e0..8ced5f0 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -446,15 +446,16 @@ elf_locate_base (void) else if (dyn_tag == DT_MIPS_RLD_MAP) { char *pbuf; + int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT; - pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT); + pbuf = alloca (pbuf_size); /* DT_MIPS_RLD_MAP contains a pointer to the address of the dynamic link structure. */ dyn_ptr = bfd_h_get_32 (exec_bfd, (bfd_byte *) x_dynp->d_un.d_ptr); - if (target_read_memory (dyn_ptr, pbuf, sizeof (pbuf))) + if (target_read_memory (dyn_ptr, pbuf, pbuf_size)) return 0; - return extract_unsigned_integer (pbuf, sizeof (pbuf)); + return extract_unsigned_integer (pbuf, pbuf_size); } } } @@ -477,6 +478,20 @@ elf_locate_base (void) (bfd_byte *) x_dynp->d_un.d_ptr); return dyn_ptr; } + else if (dyn_tag == DT_MIPS_RLD_MAP) + { + char *pbuf; + int pbuf_size = TARGET_PTR_BIT / HOST_CHAR_BIT; + + pbuf = alloca (pbuf_size); + /* DT_MIPS_RLD_MAP contains a pointer to the address + of the dynamic link structure. */ + dyn_ptr = bfd_h_get_64 (exec_bfd, + (bfd_byte *) x_dynp->d_un.d_ptr); + if (target_read_memory (dyn_ptr, pbuf, pbuf_size)) + return 0; + return extract_unsigned_integer (pbuf, pbuf_size); + } } } diff --git a/gdb/solib.c b/gdb/solib.c index d4876c1..639788b 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -42,6 +42,7 @@ #include "filenames.h" /* for DOSish file names */ #include "solist.h" +#include /* external data declarations */ diff --git a/gdb/somsolib.c b/gdb/somsolib.c index 2eb1ff5..6cc9f45 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -191,7 +191,7 @@ addr_and_unwind_t; /* When adding fields, be sure to clear them in _initialize_som_solib. */ static struct { - boolean is_valid; + int is_valid; addr_and_unwind_t hook; addr_and_unwind_t hook_stub; addr_and_unwind_t load; diff --git a/gdb/source.c b/gdb/source.c index 293913e..1cc4dd0 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -44,6 +44,7 @@ #include "filenames.h" /* for DOSish file names */ #include "completer.h" #include "ui-out.h" +#include #ifdef CRLF_SOURCE_FILES @@ -357,6 +358,12 @@ init_source_path (void) forget_cached_source_info (); } +void +init_last_source_visited (void) +{ + last_source_visited = NULL; +} + /* Add zero or more directories to the front of the source path. */ void @@ -387,6 +394,18 @@ directory_command (char *dirname, int from_tty) void mod_path (char *dirname, char **which_path) { + add_path (dirname, which_path, 1); +} + +/* Workhorse of mod_path. Takes an extra argument to determine + if dirname should be parsed for separators that indicate multiple + directories. This allows for interfaces that pre-parse the dirname + and allow specification of traditional separator characters such + as space or tab. */ + +void +add_path (char *dirname, char **which_path, int parse_separators) +{ char *old = *which_path; int prefix = 0; @@ -403,9 +422,16 @@ mod_path (char *dirname, char **which_path) struct stat st; { - char *separator = strchr (name, DIRNAME_SEPARATOR); - char *space = strchr (name, ' '); - char *tab = strchr (name, '\t'); + char *separator = NULL; + char *space = NULL; + char *tab = NULL; + + if (parse_separators) + { + separator = strchr (name, DIRNAME_SEPARATOR); + space = strchr (name, ' '); + tab = strchr (name, '\t'); + } if (separator == 0 && space == 0 && tab == 0) p = dirname = name + strlen (name); @@ -536,7 +562,8 @@ mod_path (char *dirname, char **which_path) tinybuf[0] = DIRNAME_SEPARATOR; tinybuf[1] = '\0'; - /* If we have already tacked on a name(s) in this command, be sure they stay on the front as we tack on some more. */ + /* If we have already tacked on a name(s) in this command, be sure they stay + on the front as we tack on some more. */ if (prefix) { char *temp, c; diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index b2c6d41..5970b5a 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -1,5 +1,6 @@ /* Functions specific to running gdb native on a SPARC running SunOS4. - Copyright 1989, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1989, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -58,6 +59,25 @@ fetch_inferior_registers (int regno) struct regs inferior_registers; struct fp_status inferior_fp_registers; int i; + int fetch_pid; + + /* NOTE: cagney/2002-12-03: This code assumes that the currently + selected light weight processes' registers can be written + directly into the selected thread's register cache. This works + fine when given an 1:1 LWP:thread model (such as found on + GNU/Linux) but will, likely, have problems when used on an N:1 + (userland threads) or N:M (userland multiple LWP) model. In the + case of the latter two, the LWP's registers do not necessarily + belong to the selected thread (the LWP could be in the middle of + executing the thread switch code). + + These functions should instead be paramaterized with an explicit + object (struct regcache, struct thread_info?) into which the LWPs + registers can be written. */ + + fetch_pid = TIDGET (inferior_ptid); + if (fetch_pid == 0) + fetch_pid = PIDGET (inferior_ptid); /* We should never be called with deferred stores, because a prerequisite for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh. */ @@ -75,7 +95,7 @@ fetch_inferior_registers (int regno) || regno >= Y_REGNUM || (!deprecated_register_valid[SP_REGNUM] && regno < I7_REGNUM)) { - if (0 != ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), + if (0 != ptrace (PTRACE_GETREGS, fetch_pid, (PTRACE_ARG3_TYPE) & inferior_registers, 0)) perror ("ptrace_getregs"); @@ -108,7 +128,7 @@ fetch_inferior_registers (int regno) regno == FPS_REGNUM || (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31)) { - if (0 != ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid), + if (0 != ptrace (PTRACE_GETFPREGS, fetch_pid, (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0)) perror ("ptrace_getfpregs"); @@ -153,6 +173,13 @@ store_inferior_registers (int regno) struct regs inferior_registers; struct fp_status inferior_fp_registers; int wanna_store = INT_REGS + STACK_REGS + FP_REGS; + int store_pid; + + /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers + about threaded assumptions. */ + store_pid = TIDGET (inferior_ptid); + if (store_pid == 0) + store_pid = PIDGET (inferior_ptid); /* First decide which pieces of machine-state we need to modify. Default for regno == -1 case is all pieces. */ @@ -236,7 +263,7 @@ store_inferior_registers (int regno) inferior_registers.r_y = *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)]; - if (0 != ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), + if (0 != ptrace (PTRACE_SETREGS, store_pid, (PTRACE_ARG3_TYPE) & inferior_registers, 0)) perror ("ptrace_setregs"); } @@ -252,7 +279,7 @@ store_inferior_registers (int regno) &deprecated_registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE)); if (0 != - ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid), + ptrace (PTRACE_SETFPREGS, store_pid, (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0)) perror ("ptrace_setfpregs"); } diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index af43c9f..45fce0b 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -314,13 +314,13 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi) /* Compute ->frame as if not flat. If it is flat, we'll change it later. */ if (fi->next->next != NULL - && (fi->next->next->signal_handler_caller + && ((get_frame_type (fi->next->next) == SIGTRAMP_FRAME) || deprecated_frame_in_dummy (fi->next->next)) && frameless_look_for_prologue (fi->next)) { /* A frameless function interrupted by a signal did not change the frame pointer, fix up frame pointer accordingly. */ - fi->frame = FRAME_FP (fi->next); + fi->frame = get_frame_base (fi->next); fi->extra_info->bottom = fi->next->extra_info->bottom; } else @@ -451,7 +451,7 @@ sparc_frame_saved_pc (struct frame_info *frame) CORE_ADDR addr; buf = alloca (MAX_REGISTER_RAW_SIZE); - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) { /* This is the signal trampoline frame. Get the saved PC from the sigcontext structure. */ @@ -487,7 +487,7 @@ sparc_frame_saved_pc (struct frame_info *frame) } else if (frame->extra_info->in_prologue || (frame->next != NULL && - (frame->next->signal_handler_caller || + ((get_frame_type (frame->next) == SIGTRAMP_FRAME) || deprecated_frame_in_dummy (frame->next)) && frameless_look_for_prologue (frame))) { @@ -816,10 +816,10 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, /* error ("No selected frame."); */ if (!target_has_registers) error ("The program has no registers now."); - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); /* Try to use selected frame */ - frame = get_prev_frame (selected_frame); + frame = get_prev_frame (deprecated_selected_frame); if (frame == 0) error ("Cmd not meaningful in the outermost frame."); } @@ -848,7 +848,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (frame1->pc >= (frame1->extra_info->bottom ? frame1->extra_info->bottom : read_sp ()) - && frame1->pc <= FRAME_FP (frame1)) + && frame1->pc <= get_frame_base (frame1)) { /* Dummy frame. All but the window regs are in there somewhere. The window registers are saved on the stack, just like in a @@ -1112,7 +1112,7 @@ static void sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) { register int regnum; - CORE_ADDR frame_addr = FRAME_FP (fi); + CORE_ADDR frame_addr = get_frame_base (fi); if (!fi) internal_error (__FILE__, __LINE__, @@ -1122,7 +1122,7 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) if (fi->pc >= (fi->extra_info->bottom ? fi->extra_info->bottom : read_sp ()) - && fi->pc <= FRAME_FP (fi)) + && fi->pc <= get_frame_base (fi)) { /* Dummy frame. All but the window regs are in there somewhere. */ for (regnum = G1_REGNUM; regnum < G1_REGNUM + 7; regnum++) @@ -1205,16 +1205,17 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) } /* Otherwise, whatever we would get from ptrace(GETREGS) is accurate */ /* FIXME -- should this adjust for the sparc64 offset? */ - saved_regs_addr[SP_REGNUM] = FRAME_FP (fi); + saved_regs_addr[SP_REGNUM] = get_frame_base (fi); } /* Discard from the stack the innermost frame, restoring all saved registers. - Note that the values stored in fsr by get_frame_saved_regs are *in - the context of the called frame*. What this means is that the i - regs of fsr must be restored into the o regs of the (calling) frame that - we pop into. We don't care about the output regs of the calling frame, - since unless it's a dummy frame, it won't have any output regs in it. + Note that the values stored in fsr by + deprecated_get_frame_saved_regs are *in the context of the called + frame*. What this means is that the i regs of fsr must be restored + into the o regs of the (calling) frame that we pop into. We don't + care about the output regs of the calling frame, since unless it's + a dummy frame, it won't have any output regs in it. We never have to bother with %l (local) regs, since the called routine's locals get tossed, and the calling routine's locals are already saved @@ -1871,8 +1872,8 @@ sparc_print_register_hook (int regno) { char value[16]; - if (frame_register_read (selected_frame, regno, value) - && frame_register_read (selected_frame, regno + 1, value + 4)) + if (frame_register_read (deprecated_selected_frame, regno, value) + && frame_register_read (deprecated_selected_frame, regno + 1, value + 4)) { printf_unfiltered ("\t"); print_floating (value, builtin_type_double, gdb_stdout); @@ -1880,8 +1881,8 @@ sparc_print_register_hook (int regno) #if 0 /* FIXME: gdb doesn't handle long doubles */ if ((regno & 3) == 0) { - if (frame_register_read (selected_frame, regno + 2, value + 8) - && frame_register_read (selected_frame, regno + 3, value + 12)) + if (frame_register_read (deprecated_selected_frame, regno + 2, value + 8) + && frame_register_read (deprecated_selected_frame, regno + 3, value + 12)) { printf_unfiltered ("\t"); print_floating (value, builtin_type_long_double, gdb_stdout); @@ -1900,8 +1901,8 @@ sparc_print_register_hook (int regno) { char value[16]; - if (frame_register_read (selected_frame, regno, value) - && frame_register_read (selected_frame, regno + 1, value + 8)) + if (frame_register_read (deprecated_selected_frame, regno, value) + && frame_register_read (deprecated_selected_frame, regno + 1, value + 8)) { printf_unfiltered ("\t"); print_floating (value, builtin_type_long_double, gdb_stdout); @@ -2150,7 +2151,7 @@ sparc_print_registers_info (struct gdbarch *gdbarch, void sparc_do_registers_info (int regnum, int all) { - sparc_print_registers_info (current_gdbarch, gdb_stdout, selected_frame, + sparc_print_registers_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, regnum, all); } @@ -2166,8 +2167,8 @@ sparclet_print_registers_info (struct gdbarch *gdbarch, void sparclet_do_registers_info (int regnum, int all) { - sparclet_print_registers_info (current_gdbarch, gdb_stdout, selected_frame, - regnum, all); + sparclet_print_registers_info (current_gdbarch, gdb_stdout, + deprecated_selected_frame, regnum, all); } @@ -3149,10 +3150,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT); set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM); set_gdbarch_fp0_regnum (gdbarch, SPARC_FP0_REGNUM); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); set_gdbarch_frame_chain (gdbarch, sparc_frame_chain); set_gdbarch_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown); set_gdbarch_frame_saved_pc (gdbarch, sparc_frame_saved_pc); set_gdbarch_frameless_function_invocation (gdbarch, @@ -3181,7 +3180,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); set_gdbarch_skip_prologue (gdbarch, sparc_skip_prologue); set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM); - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); /* @@ -3199,7 +3198,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* 32-bit machine types: */ #ifdef SPARC32_CALL_DUMMY_ON_STACK - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30); set_gdbarch_call_dummy_length (gdbarch, 0x38); @@ -3250,11 +3249,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_location (gdbarch, ON_STACK); set_gdbarch_call_dummy_words (gdbarch, call_dummy_32); #else - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); #endif set_gdbarch_call_dummy_stack_adjust (gdbarch, 68); @@ -3298,7 +3296,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) default: /* Any new machine type is likely to be 64-bit. */ #ifdef SPARC64_CALL_DUMMY_ON_STACK - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 8 * 4); set_gdbarch_call_dummy_length (gdbarch, 192); @@ -3306,11 +3304,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 148); set_gdbarch_call_dummy_words (gdbarch, call_dummy_64); #else - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); #endif diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c index 1103eaa..ab984ff 100644 --- a/gdb/sparcnbsd-tdep.c +++ b/gdb/sparcnbsd-tdep.c @@ -523,9 +523,9 @@ _initialize_sparnbsd_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour, sparcnbsd_aout_osabi_sniffer); - gdbarch_register_osabi (bfd_arch_sparc, GDB_OSABI_NETBSD_AOUT, + gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT, sparcnbsd_init_abi_aout); - gdbarch_register_osabi (bfd_arch_sparc, GDB_OSABI_NETBSD_ELF, + gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_ELF, sparcnbsd_init_abi_elf); add_core_fns (&sparcnbsd_core_fns); diff --git a/gdb/stabsread.c b/gdb/stabsread.c index a4807e3..1b81eb8 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -202,47 +202,31 @@ static const char vb_name[] = "_vb$"; #define BELIEVE_PCC_PROMOTION_TYPE 0 #endif -static struct deprecated_complaint invalid_cpp_abbrev_complaint = -{"invalid C++ abbreviation `%s'", 0, 0}; - -static struct deprecated_complaint invalid_cpp_type_complaint = -{"C++ abbreviated type name unknown at symtab pos %d", 0, 0}; - -static struct deprecated_complaint member_fn_complaint = -{"member function type missing, got '%c'", 0, 0}; - -static struct deprecated_complaint const_vol_complaint = -{"const/volatile indicator missing, got '%c'", 0, 0}; - -static struct deprecated_complaint error_type_complaint = -{"couldn't parse type; debugger out of date?", 0, 0}; - -static struct deprecated_complaint invalid_member_complaint = -{"invalid (minimal) member type data format at symtab pos %d.", 0, 0}; - -static struct deprecated_complaint range_type_base_complaint = -{"base type %d of range type is not defined", 0, 0}; - -static struct deprecated_complaint reg_value_complaint = -{"register number %d too large (max %d) in symbol %s", 0, 0}; - -static struct deprecated_complaint vtbl_notfound_complaint = -{"virtual function table pointer not found when defining class `%s'", 0, 0}; - -static struct deprecated_complaint unrecognized_cplus_name_complaint = -{"Unknown C++ symbol name `%s'", 0, 0}; - -static struct deprecated_complaint rs6000_builtin_complaint = -{"Unknown builtin type %d", 0, 0}; +static void +invalid_cpp_abbrev_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "invalid C++ abbreviation `%s'", arg1); +} -static struct deprecated_complaint unresolved_sym_chain_complaint = -{"%s: common block `%s' from global_sym_chain unresolved", 0, 0}; +static void +reg_value_complaint (int arg1, int arg2, const char *arg3) +{ + complaint (&symfile_complaints, + "register number %d too large (max %d) in symbol %s", arg1, arg2, + arg3); +} -static struct deprecated_complaint stabs_general_complaint = -{"%s", 0, 0}; +static void +stabs_general_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "%s", arg1); +} -static struct deprecated_complaint lrs_general_complaint = -{"%s", 0, 0}; +static void +lrs_general_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "%s", arg1); +} /* Make a list of forward references which haven't been defined. */ @@ -311,11 +295,9 @@ dbx_lookup_type (int typenums[2]) if (filenum < 0 || filenum >= n_this_object_header_files) { - static struct deprecated_complaint msg = - {"\ -Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.", - 0, 0}; - complain (&msg, filenum, index, symnum); + complaint (&symfile_complaints, + "Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.", + filenum, index, symnum); goto error_return; } @@ -606,6 +588,12 @@ get_cfront_method_physname (char *fname) return p; } +static void +msg_unknown_complaint (const char *arg1) +{ + complaint (&symfile_complaints, "Unsupported token in stabs string %s", arg1); +} + /* Read base classes within cfront class definition. eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;; ^^^^^^^^^^^^^^^^^^ @@ -618,14 +606,6 @@ static int read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, struct objfile *objfile) { - static struct deprecated_complaint msg_unknown = - {"\ - Unsupported token in stabs string %s.\n", - 0, 0}; - static struct deprecated_complaint msg_notfound = - {"\ - Unable to find base type for %s.\n", - 0, 0}; int bnum = 0; char *p; int i; @@ -692,10 +672,9 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, /* Bad visibility format. Complain and treat it as public. */ { - static struct deprecated_complaint msg = - { - "Unknown visibility `%c' for baseclass", 0, 0}; - complain (&msg, new->visibility); + complaint (&symfile_complaints, + "Unknown visibility `%c' for baseclass", + new->visibility); new->visibility = VISIBILITY_PUBLIC; } } @@ -703,7 +682,7 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, /* "@" comes next - eg: @Bvir */ if (**pp != '@') { - complain (&msg_unknown, *pp); + msg_unknown_complaint (*pp); return 1; } ++(*pp); @@ -731,7 +710,7 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, bname = get_substring (pp, ';'); if (!bname || !*bname) { - complain (&msg_unknown, *pp); + msg_unknown_complaint (*pp); return 1; } /* FIXME! attach base info to type */ @@ -743,7 +722,8 @@ read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type, } else { - complain (&msg_notfound, *pp); + complaint (&symfile_complaints, "Unable to find base type for %s", + *pp); return 1; } } @@ -810,11 +790,8 @@ read_cfront_member_functions (struct field_info *fip, char **pp, ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */ if (!ref_func) { - static struct deprecated_complaint msg = - {"\ - Unable to find function symbol for %s\n", - 0, 0}; - complain (&msg, fname); + complaint (&symfile_complaints, + "Unable to find function symbol for %s", fname); continue; } sublist = NULL; @@ -1070,7 +1047,7 @@ resolve_symbol_reference (struct objfile *objfile, struct symbol *sym, char *p) ref_sym = ref_search (refnum); if (!ref_sym) { - complain (&lrs_general_complaint, "symbol for reference not found"); + lrs_general_complaint ("symbol for reference not found"); return 0; } @@ -1106,7 +1083,7 @@ resolve_symbol_reference (struct objfile *objfile, struct symbol *sym, char *p) sizeof (struct alias_list)); if (!alias) { - complain (&lrs_general_complaint, "Unable to allocate alias list memory"); + lrs_general_complaint ("Unable to allocate alias list memory"); return 0; } @@ -1361,7 +1338,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, #endif default: - complain (&unrecognized_cplus_name_complaint, string); + complaint (&symfile_complaints, "Unknown C++ symbol name `%s'", + string); goto normal; /* Do *something* with it */ } } @@ -1813,9 +1791,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu); if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS) { - complain (®_value_complaint, SYMBOL_VALUE (sym), - NUM_REGS + NUM_PSEUDO_REGS, - SYMBOL_PRINT_NAME (sym)); + reg_value_complaint (SYMBOL_VALUE (sym), + NUM_REGS + NUM_PSEUDO_REGS, + SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -1829,9 +1807,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu); if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS) { - complain (®_value_complaint, SYMBOL_VALUE (sym), - NUM_REGS + NUM_PSEUDO_REGS, - SYMBOL_PRINT_NAME (sym)); + reg_value_complaint (SYMBOL_VALUE (sym), + NUM_REGS + NUM_PSEUDO_REGS, + SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -2083,9 +2061,9 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu); if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS) { - complain (®_value_complaint, SYMBOL_VALUE (sym), - NUM_REGS + NUM_PSEUDO_REGS, - SYMBOL_PRINT_NAME (sym)); + reg_value_complaint (SYMBOL_VALUE (sym), + NUM_REGS + NUM_PSEUDO_REGS, + SYMBOL_PRINT_NAME (sym)); SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */ } SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; @@ -2180,7 +2158,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, p = strchr (p, ')'); if (!*p || *p != ')') { - complain (&lrs_general_complaint, "live range format not recognized"); + lrs_general_complaint ("live range format not recognized"); return NULL; } p++; @@ -2201,14 +2179,14 @@ resolve_live_range (struct objfile *objfile, struct symbol *sym, char *p) /* Sanity check the beginning of the stabs string. */ if (!*p || *p != 'l') { - complain (&lrs_general_complaint, "live range string 1"); + lrs_general_complaint ("live range string 1"); return 0; } p++; if (!*p || *p != '(') { - complain (&lrs_general_complaint, "live range string 2"); + lrs_general_complaint ("live range string 2"); return 0; } p++; @@ -2221,13 +2199,13 @@ resolve_live_range (struct objfile *objfile, struct symbol *sym, char *p) start = ref_search_value (refnum); if (!start) { - complain (&lrs_general_complaint, "Live range symbol not found 1"); + lrs_general_complaint ("Live range symbol not found 1"); return 0; } if (!*p || *p != ',') { - complain (&lrs_general_complaint, "live range string 3"); + lrs_general_complaint ("live range string 3"); return 0; } p++; @@ -2240,13 +2218,13 @@ resolve_live_range (struct objfile *objfile, struct symbol *sym, char *p) end = ref_search_value (refnum); if (!end) { - complain (&lrs_general_complaint, "Live range symbol not found 2"); + lrs_general_complaint ("Live range symbol not found 2"); return 0; } if (!*p || *p != ')') { - complain (&lrs_general_complaint, "live range string 4"); + lrs_general_complaint ("live range string 4"); return 0; } @@ -2268,7 +2246,7 @@ add_live_range (struct objfile *objfile, struct symbol *sym, CORE_ADDR start, if (start >= end) { - complain (&lrs_general_complaint, "end of live range follows start"); + lrs_general_complaint ("end of live range follows start"); return; } @@ -2325,7 +2303,7 @@ add_live_range (struct objfile *objfile, struct symbol *sym, CORE_ADDR start, static struct type * error_type (char **pp, struct objfile *objfile) { - complain (&error_type_complaint); + complaint (&symfile_complaints, "couldn't parse type; debugger out of date?"); while (1) { /* Skip to end of symbol. */ @@ -2435,9 +2413,8 @@ again: { /* Complain and keep going, so compilers can invent new cross-reference types. */ - static struct deprecated_complaint msg = - {"Unrecognized cross-reference type `%c'", 0, 0}; - complain (&msg, (*pp)[0]); + complaint (&symfile_complaints, + "Unrecognized cross-reference type `%c'", (*pp)[0]); code = TYPE_CODE_STRUCT; break; } @@ -2660,11 +2637,9 @@ again: ++*pp; else { - static struct deprecated_complaint msg = { - "Prototyped function type didn't end arguments with `#':\n%s", - 0, 0 - }; - complain (&msg, type_start); + complaint (&symfile_complaints, + "Prototyped function type didn't end arguments with `#':\n%s", + type_start); } /* If there is just one argument whose type is `void', then @@ -2797,7 +2772,9 @@ again: (*pp)++; return_type = read_type (pp, objfile); if (*(*pp)++ != ';') - complain (&invalid_member_complaint, symnum); + complaint (&symfile_complaints, + "invalid (minimal) member type data format at symtab pos %d.", + symnum); type = allocate_stub_method (return_type); if (typenums[0] != -1) *dbx_lookup_type (typenums) = type; @@ -2930,7 +2907,7 @@ rs6000_builtin_type (int typenum) if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED) { - complain (&rs6000_builtin_complaint, typenum); + complaint (&symfile_complaints, "Unknown builtin type %d", typenum); return builtin_type_error; } if (negative_types[-typenum] != NULL) @@ -3288,7 +3265,8 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type, case '.': break; default: - complain (&const_vol_complaint, **pp); + complaint (&symfile_complaints, + "const/volatile indicator missing, got '%c'", **pp); break; } @@ -3370,7 +3348,8 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type, default: /* error */ - complain (&member_fn_complaint, (*pp)[-1]); + complaint (&symfile_complaints, + "member function type missing, got '%c'", (*pp)[-1]); /* Fall through into normal member function. */ case '.': @@ -3635,7 +3614,9 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type, name = type_name_no_tag (context); if (name == NULL) { - complain (&invalid_cpp_type_complaint, symnum); + complaint (&symfile_complaints, + "C++ abbreviated type name unknown at symtab pos %d", + symnum); name = "FOO"; } fip->list->field.name = @@ -3643,7 +3624,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type, break; default: - complain (&invalid_cpp_abbrev_complaint, *pp); + invalid_cpp_abbrev_complaint (*pp); fip->list->field.name = obconcat (&objfile->type_obstack, "INVALID_CPLUSPLUS_ABBREV", "", ""); @@ -3656,7 +3637,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type, p = ++(*pp); if (p[-1] != ':') { - complain (&invalid_cpp_abbrev_complaint, *pp); + invalid_cpp_abbrev_complaint (*pp); return 0; } fip->list->field.type = read_type (pp, objfile); @@ -3677,7 +3658,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type, } else { - complain (&invalid_cpp_abbrev_complaint, *pp); + invalid_cpp_abbrev_complaint (*pp); /* We have no idea what syntax an unrecognized abbrev would have, so better return 0. If we returned 1, we would need to at least advance *pp to avoid an infinite loop. */ @@ -3761,7 +3742,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p, else if (**pp != ',') { /* Bad structure-type format. */ - complain (&stabs_general_complaint, "bad structure-type format"); + stabs_general_complaint ("bad structure-type format"); return; } @@ -3772,13 +3753,13 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p, FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &nbits); if (nbits != 0) { - complain (&stabs_general_complaint, "bad structure-type format"); + stabs_general_complaint ("bad structure-type format"); return; } FIELD_BITSIZE (fip->list->field) = read_huge_number (pp, ';', &nbits); if (nbits != 0) { - complain (&stabs_general_complaint, "bad structure-type format"); + stabs_general_complaint ("bad structure-type format"); return; } } @@ -4018,10 +3999,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, default: /* Unknown character. Complain and treat it as non-virtual. */ { - static struct deprecated_complaint msg = - { - "Unknown virtual character `%c' for baseclass", 0, 0}; - complain (&msg, **pp); + complaint (&symfile_complaints, + "Unknown virtual character `%c' for baseclass", **pp); } } ++(*pp); @@ -4037,11 +4016,9 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, /* Bad visibility format. Complain and treat it as public. */ { - static struct deprecated_complaint msg = - { - "Unknown visibility `%c' for baseclass", 0, 0 - }; - complain (&msg, new->visibility); + complaint (&symfile_complaints, + "Unknown visibility `%c' for baseclass", + new->visibility); new->visibility = VISIBILITY_PUBLIC; } } @@ -4147,7 +4124,9 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type, } } /* Virtual function table field not found. */ - complain (&vtbl_notfound_complaint, TYPE_NAME (type)); + complaint (&symfile_complaints, + "virtual function table pointer not found when defining class `%s'", + TYPE_NAME (type)); return 0; } else @@ -4210,11 +4189,8 @@ read_cfront_static_fields (struct field_info *fip, char **pp, struct type *type, ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */ if (!ref_static) { - static struct deprecated_complaint msg = - {"\ - Unable to find symbol for static data field %s\n", - 0, 0}; - complain (&msg, sname); + complaint (&symfile_complaints, + "Unable to find symbol for static data field %s", sname); continue; } stype = SYMBOL_TYPE (ref_static); @@ -4389,10 +4365,8 @@ attach_fields_to_type (struct field_info *fip, register struct type *type, default: /* Unknown visibility. Complain and treat it as public. */ { - static struct deprecated_complaint msg = - { - "Unknown visibility `%c' for field", 0, 0}; - complain (&msg, fip->list->visibility); + complaint (&symfile_complaints, "Unknown visibility `%c' for field", + fip->list->visibility); } break; } @@ -4402,10 +4376,6 @@ attach_fields_to_type (struct field_info *fip, register struct type *type, } -static struct deprecated_complaint multiply_defined_struct = -{"struct/union type gets multiply defined: %s%s", 0, 0}; - - /* Complain that the compiler has emitted more than one definition for the structure type TYPE. */ static void @@ -4436,7 +4406,8 @@ complain_about_struct_wipeout (struct type *type) kind = ""; } - complain (&multiply_defined_struct, kind, name); + complaint (&symfile_complaints, + "struct/union type gets multiply defined: %s%s", kind, name); } @@ -5138,7 +5109,8 @@ handle_true_range: static struct type *range_type_index; - complain (&range_type_base_complaint, rangenums[1]); + complaint (&symfile_complaints, + "base type %d of range type is not defined", rangenums[1]); if (range_type_index == NULL) range_type_index = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, @@ -5214,11 +5186,8 @@ common_block_start (char *name, struct objfile *objfile) { if (common_block_name != NULL) { - static struct deprecated_complaint msg = - { - "Invalid symbol data: common block within common block", - 0, 0}; - complain (&msg); + complaint (&symfile_complaints, + "Invalid symbol data: common block within common block"); } common_block = local_symbols; common_block_i = local_symbols ? local_symbols->nsyms : 0; @@ -5244,9 +5213,7 @@ common_block_end (struct objfile *objfile) if (common_block_name == NULL) { - static struct deprecated_complaint msg = - {"ECOMM symbol unmatched by BCOMM", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, "ECOMM symbol unmatched by BCOMM"); return; } @@ -5359,9 +5326,7 @@ cleanup_undefined_types (void) if (typename == NULL) { - static struct deprecated_complaint msg = - {"need a type name", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, "need a type name"); break; } for (ppt = file_symbols; ppt; ppt = ppt->next) @@ -5384,10 +5349,9 @@ cleanup_undefined_types (void) default: { - static struct deprecated_complaint msg = - {"\ -GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0}; - complain (&msg, TYPE_CODE (*type)); + complaint (&symfile_complaints, + "GDB internal error. cleanup_undefined_types with bad type %d.", + TYPE_CODE (*type)); } break; } @@ -5547,8 +5511,9 @@ scan_file_globals (struct objfile *objfile) if (SYMBOL_CLASS (prev) == LOC_STATIC) SYMBOL_CLASS (prev) = LOC_UNRESOLVED; else - complain (&unresolved_sym_chain_complaint, - objfile->name, SYMBOL_NAME (prev)); + complaint (&symfile_complaints, + "%s: common block `%s' from global_sym_chain unresolved", + objfile->name, SYMBOL_NAME (prev)); } } memset (global_sym_chain, 0, sizeof (global_sym_chain)); diff --git a/gdb/stabsread.h b/gdb/stabsread.h index 1371f6c..017074b 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -128,9 +128,6 @@ EXTERN int n_this_object_header_files; EXTERN int n_allocated_this_object_header_files; -extern struct deprecated_complaint unknown_symtype_complaint; -extern struct deprecated_complaint unknown_symchar_complaint; - extern struct type *read_type (char **, struct objfile *); extern void cleanup_undefined_types (void); diff --git a/gdb/stack.c b/gdb/stack.c index 734132d..40bc316 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -112,27 +112,6 @@ static void frame_info (char *, int); extern int addressprint; /* Print addresses, or stay symbolic only? */ -/* The "selected" stack frame is used by default for local and arg access. - May be zero, for no selected frame. */ - -struct frame_info *selected_frame; - -/* Level of the selected frame: - 0 for innermost, 1 for its caller, ... - or -1 for frame specified by address with no defined level. */ - -/* Level of the selected frame: 0 for innermost, 1 for its caller, ... - or -1 for NULL frame. */ - -int -frame_relative_level (struct frame_info *fi) -{ - if (fi == NULL) - return -1; - else - return fi->level; -} - /* Zero means do things normally; we are interacting directly with the user. One means print the full filename and linenumber when a frame is printed, and do so in a format emacs18/emacs19.22 can @@ -335,27 +314,9 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) int source_print; int location_print; -#if 0 - char buf[MAX_REGISTER_RAW_SIZE]; - CORE_ADDR sp; - - /* On the 68k, this spends too much time in m68k_find_saved_regs. */ - - /* Get the value of SP_REGNUM relative to the frame. */ - get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL, - FRAME_INFO_ID (fi), SP_REGNUM, (enum lval_type *) NULL); - sp = extract_address (buf, REGISTER_RAW_SIZE (SP_REGNUM)); - - /* This is not a perfect test, because if a function alloca's some - memory, puts some code there, and then jumps into it, then the test - will succeed even though there is no call dummy. Probably best is - to check for a bp_call_dummy breakpoint. */ - if (PC_IN_CALL_DUMMY (fi->pc, sp, fi->frame)) -#else - if (deprecated_frame_in_dummy (fi)) -#endif + if (get_frame_type (fi) == DUMMY_FRAME) { - annotate_frame_begin (level == -1 ? 0 : level, fi->pc); + annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); /* Do this regardless of SOURCE because we don't have any source to list for this frame. */ @@ -369,9 +330,9 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) annotate_frame_end (); return; } - if (fi->signal_handler_caller) + if ((get_frame_type (fi) == SIGTRAMP_FRAME)) { - annotate_frame_begin (level == -1 ? 0 : level, fi->pc); + annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); /* Do this regardless of SOURCE because we don't have any source to list for this frame. */ @@ -387,16 +348,12 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) } /* If fi is not the innermost frame, that normally means that fi->pc - points to *after* the call instruction, and we want to get the line - containing the call, never the next line. But if the next frame is - a signal_handler_caller or a dummy frame, then the next frame was - not entered as the result of a call, and we want to get the line - containing fi->pc. */ - sal = - find_pc_line (fi->pc, - fi->next != NULL - && !fi->next->signal_handler_caller - && !deprecated_frame_in_dummy (fi->next)); + points to *after* the call instruction, and we want to get the + line containing the call, never the next line. But if the next + frame is a SIGTRAMP_FRAME or a DUMMY_FRAME, then the next frame + was not entered as the result of a call, and we want to get the + line containing fi->pc. */ + find_frame_sal (fi, &sal); location_print = (source == LOCATION || source == LOC_AND_ADDRESS @@ -414,11 +371,11 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) { struct symtab_and_line cursal; int done = 0; - int mid_statement = (source == SRC_LINE) && (fi->pc != sal.pc); + int mid_statement = (source == SRC_LINE) && (get_frame_pc (fi) != sal.pc); if (annotation_level) done = identify_source_line (sal.symtab, sal.line, mid_statement, - fi->pc); + get_frame_pc (fi)); if (!done) { if (print_frame_info_listing_hook) @@ -435,7 +392,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) ability to decide for themselves if it is desired. */ if (addressprint && mid_statement) { - ui_out_field_core_addr (uiout, "addr", fi->pc); + ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi)); ui_out_text (uiout, "\t"); } @@ -450,7 +407,7 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) } if (source != 0) - set_default_breakpoint (1, fi->pc, sal.symtab, sal.line); + set_default_breakpoint (1, get_frame_pc (fi), sal.symtab, sal.line); annotate_frame_end (); @@ -549,7 +506,7 @@ print_frame (struct frame_info *fi, } } - annotate_frame_begin (level == -1 ? 0 : level, fi->pc); + annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); @@ -559,10 +516,12 @@ print_frame (struct frame_info *fi, ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); } if (addressprint) - if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS) + if (get_frame_pc (fi) != sal.pc + || !sal.symtab + || source == LOC_AND_ADDRESS) { annotate_frame_address (); - ui_out_field_core_addr (uiout, "addr", fi->pc); + ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi)); annotate_frame_address_end (); ui_out_text (uiout, " in "); } @@ -607,7 +566,7 @@ print_frame (struct frame_info *fi, #ifdef PC_SOLIB if (!funname || (!sal.symtab || !sal.symtab->filename)) { - char *lib = PC_SOLIB (fi->pc); + char *lib = PC_SOLIB (get_frame_pc (fi)); if (lib) { annotate_frame_where (); @@ -699,9 +658,9 @@ parse_frame_specification (char *frame_exp) switch (numargs) { case 0: - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); - return selected_frame; + return deprecated_selected_frame; /* NOTREACHED */ case 1: { @@ -733,13 +692,13 @@ parse_frame_specification (char *frame_exp) (s)he gets. Still, give the highest one that matches. */ for (fid = get_current_frame (); - fid && fid->frame != args[0]; + fid && get_frame_base (fid) != args[0]; fid = get_prev_frame (fid)) ; if (fid) while ((tfid = get_prev_frame (fid)) && - (tfid->frame == args[0])) + (get_frame_base (tfid) == args[0])) fid = tfid; /* We couldn't identify the frame as an existing frame, but @@ -793,12 +752,11 @@ frame_info (char *addr_exp, int from_tty) if (fi == NULL) error ("Invalid frame specified."); - sal = find_pc_line (fi->pc, - fi->next != NULL - && !fi->next->signal_handler_caller - && !deprecated_frame_in_dummy (fi->next)); + find_frame_sal (fi, &sal); func = get_frame_function (fi); - s = find_pc_symtab (fi->pc); + /* FIXME: cagney/2002-11-28: Why bother? Won't sal.symtab contain + the same value. */ + s = find_pc_symtab (get_frame_pc (fi)); if (func) { /* I'd like to use SYMBOL_PRINT_NAME() here, to display @@ -830,7 +788,7 @@ frame_info (char *addr_exp, int from_tty) } else { - register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc); + register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi)); if (msymbol != NULL) { funname = SYMBOL_NAME (msymbol); @@ -839,21 +797,21 @@ frame_info (char *addr_exp, int from_tty) } calling_frame_info = get_prev_frame (fi); - if (!addr_exp && frame_relative_level (selected_frame) >= 0) + if (!addr_exp && frame_relative_level (deprecated_selected_frame) >= 0) { printf_filtered ("Stack level %d, frame at ", - frame_relative_level (selected_frame)); - print_address_numeric (fi->frame, 1, gdb_stdout); + frame_relative_level (deprecated_selected_frame)); + print_address_numeric (get_frame_base (fi), 1, gdb_stdout); printf_filtered (":\n"); } else { printf_filtered ("Stack frame at "); - print_address_numeric (fi->frame, 1, gdb_stdout); + print_address_numeric (get_frame_base (fi), 1, gdb_stdout); printf_filtered (":\n"); } printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM)); - print_address_numeric (fi->pc, 1, gdb_stdout); + print_address_numeric (get_frame_pc (fi), 1, gdb_stdout); wrap_here (" "); if (funname) @@ -868,7 +826,7 @@ frame_info (char *addr_exp, int from_tty) puts_filtered ("; "); wrap_here (" "); printf_filtered ("saved %s ", REGISTER_NAME (PC_REGNUM)); - print_address_numeric (FRAME_SAVED_PC (fi), 1, gdb_stdout); + print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout); printf_filtered ("\n"); { @@ -881,20 +839,23 @@ frame_info (char *addr_exp, int from_tty) if (calling_frame_info) { printf_filtered (" called by frame at "); - print_address_numeric (calling_frame_info->frame, 1, gdb_stdout); + print_address_numeric (get_frame_base (calling_frame_info), + 1, gdb_stdout); } - if (fi->next && calling_frame_info) + if (get_next_frame (fi) && calling_frame_info) puts_filtered (","); wrap_here (" "); - if (fi->next) + if (get_next_frame (fi)) { printf_filtered (" caller of frame at "); - print_address_numeric (fi->next->frame, 1, gdb_stdout); + print_address_numeric (get_frame_base (get_next_frame (fi)), 1, + gdb_stdout); } - if (fi->next || calling_frame_info) + if (get_next_frame (fi) || calling_frame_info) puts_filtered ("\n"); if (s) - printf_filtered (" source language %s.\n", language_str (s->language)); + printf_filtered (" source language %s.\n", + language_str (s->language)); #ifdef PRINT_EXTRA_FRAME_INFO PRINT_EXTRA_FRAME_INFO (fi); @@ -941,7 +902,7 @@ frame_info (char *addr_exp, int from_tty) } } - if (fi->saved_regs == NULL) + if (get_frame_saved_regs (fi) == NULL) FRAME_INIT_SAVED_REGS (fi); /* Print as much information as possible on the location of all the registers. */ @@ -1345,7 +1306,7 @@ print_frame_label_vars (register struct frame_info *fi, int this_level_only, register int values_printed = 0; int index, have_default = 0; char *blocks_printed; - CORE_ADDR pc = fi->pc; + CORE_ADDR pc = get_frame_pc (fi); if (block == 0) { @@ -1408,9 +1369,9 @@ print_frame_label_vars (register struct frame_info *fi, int this_level_only, void locals_info (char *args, int from_tty) { - if (!selected_frame) + if (!deprecated_selected_frame) error ("No frame selected."); - print_frame_local_vars (selected_frame, 0, gdb_stdout); + print_frame_local_vars (deprecated_selected_frame, 0, gdb_stdout); } static void @@ -1427,17 +1388,17 @@ catch_info (char *ignore, int from_tty) system to find the list of active handlers, etc. */ fprintf_filtered (gdb_stdout, "Info catch not supported with this target/compiler combination.\n"); #if 0 - if (!selected_frame) + if (!deprecated_selected_frame) error ("No frame selected."); #endif } else { /* Assume g++ compiled code -- old v 4.16 behaviour */ - if (!selected_frame) + if (!deprecated_selected_frame) error ("No frame selected."); - print_frame_label_vars (selected_frame, 0, gdb_stdout); + print_frame_label_vars (deprecated_selected_frame, 0, gdb_stdout); } } @@ -1503,9 +1464,9 @@ print_frame_arg_vars (register struct frame_info *fi, void args_info (char *ignore, int from_tty) { - if (!selected_frame) + if (!deprecated_selected_frame) error ("No frame selected."); - print_frame_arg_vars (selected_frame, gdb_stdout); + print_frame_arg_vars (deprecated_selected_frame, gdb_stdout); } @@ -1517,44 +1478,6 @@ args_plus_locals_info (char *ignore, int from_tty) } -/* Select frame FI (or NULL - to invalidate the current frame). */ - -void -select_frame (struct frame_info *fi) -{ - register struct symtab *s; - - selected_frame = fi; - /* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the - frame is being invalidated. */ - if (selected_frame_level_changed_hook) - selected_frame_level_changed_hook (frame_relative_level (fi)); - - /* FIXME: kseitz/2002-08-28: It would be nice to call - selected_frame_level_changed_event right here, but due to limitations - in the current interfaces, we would end up flooding UIs with events - because select_frame is used extensively internally. - - Once we have frame-parameterized frame (and frame-related) commands, - the event notification can be moved here, since this function will only - be called when the users selected frame is being changed. */ - - /* Ensure that symbols for this frame are read in. Also, determine the - source language of this frame, and switch to it if desired. */ - if (fi) - { - s = find_pc_symtab (fi->pc); - if (s - && s->language != current_language->la_language - && s->language != language_unknown - && language_mode == language_mode_auto) - { - set_language (s->language); - } - } -} - - /* Select frame FI. Also print the stack frame and show the source if this is the tui version. */ static void @@ -1580,9 +1503,24 @@ get_selected_block (CORE_ADDR *addr_in_block) if (!target_has_stack) return 0; - if (!selected_frame) - return get_current_block (addr_in_block); - return get_frame_block (selected_frame, addr_in_block); + /* NOTE: cagney/2002-11-28: Why go to all this effort to not create + a selected/current frame? Perhaphs this function is called, + indirectly, by WFI in "infrun.c" where avoiding the creation of + an inner most frame is very important (it slows down single + step). I suspect, though that this was true in the deep dark + past but is no longer the case. A mindless look at all the + callers tends to support this theory. I think we should be able + to assume that there is always a selcted frame. */ + /* gdb_assert (deprecated_selected_frame != NULL); So, do you feel + lucky? */ + if (!deprecated_selected_frame) + { + CORE_ADDR pc = read_pc (); + if (addr_in_block != NULL) + *addr_in_block = pc; + return block_for_pc (pc); + } + return get_frame_block (deprecated_selected_frame, addr_in_block); } /* Find a frame a certain number of levels away from FRAME. @@ -1643,7 +1581,7 @@ static void select_frame_command (char *level_exp, int from_tty) { struct frame_info *frame; - int level = frame_relative_level (selected_frame); + int level = frame_relative_level (deprecated_selected_frame); if (!target_has_stack) error ("No stack."); @@ -1651,8 +1589,8 @@ select_frame_command (char *level_exp, int from_tty) frame = parse_frame_specification (level_exp); select_frame (frame); - if (level != frame_relative_level (selected_frame)) - selected_frame_level_changed_event (frame_relative_level (selected_frame)); + if (level != frame_relative_level (deprecated_selected_frame)) + selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } /* The "frame" command. With no arg, print selected frame briefly. @@ -1663,8 +1601,8 @@ void frame_command (char *level_exp, int from_tty) { select_frame_command (level_exp, from_tty); - show_and_print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + show_and_print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } /* The XDB Compatibility command to print the current frame. */ @@ -1672,10 +1610,10 @@ frame_command (char *level_exp, int from_tty) static void current_frame_command (char *level_exp, int from_tty) { - if (target_has_stack == 0 || selected_frame == 0) + if (target_has_stack == 0 || deprecated_selected_frame == 0) error ("No stack."); - print_only_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + print_only_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } /* Select the frame up one or COUNT stack levels @@ -1691,14 +1629,14 @@ up_silently_base (char *count_exp) count = parse_and_eval_long (count_exp); count1 = count; - if (target_has_stack == 0 || selected_frame == 0) + if (target_has_stack == 0 || deprecated_selected_frame == 0) error ("No stack."); - fi = find_relative_frame (selected_frame, &count1); + fi = find_relative_frame (deprecated_selected_frame, &count1); if (count1 != 0 && count_exp == 0) error ("Initial frame selected; you cannot go up."); select_frame (fi); - selected_frame_level_changed_event (frame_relative_level (selected_frame)); + selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } static void @@ -1711,8 +1649,8 @@ static void up_command (char *count_exp, int from_tty) { up_silently_base (count_exp); - show_and_print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + show_and_print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } /* Select the frame down one or COUNT stack levels @@ -1728,10 +1666,10 @@ down_silently_base (char *count_exp) count = -parse_and_eval_long (count_exp); count1 = count; - if (target_has_stack == 0 || selected_frame == 0) + if (target_has_stack == 0 || deprecated_selected_frame == 0) error ("No stack."); - frame = find_relative_frame (selected_frame, &count1); + frame = find_relative_frame (deprecated_selected_frame, &count1); if (count1 != 0 && count_exp == 0) { @@ -1744,7 +1682,7 @@ down_silently_base (char *count_exp) } select_frame (frame); - selected_frame_level_changed_event (frame_relative_level (selected_frame)); + selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } /* ARGSUSED */ @@ -1758,8 +1696,8 @@ static void down_command (char *count_exp, int from_tty) { down_silently_base (count_exp); - show_and_print_stack_frame (selected_frame, - frame_relative_level (selected_frame), 1); + show_and_print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); } void @@ -1771,11 +1709,11 @@ return_command (char *retval_exp, int from_tty) struct frame_info *frame; struct value *return_value = NULL; - if (selected_frame == NULL) + if (deprecated_selected_frame == NULL) error ("No selected frame."); - thisfun = get_frame_function (selected_frame); - selected_frame_addr = FRAME_FP (selected_frame); - selected_frame_pc = selected_frame->pc; + thisfun = get_frame_function (deprecated_selected_frame); + selected_frame_addr = get_frame_base (deprecated_selected_frame); + selected_frame_pc = get_frame_pc (deprecated_selected_frame); /* Compute the return value (if any -- possibly getting errors here). */ @@ -1815,12 +1753,12 @@ return_command (char *retval_exp, int from_tty) } /* Do the real work. Pop until the specified frame is current. We - use this method because the selected_frame is not valid after + use this method because the deprecated_selected_frame is not valid after a POP_FRAME. The pc comparison makes this work even if the selected frame shares its fp with another frame. */ - while (selected_frame_addr != (frame = get_current_frame ())->frame - || selected_frame_pc != frame->pc) + while (selected_frame_addr != get_frame_base (frame = get_current_frame ()) + || selected_frame_pc != get_frame_pc (frame)) POP_FRAME; /* Then pop that frame. */ @@ -1836,7 +1774,7 @@ return_command (char *retval_exp, int from_tty) /* If we are at the end of a call dummy now, pop the dummy frame too. */ if (CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (), - FRAME_FP (get_current_frame ()))) + get_frame_base (get_current_frame ()))) POP_FRAME; /* If interactive, print the frame that is now current. */ @@ -1889,8 +1827,8 @@ func_command (char *arg, int from_tty) do { for (i = 0; (i < sals.nelts && !found); i++) - found = (fp->pc >= func_bounds[i].low && - fp->pc < func_bounds[i].high); + found = (get_frame_pc (fp) >= func_bounds[i].low && + get_frame_pc (fp) < func_bounds[i].high); if (!found) { level = 1; @@ -1904,7 +1842,7 @@ func_command (char *arg, int from_tty) if (!found) printf_filtered ("'%s' not within current stack frame.\n", arg); - else if (fp != selected_frame) + else if (fp != deprecated_selected_frame) select_and_print_frame (fp); } @@ -1916,9 +1854,9 @@ get_frame_language (void) register struct symtab *s; enum language flang; /* The language of the current frame */ - if (selected_frame) + if (deprecated_selected_frame) { - s = find_pc_symtab (selected_frame->pc); + s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); if (s) flang = s->language; else diff --git a/gdb/std-regs.c b/gdb/std-regs.c index 8177fc2..6078d1a 100644 --- a/gdb/std-regs.c +++ b/gdb/std-regs.c @@ -64,7 +64,8 @@ value_of_builtin_frame_reg (struct frame_info *frame) memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); /* frame.base. */ if (frame != NULL) - ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, + get_frame_base (frame)); buf += TYPE_LENGTH (builtin_type_void_data_ptr); /* frame.XXX. */ return val; @@ -83,7 +84,8 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame) if (frame == NULL) memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); else - ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, + get_frame_base (frame)); return val; } } @@ -101,7 +103,8 @@ value_of_builtin_frame_pc_reg (struct frame_info *frame) if (frame == NULL) memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); else - ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->pc); + ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, + get_frame_pc (frame)); return val; } } diff --git a/gdb/symfile.c b/gdb/symfile.c index b3d3afa..1ae7708 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -43,6 +43,7 @@ #include "gdb_obstack.h" #include "completer.h" #include "bcache.h" +#include #include #include @@ -445,43 +446,13 @@ free_section_addr_info (struct section_addr_info *sap) } -/* Parse the user's idea of an offset for dynamic linking, into our idea - of how to represent it for fast symbol reading. This is the default - version of the sym_fns.sym_offsets function for symbol readers that - don't need to do anything special. It allocates a section_offsets table - for the objectfile OBJFILE and stuffs ADDR into all of the offsets. */ - -void -default_symfile_offsets (struct objfile *objfile, - struct section_addr_info *addrs) +/* Initialize OBJFILE's sect_index_* members. */ +static void +init_objfile_sect_indices (struct objfile *objfile) { + asection *sect; int i; - asection *sect = NULL; - - objfile->num_sections = SECT_OFF_MAX; - objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); - memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS); - - /* Now calculate offsets for section that were specified by the - caller. */ - for (i = 0; i < MAX_SECTIONS && addrs->other[i].name; i++) - { - struct other_sections *osp ; - - osp = &addrs->other[i] ; - if (osp->addr == 0) - continue; - - /* Record all sections in offsets */ - /* The section_offsets in the objfile are here filled in using - the BFD index. */ - (objfile->section_offsets)->offsets[osp->sectindex] = osp->addr; - } - - /* Remember the bfd indexes for the .text, .data, .bss and - .rodata sections. */ - + sect = bfd_get_section_by_name (objfile->obfd, ".text"); if (sect) objfile->sect_index_text = sect->index; @@ -528,6 +499,46 @@ default_symfile_offsets (struct objfile *objfile, } } + +/* Parse the user's idea of an offset for dynamic linking, into our idea + of how to represent it for fast symbol reading. This is the default + version of the sym_fns.sym_offsets function for symbol readers that + don't need to do anything special. It allocates a section_offsets table + for the objectfile OBJFILE and stuffs ADDR into all of the offsets. */ + +void +default_symfile_offsets (struct objfile *objfile, + struct section_addr_info *addrs) +{ + int i; + + objfile->num_sections = SECT_OFF_MAX; + objfile->section_offsets = (struct section_offsets *) + obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); + memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS); + + /* Now calculate offsets for section that were specified by the + caller. */ + for (i = 0; i < MAX_SECTIONS && addrs->other[i].name; i++) + { + struct other_sections *osp ; + + osp = &addrs->other[i] ; + if (osp->addr == 0) + continue; + + /* Record all sections in offsets */ + /* The section_offsets in the objfile are here filled in using + the BFD index. */ + (objfile->section_offsets)->offsets[osp->sectindex] = osp->addr; + } + + /* Remember the bfd indexes for the .text, .data, .bss and + .rodata sections. */ + init_objfile_sect_indices (objfile); +} + + /* Process a symbol file, as either the main file or as a dynamically loaded file. @@ -624,25 +635,27 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs, else lower_offset = 0; - /* Calculate offsets for the loadable sections. + /* Calculate offsets for the loadable sections. FIXME! Sections must be in order of increasing loadable section so that contiguous sections can use the lower-offset!!! - Adjust offsets if the segments are not contiguous. - If the section is contiguous, its offset should be set to + Adjust offsets if the segments are not contiguous. + If the section is contiguous, its offset should be set to the offset of the highest loadable section lower than it (the loadable section directly below it in memory). this_offset = lower_offset = lower_addr - lower_orig_addr */ - /* Calculate offsets for sections. */ + /* Calculate offsets for sections. */ for (i=0 ; i < MAX_SECTIONS && addrs->other[i].name; i++) { if (addrs->other[i].addr != 0) { - sect = bfd_get_section_by_name (objfile->obfd, addrs->other[i].name); + sect = bfd_get_section_by_name (objfile->obfd, + addrs->other[i].name); if (sect) { - addrs->other[i].addr -= bfd_section_vma (objfile->obfd, sect); + addrs->other[i].addr + -= bfd_section_vma (objfile->obfd, sect); lower_offset = addrs->other[i].addr; /* This is the index used by BFD. */ addrs->other[i].sectindex = sect->index ; @@ -879,10 +892,14 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, else { printf_filtered ("done.\n"); - gdb_flush (gdb_stdout); } } + /* We print some messages regardless of whether 'from_tty || + info_verbose' is true, so make sure they go out at the right + time. */ + gdb_flush (gdb_stdout); + if (objfile->sf == NULL) return objfile; /* No symbols. */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 86ba9d9..835071a 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -36,6 +36,7 @@ #include "dictionary.h" #include "gdb_string.h" +#include #ifndef DEV_TTY #define DEV_TTY "/dev/tty" diff --git a/gdb/symtab.h b/gdb/symtab.h index b558e81..99119ef 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -688,11 +688,13 @@ struct section_offsets ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \ : secoff->offsets[whichone]) -/* The maximum possible size of a section_offsets table. */ - -#define SIZEOF_SECTION_OFFSETS \ +/* The size of a section_offsets table for N sections. */ +#define SIZEOF_N_SECTION_OFFSETS(n) \ (sizeof (struct section_offsets) \ - + sizeof (((struct section_offsets *) 0)->offsets) * (SECT_OFF_MAX-1)) + + sizeof (((struct section_offsets *) 0)->offsets) * ((n)-1)) + +/* The maximum possible size of a section_offsets table. */ +#define SIZEOF_SECTION_OFFSETS (SIZEOF_N_SECTION_OFFSETS (SECT_OFF_MAX)) /* Each source file or header is represented by a struct symtab. These objects are chained through the `next' field. */ diff --git a/gdb/target.c b/gdb/target.c index 51ace74..e19ad6d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -44,8 +44,6 @@ static void cleanup_target (struct target_ops *); static void maybe_kill_then_create_inferior (char *, char *, char **); -static void default_clone_and_follow_inferior (int, int *); - static void maybe_kill_then_attach (char *, int); static void kill_or_be_killed (int); @@ -348,12 +346,6 @@ maybe_kill_then_create_inferior (char *exec, char *args, char **env) target_create_inferior (exec, args, env); } -static void -default_clone_and_follow_inferior (int child_pid, int *followed_child) -{ - target_clone_and_follow_inferior (child_pid, followed_child); -} - /* Clean up a target struct so it no longer has any zero pointers in it. We default entries, at least to stubs that print error messages. */ @@ -376,14 +368,9 @@ cleanup_target (struct target_ops *t) de_fault (to_post_attach, (void (*) (int)) target_ignore); - de_fault (to_require_attach, - maybe_kill_then_attach); de_fault (to_detach, (void (*) (char *, int)) target_ignore); - de_fault (to_require_detach, - (void (*) (int, char *, int)) - target_ignore); de_fault (to_resume, (void (*) (ptid_t, int, enum target_signal)) noprocess); @@ -469,11 +456,6 @@ cleanup_target (struct target_ops *t) de_fault (to_acknowledge_created_inferior, (void (*) (int)) target_ignore); - de_fault (to_clone_and_follow_inferior, - default_clone_and_follow_inferior); - de_fault (to_post_follow_inferior_by_clone, - (void (*) (void)) - target_ignore); de_fault (to_insert_fork_catchpoint, (int (*) (int)) tcomplain); @@ -486,17 +468,8 @@ cleanup_target (struct target_ops *t) de_fault (to_remove_vfork_catchpoint, (int (*) (int)) tcomplain); - de_fault (to_has_forked, - (int (*) (int, int *)) - return_zero); - de_fault (to_has_vforked, - (int (*) (int, int *)) - return_zero); - de_fault (to_can_follow_vfork_prior_to_exec, - (int (*) (void)) - return_zero); - de_fault (to_post_follow_vfork, - (void (*) (int, int, int, int)) + de_fault (to_follow_fork, + (int (*) (int)) target_ignore); de_fault (to_insert_exec_catchpoint, (int (*) (int)) @@ -504,15 +477,9 @@ cleanup_target (struct target_ops *t) de_fault (to_remove_exec_catchpoint, (int (*) (int)) tcomplain); - de_fault (to_has_execd, - (int (*) (int, char **)) - return_zero); de_fault (to_reported_exec_events_per_exec_call, (int (*) (void)) return_one); - de_fault (to_has_syscall_event, - (int (*) (int, enum target_waitkind *, int *)) - return_zero); de_fault (to_has_exited, (int (*) (int, int, int *)) return_zero); @@ -588,9 +555,7 @@ update_current_target (void) INHERIT (to_close, t); INHERIT (to_attach, t); INHERIT (to_post_attach, t); - INHERIT (to_require_attach, t); INHERIT (to_detach, t); - INHERIT (to_require_detach, t); INHERIT (to_resume, t); INHERIT (to_wait, t); INHERIT (to_post_wait, t); @@ -621,21 +586,14 @@ update_current_target (void) INHERIT (to_create_inferior, t); INHERIT (to_post_startup_inferior, t); INHERIT (to_acknowledge_created_inferior, t); - INHERIT (to_clone_and_follow_inferior, t); - INHERIT (to_post_follow_inferior_by_clone, t); INHERIT (to_insert_fork_catchpoint, t); INHERIT (to_remove_fork_catchpoint, t); INHERIT (to_insert_vfork_catchpoint, t); INHERIT (to_remove_vfork_catchpoint, t); - INHERIT (to_has_forked, t); - INHERIT (to_has_vforked, t); - INHERIT (to_can_follow_vfork_prior_to_exec, t); - INHERIT (to_post_follow_vfork, t); + INHERIT (to_follow_fork, t); INHERIT (to_insert_exec_catchpoint, t); INHERIT (to_remove_exec_catchpoint, t); - INHERIT (to_has_execd, t); INHERIT (to_reported_exec_events_per_exec_call, t); - INHERIT (to_has_syscall_event, t); INHERIT (to_has_exited, t); INHERIT (to_mourn_inferior, t); INHERIT (to_can_run, t); @@ -651,7 +609,6 @@ update_current_target (void) INHERIT (to_get_current_exception_event, t); INHERIT (to_pid_to_exec_file, t); INHERIT (to_stratum, t); - INHERIT (DONT_USE, t); INHERIT (to_has_all_memory, t); INHERIT (to_has_memory, t); INHERIT (to_has_stack, t); @@ -1245,26 +1202,6 @@ find_default_attach (char *args, int from_tty) } void -find_default_require_attach (char *args, int from_tty) -{ - struct target_ops *t; - - t = find_default_run_target ("require_attach"); - (t->to_require_attach) (args, from_tty); - return; -} - -void -find_default_require_detach (int pid, char *args, int from_tty) -{ - struct target_ops *t; - - t = find_default_run_target ("require_detach"); - (t->to_require_detach) (pid, args, from_tty); - return; -} - -void find_default_create_inferior (char *exec_file, char *allargs, char **env) { struct target_ops *t; @@ -1274,16 +1211,6 @@ find_default_create_inferior (char *exec_file, char *allargs, char **env) return; } -void -find_default_clone_and_follow_inferior (int child_pid, int *followed_child) -{ - struct target_ops *t; - - t = find_default_run_target ("run"); - (t->to_clone_and_follow_inferior) (child_pid, followed_child); - return; -} - static int default_region_size_ok_for_hw_watchpoint (int byte_count) { @@ -1581,10 +1508,7 @@ init_dummy_target (void) dummy_target.to_longname = "None"; dummy_target.to_doc = ""; dummy_target.to_attach = find_default_attach; - dummy_target.to_require_attach = find_default_require_attach; - dummy_target.to_require_detach = find_default_require_detach; dummy_target.to_create_inferior = find_default_create_inferior; - dummy_target.to_clone_and_follow_inferior = find_default_clone_and_follow_inferior; dummy_target.to_pid_to_str = normal_pid_to_str; dummy_target.to_stratum = dummy_stratum; dummy_target.to_find_memory_regions = dummy_find_memory_regions; @@ -1629,15 +1553,6 @@ debug_to_post_attach (int pid) } static void -debug_to_require_attach (char *args, int from_tty) -{ - debug_target.to_require_attach (args, from_tty); - - fprintf_unfiltered (gdb_stdlog, - "target_require_attach (%s, %d)\n", args, from_tty); -} - -static void debug_to_detach (char *args, int from_tty) { debug_target.to_detach (args, from_tty); @@ -1646,15 +1561,6 @@ debug_to_detach (char *args, int from_tty) } static void -debug_to_require_detach (int pid, char *args, int from_tty) -{ - debug_target.to_require_detach (pid, args, from_tty); - - fprintf_unfiltered (gdb_stdlog, - "target_require_detach (%d, %s, %d)\n", pid, args, from_tty); -} - -static void debug_to_resume (ptid_t ptid, int step, enum target_signal siggnal) { debug_target.to_resume (ptid, step, siggnal); @@ -2058,24 +1964,6 @@ debug_to_acknowledge_created_inferior (int pid) pid); } -static void -debug_to_clone_and_follow_inferior (int child_pid, int *followed_child) -{ - debug_target.to_clone_and_follow_inferior (child_pid, followed_child); - - fprintf_unfiltered (gdb_stdlog, - "target_clone_and_follow_inferior (%d, %d)\n", - child_pid, *followed_child); -} - -static void -debug_to_post_follow_inferior_by_clone (void) -{ - debug_target.to_post_follow_inferior_by_clone (); - - fprintf_unfiltered (gdb_stdlog, "target_post_follow_inferior_by_clone ()\n"); -} - static int debug_to_insert_fork_catchpoint (int pid) { @@ -2129,53 +2017,14 @@ debug_to_remove_vfork_catchpoint (int pid) } static int -debug_to_has_forked (int pid, int *child_pid) -{ - int has_forked; - - has_forked = debug_target.to_has_forked (pid, child_pid); - - fprintf_unfiltered (gdb_stdlog, "target_has_forked (%d, %d) = %d\n", - pid, *child_pid, has_forked); - - return has_forked; -} - -static int -debug_to_has_vforked (int pid, int *child_pid) +debug_to_follow_fork (int follow_child) { - int has_vforked; - - has_vforked = debug_target.to_has_vforked (pid, child_pid); - - fprintf_unfiltered (gdb_stdlog, "target_has_vforked (%d, %d) = %d\n", - pid, *child_pid, has_vforked); - - return has_vforked; -} - -static int -debug_to_can_follow_vfork_prior_to_exec (void) -{ - int can_immediately_follow_vfork; - - can_immediately_follow_vfork = debug_target.to_can_follow_vfork_prior_to_exec (); - - fprintf_unfiltered (gdb_stdlog, "target_can_follow_vfork_prior_to_exec () = %d\n", - can_immediately_follow_vfork); - - return can_immediately_follow_vfork; -} + int retval = debug_target.to_follow_fork (follow_child); -static void -debug_to_post_follow_vfork (int parent_pid, int followed_parent, int child_pid, - int followed_child) -{ - debug_target.to_post_follow_vfork (parent_pid, followed_parent, child_pid, followed_child); + fprintf_unfiltered (gdb_stdlog, "target_follow_fork (%d) = %d\n", + follow_child, retval); - fprintf_unfiltered (gdb_stdlog, - "target_post_follow_vfork (%d, %d, %d, %d)\n", - parent_pid, followed_parent, child_pid, followed_child); + return retval; } static int @@ -2205,20 +2054,6 @@ debug_to_remove_exec_catchpoint (int pid) } static int -debug_to_has_execd (int pid, char **execd_pathname) -{ - int has_execd; - - has_execd = debug_target.to_has_execd (pid, execd_pathname); - - fprintf_unfiltered (gdb_stdlog, "target_has_execd (%d, %s) = %d\n", - pid, (*execd_pathname ? *execd_pathname : ""), - has_execd); - - return has_execd; -} - -static int debug_to_reported_exec_events_per_exec_call (void) { int reported_exec_events; @@ -2233,36 +2068,6 @@ debug_to_reported_exec_events_per_exec_call (void) } static int -debug_to_has_syscall_event (int pid, enum target_waitkind *kind, - int *syscall_id) -{ - int has_syscall_event; - char *kind_spelling = "??"; - - has_syscall_event = debug_target.to_has_syscall_event (pid, kind, syscall_id); - if (has_syscall_event) - { - switch (*kind) - { - case TARGET_WAITKIND_SYSCALL_ENTRY: - kind_spelling = "SYSCALL_ENTRY"; - break; - case TARGET_WAITKIND_SYSCALL_RETURN: - kind_spelling = "SYSCALL_RETURN"; - break; - default: - break; - } - } - - fprintf_unfiltered (gdb_stdlog, - "target_has_syscall_event (%d, %s, %d) = %d\n", - pid, kind_spelling, *syscall_id, has_syscall_event); - - return has_syscall_event; -} - -static int debug_to_has_exited (int pid, int wait_status, int *exit_status) { int has_exited; @@ -2395,9 +2200,7 @@ setup_target_debug (void) current_target.to_close = debug_to_close; current_target.to_attach = debug_to_attach; current_target.to_post_attach = debug_to_post_attach; - current_target.to_require_attach = debug_to_require_attach; current_target.to_detach = debug_to_detach; - current_target.to_require_detach = debug_to_require_detach; current_target.to_resume = debug_to_resume; current_target.to_wait = debug_to_wait; current_target.to_post_wait = debug_to_post_wait; @@ -2428,21 +2231,14 @@ setup_target_debug (void) current_target.to_create_inferior = debug_to_create_inferior; current_target.to_post_startup_inferior = debug_to_post_startup_inferior; current_target.to_acknowledge_created_inferior = debug_to_acknowledge_created_inferior; - current_target.to_clone_and_follow_inferior = debug_to_clone_and_follow_inferior; - current_target.to_post_follow_inferior_by_clone = debug_to_post_follow_inferior_by_clone; current_target.to_insert_fork_catchpoint = debug_to_insert_fork_catchpoint; current_target.to_remove_fork_catchpoint = debug_to_remove_fork_catchpoint; current_target.to_insert_vfork_catchpoint = debug_to_insert_vfork_catchpoint; current_target.to_remove_vfork_catchpoint = debug_to_remove_vfork_catchpoint; - current_target.to_has_forked = debug_to_has_forked; - current_target.to_has_vforked = debug_to_has_vforked; - current_target.to_can_follow_vfork_prior_to_exec = debug_to_can_follow_vfork_prior_to_exec; - current_target.to_post_follow_vfork = debug_to_post_follow_vfork; + current_target.to_follow_fork = debug_to_follow_fork; current_target.to_insert_exec_catchpoint = debug_to_insert_exec_catchpoint; current_target.to_remove_exec_catchpoint = debug_to_remove_exec_catchpoint; - current_target.to_has_execd = debug_to_has_execd; current_target.to_reported_exec_events_per_exec_call = debug_to_reported_exec_events_per_exec_call; - current_target.to_has_syscall_event = debug_to_has_syscall_event; current_target.to_has_exited = debug_to_has_exited; current_target.to_mourn_inferior = debug_to_mourn_inferior; current_target.to_can_run = debug_to_can_run; diff --git a/gdb/target.h b/gdb/target.h index 5cdb76f..8c6dce1 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -112,8 +112,8 @@ enum target_waitkind inferior. */ TARGET_WAITKIND_SPURIOUS, - /* This is used for target async and extended-async - only. Remote_async_wait() returns this when there is an event + /* An event has occured, but we should wait again. + Remote_async_wait() returns this when there is an event on the inferior, but the rest of the world is not interested in it. The inferior has not stopped, but has just sent some output to the console, for instance. In this case, we want to go back @@ -193,9 +193,7 @@ struct target_ops void (*to_close) (int); void (*to_attach) (char *, int); void (*to_post_attach) (int); - void (*to_require_attach) (char *, int); void (*to_detach) (char *, int); - void (*to_require_detach) (int, char *, int); void (*to_resume) (ptid_t, int, enum target_signal); ptid_t (*to_wait) (ptid_t, struct target_waitstatus *); void (*to_post_wait) (ptid_t, int); @@ -272,21 +270,14 @@ struct target_ops void (*to_create_inferior) (char *, char *, char **); void (*to_post_startup_inferior) (ptid_t); void (*to_acknowledge_created_inferior) (int); - void (*to_clone_and_follow_inferior) (int, int *); - void (*to_post_follow_inferior_by_clone) (void); int (*to_insert_fork_catchpoint) (int); int (*to_remove_fork_catchpoint) (int); int (*to_insert_vfork_catchpoint) (int); int (*to_remove_vfork_catchpoint) (int); - int (*to_has_forked) (int, int *); - int (*to_has_vforked) (int, int *); - int (*to_can_follow_vfork_prior_to_exec) (void); - void (*to_post_follow_vfork) (int, int, int, int); + int (*to_follow_fork) (int); int (*to_insert_exec_catchpoint) (int); int (*to_remove_exec_catchpoint) (int); - int (*to_has_execd) (int, char **); int (*to_reported_exec_events_per_exec_call) (void); - int (*to_has_syscall_event) (int, enum target_waitkind *, int *); int (*to_has_exited) (int, int, int *); void (*to_mourn_inferior) (void); int (*to_can_run) (void); @@ -304,8 +295,6 @@ struct target_ops struct exception_event_record *(*to_get_current_exception_event) (void); char *(*to_pid_to_exec_file) (int pid); enum strata to_stratum; - struct target_ops - *DONT_USE; /* formerly to_next */ int to_has_all_memory; int to_has_memory; int to_has_stack; @@ -411,17 +400,6 @@ extern struct target_stack_item *target_stack; #define target_post_attach(pid) \ (*current_target.to_post_attach) (pid) -/* Attaches to a process on the target side, if not already attached. - (If already attached, takes no action.) - - This operation can be used to follow the child process of a fork. - On some targets, such child processes of an original inferior process - are automatically under debugger control, and thus do not require an - actual attach operation. */ - -#define target_require_attach(args, from_tty) \ - (*current_target.to_require_attach) (args, from_tty) - /* Takes a program previously attached to and detaches it. The program may resume execution (some targets do, some don't) and will no longer stop on signals, etc. We better not have left any breakpoints @@ -431,21 +409,6 @@ extern struct target_stack_item *target_stack; extern void target_detach (char *, int); -/* Detaches from a process on the target side, if not already dettached. - (If already detached, takes no action.) - - This operation can be used to follow the parent process of a fork. - On some targets, such child processes of an original inferior process - are automatically under debugger control, and thus do require an actual - detach operation. - - PID is the process id of the child to detach from. - ARGS is arguments typed by the user (e.g. a signal to send the process). - FROM_TTY says whether to be verbose or not. */ - -#define target_require_detach(pid, args, from_tty) \ - (*current_target.to_require_detach) (pid, args, from_tty) - /* Resume execution of the target process PTID. STEP says whether to single-step or to run free; SIGGNAL is the signal to be given to the target, or TARGET_SIGNAL_0 for no signal. The caller may not @@ -545,10 +508,6 @@ extern void child_post_startup_inferior (ptid_t); extern void child_acknowledge_created_inferior (int); -extern void child_clone_and_follow_inferior (int, int *); - -extern void child_post_follow_inferior_by_clone (void); - extern int child_insert_fork_catchpoint (int); extern int child_remove_fork_catchpoint (int); @@ -557,30 +516,28 @@ extern int child_insert_vfork_catchpoint (int); extern int child_remove_vfork_catchpoint (int); -extern int child_has_forked (int, int *); - -extern int child_has_vforked (int, int *); - extern void child_acknowledge_created_inferior (int); -extern int child_can_follow_vfork_prior_to_exec (void); - -extern void child_post_follow_vfork (int, int, int, int); +extern int child_follow_fork (int); extern int child_insert_exec_catchpoint (int); extern int child_remove_exec_catchpoint (int); -extern int child_has_execd (int, char **); - extern int child_reported_exec_events_per_exec_call (void); -extern int child_has_syscall_event (int, enum target_waitkind *, int *); - extern int child_has_exited (int, int, int *); extern int child_thread_alive (ptid_t); +/* From infrun.c. */ + +extern int inferior_has_forked (int pid, int *child_pid); + +extern int inferior_has_vforked (int pid, int *child_pid); + +extern int inferior_has_execd (int pid, char **execd_pathname); + /* From exec.c */ extern void print_section_info (struct target_ops *, bfd *); @@ -702,33 +659,6 @@ extern void target_load (char *arg, int from_tty); #define target_acknowledge_created_inferior(pid) \ (*current_target.to_acknowledge_created_inferior) (pid) -/* An inferior process has been created via a fork() or similar - system call. This function will clone the debugger, then ensure - that CHILD_PID is attached to by that debugger. - - FOLLOWED_CHILD is set TRUE on return *for the clone debugger only*, - and FALSE otherwise. (The original and clone debuggers can use this - to determine which they are, if need be.) - - (This is not a terribly useful feature without a GUI to prevent - the two debuggers from competing for shell input.) */ - -#define target_clone_and_follow_inferior(child_pid,followed_child) \ - (*current_target.to_clone_and_follow_inferior) (child_pid, followed_child) - -/* This operation is intended to be used as the last in a sequence of - steps taken when following both parent and child of a fork. This - is used by a clone of the debugger, which will follow the child. - - The original debugger has detached from this process, and the - clone has attached to it. - - On some targets, this requires a bit of cleanup to make it work - correctly. */ - -#define target_post_follow_inferior_by_clone() \ - (*current_target.to_post_follow_inferior_by_clone) () - /* On some targets, we can catch an inferior fork or vfork event when it occurs. These functions insert/remove an already-created catchpoint for such events. */ @@ -745,42 +675,16 @@ extern void target_load (char *arg, int from_tty); #define target_remove_vfork_catchpoint(pid) \ (*current_target.to_remove_vfork_catchpoint) (pid) -/* Returns TRUE if PID has invoked the fork() system call. And, - also sets CHILD_PID to the process id of the other ("child") - inferior process that was created by that call. */ - -#define target_has_forked(pid,child_pid) \ - (*current_target.to_has_forked) (pid,child_pid) - -/* Returns TRUE if PID has invoked the vfork() system call. And, - also sets CHILD_PID to the process id of the other ("child") - inferior process that was created by that call. */ - -#define target_has_vforked(pid,child_pid) \ - (*current_target.to_has_vforked) (pid,child_pid) - -/* Some platforms (such as pre-10.20 HP-UX) don't allow us to do - anything to a vforked child before it subsequently calls exec(). - On such platforms, we say that the debugger cannot "follow" the - child until it has vforked. - - This function should be defined to return 1 by those targets - which can allow the debugger to immediately follow a vforked - child, and 0 if they cannot. */ - -#define target_can_follow_vfork_prior_to_exec() \ - (*current_target.to_can_follow_vfork_prior_to_exec) () +/* If the inferior forks or vforks, this function will be called at + the next resume in order to perform any bookkeeping and fiddling + necessary to continue debugging either the parent or child, as + requested, and releasing the other. Information about the fork + or vfork event is available via get_last_target_status (). + This function returns 1 if the inferior should not be resumed + (i.e. there is another event pending). */ -/* An inferior process has been created via a vfork() system call. - The debugger has followed the parent, the child, or both. The - process of setting up for that follow may have required some - target-specific trickery to track the sequence of reported events. - If so, this function should be defined by those targets that - require the debugger to perform cleanup or initialization after - the vfork follow. */ - -#define target_post_follow_vfork(parent_pid,followed_parent,child_pid,followed_child) \ - (*current_target.to_post_follow_vfork) (parent_pid,followed_parent,child_pid,followed_child) +#define target_follow_fork(follow_child) \ + (*current_target.to_follow_fork) (follow_child) /* On some targets, we can catch an inferior exec event when it occurs. These functions insert/remove an already-created @@ -792,13 +696,6 @@ extern void target_load (char *arg, int from_tty); #define target_remove_exec_catchpoint(pid) \ (*current_target.to_remove_exec_catchpoint) (pid) -/* Returns TRUE if PID has invoked a flavor of the exec() system call. - And, also sets EXECD_PATHNAME to the pathname of the executable - file that was passed to exec(), and is now being executed. */ - -#define target_has_execd(pid,execd_pathname) \ - (*current_target.to_has_execd) (pid,execd_pathname) - /* Returns the number of exec events that are reported when a process invokes a flavor of the exec() system call on this target, if exec events are being reported. */ @@ -806,13 +703,6 @@ extern void target_load (char *arg, int from_tty); #define target_reported_exec_events_per_exec_call() \ (*current_target.to_reported_exec_events_per_exec_call) () -/* Returns TRUE if PID has reported a syscall event. And, also sets - KIND to the appropriate TARGET_WAITKIND_, and sets SYSCALL_ID to - the unique integer ID of the syscall. */ - -#define target_has_syscall_event(pid,kind,syscall_id) \ - (*current_target.to_has_syscall_event) (pid,kind,syscall_id) - /* Returns TRUE if PID has exited. And, also sets EXIT_STATUS to the exit code of PID, if any. */ @@ -888,11 +778,6 @@ extern void target_load (char *arg, int from_tty); #define target_get_current_exception_event() \ (*current_target.to_get_current_exception_event) () -/* Pointer to next target in the chain, e.g. a core file and an exec file. */ - -#define target_next \ - (current_target.to_next) - /* Does the target include all of memory, or only part of it? This determines whether we look up the target chain for other parts of memory if this target can't satisfy a request. */ @@ -1241,14 +1126,8 @@ extern void noprocess (void); extern void find_default_attach (char *, int); -extern void find_default_require_attach (char *, int); - -extern void find_default_require_detach (int, char *, int); - extern void find_default_create_inferior (char *, char *, char **); -extern void find_default_clone_and_follow_inferior (int, int *); - extern struct target_ops *find_run_target (void); extern struct target_ops *find_core_target (void); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1f699e4..c3372c7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,132 @@ +2002-12-23 David Carlton + + * gdb.base/selftest.exp (do_steps_and_nexts): Allow initial brace + and current_directory initialization. + +2002-12-22 Jim Blandy + + * gdb.trace/tfind.exp: Pass '-O1' flag via the 'optimize' option, + rather than as part of the output file name. + + * gdb.base/attach.exp: There's no need to copy the test program to + /tmp; that was only ever necessary on HP/UX, and this test is + entirely disabled there anyway. + +2002-12-21 Jim Blandy + + * gdb.c++/psmang.exp: Doc fix. + + * gdb.c++/psmang.exp, gdb.c++/psmang1.cc, gdb.c++/psmang2.cc: New + test. + +2002-12-20 David Carlton + + * gdb.c++/annota2.exp: KFAIL annotate-quit. + +2002-12-18 Michael Chastain + + * gdb.c++/annota2.exp: Add copyright year 2002. + +2002-12-17 David Carlton + + * gdb.c++/try_catch.cc: Add marker comments. + * gdb.c++/try_catch.exp: Get line numbers from marker comments. + * gdb.c++/m-data.cc: Delete namespace __gnu_test. + * gdb.c++/m-static.cc: Ditto. + * gdb.c++/m-static1.cc: Ditto. + * gdb.c++/try_catch.cc: Ditto. + +2002-12-16 Jeff Johnston + + * lib/mi-support.exp (mi_reinitialize_dir): Check mi level + to see whether we are using the new -environment-directory + command which resets via -r or the old version of the command + which may prompt the user. Part of fix for gdb/741. + +2002-12-13 Andrew Cagney + + * gdb.fortran/types.exp: Update obsolete comment. + * gdb.fortran/exprs.exp: Ditto. + * lib/gdb.exp: Delete obsolete code. + * gdb.chill/ChangeLog, gdb.chill/Makefile.in: Delete. + * gdb.chill/builtins.ch, gdb.chill/builtins.exp: Delete. + * gdb.chill/callch.ch, gdb.chill/callch.exp: Delete. + * gdb.chill/chexp.exp, gdb.chill/chillvars.ch: Delete. + * gdb.chill/chillvars.exp, gdb.chill/configure: Delete. + * gdb.chill/configure.in, gdb.chill/enum.ch: Delete. + * gdb.chill/enum.exp, gdb.chill/func1.ch: Delete. + * gdb.chill/gch1041.ch, gdb.chill/gch1041.exp: Delete. + * gdb.chill/gch1272.ch, gdb.chill/gch1272.exp: Delete. + * gdb.chill/gch1280.ch, gdb.chill/gch1280.exp: Delete. + * gdb.chill/gch922.ch, gdb.chill/gch922.exp: Delete. + * gdb.chill/gch981.ch, gdb.chill/gch981.exp: Delete. + * gdb.chill/misc.ch, gdb.chill/misc.exp: Delete. + * gdb.chill/powerset.ch, gdb.chill/powerset.exp: Delete. + * gdb.chill/pr-4975-grt.ch, gdb.chill/pr-4975.ch: Delete. + * gdb.chill/pr-4975.exp, gdb.chill/pr-5016.ch: Delete. + * gdb.chill/pr-5016.exp, gdb.chill/pr-5020.ch: Delete. + * gdb.chill/pr-5020.exp, gdb.chill/pr-5022.ch: Delete. + * gdb.chill/pr-5022.exp, gdb.chill/pr-5646-grt.ch: Delete. + * gdb.chill/pr-5646.ch, gdb.chill/pr-5646.exp: Delete. + * gdb.chill/pr-5984.ch, gdb.chill/pr-5984.exp: Delete. + * gdb.chill/pr-6292.ch, gdb.chill/pr-6292.exp: Delete. + * gdb.chill/pr-6632-grt.ch, gdb.chill/pr-6632.ch: Delete. + * gdb.chill/pr-6632.exp, gdb.chill/pr-8134.exp: Delete. + * gdb.chill/pr-8136.ch, gdb.chill/pr-8136.exp: Delete. + * gdb.chill/pr-8405.ch, gdb.chill/pr-8405.exp: Delete. + * gdb.chill/pr-8742.ch, gdb.chill/pr-8742.exp: Delete. + * gdb.chill/pr-8894-grt.ch, gdb.chill/pr-8894.ch: Delete. + * gdb.chill/pr-8894.exp, gdb.chill/pr-9095.ch: Delete. + * gdb.chill/pr-9095.exp, gdb.chill/pr-9946.ch: Delete. + * gdb.chill/pr-9946.exp, gdb.chill/result.ch: Delete. + * gdb.chill/result.exp, gdb.chill/string.ch: Delete. + * gdb.chill/string.exp, gdb.chill/tests1.ch: Delete. + * gdb.chill/tests1.exp, gdb.chill/tests2.ch: Delete. + * gdb.chill/tests2.exp, gdb.chill/tuples.ch: Delete. + * gdb.chill/tuples.exp, gdb.chill/xstruct-grt.ch: Delete. + * gdb.chill/xstruct.ch, gdb.chill/xstruct.exp: Delete. + +2002-12-11 David Carlton + + * gdb.c++/m-data.exp: Add test for members that shadow global + variables: see PR gdb/804. + * gdb.c++/m-data.cc: Ditto. + +2002-12-10 Daniel Jacobowitz + + * gdb.base/foll-vfork.exp: Re-enable test on HP/UX. + +2002-12-06 David Carlton + + * gdb.base/store.c: Don't declare functions static. + +2002-12-04 Andrew Cagney + + * gdb.base/store.exp, gdb.base/store.c: New files. + +2002-12-03 Daniel Jacobowitz + + * gdb.base/selftest.exp: Update for current gdb. + +2002-12-03 Daniel Jacobowitz + + * gdb.base/maint.exp: Only dump symbols from one source file + or objfile. + +2002-12-03 Daniel Jacobowitz + + * gdb.base/step-test.exp: Allow MIPS to return to the line of a + function call. + +2002-11-25 Jim Blandy + + * lib/mi-support.exp (mi_delete_breakpoints): Change name of + function appearing in error message. + +2002-11-21 Daniel Jacobowitz + + * gdb.base/maint.exp (help maint dump-me): Update with typo fix. + 2002-12-20 David Carlton * gdb.c++/namespace.exp: Delete tests that try to apply using diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp index 9c6bb97..4019fea 100644 --- a/gdb/testsuite/gdb.base/attach.exp +++ b/gdb/testsuite/gdb.base/attach.exp @@ -63,31 +63,12 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -# Because we can't attach over nfs, copy binfile to /tmp/${binfile}.${pid} -# and replace binfile with a symbolic link - - set pid [pid] - exec /bin/cp -f ${binfile} /tmp/attach1.${pid} - exec rm -f ${binfile} - set binfile /tmp/attach1.${pid} -# exec ln -s /tmp/attach1.${pid} ${binfile} - # Build the in-system-call test if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -# Because we can't attach over nfs, copy binfile2 to /tmp/${binfile2}.${pid} -# and replace binfile2 with a symbolic link - - set pid [pid] - exec cp -f ${binfile2} /tmp/attach2.${pid} - exec rm -f ${binfile2} - set binfile2 /tmp/attach2.${pid} -# exec ln -s /tmp/attach2.${pid} ${binfile2} - - if [get_compiler_info ${binfile}] { return -1 } @@ -428,19 +409,7 @@ do_attach_tests gdb_exit gdb_start -# this seems not necessary. - guo -# -# # Since we have moved the executable to /tmp, it will be hard for gdb -# # to find the object file/executable to read the symbols. This is -# # a known limitation. We try and get the name of the executable the -# # process is running from a variety of methods, but none is foolproof. -# # Using "dir" will get us the symbols. -# -# gdb_test "dir ./gdb.base" ".*" "set up directory before attach" gdb_reinitialize_dir $srcdir/$subdir do_call_attach_tests -# Cleanup the files placed in /tmp and the symlinks - remote_exec build "rm -f ${binfile} ${binfile2} /tmp/attach1.${pid} /tmp/attach2.${pid}" - return 0 diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp index 1fed06b..86a1ce9 100644 --- a/gdb/testsuite/gdb.base/foll-vfork.exp +++ b/gdb/testsuite/gdb.base/foll-vfork.exp @@ -28,10 +28,13 @@ if { ![isnative] } then { set prms_id 0 set bug_id 0 -if [istarget "hppa2.0w-hp-hpux*"] { - warning "Don't run gdb.base/foll-vfork.exp until JAGaa43495 kernel problem is fixed." - return 0 -} +# NOTE drow/2002-12-06: I don't know what the referenced kernel problem +# is, but it appears to be fixed in recent HP/UX versions. + +##if [istarget "hppa2.0w-hp-hpux*"] { +## warning "Don't run gdb.base/foll-vfork.exp until JAGaa43495 kernel problem is fixed." +## return 0 +##} set testfile "foll-vfork" set testfile2 "vforked-prog" diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 51f4c9d..9dbc509 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -230,9 +230,9 @@ gdb_expect { timeout { fail "(timeout) maint print psymbols w/o args" } } -send_gdb "maint print psymbols psymbols_output\n" +send_gdb "maint print psymbols psymbols_output ${srcdir}/${subdir}/${srcfile}\n" gdb_expect { - -re "^maint print psymbols psymbols_output\r\n$gdb_prompt $"\ + -re "^maint print psymbols psymbols_output \[^\n\]*\r\n$gdb_prompt $"\ { send_gdb "shell ls psymbols_output\n" gdb_expect { @@ -272,9 +272,9 @@ gdb_expect { timeout { fail "(timeout) maint print msymbols w/o args" } } -send_gdb "maint print msymbols msymbols_output\n" +send_gdb "maint print msymbols msymbols_output ${binfile}\n" gdb_expect { - -re "^maint print msymbols msymbols_output\r\n$gdb_prompt $"\ + -re "^maint print msymbols msymbols_output \[^\n\]*\r\n$gdb_prompt $"\ { send_gdb "shell ls msymbols_output\n" gdb_expect { @@ -307,16 +307,13 @@ gdb_expect { timeout { fail "(timeout) maint print symbols w/o args" } } -# This command can legitimately take many minutes to execute. If the -# executable is dynamically linked, then you get all the debugging -# info for the entire library --- 89Mb on my system. -jimb +# Request symbols for one particular source file so that we don't try to +# dump the symbol information for the entire C library - over 500MB nowadays +# for GNU libc. -set old_timeout $timeout -set timeout 600 - -send_gdb "maint print symbols symbols_output\n" +send_gdb "maint print symbols symbols_output ${srcdir}/${subdir}/${srcfile}\n" gdb_expect { - -re "^maint print symbols symbols_output\r\n$gdb_prompt $"\ + -re "^maint print symbols symbols_output \[^\n\]*\r\n$gdb_prompt $"\ { send_gdb "shell ls symbols_output\n" gdb_expect { @@ -341,8 +338,6 @@ gdb_expect { timeout { fail "(timeout) maint print symbols" } } -set timeout $old_timeout - send_gdb "maint print type argc\n" gdb_expect { -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nupper_bound_type $hex \\(BOUND_SIMPLE\\)\r\nlower_bound_type $hex \\(BOUND_SIMPLE\\)\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\ @@ -499,7 +494,7 @@ if [ishost *cygwin*] { } send_gdb "help maint dump-me\n" gdb_expect { - -re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\ + -re "Get fatal error; make debugger dump its core\\.\r\nGDB sets its handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\ { pass "help maint dump-me" } -re ".*$gdb_prompt $" { fail "help maint dump-me" } timeout { fail "(timeout) help maint dump-me" } diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp index 85e9fa7..bf71c49 100644 --- a/gdb/testsuite/gdb.base/selftest.exp +++ b/gdb/testsuite/gdb.base/selftest.exp @@ -1,4 +1,4 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000 +# Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -54,6 +54,10 @@ proc do_steps_and_nexts {} { for {set count 0} {$count < 26} {incr count} { send_gdb "list\n" + # NOTE: carlton/2002-12-11: The "initial brace" and + # "current_directory initialization" possibilities happen to + # me with GCC 3.1 on i686-pc-linux-gnu when I compile with + # optimization. gdb_expect { -re ".*context = data.*$gdb_prompt $" { set description "step over context initialization" @@ -158,6 +162,14 @@ proc do_steps_and_nexts {} { set description "next over textdomain PACKAGE" set command "next" } + -re "\[0-9\]*\t\{\r\n$gdb_prompt $" { + set description "step over initial brace" + set command "step" + } + -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" { + set description "step over current_directory initialization" + set command "step" + } -re "\[ \t\]+\{\r\n$gdb_prompt $" { setup_xfail "mips-*-irix5*" fail "$description ended up at odd location" @@ -392,7 +404,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ set description "backtrace through signal handler" send_gdb "backtrace\n" gdb_expect { - -re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" { + -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" { pass "$description" } -re ".*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp index 9a21136..32af949 100644 --- a/gdb/testsuite/gdb.base/step-test.exp +++ b/gdb/testsuite/gdb.base/step-test.exp @@ -78,7 +78,8 @@ gdb_test "step" ".*${decimal}.*myglob.*" "step into" # On PA64, we end up at a different instruction than PA32. # On IA-64, we also end up on callee instead of on the next line due # to the restoration of the global pointer (which is a caller-save). -if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"]} { +# Similarly on MIPS PIC targets. +if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"]} { send_gdb "finish\n" gdb_expect { -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" { pass "step out 1" } @@ -176,8 +177,11 @@ gdb_expect { # On PA64, we end up at a different instruction than PA32. # On IA-64, we end up on callee instead of on the following line due # to the restoration of the global pointer. - if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] } { + # Similarly on MIPS PIC targets. + if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] || [istarget "mips*-*-*"] } { pass "stepi: finish call 2" + test_i "stepi: past call" "stepi" \ + ".*${decimal}.*callee.*STEPI" ".*${decimal}.*callee.*NEXTI" } else { fail "stepi: finish call 2" return diff --git a/gdb/testsuite/gdb.c++/annota2.exp b/gdb/testsuite/gdb.c++/annota2.exp index 51c1116..0e585ec 100644 --- a/gdb/testsuite/gdb.c++/annota2.exp +++ b/gdb/testsuite/gdb.c++/annota2.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000, 2001 +# Copyright 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -214,6 +214,7 @@ send_gdb "\003" gdb_expect { -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \ { pass "annotate-quit" } + -re "$gdb_prompt$" { kfail "gdb/544" "annotate-quit" } -re ".*$gdb_prompt$" { fail "annotate-quit" } timeout { fail "annotate-quit (timeout)" } } diff --git a/gdb/testsuite/gdb.c++/m-data.cc b/gdb/testsuite/gdb.c++/m-data.cc index 2066546..c97e719 100644 --- a/gdb/testsuite/gdb.c++/m-data.cc +++ b/gdb/testsuite/gdb.c++/m-data.cc @@ -40,11 +40,25 @@ public: gnu_obj_3(antiquities b): data(etruscan) { } }; +int shadow = 0; + +class C +{ +public: + C (int x) : shadow (x) {} + void marker () {} +private: + int shadow; +}; + int main() { gnu_obj_1 test1(egyptian, 4589); gnu_obj_2 test2(roman); gnu_obj_3 test3(greek); - return 0; // breakpoint: constructs-done + C theC (1); // breakpoint: first-constructs-done + theC.marker (); + + return 0; } diff --git a/gdb/testsuite/gdb.c++/m-data.exp b/gdb/testsuite/gdb.c++/m-data.exp index daee138..85adb5e 100644 --- a/gdb/testsuite/gdb.c++/m-data.exp +++ b/gdb/testsuite/gdb.c++/m-data.exp @@ -54,10 +54,10 @@ if ![runto_main] then { continue } -# First, run to after we've constructed all the objects: +# First, run to after we've constructed all the gnu_obj_N's: -gdb_breakpoint [gdb_get_line_number "constructs-done"] -gdb_continue_to_breakpoint "end of constructors" +gdb_breakpoint [gdb_get_line_number "first-constructs-done"] +gdb_continue_to_breakpoint "end of first constructors" # One. @@ -107,5 +107,13 @@ gdb_test "print test3.data.value" "\\$\[0-9\]* = oriental" "template object, bas # template object, derived template data member's enum gdb_test "print test3.data.value_derived" "\\$\[0-9]\* = etruscan" "template object, derived enum" +# Now some tests for shadowing (see PR gdb/804): + +gdb_breakpoint "C::marker" +gdb_continue_to_breakpoint "continue to shadow breakpoint" + +gdb_test "print shadow" "\\$\[0-9]\* = 1" "shadowing member" +gdb_test "print ::shadow" "\\$\[0-9]\* = 0" "shadowed global variable" + gdb_exit return 0 diff --git a/gdb/testsuite/gdb.c++/try_catch.cc b/gdb/testsuite/gdb.c++/try_catch.cc index 9a9c737..e13dd64 100644 --- a/gdb/testsuite/gdb.c++/try_catch.cc +++ b/gdb/testsuite/gdb.c++/try_catch.cc @@ -4,50 +4,45 @@ #include #include -namespace __gnu_test -{ - enum region { oriental, egyptian, greek, etruscan, roman }; +enum region { oriental, egyptian, greek, etruscan, roman }; - // Test one. - class gnu_obj_1 - { - public: - typedef region antiquities; - const bool test; - const int key1; - long key2; +// Test one. +class gnu_obj_1 +{ +public: + typedef region antiquities; + const bool test; + const int key1; + long key2; - antiquities value; + antiquities value; - gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {} - }; + gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {} +}; - // Test two. - template - class gnu_obj_2: public virtual gnu_obj_1 - { - public: - antiquities value_derived; - - gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } - }; +// Test two. +template +class gnu_obj_2: public virtual gnu_obj_1 +{ +public: + antiquities value_derived; + + gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } +}; - // Test three. - template - class gnu_obj_3 - { - public: - typedef region antiquities; - gnu_obj_2 data; +// Test three. +template +class gnu_obj_3 +{ +public: + typedef region antiquities; + gnu_obj_2 data; - gnu_obj_3(antiquities b): data(etruscan) { } - }; -} + gnu_obj_3(antiquities b): data(etruscan) { } +}; int main() { - using namespace __gnu_test; - bool test = true; const int i = 5; int j = i; @@ -58,12 +53,12 @@ int main() try { ++j; - throw gnu_obj_1(egyptian, 4589); + throw gnu_obj_1(egyptian, 4589); // marker 1-throw } catch (gnu_obj_1& obj) { ++j; - if (obj.value != egyptian) + if (obj.value != egyptian) // marker 1-catch test &= false; if (obj.key2 != 4589) test &= false; @@ -77,19 +72,19 @@ int main() // 2 try { - ++j; + ++j; // marker 2-start try { - ++j; + ++j; // marker 2-next try { ++j; - throw gnu_obj_1(egyptian, 4589); + throw gnu_obj_1(egyptian, 4589); // marker 2-throw } catch (gnu_obj_1& obj) { ++j; - if (obj.value != egyptian) + if (obj.value != egyptian) // marker 2-catch test &= false; if (obj.key2 != 4589) test &= false; @@ -115,11 +110,11 @@ int main() try { if (j < 100) - throw invalid_argument("gdb.1"); + throw invalid_argument("gdb.1"); // marker 3-throw } catch (exception& obj) { - if (obj.what() != "gdb.1") + if (obj.what() != "gdb.1") // marker 3-catch test &= false; } return 0; diff --git a/gdb/testsuite/gdb.c++/try_catch.exp b/gdb/testsuite/gdb.c++/try_catch.exp index e024132..1473e20 100644 --- a/gdb/testsuite/gdb.c++/try_catch.exp +++ b/gdb/testsuite/gdb.c++/try_catch.exp @@ -54,31 +54,29 @@ if ![runto_main] then { continue } -# One. +gdb_breakpoint [gdb_get_line_number "marker 1-throw"] +gdb_continue_to_breakpoint "marker 1-throw" -gdb_test "break 61" "Breakpoint \[0-9\]*.*line 61\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:61\r\n.*" "continue to 61" +gdb_breakpoint [gdb_get_line_number "marker 1-catch"] +gdb_continue_to_breakpoint "marker 1-catch" -gdb_test "break 66" "Breakpoint \[0-9\]*.*line 66\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:66\r\n.*" "continue to 66" +gdb_breakpoint [gdb_get_line_number "marker 2-start"] +gdb_continue_to_breakpoint "marker 2-start" -gdb_test "break 80" "Breakpoint \[0-9\]*.*line 80\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:80\r\n.*" "continue to 80" +gdb_breakpoint [gdb_get_line_number "marker 2-next"] +gdb_continue_to_breakpoint "marker 2-next" -gdb_test "break 83" "Breakpoint \[0-9\]*.*line 83\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:83\r\n.*" "continue to 83" +gdb_breakpoint [gdb_get_line_number "marker 2-throw"] +gdb_continue_to_breakpoint "marker 2-throw" -gdb_test "break 87" "Breakpoint \[0-9\]*.*line 87\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:87\r\n.*" "continue to 87" +gdb_breakpoint [gdb_get_line_number "marker 2-catch"] +gdb_continue_to_breakpoint "marker 2-catch" -gdb_test "break 92" "Breakpoint \[0-9\]*.*line 92\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:92\r\n.*" "continue to 92" +gdb_breakpoint [gdb_get_line_number "marker 3-throw"] +gdb_continue_to_breakpoint "marker 3-throw" -gdb_test "break 118" "Breakpoint \[0-9\]*.*line 118\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:118\r\n.*" "continue to 118" - -gdb_test "break 122" "Breakpoint \[0-9\]*.*line 122\\." -gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:122\r\n.*" "continue to 122" +gdb_breakpoint [gdb_get_line_number "marker 3-catch"] +gdb_continue_to_breakpoint "marker 3-catch" gdb_exit return 0 diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog deleted file mode 100644 index ea0068f..0000000 --- a/gdb/testsuite/gdb.chill/ChangeLog +++ /dev/null @@ -1,350 +0,0 @@ -2002-11-09 Klee Dienes - - * chexp.exp: Mark as obsolete. - * pr-5016.exp: Remove stray trailing newline. - -2002-08-01 Andrew Cagney - - * builtins.exp, callch.exp, chillvars.exp: Make files obsolete. - * enum.exp, gch1041.exp, gch1272.exp: Make files obsolete. - * gch1280.exp, gch922.exp, gch981.exp: Make files obsolete. - * misc.exp, powerset.exp, pr-4975.exp: Make files obsolete. - * pr-5016.exp, pr-5020.exp, pr-5022.exp: Make files obsolete. - * pr-5646.exp, pr-5984.exp, pr-6292.exp: Make files obsolete. - * pr-6632.exp, pr-8134.exp, pr-8136.exp: Make files obsolete. - * pr-8405.exp, pr-8742.exp, pr-8894.exp: Make files obsolete. - * pr-9095.exp, pr-9946.exp, result.exp: Make files obsolete. - * string.exp, tests1.exp, tests2.exp: Make files obsolete. - * tuples.exp, xstruct.exp: Make files obsolete. - -2001-03-06 Kevin Buettner - - * builtins.exp, callch.exp, chexp.exp, chillvars.exp, - enum.exp, gch1041.exp, gch1272.exp, gch1280.exp, gch922.exp, - gch981.exp, misc.exp, powerset.exp, pr-4975.exp, pr-5016.exp, - pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp, - pr-6292.exp, pr-6632.exp, pr-8134.exp, pr-8136.exp, - pr-8405.exp, pr-8742.exp, pr-8894.exp, pr-9095.exp, - pr-9946.exp, result.exp, string.exp, tests1.ch, tests1.exp, - tests2.ch, tests2.exp, tuples.exp, xstruct.exp: Update/correct - copyright notices. - -1999-06-25 Stan Shebs - - From Jimmy Guo : - * xstruct-grt.ch, xstruct.ch, xstruct.exp: Rename to mollify - doschk. - -Thu May 21 02:45:18 1998 Felix Lee - - * chexp.exp: fix tests that assume >16-bit ints. - -Wed Sep 10 15:01:55 1997 Bob Manson - - * *.exp: The end-all be-all of quoting fixes. Ha. - -Thu Aug 21 10:31:23 1997 Bob Manson - - * enum.exp: More quoting fixes. - * pr-9946.exp: Ditto. - * gch1280.exp: Ditto. - * gch1272.exp: Ditto. - -Tue Aug 12 21:48:08 1997 Bob Manson - - * tests2.exp: Fix quoting. - * tests1.exp: Ditto. - * pr-9946.exp: Ditto. - * enum.exp: Ditto. - * builtins.exp: Ditto. - * powerset.exp: Ditto. - * misc.exp: Ditto. - * gch981.exp: Ditto. - * gch922.exp: Ditto. - * gch1280.exp: Ditto. - * gch1272.exp: Ditto. - * gch1041.exp: Ditto. - -Sat Nov 23 14:00:59 1996 Fred Fish - - * misc.exp: Change x86 linux setup_xfails to use new - i*86-pc-linux*-gnu quads. - * tuples.exp: Ditto. - * tests2.exp: Ditto. - * pr-5016.exp: Ditto. - - * tuples.exp: Add i*86-pc-linux-gnu setup_fail to existing - xfails for 'set var vs1 := [ "bar", 42, m_ps[ a ] ]', - 'set var $i := m_s1["foo", 44, m_ps[a ]]', and - 'set var vs2 := [ 10+3, m_s1[ "foo" , 42, m_ps[ b ]]]'. - -Mon Nov 11 10:27:32 1996 Fred Fish - - * callch.exp: Add mips*-sgi-irix* xfail for - "call king(a, otto[[10, 15], [20, 25]])". - * pr-8742.exp: Add mips*-sgi-irix* xfails for - "pass int powerset tuple" - "pass set powerset tuple" - "pass modeless int powerset tuple" and - "pass modeless set powerset tuple". - * tuples.exp: Add sparc-*-solaris* and sparc-*-sunos* - xfails for several "set var" commands that are failing. - Convert most of the set commands into gdb_test_exact - commands. - -Fri Oct 11 16:48:56 1996 Fred Fish - - * expstruct.exp (objfile2): Set and use, like other chill tests. - * pr-4975.exp: Ditto. - * pr-5646.exp: Ditto. - * pr-8134.exp: Ditto. - -Thu Sep 5 01:54:42 1996 Wilfried Moser (Alcatel) - - * gch1280.exp: Enhance test case. - -Wed Sep 4 07:30:44 1996 Wilfried Moser (Alcatel) - - * gch1272.{ch,exp}, gch1280.{ch,exp}, pr-9946.{ch,exp}: - New test cases. - -Sun Aug 18 13:29:48 1996 Fred Fish - - * tests2.exp: Remove mips-sgi-irix* setup_xfail for - "real write 4" and "real write 8". - -Mon Jun 10 14:04:05 1996 Fred Fish - - * tests1.exp (test_modes): Remove *-*-* setup_sfail for - "print unnumbered set range mode" and - "print numbered set range mode". - -Wed Apr 17 01:23:06 1996 Wilfried Moser (Alcatel) - - * tests1.{ch,exp}: Tets case modified and enhanced. - -Tue Apr 9 01:18:04 1996 Wilfried Moser (Alcatel) - - * gch981.{ch,exp}, gch1041.{ch,exp}: New test cases. - -Wed Mar 6 00:29:35 1996 Wilfried Moser (Alcatel) - - * powerset.exp: Add test. - -Tue Mar 5 23:41:39 1996 Wilfried Moser (Alcatel) - - * gch922.{ch,exp}, powerset.{ch,exp}: New test cases. - - * builtins.exp, chillvars.exp, misc.exp, tests1.exp: Updated - due to new format of nonprintable characters (control sequence - instead of C'xx'). - -Tue Mar 5 00:09:17 1996 Per Bothner - - * string.ch, string.exp: Add tests (from Cygnus PR chill/9078). - - * pr-9095.ch, pr-9095.exp: New test case. - -Fri Feb 9 08:22:16 1996 Fred Fish - - * Makefile.in (clean): Add missing '{'. - -Tue Feb 6 21:52:26 1996 Per Bothner - - * pr-8894.exp, pr-8894.ch, pr-8894-grt.ch: New test case. - -Mon Jan 29 00:05:01 1996 Wilfried Moser (Alcatel) - - * builtins.ch, builtins.exp: Enhance test case. - - * extstruct.ch, extstruct-grt.ch, extstruct.exp: New test case. - -Tue Jan 23 16:57:13 1996 Per Bothner - - * enum.ch, enum.exp: New test case (covers PRs 8869 and 8870). - -Thu Jan 11 17:34:01 1996 Per Bothner - - * Makefile.in (PROGS): Removed. - (clean mostlyclean): Remove *.exe rather than ${PROGS}. - - * pr-8742.ch, pr-8742.exp: New test case. - -Tue Jan 9 04:47:27 1996 Wilfried Moser (Alcatel) - - * misc.ch, misc.exp: Enhance test case. - -Sat Dec 30 15:31:59 1995 Fred Fish - - * tests2.exp: Setup_xfail "i*86-*-linux" and - "mips-sgi-irix*" for "real write 4" and "real write 8". - Conditionalize both tests for system specific value - of "infinity" string. - -Fri Dec 29 10:46:09 1995 Fred Fish - - * builtins.exp (test_size): Alpha seems to have long builtins. - * tests1.exp: Setup xfail "*-*-*" for "ptype r2". - * tests2.exp: Add check to skip chill tests. - -Mon Dec 11 16:53:40 1995 Per Bothner - - * tuples.ch, tuples.exp: Exhance test cases (from PR 8643). - -Mon Dec 11 06:57:07 1995 Wilfried Moser (Alcatel) - - * builtins.exp, pr-5016.{ch,exp}, result.{ch,exp}, - tests1.{ch,exp}: Enhance test cases. - -Thu Dec 7 05:16:34 1995 Wilfried Moser (Alcatel) - - * builtins.ch, builtins.exp, Makefile.in: New test case. - -Tue Dec 5 01:51:45 1995 Wilfried Moser (Alcatel) - - * tests2.exp: Add compiling of the test case. - -Fri Dec 1 00:08:37 1995 Per Bothner - - * pr-8405.ch, pr-8405.exp, Makefile.in: New test case. - - * tests1.exp, tests2.exp (test_print_reject): Remove; causes - conflicts with later tests using test_print_reject in ../lib/gdb.exp. - (passcount): Remove. - * tests2.exp (test_print_accept): Removed. - (test_write): Re-write to use gdb_test rather than test_print_accept. - * tests1.exp (test_print_accept_exact): Removed. - (tests_locations): Rewrite to use gdb_test and not above proc. - - * tests1.ch, tests1.exp, tests2.ch, tests2.exp, Makefile.in: - New (extensive) test cases. - * chexp.exp: Fix relations to return TRUE or FALSE. - -Wed Nov 29 19:28:13 1995 Per Bothner - - * Makefile.in: Add .exp.check rule. - * callch.ch: Add missing "%." to format strings. - * callch.exp: Fix argument to gdb_load. - * chexp.exp: Add specific error messages to test_print_reject calls. - * misc.exp: Add a test for PR 8496. - * pr-6632.exp, pr-8136.exp: Link executables from two .o files. - -Sat Nov 25 20:49:27 1995 Fred Fish - - * pr-5016.exp: xfail "whatis i" for alpha-osf-dec-osf2*, same as linux. - -Sun Oct 29 17:58:01 1995 Fred Fish - - * pr-5016.exp: xfail "whatis i" for sparc-sun-sunos4*, same as linux. - -Wed Oct 4 18:20:53 1995 Per Bothner - - * pr-8136.{ch,exp}, pr-8134.exp, func1.ch, Makefile.in: New test cases. - -Wed Sep 27 11:51:50 1995 Per Bothner - - * tuples.ch. tuples.exp: Add new test for setting a variant record - using a tuple, and access the fields. - -Thu Aug 3 10:45:37 1995 Fred Fish - - * Update all FSF addresses except those in COPYING* files. - -Thu Jul 27 20:36:30 1995 Fred Fish (fnf@cygnus.com) - - * pr-5016.exp: xfail "i*86-*-linux*" for "whatis int-range" - test. Thinks it is "_cint" rather than "m_index". - * misc.exp: xfail "i*86-*-linux*" for "info line" test. - Line number is off by one. - -Wed Jun 14 13:07:45 1995 Per Bothner - - * chillvars.exp, string.exp: New tests for LOWER/UPPER/LENGTH. - -Wed Jun 7 17:52:38 1995 Per Bothner - - * chillvars.ch (xptr): Declare new variable. - * chillvars.exp (test_ptr): New function to test EXPR->MODENAME. - -Tue Mar 28 17:13:13 1995 Per Bothner - - * pr-6632.ch, pr-6632-grt.ch, pr-6632.exp, Makefile.in: New test case. - -Tue Mar 21 12:10:06 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * tuples.exp (do_tests): Make names of "print v_ps" test unique. - -Wed Mar 8 13:26:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * *.exp: Skip all tests silently if skip_chill_tests returns true. - - * misc.exp: Remove reference to non-existent variable passcount. - -Tue Mar 7 19:30:05 1995 Per Bothner - - * string.ch, string.exp, Makefile.in: New test case. - -Mon Mar 6 14:11:01 1995 Per Bothner - - * tuples.ch (setnmode); New module. - * tuples.exp: Add some extra tests. - -Sat Mar 4 15:16:17 1995 Per Bothner - - * callch.ch, callch.exp, Makefile.in: New test case. - -Thu Mar 2 06:17:41 1995 Jim Kingdon (kingdon@lioth.cygnus.com) - - * misc.exp: If executable does not exist, issue warning and skip - remaining tests, like other chill tests. - -Wed Mar 1 20:28:42 1995 Per Bothner - - * misc.ch, misc.exp, Makefile.in: New test case. - -Mon Feb 20 16:19:58 1995 Per Bothner - - * chillvars.ch: Add missing INIT's. - * chillvars.exp: Allow builtin types as either case. E.g. (BOOL|bool). - * pr-5016.exp: Likewise. - -Sun Feb 12 11:26:08 1995 Per Bothner - - * pr-6292.ch, pr-6292.exp, Makefile.in: New test case. - -Wed Feb 1 13:09:48 1995 Per Bothner - - * tuples.ch, tuples.exp, Makefile.in: New test case. - -Mon Nov 28 18:39:08 1994 Per Bothner - - * pr-5984.ch, pr-5984.exp, Makefile.in: New test case. - -Fri Sep 16 16:55:03 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * pr-5646.ch, pr-5646-grt.ch, pr-5646.exp, Makefile.in: New testcase. - -Tue Sep 6 13:21:27 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * pr-5016.ch, pr-5016.exp, Makefile.in: New testcase. - * Makefile.in (.exe.check): New rule, to run just one test. - -Tue Jun 14 16:20:18 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * result.ch, result.exp, Makefile.in: New test case. - * pr-4975.ch, pr-4975-grt.ch, pr-4975.exp, Makefile.in: Ditto. - -Thu Jun 9 15:20:43 1994 Per Bothner (bothner@kalessin.cygnus.com) - - * pr-5022.ch, pr-5022.exp: New testcase. - * chillvars.exp: Remove spurious newline. - - * Makefile.in: Bunch of fixes so it actually works in this - directory. (E.g. add extra ../ where needed.) - Also, add .exe to executables, so we can use suffix rules. - * chexp.exp (test_print_reject): Update syntax error message. - * chillvars.ch (module PR_5020): Moved from here ... - * pr-5022.ch: ... to this new file. - * chillvars.exp, pr-5020.exp (binfile): Add .exe extension. - * chillvars.exp, pr-5020.exp: Don't check all_flag. - * pr-5020.exp: Add more tests; fix "print y pretty" output. diff --git a/gdb/testsuite/gdb.chill/Makefile.in b/gdb/testsuite/gdb.chill/Makefile.in deleted file mode 100644 index a965b57..0000000 --- a/gdb/testsuite/gdb.chill/Makefile.in +++ /dev/null @@ -1,26 +0,0 @@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -all: - @echo "Nothing to be done for all..." - -#### host, target, and site specific Makefile frags come in here. - -.SUFFIXES: .ch .o .exe .exp .check - -# Do 'make chillvars.check' to run just the chillvars.{ch,exp} test. - -.exp.check: - rootme=`pwd`/; export rootme; \ - cd .. ; \ - $(MAKE) just-check RUNTESTFLAGS="${RUNTESTFLAGS} $*.exp" \ - EXPECT=${EXPECT} - -clean mostlyclean: - -rm -f *.o ${OBJS} *.exe *~ core - -distclean maintainer-clean realclean: clean - -rm -f Makefile config.status config.log - -Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in - $(SHELL) ./config.status --recheck diff --git a/gdb/testsuite/gdb.chill/builtins.ch b/gdb/testsuite/gdb.chill/builtins.ch deleted file mode 100644 index ef12c83..0000000 --- a/gdb/testsuite/gdb.chill/builtins.ch +++ /dev/null @@ -1,83 +0,0 @@ -xx: MODULE - -DCL v_bool BOOL INIT := FALSE; -DCL v_char CHAR INIT := 'X'; -DCL v_byte BYTE INIT := -30; -DCL v_ubyte UBYTE INIT := 30; -DCL v_int INT INIT := -333; -DCL v_uint UINT INIT := 333; -DCL v_long LONG INIT := -4444; -DCL v_ulong ULONG INIT := 4444; -DCL v_ptr PTR; - -SYNMODE m_set = SET (e1, e2, e3, e4, e5, e6); -DCL v_set m_set INIT := e3; - -SYNMODE m_set_range = m_set(e2:e5); -DCL v_set_range m_set_range INIT := e3; - -SYNMODE m_numbered_set = SET (n1 = 25, n2 = 22, n3 = 35, n4 = 33, - n5 = 45, n6 = 43); -DCL v_numbered_set m_numbered_set INIT := n3; - -SYNMODE m_char_range = CHAR('A':'Z'); -DCL v_char_range m_char_range INIT := 'G'; - -SYNMODE m_bool_range = BOOL(FALSE:FALSE); -DCL v_bool_range m_bool_range; - -SYNMODE m_long_range = LONG(255:3211); -DCL v_long_range m_long_range INIT := 1000; - -SYNMODE m_range = RANGE(12:28); -DCL v_range m_range INIT := 23; - -SYNMODE m_chars = CHARS(20); -SYNMODE m_chars_v = CHARS(20) VARYING; -DCL v_chars CHARS(20); -DCL v_chars_v CHARS(20) VARYING INIT := "foo bar"; - -SYNMODE m_bits = BOOLS(10); -DCL v_bits BOOLS(10); - -SYNMODE m_arr = ARRAY(1:10) BYTE; -DCL v_arr ARRAY(1:10) BYTE; - -SYNMODE m_char_arr = ARRAY (CHAR) BYTE; -DCL v_char_arr ARRAY(CHAR) BYTE; - -SYNMODE m_bool_arr = ARRAY (BOOL) BYTE; -DCL v_bool_arr ARRAY (BOOL) BYTE; - -SYNMODE m_int_arr = ARRAY (INT) BYTE; -DCL v_int_arr ARRAY (INT) BYTE; - -SYNMODE m_set_arr = ARRAY (m_set) BYTE; -DCL v_set_arr ARRAY (m_set) BYTE; - -SYNMODE m_numbered_set_arr = ARRAY (m_numbered_set) BYTE; -DCL v_numbered_set_arr ARRAY (m_numbered_set) BYTE; - -SYNMODE m_char_range_arr = ARRAY (m_char_range) BYTE; -DCL v_char_range_arr ARRAY (m_char_range) BYTE; - -SYNMODE m_set_range_arr = ARRAY (m_set_range) BYTE; -DCL v_set_range_arr ARRAY (m_set_range) BYTE; - -SYNMODE m_bool_range_arr = ARRAY (m_bool_range) BYTE; -DCL v_bool_range_arr ARRAY (m_bool_range) BYTE; - -SYNMODE m_long_range_arr = ARRAY (m_long_range) BYTE; -DCL v_long_range_arr ARRAY (m_long_range) BYTE; - -SYNMODE m_range_arr = ARRAY (m_range) BYTE; -DCL v_range_arr ARRAY (m_range) BYTE; - -SYNMODE m_struct = STRUCT (i LONG, - c CHAR, - s CHARS(30)); -DCL v_struct m_struct; - -v_bool := TRUE; - -END xx; diff --git a/gdb/testsuite/gdb.chill/builtins.exp b/gdb/testsuite/gdb.chill/builtins.exp deleted file mode 100644 index 482a695..0000000 --- a/gdb/testsuite/gdb.chill/builtins.exp +++ /dev/null @@ -1,441 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file tests various Chill values, expressions, and types. -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "builtins" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE send_gdb "break xx_\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE send_gdb "run\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't set breakpoint (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Testing printing of a specific value. Increment passcount for -# OBSOLETE # success or issue fail message for failure. In both cases, return -# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout -# OBSOLETE # is a serious error, generates a special fail message, and causes -# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail -# OBSOLETE # as well. -# OBSOLETE # -# OBSOLETE # Args are: -# OBSOLETE # -# OBSOLETE # First one is string to send_gdb to gdb -# OBSOLETE # Second one is string to match gdb result to -# OBSOLETE # Third one is an optional message to be printed -# OBSOLETE -# OBSOLETE proc test_print_accept { args } { -# OBSOLETE global gdb_prompt -# OBSOLETE global passcount -# OBSOLETE global verbose -# OBSOLETE -# OBSOLETE if [llength $args]==3 then { -# OBSOLETE set message [lindex $args 2] -# OBSOLETE } else { -# OBSOLETE set message [lindex $args 0] -# OBSOLETE } -# OBSOLETE set sendthis [lindex $args 0] -# OBSOLETE set expectthis [lindex $args 1] -# OBSOLETE set result [gdb_test $sendthis ".* = ${expectthis}" $message] -# OBSOLETE if $result==0 {incr passcount} -# OBSOLETE return $result -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_lower {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin LOWER" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete mode names -# OBSOLETE test_print_accept "print lower(bool)" "FALSE" -# OBSOLETE test_print_accept "print lower(char)" {'\^[(]0[)]'} -# OBSOLETE test_print_accept "print lower(byte)" "-128" -# OBSOLETE test_print_accept "print lower(ubyte)" "0" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print lower(int)" "-2147483648" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print lower(int)" "-32768" -# OBSOLETE } -# OBSOLETE test_print_accept "print lower(uint)" "0" -# OBSOLETE setup_xfail "alpha-*-*" -# OBSOLETE test_print_accept "print lower(long)" "-2147483648" -# OBSOLETE test_print_accept "print lower(ulong)" "0" -# OBSOLETE test_print_accept "print lower(m_set)" "e1" -# OBSOLETE test_print_accept "print lower(m_set_range)" "e2" -# OBSOLETE test_print_accept "print lower(m_numbered_set)" "n2" -# OBSOLETE test_print_accept "print lower(m_char_range)" "'A'" -# OBSOLETE test_print_accept "print lower(m_bool_range)" "FALSE" -# OBSOLETE test_print_accept "print lower(m_long_range)" "255" -# OBSOLETE test_print_accept "print lower(m_range)" "12" -# OBSOLETE -# OBSOLETE # discrete locations -# OBSOLETE test_print_accept "print lower(v_bool)" "FALSE" -# OBSOLETE test_print_accept "print lower(v_char)" {'\^[(]0[)]'} -# OBSOLETE test_print_accept "print lower(v_byte)" "-128" -# OBSOLETE test_print_accept "print lower(v_ubyte)" "0" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print lower(v_int)" "-2147483648" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print lower(v_int)" "-32768" -# OBSOLETE } -# OBSOLETE test_print_accept "print lower(v_uint)" "0" -# OBSOLETE setup_xfail "alpha-*-*" -# OBSOLETE test_print_accept "print lower(v_long)" "-2147483648" -# OBSOLETE test_print_accept "print lower(v_ulong)" "0" -# OBSOLETE test_print_accept "print lower(v_set)" "e1" -# OBSOLETE test_print_accept "print lower(v_set_range)" "e2" -# OBSOLETE test_print_accept "print lower(v_numbered_set)" "n2" -# OBSOLETE test_print_accept "print lower(v_char_range)" "'A'" -# OBSOLETE test_print_accept "print lower(v_bool_range)" "FALSE" -# OBSOLETE test_print_accept "print lower(v_long_range)" "255" -# OBSOLETE test_print_accept "print lower(v_range)" "12" -# OBSOLETE -# OBSOLETE # string mode names -# OBSOLETE test_print_accept "print lower(m_chars)" "0" -# OBSOLETE test_print_accept "print lower(m_chars_v)" "0" -# OBSOLETE test_print_accept "print lower(m_bits)" "0" -# OBSOLETE -# OBSOLETE # string locations -# OBSOLETE test_print_accept "print lower(v_chars)" "0" -# OBSOLETE test_print_accept "print lower(v_chars_v)" "0" -# OBSOLETE test_print_accept "print lower(v_bits)" "0" -# OBSOLETE -# OBSOLETE # string expressions -# OBSOLETE test_print_accept "print lower(\"abcd\")" "0" -# OBSOLETE test_print_accept "print lower(B'010101')" "0" -# OBSOLETE -# OBSOLETE # array mode name -# OBSOLETE test_print_accept "print lower(m_arr)" "1"; -# OBSOLETE test_print_accept "print lower(m_char_arr)" {'\^[(]0[)]'} -# OBSOLETE test_print_accept "print lower(m_bool_arr)" "FALSE" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print lower(m_int_arr)" "-2147483648" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print lower(m_int_arr)" "-32768" -# OBSOLETE } -# OBSOLETE test_print_accept "print lower(m_set_arr)" "e1" -# OBSOLETE test_print_accept "print lower(m_set_range_arr)" "e2" -# OBSOLETE test_print_accept "print lower(m_numbered_set_arr)" "n2" -# OBSOLETE test_print_accept "print lower(m_char_range_arr)" "'A'" -# OBSOLETE test_print_accept "print lower(m_bool_range_arr)" "FALSE" -# OBSOLETE test_print_accept "print lower(m_long_range_arr)" "255" -# OBSOLETE test_print_accept "print lower(m_range_arr)" "12" -# OBSOLETE -# OBSOLETE # array locations -# OBSOLETE test_print_accept "print lower(v_arr)" "1"; -# OBSOLETE test_print_accept "print lower(v_char_arr)" {'\^[(]0[)]'} -# OBSOLETE test_print_accept "print lower(v_bool_arr)" "FALSE" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print lower(v_int_arr)" "-2147483648" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print lower(v_int_arr)" "-32768" -# OBSOLETE } -# OBSOLETE test_print_accept "print lower(v_set_arr)" "e1" -# OBSOLETE test_print_accept "print lower(v_set_range_arr)" "e2" -# OBSOLETE test_print_accept "print lower(v_numbered_set_arr)" "n2" -# OBSOLETE test_print_accept "print lower(v_char_range_arr)" "'A'" -# OBSOLETE test_print_accept "print lower(v_bool_range_arr)" "FALSE" -# OBSOLETE test_print_accept "print lower(v_long_range_arr)" "255" -# OBSOLETE test_print_accept "print lower(v_range_arr)" "12" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_upper {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin UPPER" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete mode names -# OBSOLETE test_print_accept "print upper(bool)" "TRUE" -# OBSOLETE test_print_accept "print upper(char)" {'\^[(]255[)]'} -# OBSOLETE test_print_accept "print upper(byte)" "127" -# OBSOLETE test_print_accept "print upper(ubyte)" "255" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print upper(int)" "2147483647" -# OBSOLETE test_print_accept "print upper(uint)" "4294967295" -# OBSOLETE setup_xfail "alpha-*-*" -# OBSOLETE test_print_accept "print upper(long)" "4294967295" -# OBSOLETE test_print_accept "print upper(ulong)" "18446744073709551615" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print upper(int)" "32767" -# OBSOLETE test_print_accept "print upper(uint)" "65535" -# OBSOLETE test_print_accept "print upper(long)" "2147483647" -# OBSOLETE test_print_accept "print upper(ulong)" "4294967295" -# OBSOLETE } -# OBSOLETE test_print_accept "print upper(m_set)" "e6" -# OBSOLETE test_print_accept "print upper(m_set_range)" "e5" -# OBSOLETE test_print_accept "print upper(m_numbered_set)" "n5" -# OBSOLETE test_print_accept "print upper(m_char_range)" "'Z'" -# OBSOLETE test_print_accept "print upper(m_bool_range)" "FALSE" -# OBSOLETE test_print_accept "print upper(m_long_range)" "3211" -# OBSOLETE test_print_accept "print upper(m_range)" "28" -# OBSOLETE -# OBSOLETE # discrete locations -# OBSOLETE test_print_accept "print upper(v_bool)" "TRUE" -# OBSOLETE test_print_accept "print upper(v_char)" {'\^[(]255[)]'} -# OBSOLETE test_print_accept "print upper(v_byte)" "127" -# OBSOLETE test_print_accept "print upper(v_ubyte)" "255" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print upper(v_int)" "2147483647" -# OBSOLETE test_print_accept "print upper(v_uint)" "4294967295" -# OBSOLETE setup_xfail "alpha-*-*" -# OBSOLETE test_print_accept "print upper(v_long)" "4294967295" -# OBSOLETE test_print_accept "print upper(v_ulong)" "18446744073709551615" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print upper(v_int)" "32767" -# OBSOLETE test_print_accept "print upper(v_uint)" "65535" -# OBSOLETE test_print_accept "print upper(v_long)" "2147483647" -# OBSOLETE test_print_accept "print upper(v_ulong)" "4294967295" -# OBSOLETE } -# OBSOLETE test_print_accept "print upper(v_set)" "e6" -# OBSOLETE test_print_accept "print upper(v_set_range)" "e5" -# OBSOLETE test_print_accept "print upper(v_numbered_set)" "n5" -# OBSOLETE test_print_accept "print upper(v_char_range)" "'Z'" -# OBSOLETE test_print_accept "print upper(v_bool_range)" "FALSE" -# OBSOLETE test_print_accept "print upper(v_long_range)" "3211" -# OBSOLETE test_print_accept "print upper(v_range)" "28" -# OBSOLETE -# OBSOLETE # string mode names -# OBSOLETE test_print_accept "print upper(m_chars)" "19" -# OBSOLETE test_print_accept "print upper(m_chars_v)" "19" -# OBSOLETE test_print_accept "print upper(m_bits)" "9" -# OBSOLETE -# OBSOLETE # string locations -# OBSOLETE test_print_accept "print upper(v_chars)" "19" -# OBSOLETE test_print_accept "print upper(v_chars_v)" "19" -# OBSOLETE test_print_accept "print upper(v_bits)" "9" -# OBSOLETE -# OBSOLETE # string expressions -# OBSOLETE test_print_accept "print upper(\"abcd\")" "3" -# OBSOLETE test_print_accept "print upper(B'010101')" "5" -# OBSOLETE -# OBSOLETE # array mode name -# OBSOLETE test_print_accept "print upper(m_arr)" "10"; -# OBSOLETE test_print_accept "print upper(m_char_arr)" {'\^[(]255[)]'} -# OBSOLETE test_print_accept "print upper(m_bool_arr)" "TRUE" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print upper(m_int_arr)" "2147483647" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print upper(m_int_arr)" "32767" -# OBSOLETE } -# OBSOLETE test_print_accept "print upper(m_set_arr)" "e6" -# OBSOLETE test_print_accept "print upper(m_set_range_arr)" "e5" -# OBSOLETE test_print_accept "print upper(m_numbered_set_arr)" "n5" -# OBSOLETE test_print_accept "print upper(m_char_range_arr)" "'Z'" -# OBSOLETE test_print_accept "print upper(m_bool_range_arr)" "FALSE" -# OBSOLETE test_print_accept "print upper(m_long_range_arr)" "3211" -# OBSOLETE test_print_accept "print upper(m_range_arr)" "28" -# OBSOLETE -# OBSOLETE # array locations -# OBSOLETE test_print_accept "print upper(v_arr)" "10"; -# OBSOLETE test_print_accept "print upper(v_char_arr)" {'\^[(]255[)]'} -# OBSOLETE test_print_accept "print upper(v_bool_arr)" "TRUE" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print upper(v_int_arr)" "2147483647" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print upper(v_int_arr)" "32767" -# OBSOLETE } -# OBSOLETE test_print_accept "print upper(v_set_arr)" "e6" -# OBSOLETE test_print_accept "print upper(v_set_range_arr)" "e5" -# OBSOLETE test_print_accept "print upper(v_numbered_set_arr)" "n5" -# OBSOLETE test_print_accept "print upper(v_char_range_arr)" "'Z'" -# OBSOLETE test_print_accept "print upper(v_bool_range_arr)" "FALSE" -# OBSOLETE test_print_accept "print upper(v_long_range_arr)" "3211" -# OBSOLETE test_print_accept "print upper(v_range_arr)" "28" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_length {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin LENGTH" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # string locations -# OBSOLETE test_print_accept "print length(v_chars)" "20" -# OBSOLETE test_print_accept "print length(v_chars_v)" "7"; -# OBSOLETE test_print_accept "print length(v_bits)" "10"; -# OBSOLETE -# OBSOLETE # string expressions -# OBSOLETE test_print_accept "print length(\"the quick brown fox ...\")" "23" -# OBSOLETE test_print_accept "print length(B'010101010101')" "12" -# OBSOLETE test_print_accept "print length(\"foo \" // \"bar\")" "7" -# OBSOLETE -# OBSOLETE # check some failures -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print length(m_chars)" "typename in invalid context" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print length(v_byte)" "bad argument to LENGTH builtin" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print length(b'000000' // b'111111')" "12" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_size {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin SIZE" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # modes -# OBSOLETE test_print_accept "print size(bool)" "1" -# OBSOLETE test_print_accept "print size(char)" "1" -# OBSOLETE test_print_accept "print size(byte)" "1" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print size(int)" "4" -# OBSOLETE test_print_accept "print size(ulong)" "8" -# OBSOLETE test_print_accept "print size(ptr)" "8" -# OBSOLETE test_print_accept "print size(m_chars_v)" "24" -# OBSOLETE test_print_accept "print size(m_struct)" "40" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print size(int)" "2" -# OBSOLETE test_print_accept "print size(ulong)" "4" -# OBSOLETE test_print_accept "print size(ptr)" "4" -# OBSOLETE test_print_accept "print size(m_chars_v)" "22" -# OBSOLETE test_print_accept "print size(m_struct)" "36" -# OBSOLETE } -# OBSOLETE test_print_accept "print size(m_set)" "1" -# OBSOLETE test_print_accept "print size(m_numbered_set)" "1" -# OBSOLETE test_print_accept "print size(m_char_range)" "1" -# OBSOLETE test_print_accept "print size(m_range_arr)" "17" -# OBSOLETE test_print_accept "print size(m_chars)" "20" -# OBSOLETE test_print_accept "print size(m_bits)" "2" -# OBSOLETE -# OBSOLETE # locations -# OBSOLETE test_print_accept "print size(v_bool)" "1" -# OBSOLETE test_print_accept "print size(v_char)" "1" -# OBSOLETE test_print_accept "print size(v_byte)" "1" -# OBSOLETE if [istarget "alpha-*-*"] then { -# OBSOLETE test_print_accept "print size(v_int)" "4" -# OBSOLETE test_print_accept "print size(v_ulong)" "8" -# OBSOLETE test_print_accept "print size(v_ptr)" "8" -# OBSOLETE test_print_accept "print size(v_chars_v)" "24" -# OBSOLETE test_print_accept "print size(v_struct)" "40" -# OBSOLETE } else { -# OBSOLETE test_print_accept "print size(v_int)" "2" -# OBSOLETE test_print_accept "print size(v_ulong)" "4" -# OBSOLETE test_print_accept "print size(v_ptr)" "4" -# OBSOLETE test_print_accept "print size(v_chars_v)" "22" -# OBSOLETE test_print_accept "print size(v_struct)" "36" -# OBSOLETE } -# OBSOLETE test_print_accept "print size(v_set)" "1" -# OBSOLETE test_print_accept "print size(v_numbered_set)" "1" -# OBSOLETE test_print_accept "print size(v_char_range)" "1" -# OBSOLETE test_print_accept "print size(v_range_arr)" "17" -# OBSOLETE test_print_accept "print size(v_chars)" "20" -# OBSOLETE test_print_accept "print size(v_bits)" "2" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_num {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin NUM" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # constants -# OBSOLETE test_print_accept "print num(false)" "0" -# OBSOLETE test_print_accept "print num(true)" "1" -# OBSOLETE test_print_accept "print num(10)" "10" -# OBSOLETE test_print_accept "print num(33-34)" "-1" -# OBSOLETE test_print_accept "print num('X')" "88" -# OBSOLETE test_print_accept "print num(e5)" "4" -# OBSOLETE -# OBSOLETE # locations -# OBSOLETE test_print_accept "print num(v_bool)" "0" -# OBSOLETE test_print_accept "print num(v_char)" "88" -# OBSOLETE test_print_accept "print num(v_byte)" "-30" -# OBSOLETE test_print_accept "print num(v_ubyte)" "30" -# OBSOLETE test_print_accept "print num(v_int)" "-333" -# OBSOLETE test_print_accept "print num(v_uint)" "333" -# OBSOLETE test_print_accept "print num(v_long)" "-4444" -# OBSOLETE test_print_accept "print num(v_ulong)" "4444" -# OBSOLETE test_print_accept "print num(v_set)" "2" -# OBSOLETE test_print_accept "print num(v_set_range)" "2" -# OBSOLETE test_print_accept "print num(v_numbered_set)" "35" -# OBSOLETE test_print_accept "print num(v_char_range)" "71" -# OBSOLETE test_print_accept "print num(v_long_range)" "1000" -# OBSOLETE test_print_accept "print num(v_range)" "23" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200 -# OBSOLETE test_num -# OBSOLETE test_size -# OBSOLETE test_lower -# OBSOLETE test_upper -# OBSOLETE test_length -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/callch.ch b/gdb/testsuite/gdb.chill/callch.ch deleted file mode 100644 index 6001d92..0000000 --- a/gdb/testsuite/gdb.chill/callch.ch +++ /dev/null @@ -1,50 +0,0 @@ -hack : module - -dcl i int; -newmode otto = array (bool, bool) byte; -newmode str1 = struct (f1 int, f2 bool); -newmode str2 = struct (f1 otto); - -dcl a otto := [[1,1],[1,1]]; -dcl b str1 := [10, false]; -dcl c str2; - -fred : proc (a int in, b int loc); - writetext(stdout, "a is '%C'; b is '%C'.%/", a, b); -end fred; - -klaus : proc (); - writetext(stdout, "here's klaus calling.%/"); -end klaus; - -king : proc (p otto loc, x otto in); - dcl i, j bool; - p := [[h'ff,h'ff],[h'ff,h'ff]]; - do for i:= lower(bool) to upper(bool); - do for j:= lower(bool) to upper(bool); - writetext(stdout, "x(%C, %C) = %C%..%/", i, j, x(i, j)); - writetext(stdout, "p(%C, %C) = %C%..%/", i, j, p(i, j)); - od; - od; -end king; - -ralph : proc (x str1 in); - writetext(stdout, "x.f1 = %C, x.f2 = %C%..%/", x.f1, x.f2); -end ralph; - -whitney : proc (x str2 in); - dcl i, j bool; - - do for i:= lower(bool) to upper(bool); - do for j:= lower(bool) to upper(bool); - writetext(stdout, "x.f1(%C, %C) = %C%..%/", i, j, x.f1(i, j)); - od; - od; - -end whitney; - -c := [a]; -i:=12; -writetext(stdout, "done.%/"); - -end hack; diff --git a/gdb/testsuite/gdb.chill/callch.exp b/gdb/testsuite/gdb.chill/callch.exp deleted file mode 100644 index f81d42f..0000000 --- a/gdb/testsuite/gdb.chill/callch.exp +++ /dev/null @@ -1,69 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file tests that gdb can call functions in a Chill inferior. -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "callch" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" ; -# OBSOLETE -# OBSOLETE gdb_test "break callch.ch:48" "" -# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $" -# OBSOLETE gdb_test {set fred(10, i)} {a is '10'; b is '12'.} -# OBSOLETE gdb_test_exact "call klaus()" {here's klaus calling.} -# OBSOLETE gdb_test_exact "call fred()" {too few arguments in function call} -# OBSOLETE # Too many arguments are allowed -# OBSOLETE gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.} -# OBSOLETE gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\ -# OBSOLETE "print a before king" -# OBSOLETE # Current gdb prints 255 for the results that are expected to be -1. -# OBSOLETE setup_xfail "mips*-sgi-irix*" -# OBSOLETE gdb_test {call king(a, otto[[10, 15], [20, 25]])} "x\\(FALSE, FALSE\\) = 10.*p\\(FALSE, FALSE\\) = -1.*x\\(FALSE, TRUE\\) = 15.*p\\(FALSE, TRUE\\) = -1.*x\\(TRUE, FALSE\\) = 20.*p\\(TRUE, FALSE\\) = -1.*x\\(TRUE, TRUE\\) = 25.*p\\(TRUE, TRUE\\) = -1.*" -# OBSOLETE gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\ -# OBSOLETE "print a after king" -# OBSOLETE gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.} -# OBSOLETE gdb_test "call whitney(c)" "x.f1\\(FALSE, FALSE\\) = 1.*x.f1\\(FALSE, TRUE\\) = 1.*x.f1\\(TRUE, FALSE\\) = 1.*x.f1\\(TRUE, TRUE\\) = 1.*" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/chexp.exp b/gdb/testsuite/gdb.chill/chexp.exp deleted file mode 100644 index aca5632..0000000 --- a/gdb/testsuite/gdb.chill/chexp.exp +++ /dev/null @@ -1,450 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995, 1998 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_integer_literals_accepted {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # Test various decimal values. -# OBSOLETE -# OBSOLETE gdb_test "p 123" " = 123" -# OBSOLETE gdb_test "p -123" " = -123" -# OBSOLETE gdb_test "p D'123" " = 123" -# OBSOLETE gdb_test "p d'123" " = 123" -# OBSOLETE gdb_test "p -D'123" " = -123" -# OBSOLETE gdb_test "p -d'123" " = -123" -# OBSOLETE gdb_test "p 12_345" " = 12345" -# OBSOLETE gdb_test "p __1_2_3__" " = 123" -# OBSOLETE gdb_test "p/d 123" " = D'123" -# OBSOLETE -# OBSOLETE # Test various binary values. -# OBSOLETE -# OBSOLETE gdb_test "p B'111" " = 7" -# OBSOLETE gdb_test "p b'111" " = 7" -# OBSOLETE gdb_test "p -B'111" " = -7" -# OBSOLETE gdb_test "p B'0111" " = 7" -# OBSOLETE gdb_test "p b'0111" " = 7" -# OBSOLETE gdb_test "p -b'0111" " = -7" -# OBSOLETE gdb_test "p B'_0_1_1_1_" " = 7" -# OBSOLETE gdb_test "p b'_0_1_1_1_" " = 7" -# OBSOLETE gdb_test "p -b'_0_1_1_1_" " = -7" -# OBSOLETE gdb_test "p/t B'111" " = B'111" -# OBSOLETE -# OBSOLETE # Test various octal values. -# OBSOLETE -# OBSOLETE gdb_test "p O'123" " = 83" -# OBSOLETE gdb_test "p o'123" " = 83" -# OBSOLETE gdb_test "p -o'0123" " = -83" -# OBSOLETE gdb_test "p O'0123" " = 83" -# OBSOLETE gdb_test "p o'0123" " = 83" -# OBSOLETE gdb_test "p -o'123" " = -83" -# OBSOLETE gdb_test "p O'_1_2_3_" " = 83" -# OBSOLETE gdb_test "p o'_1_2_3_" " = 83" -# OBSOLETE gdb_test "p -o'_1_2_3_" " = -83" -# OBSOLETE gdb_test "p/o O'123" " = O'123" -# OBSOLETE -# OBSOLETE # Test various hexadecimal values. -# OBSOLETE -# OBSOLETE gdb_test "p H'123" " = 291" -# OBSOLETE gdb_test "p h'123" " = 291" -# OBSOLETE gdb_test "p -h'123" " = -291" -# OBSOLETE gdb_test "p H'0123" " = 291" -# OBSOLETE gdb_test "p h'0123" " = 291" -# OBSOLETE gdb_test "p -h'0123" " = -291" -# OBSOLETE gdb_test "p H'_1_2_3_" " = 291" -# OBSOLETE gdb_test "p h'_1_2_3_" " = 291" -# OBSOLETE gdb_test "p -h'_1_2_3_" " = -291" -# OBSOLETE gdb_test "p H'ABC" " = 2748" -# OBSOLETE gdb_test "p H'abc" " = 2748" -# OBSOLETE gdb_test "p H'AbC" " = 2748" -# OBSOLETE gdb_test "p H'_A_b_C_" " = 2748" -# OBSOLETE gdb_test "p H'_D_e_F_" " = 3567" -# OBSOLETE gdb_test "p H'_d_E_f_" " = 3567" -# OBSOLETE gdb_test "p/x H'123" " = H'123" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_character_literals_accepted {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # Test various decimal values. -# OBSOLETE -# OBSOLETE gdb_test "p 'a'" " = 'a'" -# OBSOLETE gdb_test "p/x 'a'" " = H'61" -# OBSOLETE gdb_test "p/d 'a'" " = D'97" -# OBSOLETE gdb_test "p/t 'a'" " = B'1100001" -# OBSOLETE # gdb_test "p '^(97)'" " = 'a'" (not in GNU Chill) -# OBSOLETE gdb_test "p C'61'" " = 'a'" -# OBSOLETE gdb_test "p c'61'" " = 'a'" -# OBSOLETE gdb_test "p/x C'FF'" " = H'ff" -# OBSOLETE # gdb_test "p/x '^(H'FF)'" " = H'ff" (not in GNU Chill) -# OBSOLETE # gdb_test "p/x '^(D'255)'" " = H'ff" (not in GNU Chill) -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_integer_literals_rejected {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # These are valid integer literals in Z.200, but not GNU-Chill. -# OBSOLETE -# OBSOLETE test_print_reject "p _" -# OBSOLETE test_print_reject "p __" -# OBSOLETE -# OBSOLETE test_print_reject "p D'" -# OBSOLETE test_print_reject "p D'_" -# OBSOLETE test_print_reject "p D'__" -# OBSOLETE -# OBSOLETE test_print_reject "p B'" -# OBSOLETE test_print_reject "p B'_" -# OBSOLETE test_print_reject "p B'__" -# OBSOLETE -# OBSOLETE test_print_reject "p O'" -# OBSOLETE test_print_reject "p O'_" -# OBSOLETE test_print_reject "p O'__" -# OBSOLETE -# OBSOLETE test_print_reject "p H'" -# OBSOLETE test_print_reject "p H'_" -# OBSOLETE test_print_reject "p H'__" -# OBSOLETE -# OBSOLETE # Test various decimal values. -# OBSOLETE -# OBSOLETE test_print_reject "p D'DEADBEEF" -# OBSOLETE test_print_reject "p D'123DEADBEEF" -# OBSOLETE -# OBSOLETE # Test various binary values. -# OBSOLETE -# OBSOLETE test_print_reject "p B'2" "Too-large digit in bitstring or integer." -# OBSOLETE test_print_reject "p B'12" "Too-large digit in bitstring or integer." -# OBSOLETE -# OBSOLETE # Test various octal values. -# OBSOLETE -# OBSOLETE test_print_reject "p O'9" "Too-large digit in bitstring or integer." -# OBSOLETE test_print_reject "p O'79" "Too-large digit in bitstring or integer." -# OBSOLETE -# OBSOLETE # Test various hexadecimal values. -# OBSOLETE -# OBSOLETE test_print_reject "p H'G" "Invalid character in bitstring or integer." -# OBSOLETE test_print_reject "p H'AG" "Invalid character in bitstring or integer." -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_boolean_literals_accepted {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # Test the only possible values for a boolean, TRUE and FALSE. -# OBSOLETE -# OBSOLETE gdb_test "p TRUE" " = TRUE" -# OBSOLETE gdb_test "p FALSE" " = FALSE" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_float_literals_accepted {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # Test various floating point formats -# OBSOLETE -# OBSOLETE gdb_test "p .44 < .45" " = TRUE" -# OBSOLETE gdb_test "p .44 > .45" " = FALSE" -# OBSOLETE gdb_test "p 0.44 < 0.45" " = TRUE" -# OBSOLETE gdb_test "p 0.44 > 0.45" " = FALSE" -# OBSOLETE gdb_test "p 44. < 45." " = TRUE" -# OBSOLETE gdb_test "p 44. > 45." " = FALSE" -# OBSOLETE gdb_test "p 44.0 < 45.0" " = TRUE" -# OBSOLETE gdb_test "p 44.0 > 45.0" " = FALSE" -# OBSOLETE gdb_test "p 10D20 < 10D21" " = TRUE" -# OBSOLETE gdb_test "p 10D20 > 10D21" " = FALSE" -# OBSOLETE gdb_test "p 10d20 < 10d21" " = TRUE" -# OBSOLETE gdb_test "p 10d20 > 10d21" " = FALSE" -# OBSOLETE gdb_test "p 10E20 < 10E21" " = TRUE" -# OBSOLETE gdb_test "p 10E20 > 10E21" " = FALSE" -# OBSOLETE gdb_test "p 10e20 < 10e21" " = TRUE" -# OBSOLETE gdb_test "p 10e20 > 10e21" " = FALSE" -# OBSOLETE gdb_test "p 10.D20 < 10.D21" " = TRUE" -# OBSOLETE gdb_test "p 10.D20 > 10.D21" " = FALSE" -# OBSOLETE gdb_test "p 10.d20 < 10.d21" " = TRUE" -# OBSOLETE gdb_test "p 10.d20 > 10.d21" " = FALSE" -# OBSOLETE gdb_test "p 10.E20 < 10.E21" " = TRUE" -# OBSOLETE gdb_test "p 10.E20 > 10.E21" " = FALSE" -# OBSOLETE gdb_test "p 10.e20 < 10.e21" " = TRUE" -# OBSOLETE gdb_test "p 10.e20 > 10.e21" " = FALSE" -# OBSOLETE gdb_test "p 10.0D20 < 10.0D21" " = TRUE" -# OBSOLETE gdb_test "p 10.0D20 > 10.0D21" " = FALSE" -# OBSOLETE gdb_test "p 10.0d20 < 10.0d21" " = TRUE" -# OBSOLETE gdb_test "p 10.0d20 > 10.0d21" " = FALSE" -# OBSOLETE gdb_test "p 10.0E20 < 10.0E21" " = TRUE" -# OBSOLETE gdb_test "p 10.0E20 > 10.0E21" " = FALSE" -# OBSOLETE gdb_test "p 10.0e20 < 10.0e21" " = TRUE" -# OBSOLETE gdb_test "p 10.0e20 > 10.0e21" " = FALSE" -# OBSOLETE gdb_test "p 10.0D+20 < 10.0D+21" " = TRUE" -# OBSOLETE gdb_test "p 10.0D+20 > 10.0D+21" " = FALSE" -# OBSOLETE gdb_test "p 10.0d+20 < 10.0d+21" " = TRUE" -# OBSOLETE gdb_test "p 10.0d+20 > 10.0d+21" " = FALSE" -# OBSOLETE gdb_test "p 10.0E+20 < 10.0E+21" " = TRUE" -# OBSOLETE gdb_test "p 10.0E+20 > 10.0E+21" " = FALSE" -# OBSOLETE gdb_test "p 10.0e+20 < 10.0e+21" " = TRUE" -# OBSOLETE gdb_test "p 10.0e+20 > 10.0e+21" " = FALSE" -# OBSOLETE gdb_test "p 10.0D-11 < 10.0D-10" " = TRUE" -# OBSOLETE gdb_test "p 10.0D-11 > 10.0D-10" " = FALSE" -# OBSOLETE gdb_test "p 10.0d-11 < 10.0d-10" " = TRUE" -# OBSOLETE gdb_test "p 10.0d-11 > 10.0d-10" " = FALSE" -# OBSOLETE gdb_test "p 10.0E-11 < 10.0E-10" " = TRUE" -# OBSOLETE gdb_test "p 10.0E-11 > 10.0E-10" " = FALSE" -# OBSOLETE gdb_test "p 10.0e-11 < 10.0e-10" " = TRUE" -# OBSOLETE gdb_test "p 10.0e-11 > 10.0e-10" " = FALSE" -# OBSOLETE # looks funny, but apparently legal -# OBSOLETE gdb_test "p _.1e+10 < _.1e+11" " = TRUE" -# OBSOLETE gdb_test "p _.1e+10 > _.1e+11" " = FALSE" -# OBSOLETE gdb_test "p __.1e-12 < __.1e-11" " = TRUE" -# OBSOLETE gdb_test "p __.1e-12 > __.1e-11" " = FALSE" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_convenience_variables {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE gdb_test "set \$foo := 101" " := 101\[\r\]*" \ -\# OBSOLETE "Set a new convenience variable" -# OBSOLETE -# OBSOLETE gdb_test "print \$foo" " = 101" \ -\# OBSOLETE "Print contents of new convenience variable" -# OBSOLETE -# OBSOLETE gdb_test "set \$foo := 301" " := 301\[\r\]*" \ -\# OBSOLETE "Set convenience variable to a new value" -# OBSOLETE -# OBSOLETE gdb_test "print \$foo" " = 301" \ -\# OBSOLETE "Print new contents of convenience variable" -# OBSOLETE -# OBSOLETE gdb_test "set \$_ := 11" " := 11\[\r\]*" \ -\# OBSOLETE "Set convenience variable \$_" -# OBSOLETE -# OBSOLETE gdb_test "print \$_" " = 11" \ -\# OBSOLETE "Print contents of convenience variable \$_" -# OBSOLETE -# OBSOLETE gdb_test "print \$foo + 10" " = 311" \ -\# OBSOLETE "Use convenience variable in arithmetic expression" -# OBSOLETE -# OBSOLETE gdb_test "print (\$foo := 32) + 4" " = 36" \ -\# OBSOLETE "Use convenience variable assignment in arithmetic expression" -# OBSOLETE -# OBSOLETE gdb_test "print \$bar" " = void" \ -\# OBSOLETE "Print contents of uninitialized convenience variable" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_value_history {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE gdb_test "print 101" "\\\$1 = 101" \ -\# OBSOLETE "Set value-history\[1\] using \$1" -# OBSOLETE -# OBSOLETE gdb_test "print 102" "\\\$2 = 102" \ -\# OBSOLETE "Set value-history\[2\] using \$2" -# OBSOLETE -# OBSOLETE gdb_test "print 103" "\\\$3 = 103" \ -\# OBSOLETE "Set value-history\[3\] using \$3" -# OBSOLETE -# OBSOLETE gdb_test "print \$\$" "\\\$4 = 102" \ -\# OBSOLETE "Print value-history\[MAX-1\] using inplicit index \$\$" -# OBSOLETE -# OBSOLETE gdb_test "print \$\$" "\\\$5 = 103" \ -\# OBSOLETE "Print value-history\[MAX-1\] again using implicit index \$\$" -# OBSOLETE -# OBSOLETE gdb_test "print \$" "\\\$6 = 103" \ -\# OBSOLETE "Print value-history\[MAX\] using implicit index \$" -# OBSOLETE -# OBSOLETE gdb_test "print \$\$2" "\\\$7 = 102" \ -\# OBSOLETE "Print value-history\[MAX-2\] using explicit index \$\$2" -# OBSOLETE -# OBSOLETE gdb_test "print \$0" "\\\$8 = 102" \ -\# OBSOLETE "Print value-history\[MAX\] using explicit index \$0" -# OBSOLETE -# OBSOLETE gdb_test "print 108" "\\\$9 = 108" "" -# OBSOLETE -# OBSOLETE gdb_test "print \$\$0" "\\\$10 = 108" \ -\# OBSOLETE "Print value-history\[MAX\] using explicit index \$\$0" -# OBSOLETE -# OBSOLETE gdb_test "print \$1" "\\\$11 = 101" \ -\# OBSOLETE "Print value-history\[1\] using explicit index \$1" -# OBSOLETE -# OBSOLETE gdb_test "print \$2" "\\\$12 = 102" \ -\# OBSOLETE "Print value-history\[2\] using explicit index \$2" -# OBSOLETE -# OBSOLETE gdb_test "print \$3" "\\\$13 = 103" \ -\# OBSOLETE "Print value-history\[3\] using explicit index \$3" -# OBSOLETE -# OBSOLETE gdb_test "print \$-3" "\\\$14 = 100" \ -\# OBSOLETE "Print (value-history\[MAX\] - 3) using implicit index \$" -# OBSOLETE -# OBSOLETE gdb_test "print \$1 + 3" "\\\$15 = 104" \ -\# OBSOLETE "Use value-history element in arithmetic expression" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_arithmetic_expressions {} { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE # Test unary minus with various operands -# OBSOLETE -# OBSOLETE # gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool" -# OBSOLETE # gdb_test "p -('a')" " = xxx" "unary minus applied to char" -# OBSOLETE gdb_test "p -(1)" " = -1" "unary minus applied to int" -# OBSOLETE gdb_test "p -(1.0)" " = -1" "unary minus applied to real" -# OBSOLETE -# OBSOLETE # Test addition with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE + 1" " = 2" "bool plus int" -# OBSOLETE gdb_test "p 'a' + 1" " = 98" "char plus int" -# OBSOLETE gdb_test "p 1 + 1" " = 2" "int plus int" -# OBSOLETE gdb_test "p 1.0 + 1" " = 2" "real plus int" -# OBSOLETE gdb_test "p 1.0 + 2.0" " = 3" "real plus real" -# OBSOLETE -# OBSOLETE # Test subtraction with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE - 1" " = 0" "bool minus int" -# OBSOLETE gdb_test "p 'b' - 1" " = 97" "char minus int" -# OBSOLETE gdb_test "p 3 - 1" " = 2" "int minus int" -# OBSOLETE gdb_test "p 3.0 - 1" " = 2" "real minus int" -# OBSOLETE gdb_test "p 5.0 - 2.0" " = 3" "real minus real" -# OBSOLETE -# OBSOLETE # Test multiplication with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE * 1" " = 1" "bool times int" -# OBSOLETE gdb_test "p 'a' * 2" " = 194" "char times int" -# OBSOLETE gdb_test "p 2 * 3" " = 6" "int times int" -# OBSOLETE gdb_test "p 2.0 * 3" " = 6" "real times int" -# OBSOLETE gdb_test "p 2.0 * 3.0" " = 6" "real times real" -# OBSOLETE -# OBSOLETE # Test division with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE / 1" " = 1" "bool divided by int" -# OBSOLETE gdb_test "p 'a' / 2" " = 48" "char divided by int" -# OBSOLETE gdb_test "p 6 / 3" " = 2" "int divided by int" -# OBSOLETE gdb_test "p 6.0 / 3" " = 2" "real divided by int" -# OBSOLETE gdb_test "p 6.0 / 3.0" " = 2" "real divided by real" -# OBSOLETE -# OBSOLETE # Test modulo with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE MOD 1" " = 0" "bool modulo int" -# OBSOLETE gdb_test "p 'a' MOD 2" " = 1" "char modulo int" -# OBSOLETE gdb_test "p -5 MOD 3" " = 1" "negative int modulo int" -# OBSOLETE gdb_test "p 5 MOD 1" " = 0" "int modulo int" -# OBSOLETE gdb_test "p 5 MOD 2" " = 1" "int modulo int" -# OBSOLETE gdb_test "p 5 MOD 3" " = 2" "int modulo int" -# OBSOLETE gdb_test "p 5 MOD 4" " = 1" "int modulo int" -# OBSOLETE gdb_test "p 5 MOD 5" " = 0" "int modulo int" -# OBSOLETE gdb_test "p 0 MOD 1" " = 0" "int modulo int" -# OBSOLETE gdb_test "p 0 MOD 2" " = 0" "int modulo int" -# OBSOLETE gdb_test "p 0 MOD 3" " = 0" "int modulo int" -# OBSOLETE gdb_test "p 0 MOD 4" " = 0" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 1" " = 0" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 2" " = 1" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 3" " = 1" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 4" " = 3" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 5" " = 0" "int modulo int" -# OBSOLETE gdb_test "p -5 MOD 5" " = 0" "int modulo int" -# OBSOLETE test_print_reject "p 6.0 MOD 3" \ -\# OBSOLETE "Integer-only operation on floating point number.*" -# OBSOLETE test_print_reject "p 6.0 MOD 3.0" \ -\# OBSOLETE "Integer-only operation on floating point number.*" -# OBSOLETE test_print_reject "p -5 MOD -1" \ -\# OBSOLETE "Second operand of MOD must be greater than zero.*" -# OBSOLETE test_print_reject "p -5 MOD 0" \ -\# OBSOLETE "Second operand of MOD must be greater than zero.*" -# OBSOLETE -# OBSOLETE # Test remainder with various operands -# OBSOLETE -# OBSOLETE gdb_test "p TRUE REM 1" " = 0" "bool remainder int" -# OBSOLETE gdb_test "p 'a' REM 2" " = 1" "char remainder int" -# OBSOLETE gdb_test "p 5 REM 5" " = 0" "int remainder int" -# OBSOLETE gdb_test "p 5 REM 4" " = 1" "int remainder int" -# OBSOLETE gdb_test "p 5 REM 3" " = 2" "int remainder int" -# OBSOLETE gdb_test "p 5 REM 2" " = 1" "int remainder int" -# OBSOLETE gdb_test "p 5 REM 1" " = 0" "int remainder int" -# OBSOLETE gdb_test "p 5 REM -1" " = 0" "int remainder int" -# OBSOLETE gdb_test "p 5 REM -2" " = 1" "int remainder int" -# OBSOLETE gdb_test "p 5 REM -3" " = 2" "int remainder int" -# OBSOLETE gdb_test "p 5 REM -4" " = 1" "int remainder int" -# OBSOLETE gdb_test "p 5 REM -5" " = 0" "int remainder int" -# OBSOLETE gdb_test "p -5 REM 5" " = 0" "int remainder int" -# OBSOLETE gdb_test "p -5 REM 4" " = -1" "int remainder int" -# OBSOLETE gdb_test "p -5 REM 3" " = -2" "int remainder int" -# OBSOLETE gdb_test "p -5 REM 2" " = -1" "int remainder int" -# OBSOLETE gdb_test "p -5 REM 1" " = 0" "int remainder int" -# OBSOLETE gdb_test "p -5 REM -1" " = 0" "int remainder int" -# OBSOLETE gdb_test "p -5 REM -2" " = -1" "int remainder int" -# OBSOLETE gdb_test "p -5 REM -3" " = -2" "int remainder int" -# OBSOLETE gdb_test "p -5 REM -4" " = -1" "int remainder int" -# OBSOLETE gdb_test "p -5 REM -5" " = 0" "int remainder int" -# OBSOLETE gdb_test "p 6 REM 3" " = 0" "int remainder int" -# OBSOLETE test_print_reject "p 6.0 REM 3" \ -\# OBSOLETE "Integer-only operation on floating point number.*" -# OBSOLETE test_print_reject "p 6.0 REM 3.0" \ -\# OBSOLETE "Integer-only operation on floating point number.*" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" "" -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE test_value_history -# OBSOLETE test_convenience_variables -# OBSOLETE test_integer_literals_accepted -# OBSOLETE test_integer_literals_rejected -# OBSOLETE test_boolean_literals_accepted -# OBSOLETE test_character_literals_accepted -# OBSOLETE test_float_literals_accepted -# OBSOLETE test_arithmetic_expressions -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." 0 -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/chillvars.ch b/gdb/testsuite/gdb.chill/chillvars.ch deleted file mode 100644 index 21dfcba..0000000 --- a/gdb/testsuite/gdb.chill/chillvars.ch +++ /dev/null @@ -1,204 +0,0 @@ -testvars: MODULE - -DCL bool_true BOOL INIT := TRUE; -DCL bool_false BOOL INIT := FALSE; -DCL booltable1 ARRAY (0:3) BOOL INIT := [ TRUE, FALSE, FALSE, TRUE ]; -DCL booltable2 ARRAY (4:7) BOOL INIT := [ TRUE, FALSE, FALSE, TRUE ]; - -DCL control_char CHAR INIT := C'07'; -DCL printable_char CHAR INIT := 'a'; -DCL chartable1 ARRAY (0:2) CHAR INIT := [ C'00', C'01', C'02' ]; -DCL chartable2 ARRAY (3:5) CHAR INIT := [ C'00', C'01', C'02' ]; - -DCL string1 CHARS (4) INIT := 'abcd'; -DCL string2 CHARS (5) INIT := 'ef' // C'00' // 'gh'; -DCL string3 CHARS (6) INIT := 'ef' // 'gh' // 'ij'; -DCL string4 CHARS (7) INIT := (6) 'z' // C'00'; - -DCL byte_low BYTE INIT := -128; -DCL byte_high BYTE INIT := 127; -DCL bytetable1 ARRAY (0:4) BYTE INIT := [ -2, -1, 0, 1, 2 ]; -DCL bytetable2 ARRAY (5:9) BYTE INIT := [ -2, -1, 0, 1, 2 ]; -DCL bytetable3 ARRAY (1:2,'c':'d',FALSE:TRUE) BYTE - INIT := [ [ [ 0, 1 ], [ 2, 3 ] ], [ [ 4, 5 ], [ 6, 7 ] ] ]; -DCL bytetable4 ARRAY (1:2) ARRAY ('c':'d') ARRAY (FALSE:TRUE) BYTE - INIT := [ [ [ 0, 1 ], [ 2, 3 ] ], [ [ 4, 5 ], [ 6, 7 ] ] ]; - -DCL ubyte_low UBYTE INIT := 0; -DCL ubyte_high UBYTE INIT := 255; -DCL ubytetable1 ARRAY (0:4) UBYTE INIT := [ 0, 1, 2, 3, 4 ]; -DCL ubytetable2 ARRAY (5:9) UBYTE INIT := [ 0, 1, 2, 3, 4 ]; - -DCL int_low INT INIT := -32_768; -DCL int_high INT INIT := 32_767; -DCL inttable1 ARRAY (0:4) INT INIT := [ -2, -1, 0, 1, 2 ]; -DCL inttable2 ARRAY (5:9) INT INIT := [ -2, -1, 0, 1, 2 ]; - -DCL uint_low UINT INIT := 0; -DCL uint_high UINT INIT := 65_535; -DCL uinttable1 ARRAY (0:4) UINT INIT := [ 0, 1, 2, 3, 4 ]; -DCL uinttable2 ARRAY (5:9) UINT INIT := [ 0, 1, 2, 3, 4 ]; - -DCL long_low LONG INIT := -2_147_483_648; -DCL long_high LONG INIT := 2_147_483_647; -DCL longtable1 ARRAY (0:4) LONG INIT := [ -2, -1, 0, 1, 2 ]; -DCL longtable2 ARRAY (5:9) LONG INIT := [ -2, -1, 0, 1, 2 ]; - -DCL ulong_low ULONG INIT := 0; -DCL ulong_high ULONG INIT := 4_294_967_295; -DCL ulongtable1 ARRAY (0:4) ULONG INIT := [ 0, 1, 2, 3, 4 ]; -DCL ulongtable2 ARRAY (5:9) ULONG INIT := [ 0, 1, 2, 3, 4 ]; - -DCL real1 FLOAT INIT := 3.14159265358; -DCL real2 FLOAT INIT := -3.14159265358; -DCL realtable1 ARRAY (0:4) FLOAT INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ]; -DCL realtable2 ARRAY (5:9) FLOAT INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ]; - -DCL long_real1 DOUBLE INIT := 3.14e300; -DCL long_real2 DOUBLE INIT := -3.14e-300; -DCL longrealtable1 ARRAY (0:4) DOUBLE INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ]; -DCL longrealtable2 ARRAY (5:9) DOUBLE INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ]; - -/* DCL powerset1 POWERSET INT(0:7);*/ -/* DCL chars1 CHAR (16) INIT := (16)'b'; */ -/* DCL bits1 BIT(20) := B'11111111000010101011'; */ - -NEWMODE simple_struct = STRUCT (abool BOOL, aint INT, astring CHARS (8)); -DCL struct1 simple_struct := [ TRUE, 123, "a string" ]; - -NEWMODE nested_struct = STRUCT (abool BOOL, nstruct simple_struct, aint INT); -DCL struct2 nested_struct := [ TRUE, [ FALSE, 456, "deadbeef" ], 789 ]; - -/* This table is used as a source for every ascii character. */ - -DCL asciitable ARRAY (0:255) CHAR INIT := [ - C'00', C'01', C'02', C'03', C'04', C'05', C'06', C'07', - C'08', C'09', C'0a', C'0b', C'0c', C'0d', C'0e', C'0f', - C'10', C'11', C'12', C'13', C'14', C'15', C'16', C'17', - C'18', C'19', C'1a', C'1b', C'1c', C'1d', C'1e', C'1f', - C'20', C'21', C'22', C'23', C'24', C'25', C'26', C'27', - C'28', C'29', C'2a', C'2b', C'2c', C'2d', C'2e', C'2f', - C'30', C'31', C'32', C'33', C'34', C'35', C'36', C'37', - C'38', C'39', C'3a', C'3b', C'3c', C'3d', C'3e', C'3f', - C'40', C'41', C'42', C'43', C'44', C'45', C'46', C'47', - C'48', C'49', C'4a', C'4b', C'4c', C'4d', C'4e', C'4f', - C'50', C'51', C'52', C'53', C'54', C'55', C'56', C'57', - C'58', C'59', C'5a', C'5b', C'5c', C'5d', C'5e', C'5f', - C'60', C'61', C'62', C'63', C'64', C'65', C'66', C'67', - C'68', C'69', C'6a', C'6b', C'6c', C'6d', C'6e', C'6f', - C'70', C'71', C'72', C'73', C'74', C'75', C'76', C'77', - C'78', C'79', C'7a', C'7b', C'7c', C'7d', C'7e', C'7f', - C'80', C'81', C'82', C'83', C'84', C'85', C'86', C'87', - C'88', C'89', C'8a', C'8b', C'8c', C'8d', C'8e', C'8f', - C'90', C'91', C'92', C'93', C'94', C'95', C'96', C'97', - C'98', C'99', C'9a', C'9b', C'9c', C'9d', C'9e', C'9f', - C'a0', C'a1', C'a2', C'a3', C'a4', C'a5', C'a6', C'a7', - C'a8', C'a9', C'aa', C'ab', C'ac', C'ad', C'ae', C'af', - C'b0', C'b1', C'b2', C'b3', C'b4', C'b5', C'b6', C'b7', - C'b8', C'b9', C'ba', C'bb', C'bc', C'bd', C'be', C'bf', - C'c0', C'c1', C'c2', C'c3', C'c4', C'c5', C'c6', C'c7', - C'c8', C'c9', C'ca', C'cb', C'cc', C'cd', C'ce', C'cf', - C'd0', C'd1', C'd2', C'd3', C'd4', C'd5', C'd6', C'd7', - C'd8', C'd9', C'da', C'db', C'dc', C'dd', C'de', C'df', - C'e0', C'e1', C'e2', C'e3', C'e4', C'e5', C'e6', C'e7', - C'e8', C'e9', C'ea', C'eb', C'ec', C'ed', C'ee', C'ef', - C'f0', C'f1', C'f2', C'f3', C'f4', C'f5', C'f6', C'f7', - C'f8', C'f9', C'fa', C'fb', C'fc', C'fd', C'fe', C'ff' -]; - -DCL charmatrix ARRAY (0:255) CHAR INIT := [ - 'a','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X', - 'a','a','X','X','X','X','X','X','X','X','X','X','X','X','X','X', - 'a','a','a','X','X','X','X','X','X','X','X','X','X','X','X','X', - 'a','a','a','a','X','X','X','X','X','X','X','X','X','X','X','X', - 'a','a','a','a','a','X','X','X','X','X','X','X','X','X','X','X', - 'a','a','a','a','a','a','X','X','X','X','X','X','X','X','X','X', - 'a','a','a','a','a','a','a','X','X','X','X','X','X','X','X','X', - 'a','a','a','a','a','a','a','a','X','X','X','X','X','X','X','X', - 'a','a','a','a','a','a','a','a','a','X','X','X','X','X','X','X', - 'a','a','a','a','a','a','a','a','a','a','X','X','X','X','X','X', - 'a','a','a','a','a','a','a','a','a','a','a','X','X','X','X','X', - 'a','a','a','a','a','a','a','a','a','a','a','a','X','X','X','X', - 'a','a','a','a','a','a','a','a','a','a','a','a','a','X','X','X', - 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','X','X', - 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','X', - 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a' -]; - -DCL xptr PTR INIT := ->int_high; - -booleans: PROC (); - - DCL val1 BOOL := TRUE; - DCL val2 BOOL := FALSE; - DCL val3 BOOL := TRUE; - - val1 := TRUE XOR TRUE; - val1 := TRUE XOR FALSE; - val1 := FALSE XOR TRUE; - val1 := FALSE XOR FALSE; - val1 := val2 XOR val3; - - val1 := TRUE AND TRUE; - val1 := TRUE AND FALSE; - val1 := FALSE AND TRUE; - val1 := FALSE AND FALSE; - val1 := val2 AND val3; - - val1 := TRUE ANDIF TRUE; - val1 := TRUE ANDIF FALSE; - val1 := FALSE ANDIF TRUE; - val1 := FALSE ANDIF FALSE; - val1 := val2 ANDIF val3; - - val1 := TRUE OR TRUE; - val1 := TRUE OR FALSE; - val1 := FALSE OR TRUE; - val1 := FALSE OR FALSE; - val1 := val2 OR val3; - --- val1 := NOT TRUE; --- val1 := NOT FALSE; --- val1 := NOT val2; --- val1 := NOT val3; - -END booleans; - -scalar_arithmetic: PROC (); - - DCL val1 INT := 1; - DCL val2 INT := 2; - DCL val3 INT := 3; - - val1 := -val2; - val1 := val2 + val3; - val1 := val2 - val3; - val1 := val2 * val3; - val1 := val2 / val3; - val1 := val2 MOD val3; - val1 := val2 REM val3; - -END scalar_arithmetic; - -write_arrays: PROC (); - - inttable1(0) := 0; - inttable1(1) := 1; - inttable1(2) := 2; - inttable1(3) := 3; - inttable1(4) := 4; - inttable2(5) := 5; - inttable2(6) := 6; - inttable2(7) := 7; - inttable2(8) := 8; - inttable2(9) := 9; - -END write_arrays; - -uint_low := 0; - -scalar_arithmetic (); -write_arrays (); -booleans (); - -END; diff --git a/gdb/testsuite/gdb.chill/chillvars.exp b/gdb/testsuite/gdb.chill/chillvars.exp deleted file mode 100644 index 1827c3f..0000000 --- a/gdb/testsuite/gdb.chill/chillvars.exp +++ /dev/null @@ -1,316 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "chillvars" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE # This is needed (at least on SunOS4) to make sure the -# OBSOLETE # the symbol table is read. -# OBSOLETE gdb_test "break chillvars.ch:3" "" -# OBSOLETE gdb_test "delete 1" "" -# OBSOLETE -# OBSOLETE gdb_test "set width 0" "" -# OBSOLETE gdb_test "set print sevenbit-strings" "" -# OBSOLETE gdb_test "set print address off" "" -# OBSOLETE -# OBSOLETE test_BOOL -# OBSOLETE test_CHAR -# OBSOLETE test_BYTE -# OBSOLETE test_UBYTE -# OBSOLETE test_INT -# OBSOLETE test_UINT -# OBSOLETE test_LONG -# OBSOLETE test_ULONG -# OBSOLETE test_REAL -# OBSOLETE test_LONG_REAL -# OBSOLETE test_POWERSET -# OBSOLETE test_arrays -# OBSOLETE test_strings -# OBSOLETE test_structs -# OBSOLETE -# OBSOLETE test_ptr -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_BOOL {} { -# OBSOLETE -# OBSOLETE gdb_test "ptype bool_true" "type = (BOOL|bool)" -# OBSOLETE gdb_test "ptype bool_false" "type = (BOOL|bool)" -# OBSOLETE gdb_test "whatis bool_true" "type = (BOOL|bool)" -# OBSOLETE gdb_test "whatis bool_false" "type = (BOOL|bool)" -# OBSOLETE gdb_test "print bool_false" " = FALSE" -# OBSOLETE gdb_test "print bool_true" " = TRUE" -# OBSOLETE -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_CHAR {} { -# OBSOLETE gdb_test "ptype control_char" "type = (CHAR|char)" -# OBSOLETE gdb_test "whatis control_char" "type = (CHAR|char)" -# OBSOLETE gdb_test "print control_char" { = '\^[(]7[)]'} -# OBSOLETE gdb_test "ptype printable_char" "type = (CHAR|char)" -# OBSOLETE gdb_test "whatis printable_char" "type = (CHAR|char)" -# OBSOLETE gdb_test "print printable_char" " = 'a'" -# OBSOLETE -# OBSOLETE gdb_test "print lower(char)" { = '\^[(]0[)]'} -# OBSOLETE gdb_test "print upper(char)" { = '\^[(]255[)]'} -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_BYTE {} { -# OBSOLETE gdb_test "ptype byte_low" "type = (BYTE|byte)" -# OBSOLETE gdb_test "whatis byte_low" "type = (BYTE|byte)" -# OBSOLETE gdb_test "print byte_low" " = -128" -# OBSOLETE gdb_test "ptype byte_high" "type = (BYTE|byte)" -# OBSOLETE gdb_test "whatis byte_high" "type = (BYTE|byte)" -# OBSOLETE gdb_test "print byte_high" " = 127" -# OBSOLETE -# OBSOLETE gdb_test "print lower(byte)" " = -128" -# OBSOLETE gdb_test "print upper(byte)" " = 127" -# OBSOLETE gdb_test "print lower(byte_high)" " = -128" -# OBSOLETE gdb_test "print upper(byte_high)" " = 127" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_UBYTE {} { -# OBSOLETE gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)" -# OBSOLETE gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)" -# OBSOLETE gdb_test "print ubyte_low" " = 0" -# OBSOLETE gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)" -# OBSOLETE gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)" -# OBSOLETE gdb_test "print ubyte_high" " = 255" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_INT {} { -# OBSOLETE gdb_test "ptype int_low" "type = (INT|int)" -# OBSOLETE gdb_test "whatis int_low" "type = (INT|int)" -# OBSOLETE gdb_test "print int_low" " = -32768" -# OBSOLETE gdb_test "ptype int_high" "type = (INT|int)" -# OBSOLETE gdb_test "whatis int_high" "type = (INT|int)" -# OBSOLETE gdb_test "print int_high" " = 32767" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_UINT {} { -# OBSOLETE gdb_test "ptype uint_low" "type = (UINT|uint)" -# OBSOLETE gdb_test "whatis uint_low" "type = (UINT|uint)" -# OBSOLETE gdb_test "print uint_low" " = 0" -# OBSOLETE gdb_test "ptype uint_high" "type = (UINT|uint)" -# OBSOLETE gdb_test "whatis uint_high" "type = (UINT|uint)" -# OBSOLETE gdb_test "print uint_high" " = 65535" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_LONG {} { -# OBSOLETE gdb_test "ptype long_low" "type = (LONG|long)" -# OBSOLETE gdb_test "whatis long_low" "type = (LONG|long)" -# OBSOLETE gdb_test "print long_low" " = -2147483648" -# OBSOLETE gdb_test "ptype long_high" "type = (LONG|long)" -# OBSOLETE gdb_test "whatis long_high" "type = (LONG|long)" -# OBSOLETE gdb_test "print long_high" " = 2147483647" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_ULONG {} { -# OBSOLETE gdb_test "ptype ulong_low" "type = (ULONG|ulong)" -# OBSOLETE gdb_test "whatis ulong_low" "type = (ULONG|ulong)" -# OBSOLETE gdb_test "print ulong_low" " = 0" -# OBSOLETE gdb_test "ptype ulong_high" "type = (ULONG|ulong)" -# OBSOLETE gdb_test "whatis ulong_high" "type = (ULONG|ulong)" -# OBSOLETE gdb_test "print ulong_high" " = 4294967295" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_REAL {} { -# OBSOLETE gdb_test "ptype real1" "type = (FLOAT|float)" -# OBSOLETE gdb_test "whatis real1" "type = (FLOAT|float)" -# OBSOLETE gdb_test "print real1" " = 3.14159274" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_LONG_REAL {} { -# OBSOLETE gdb_test "ptype long_real1" "type = (DOUBLE|double)" -# OBSOLETE gdb_test "whatis long_real1" "type = (DOUBLE|double)" -# OBSOLETE gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_POWERSET {} { -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_arrays {} { -# OBSOLETE gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)" -# OBSOLETE gdb_test_exact "print booltable1" \ -# OBSOLETE { = [(0): TRUE, (1:2): FALSE, (3): TRUE]} -# OBSOLETE -# OBSOLETE gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)" -# OBSOLETE gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]} -# OBSOLETE -# OBSOLETE gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)" -# OBSOLETE gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']} -# OBSOLETE -# OBSOLETE gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)" -# OBSOLETE gdb_test_exact "print chartable2" \ -# OBSOLETE {= [(3): '^(0)', (4): '^(1)', (5): '^(2)']} -# OBSOLETE -# OBSOLETE gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)" -# OBSOLETE gdb_test_exact "print bytetable1" \ -# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)" -# OBSOLETE gdb_test_exact "print bytetable2" \ -# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype bytetable3" \ -# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)" -# OBSOLETE gdb_test_exact "print bytetable3" \ -# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]} -# OBSOLETE gdb_test "ptype bytetable4" \ -# OBSOLETE "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)" -# OBSOLETE gdb_test_exact "print bytetable4" \ -# OBSOLETE {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]} -# OBSOLETE -# OBSOLETE gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)" -# OBSOLETE gdb_test_exact "print ubytetable1" \ -# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)" -# OBSOLETE gdb_test_exact "print ubytetable2" \ -# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)" -# OBSOLETE gdb_test_exact "print inttable1" \ -# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)" -# OBSOLETE gdb_test_exact "print inttable2" \ -# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)" -# OBSOLETE gdb_test_exact "print uinttable1" \ -# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)" -# OBSOLETE gdb_test_exact "print uinttable2" \ -# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)" -# OBSOLETE gdb_test_exact "print longtable1" \ -# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)" -# OBSOLETE gdb_test_exact "print longtable2" \ -# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)" -# OBSOLETE gdb_test_exact "print ulongtable1" \ -# OBSOLETE {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)" -# OBSOLETE gdb_test_exact "print ulongtable2" \ -# OBSOLETE {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]} -# OBSOLETE -# OBSOLETE gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)" -# OBSOLETE gdb_test_exact "print realtable1" \ -# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)" -# OBSOLETE gdb_test_exact "print realtable2" \ -# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)" -# OBSOLETE gdb_test_exact "print longrealtable1" \ -# OBSOLETE {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]} -# OBSOLETE -# OBSOLETE gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)" -# OBSOLETE gdb_test_exact "print longrealtable2" \ -# OBSOLETE {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]} -# OBSOLETE -# OBSOLETE gdb_test "print length(longrealtable2)" {= 5} -# OBSOLETE gdb_test "print lower(longrealtable2)" {= 5} -# OBSOLETE gdb_test "print upper(longrealtable2)" {= 9} -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_strings {} { -# OBSOLETE -# OBSOLETE gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+" -# OBSOLETE gdb_test "print string1" " = \"abcd\"" -# OBSOLETE -# OBSOLETE gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+" -# OBSOLETE gdb_test "print string2" { = \"ef\^\(0\)gh\"} -# OBSOLETE -# OBSOLETE gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+" -# OBSOLETE gdb_test "print string3" " = \"efghij\"" -# OBSOLETE -# OBSOLETE gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+" -# OBSOLETE gdb_test "print string4" { = \"zzzzzz\^\(0\)\"} -# OBSOLETE -# OBSOLETE # These tests require a running process, so run to one of the procs -# OBSOLETE # and then do the tests. -# OBSOLETE -# OBSOLETE if [runto scalar_arithmetic] then { -# OBSOLETE gdb_test "ptype string1//string2" "type = CHARS \\(9\\)" -# OBSOLETE gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"} -# OBSOLETE gdb_test_exact {ptype "a chill string"} {type = CHARS (14)} -# OBSOLETE gdb_test "print 'a chill string'" " = \"a chill string\"" -# OBSOLETE gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"} -# OBSOLETE gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\"" -# OBSOLETE gdb_test "print (6) 'z'" " = \"zzzzzz\"" -# OBSOLETE gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+" -# OBSOLETE gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\"" -# OBSOLETE gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+" -# OBSOLETE } -# OBSOLETE -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_structs {} { -# OBSOLETE gdb_test "ptype struct1" \ -# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+" -# OBSOLETE gdb_test "print struct1" \ -# OBSOLETE ".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]" -# OBSOLETE gdb_test "ptype struct2" \ -# OBSOLETE "type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+" -# OBSOLETE gdb_test "print struct2" \ -# OBSOLETE ".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_ptr {} { -# OBSOLETE # This is to test Cygnus PR 6932 -# OBSOLETE gdb_test "print xptr->int" ".* = 32767" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/configure b/gdb/testsuite/gdb.chill/configure deleted file mode 100755 index 24e429d..0000000 --- a/gdb/testsuite/gdb.chill/configure +++ /dev/null @@ -1,899 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12.1 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -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' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12.1" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=chexp.exp - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -CC=${CC-cc} - -ac_aux_dir= -for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:573: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:594: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:612: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set) 2>&1 | grep ac_space` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12.1" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/gdb/testsuite/gdb.chill/configure.in b/gdb/testsuite/gdb.chill/configure.in deleted file mode 100644 index 3eed026..0000000 --- a/gdb/testsuite/gdb.chill/configure.in +++ /dev/null @@ -1,11 +0,0 @@ -dnl Process this file file with autoconf to produce a configure script. - -AC_PREREQ(2.5) -AC_INIT(chexp.exp) - -CC=${CC-cc} -AC_SUBST(CC) -AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..) -AC_CANONICAL_SYSTEM - -AC_OUTPUT(Makefile) diff --git a/gdb/testsuite/gdb.chill/enum.ch b/gdb/testsuite/gdb.chill/enum.ch deleted file mode 100644 index 971fc94..0000000 --- a/gdb/testsuite/gdb.chill/enum.ch +++ /dev/null @@ -1,9 +0,0 @@ -hugo: module - - synmode m_set = set (a, b, c, d, e, f, g, h, i); - dcl x long; - dcl y m_set; - - writetext (stdout, "done.%/"); - -end hugo; diff --git a/gdb/testsuite/gdb.chill/enum.exp b/gdb/testsuite/gdb.chill/enum.exp deleted file mode 100644 index a4e2930..0000000 --- a/gdb/testsuite/gdb.chill/enum.exp +++ /dev/null @@ -1,85 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Wilfried Moser (moser@aut.alcatel.at -# OBSOLETE # -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "enum" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE return [gdb_test "show language" ".* source language is \"chill\".*" \ -# OBSOLETE "set language to \"chill\""] -# OBSOLETE } -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if ![set_lang_chill] then { -# OBSOLETE runto hugo_ -# OBSOLETE -# OBSOLETE send_gdb "set var \$i := d\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" -# OBSOLETE gdb_test "print \$i" { = d} -# OBSOLETE gdb_test "print size (\$i)" { = 1} -# OBSOLETE gdb_test "print b+c" { = 3} -# OBSOLETE gdb_test "print c*d" { = 6} -# OBSOLETE gdb_test "print a//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'} -# OBSOLETE test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"} -# OBSOLETE test_print_accept "print c" {'a'//"\^\(0,5\)Jason"//'b'} -# OBSOLETE test_print_accept "print d" {'\^\(11\)'} -# OBSOLETE -# OBSOLETE gdb_test "set var a := (100)'\^(0,255)'" "" -# OBSOLETE test_print_accept "print a" {"\^\(0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255\)"} -# OBSOLETE -# OBSOLETE send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"} -# OBSOLETE send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"} -# OBSOLETE send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print c" {'b'//"\^\(2,3\)Hugo "//'c'} -# OBSOLETE gdb_test "set var d := '\^(199)'" "" -# OBSOLETE test_print_accept "print d" {'\^\(199\)'} -# OBSOLETE -# OBSOLETE test_print_accept "print (10)'\^(0)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\"" {"\^\(0,0,0,0,0,0,0,0,0,0\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"} -# OBSOLETE test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"} -# OBSOLETE -# OBSOLETE send_gdb "set var a := \"\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {""} -# OBSOLETE send_gdb "set var a := \"\"\"\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {""""} -# OBSOLETE send_gdb "set var a := \" \"\"\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {" """} -# OBSOLETE send_gdb "set var a := \"\^\^\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {"\^\^"} -# OBSOLETE send_gdb "set var a := \"'\" \n" ; gdb_expect -re "$gdb_prompt $" -# OBSOLETE test_print_accept "print a" {"'"} -# OBSOLETE } -# OBSOLETE -# OBSOLETE -# OBSOLETE proc test_code {} { -# OBSOLETE global passcount gdb_prompt -# OBSOLETE -# OBSOLETE verbose "Testing Chars" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE runto bulk -# OBSOLETE test_print_accept "print a" {"\^\(255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127\)"} -# OBSOLETE test_print_accept "print b" {"\^\(200\)"} -# OBSOLETE # test_print_accept "print c" {'a'//"\^\(0,5\)Jason"//'b'} -# OBSOLETE test_print_accept "print d" {'a'} -# OBSOLETE } -# OBSOLETE -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200 -# OBSOLETE -# OBSOLETE test_chars -# OBSOLETE # test_code -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/gch981.ch b/gdb/testsuite/gdb.chill/gch981.ch deleted file mode 100644 index e8f0474..0000000 --- a/gdb/testsuite/gdb.chill/gch981.ch +++ /dev/null @@ -1,60 +0,0 @@ -xx: MODULE - -SYNMODE m_set1 = SET (e1, e2, e3, e4, e5); -DCL v_set1 m_set1 INIT := e3; - -SYNMODE m_set2 = SET (a1=1, a2=2, a3=17, a4=9, a5=8, a6=0, a7=14, a8=33, a9=12); -DCL v1_set2 m_set2 INIT := a1; -DCL v2_set2 m_set2 INIT := a2; -DCL v3_set2 m_set2 INIT := a3; -DCL v4_set2 m_set2 INIT := a4; -DCL v5_set2 m_set2 INIT := a5; -DCL v6_set2 m_set2 INIT := a6; -DCL v7_set2 m_set2 INIT := a7; -DCL v8_set2 m_set2 INIT := a8; -DCL v9_set2 m_set2 INIT := a9; - -SYNMODE m_set3 = SET (b1, b2, b3, b4, b5 = 4711, b6, b7 = 4713); -DCL v_set3 m_set3 INIT := b7; - -SYNMODE m_set4 = SET(s1=111111, s2, s3, s4); -DCL v1_set4 m_set4 INIT := s1; - -SYNMODE m_set_range = m_set1(e2:e5); -DCL v_set_range m_set_range INIT := e3; - -SYNMODE m_set_range_arr = ARRAY (m_set_range) BYTE; -DCL v_set_range_arr ARRAY (m_set_range) BYTE; - -SYNMODE m_set_arr = ARRAY (m_set1) BYTE; -DCL v_set_arr ARRAY (m_set1) BYTE; - -NEWMODE m_power1 = POWERSET m_set1; -DCL v1_power1 READ m_power1 INIT := [e1,e2,e3,e4,e5]; -DCL v2_power1 m_power1 INIT := []; - -NEWMODE m_power2 = POWERSET m_set2; -DCL v_power2 m_power2 INIT := []; - -NEWMODE m_power3 = POWERSET m_set3; -DCL v_power3 m_power3 INIT := [b1:b2]; - -NEWMODE m_power4 = POWERSET CHAR; -DCL v_power4 m_power4 INIT := ['b':'x']; - -NEWMODE m_power5 = POWERSET INT (2:400); -DCL v_power5 m_power5 INIT := [2:100]; - -NEWMODE m_power6 = POWERSET INT; -DCL v_power6 m_power6; - -NEWMODE m_power7 = POWERSET LONG; -DCL v_power7 m_power7; - - -v_set1:= e2; -v2_power1:= [e1]; - -v_set1:= e1; - -END xx; diff --git a/gdb/testsuite/gdb.chill/gch981.exp b/gdb/testsuite/gdb.chill/gch981.exp deleted file mode 100644 index 9b684f0..0000000 --- a/gdb/testsuite/gdb.chill/gch981.exp +++ /dev/null @@ -1,249 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file tests various Chill values, expressions, and types. -# OBSOLETE -# OBSOLETE # This file was written by Wilfried Moser (moser@aut.alcatel.at) -# OBSOLETE # Kurt Fuchs (fuchs_k@aut.alcatel.at) -# OBSOLETE # -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "gch981" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE send_gdb "break xx_\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE send_gdb "run\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't set breakpoint (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Testing printing of a specific value. Increment passcount for -# OBSOLETE # success or issue fail message for failure. In both cases, return -# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout -# OBSOLETE # is a serious error, generates a special fail message, and causes -# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail -# OBSOLETE # as well. -# OBSOLETE # -# OBSOLETE # Args are: -# OBSOLETE # -# OBSOLETE # First one is string to send_gdb to gdb -# OBSOLETE # Second one is string to match gdb result to -# OBSOLETE # Third one is an optional message to be printed -# OBSOLETE -# OBSOLETE proc test_print_accept { args } { -# OBSOLETE global gdb_prompt -# OBSOLETE global passcount -# OBSOLETE global verbose -# OBSOLETE -# OBSOLETE if [llength $args]==3 then { -# OBSOLETE set message [lindex $args 2] -# OBSOLETE } else { -# OBSOLETE set message [lindex $args 0] -# OBSOLETE } -# OBSOLETE set sendthis [lindex $args 0] -# OBSOLETE set expectthis [lindex $args 1] -# OBSOLETE set result [gdb_test $sendthis ".* = ${expectthis}" $message] -# OBSOLETE if $result==0 {incr passcount} -# OBSOLETE return $result -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_power {} { -# OBSOLETE global passcount gdb_prompt -# OBSOLETE -# OBSOLETE verbose "Testing some POWERSET Stuff" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]} -# OBSOLETE test_print_accept "print v2_power1" {\[\]} -# OBSOLETE test_print_accept "print SIZE(v1_power1)" "1" -# OBSOLETE -# OBSOLETE gdb_test "set v1_power1 := \[b1\]" "" -# OBSOLETE # if GDB has rejected the improper values, we have to gdb_expect the same! -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]} -# OBSOLETE -# OBSOLETE gdb_test "set v1_power1 := \[a1,a2\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]} -# OBSOLETE gdb_test "set v1_power1 := \[b1,b2,b3,e4\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]} -# OBSOLETE gdb_test "set v1_power1 := \[e4:e5\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e4:e5\]} -# OBSOLETE gdb_test "set v1_power1 := \[e1, e2:e3, e5\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e3, e5\]} -# OBSOLETE gdb_test "set v1_power1 := \[e1, e2:e4, e4:e5\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e5\]} -# OBSOLETE gdb_test "set v1_power1 := \[e1, e1:e3, e1:e2, e2:e3\]" "" -# OBSOLETE test_print_accept "print v1_power1" {\[e1:e3\]} -# OBSOLETE -# OBSOLETE gdb_test "set v_power2 := \[e2\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[\]} -# OBSOLETE gdb_test "set v_power2 := \[1,2,3\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[\]} -# OBSOLETE gdb_test "set v_power2 := \[e2, b2, b1\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[\]} -# OBSOLETE -# OBSOLETE # Note, that this is a numbered SET, so a1:a3 contains all elements (exept a6) -# OBSOLETE gdb_test "set v_power2 := \[a1:a3, a6:a4, a7:a9\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a6:a3\]} -# OBSOLETE gdb_test "set v_power2 := \[a1, a4:a6, a9\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a1, a9\]} -# OBSOLETE gdb_test "set v_power2 := \[a1:a2, a6, a9\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a6:a2, a9\]} -# OBSOLETE gdb_test "set v_power2 := \[a1, a4, a7:a8, a9:a3\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a1, a4, a9:a8\]} -# OBSOLETE gdb_test "set v_power2 := \[a1, a4:a8\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a1, a4:a8\]} -# OBSOLETE gdb_test "set v_power2 := \[a8,a3,a7,a9,a5,a6\]" "" -# OBSOLETE test_print_accept "print v_power2" {\[a6, a5, a9, a7, a3, a8\]} -# OBSOLETE -# OBSOLETE gdb_test "set v_power3 := \[b1:b2,e1\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1:b2\]} -# OBSOLETE gdb_test "set v_power3 := \[b1, b3, b6:b7\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1, b3, b6:b7\]} -# OBSOLETE gdb_test "set v_power3 := \[b1, b3:b4, b7\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1, b3:b4, b7\]} -# OBSOLETE gdb_test "set v_power3 := \[b1, b4:b6, b7\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1, b4:b7\]} -# OBSOLETE gdb_test "set v_power3 := \[b1:b7\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1:b7\]} -# OBSOLETE gdb_test "set v_power3 := \[b5:b7, b1\]" "" -# OBSOLETE test_print_accept "print v_power3" {\[b1, b5:b7\]} -# OBSOLETE -# OBSOLETE gdb_test "set v_power4 := \[\"b\"\]" "" -# OBSOLETE test_print_accept "print v_power4" {\['b':'x'\]} -# OBSOLETE gdb_test "set v_power4 := \[5\]" "" -# OBSOLETE test_print_accept "print v_power4" {\['b':'x'\]} -# OBSOLETE gdb_test "set v_power4 := \['c':'f','g':'h','o':'t'\]" "" -# OBSOLETE test_print_accept "print v_power4" {\['c':'h', 'o':'t'\]} -# OBSOLETE gdb_test "set v_power4 := \['a','b','c','d','e','f'\]" "" -# OBSOLETE test_print_accept "print v_power4" {\['a':'f'\]} -# OBSOLETE gdb_test "set v_power4 := \['\^(0)':'\^(200)'\]" "" -# OBSOLETE test_print_accept "print v_power4" {\['\^\(0\)':'\^\(200\)'\]} -# OBSOLETE -# OBSOLETE gdb_test "set v_power5 := \[a8\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[2:100\]} -# OBSOLETE gdb_test "set v_power5 := \[4\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[4\]} -# OBSOLETE gdb_test "set v_power5 := \[3:95,9:100,10:107,200:250\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[3:107, 200:250\]} -# OBSOLETE gdb_test "set v_power5 := \[2, 100:120, 350:400\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[2, 100:120, 350:400\]} -# OBSOLETE gdb_test "set v_power5 := \[2:64,65:127,128:256,256:399,400\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[2:400\]} -# OBSOLETE gdb_test "set v_power5 := \[3:95, 99:100, 101:107, 200:250\]" "" -# OBSOLETE test_print_accept "print v_power5" {\[3:95, 99:107, 200:250\]} -# OBSOLETE -# OBSOLETE gdb_test "set v_power6 := \[a8\]" "" -# OBSOLETE test_print_accept "print v_power6" {\[\]} -# OBSOLETE gdb_test "set v_power6 := \[4\]" "" -# OBSOLETE test_print_accept "print v_power6" {\[4\]} -# OBSOLETE gdb_test "set v_power6 := \[3:95, 99:100, 101:107, 200:250\]" "" -# OBSOLETE test_print_accept "print v_power6" {\[3:95, 99:107, 200:250\]} -# OBSOLETE gdb_test "set v_power6 := \[-111:0, 1:112, 11111:22222\]" "" -# OBSOLETE test_print_accept "print v_power6" {\[-111:112, 11111:22222\]} -# OBSOLETE gdb_test "set v_power6 := \[0, 200:4000, 6666:9999\]" "" -# OBSOLETE test_print_accept "print v_power6" {\[0, 200:4000, 6666:9999\]} -# OBSOLETE -# OBSOLETE # gdb_test "set v_power7 := \[a8\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[2:100\]} -# OBSOLETE # gdb_test "set v_power7 := \[4\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[4\]} -# OBSOLETE # gdb_test "set v_power7 := \[3:95, 99:100, 101:107, 200:250\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]} -# OBSOLETE # gdb_test "set v_power7 := \[0, 1000, 1000000, 10000000000\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[0, 1000, 1000000, 1000000000\]} -# OBSOLETE # gdb_test "set v_power7 := \[-20000:100000, 111111:2222222\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[-20000:100000, 111111:2222222\]} -# OBSOLETE # gdb_test "set v_power7 := \[\]" "" -# OBSOLETE # test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]} -# OBSOLETE # gdb_test "set v_power7 := \[2:-500, -501:1, 20:370, -888:-920, 1000:2000, 1800:2500\]\ " "" -# OBSOLETE # test_print_accept "print v_power7" {\[-920:-888, -501:2, 20:370, 1000:2500\]} -# OBSOLETE # test_print_accept "print SIZE(v_power7)" "" -# OBSOLETE -# OBSOLETE -# OBSOLETE runto 58 -# OBSOLETE test_print_accept "print v_set1 IN v1_power1" "TRUE" -# OBSOLETE test_print_accept "print v_set1 IN v2_power1" "FALSE" -# OBSOLETE -# OBSOLETE } -# OBSOLETE -# OBSOLETE -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200 -# OBSOLETE -# OBSOLETE test_power -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/misc.ch b/gdb/testsuite/gdb.chill/misc.ch deleted file mode 100644 index 20f12c8..0000000 --- a/gdb/testsuite/gdb.chill/misc.ch +++ /dev/null @@ -1,12 +0,0 @@ -misc_tests : MODULE; - -DCL otto INT := 42; - -DCL foo STRUCT (l LONG, c CHAR, b BOOL, s CHARS(3)); - -dummyfunc: PROC(); -END dummyfunc; - -dummyfunc(); - -END misc_tests; diff --git a/gdb/testsuite/gdb.chill/misc.exp b/gdb/testsuite/gdb.chill/misc.exp deleted file mode 100644 index 1cdeb7c..0000000 --- a/gdb/testsuite/gdb.chill/misc.exp +++ /dev/null @@ -1,100 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com) -# OBSOLETE # Martin Pottendorfer (pottendo@aut.alcatel.at) -# OBSOLETE # -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "misc" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE return [gdb_test "show language" ".* source language is \"chill\".*" \ -# OBSOLETE "set language to \"chill\""] -# OBSOLETE } -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if ![set_lang_chill] then { -# OBSOLETE runto dummyfunc -# OBSOLETE # check upper/lower case -# OBSOLETE gdb_test "ptype BOOL" " = (bool|BOOL)" -# OBSOLETE gdb_test "ptype bool" " = (bool|BOOL)" -# OBSOLETE gdb_test "print otto" " = 42" -# OBSOLETE gdb_test "print OTTO" " = 42" -# OBSOLETE gdb_test "print otTO" " = 42" -# OBSOLETE gdb_test "print OTto" " = 42" -# OBSOLETE gdb_test "print NULL" " = NULL" "print emptiness literal" -# OBSOLETE -# OBSOLETE # This tests PR 8496. -# OBSOLETE gdb_test {printf "%d %d.", 3+4,2} "7 2." "printf with 2 arguments" -# OBSOLETE -# OBSOLETE # This tests GCH/924 -# OBSOLETE gdb_test {print (h'23)} { = 35} "print parantised integer literal" -# OBSOLETE -# OBSOLETE # Linux thinks this is at line 6, but is otherwise ok. -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" -# OBSOLETE gdb_test "info line" \ -# OBSOLETE {Line 7 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\ -# OBSOLETE "info about current line" -# OBSOLETE -# OBSOLETE # check array () type (expr) -# OBSOLETE setup_xfail "m68*-*-hpux*" -# OBSOLETE gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]} -# OBSOLETE -# OBSOLETE send_gdb "set var \$i := foo\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" -# OBSOLETE setup_xfail "m68*-*-hpux*" -# OBSOLETE gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'0\]} -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/powerset.ch b/gdb/testsuite/gdb.chill/powerset.ch deleted file mode 100644 index dd3172d..0000000 --- a/gdb/testsuite/gdb.chill/powerset.ch +++ /dev/null @@ -1,33 +0,0 @@ --- --- check powerset operators and built-ins --- - -ps: MODULE - -SYNMODE m_ps1 = POWERSET ULONG (0:8); -DCL v_ps1 m_ps1 INIT := [1,3,5,7]; - -SYNMODE m_ps2 = POWERSET LONG (-100:100); -DCL v_ps2 m_ps2 INIT := [ -100:-95, -1:1, 95:100]; - -SYNMODE m_set = SET (aa, bb, cc, dd, ee, ff, gg, hh, ii, jj); -SYNMODE m_ps3 = POWERSET m_set; -DCL v_ps3 m_ps3 INIT := [bb, dd, ff, ii]; - -SYNMODE m_ps4 = POWERSET CHAR(' ':'z'); -DCL v_ps4 m_ps4 INIT := [ '.', ',', 'A':'F', 'x':'z' ]; - -SYNMODE m_ps5 = POWERSET BOOL; -DCL v_ps5 m_ps5 INIT := [ FALSE ]; -DCL v_ps51 m_ps5 INIT := [ ]; - -SYNMODE m_int_range = INT(-100:100); -SYNMODE m_int_subrange = m_int_range(-50:50); -SYNMODE m_ps6 = POWERSET m_int_subrange; -DCL v_ps6 m_ps6 INIT := [ LOWER(m_int_subrange):UPPER(m_int_subrange) ]; - -DCL x INT; - -x := 25; - -END ps; diff --git a/gdb/testsuite/gdb.chill/powerset.exp b/gdb/testsuite/gdb.chill/powerset.exp deleted file mode 100644 index 6d19248..0000000 --- a/gdb/testsuite/gdb.chill/powerset.exp +++ /dev/null @@ -1,187 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file tests various Chill values, expressions, and types. -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "powerset" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE send_gdb "break xx_\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE send_gdb "run\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't set breakpoint (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Testing printing of a specific value. Increment passcount for -# OBSOLETE # success or issue fail message for failure. In both cases, return -# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout -# OBSOLETE # is a serious error, generates a special fail message, and causes -# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail -# OBSOLETE # as well. -# OBSOLETE # -# OBSOLETE # Args are: -# OBSOLETE # -# OBSOLETE # First one is string to send_gdb to gdb -# OBSOLETE # Second one is string to match gdb result to -# OBSOLETE # Third one is an optional message to be printed -# OBSOLETE -# OBSOLETE proc test_print_accept { args } { -# OBSOLETE global gdb_prompt -# OBSOLETE global passcount -# OBSOLETE global verbose -# OBSOLETE -# OBSOLETE if [llength $args]==3 then { -# OBSOLETE set message [lindex $args 2] -# OBSOLETE } else { -# OBSOLETE set message [lindex $args 0] -# OBSOLETE } -# OBSOLETE set sendthis [lindex $args 0] -# OBSOLETE set expectthis [lindex $args 1] -# OBSOLETE set result [gdb_test $sendthis ".* = ${expectthis}" $message] -# OBSOLETE if $result==0 {incr passcount} -# OBSOLETE return $result -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_card {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin CARD" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete mode names -# OBSOLETE test_print_accept "print card(v_ps1)" "4" -# OBSOLETE test_print_accept "print card(v_ps2)" "15" -# OBSOLETE test_print_accept "print card(v_ps3)" "4" -# OBSOLETE test_print_accept "print card(v_ps4)" "11" -# OBSOLETE test_print_accept "print card(v_ps5)" "1" -# OBSOLETE test_print_accept "print card(v_ps51)" "0" -# OBSOLETE test_print_accept "print card(v_ps6)" "101" -# OBSOLETE -# OBSOLETE # a failure -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print card(m_ps1)" "typename in invalid context" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_min {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin MIN" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete mode names -# OBSOLETE test_print_accept "print min(v_ps1)" "1" -# OBSOLETE test_print_accept "print min(v_ps2)" "-100" -# OBSOLETE test_print_accept "print min(v_ps3)" "bb" -# OBSOLETE test_print_accept "print min(v_ps4)" "','" -# OBSOLETE test_print_accept "print min(v_ps5)" "FALSE" -# OBSOLETE test_print_accept "print min(v_ps6)" "-50" -# OBSOLETE -# OBSOLETE # a failure -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print min(v_ps51)" "MIN for empty powerset" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print min(m_ps1)" "typename in invalid context" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_max {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing builtin MIN" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete mode names -# OBSOLETE test_print_accept "print max(v_ps1)" "7" -# OBSOLETE test_print_accept "print max(v_ps2)" "100" -# OBSOLETE test_print_accept "print max(v_ps3)" "ii" -# OBSOLETE test_print_accept "print max(v_ps4)" "'z'" -# OBSOLETE test_print_accept "print max(v_ps5)" "FALSE" -# OBSOLETE test_print_accept "print max(v_ps6)" "50" -# OBSOLETE -# OBSOLETE # test an IN -# OBSOLETE test_print_accept "print 0 in v_ps6" "TRUE" -# OBSOLETE -# OBSOLETE # a failure -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print max(v_ps51)" "MAX for empty powerset" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE # test builtins as described in chapter 6.20.3 Z.200 -# OBSOLETE test_card -# OBSOLETE test_min -# OBSOLETE test_max -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/pr-4975-grt.ch b/gdb/testsuite/gdb.chill/pr-4975-grt.ch deleted file mode 100644 index 7796362..0000000 --- a/gdb/testsuite/gdb.chill/pr-4975-grt.ch +++ /dev/null @@ -1,13 +0,0 @@ -gdb_bug_grt: MODULE -NEWMODE is_channel_type = SET (chan_1, - chan_2, - chan_3, - chan_4, - chan_5, - chan_6, - chan_7, - chan_8, - chan_9, - chan_10); -GRANT is_channel_type; -END; diff --git a/gdb/testsuite/gdb.chill/pr-4975.ch b/gdb/testsuite/gdb.chill/pr-4975.ch deleted file mode 100644 index dbba064..0000000 --- a/gdb/testsuite/gdb.chill/pr-4975.ch +++ /dev/null @@ -1,43 +0,0 @@ -/* ->Number: 4975 ->Category: chill ->Synopsis: Segmentation fault of gdb 4.12.1 ->Description: - - Problem: gdb 4.12.1 segment faults with following chill program. -*/ - -gdb_bug: MODULE - -<> USE_SEIZE_FILE "pr-4975-grt.grt" <> -SEIZE is_channel_type; - - SYNMODE chan_type = POWERSET is_channel_type; - SYN hugo chan_type = [chan_1, chan_3]; - -DCL otto is_channel_type := chan_2; - -x: PROC (); - - IF otto IN hugo THEN - WRITETEXT (STDOUT, "otto IN hugo%/"); - ELSE - WRITETEXT (STDOUT, "You loose%/"); - FI; -END x; - -x (); - -END gdb_bug; -/* -Compiled with: - - chill -S -fgrant-only pr-315-grt.ch - chill -g -o pr-315 pr-315.ch - -Run gdb with - - gdb pr-315 --readnow - -will result in a sigsegv in file gdbtypes.c function force_to_range_type. -*/ diff --git a/gdb/testsuite/gdb.chill/pr-4975.exp b/gdb/testsuite/gdb.chill/pr-4975.exp deleted file mode 100644 index 366c536..0000000 --- a/gdb/testsuite/gdb.chill/pr-4975.exp +++ /dev/null @@ -1,67 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "pr-4975-grt" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-4975" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE # This is needed (at least on SunOS4) to make sure the -# OBSOLETE # the symbol table is read. -# OBSOLETE runto "x" -# OBSOLETE # "You loose"? Why, thank you. (But I suspect "You lose" might have -# OBSOLETE # been what was intended). -# OBSOLETE gdb_test "finish" "You loose.*" "Runs and reads symbols OK" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-5016.ch b/gdb/testsuite/gdb.chill/pr-5016.ch deleted file mode 100644 index 16f49e8..0000000 --- a/gdb/testsuite/gdb.chill/pr-5016.ch +++ /dev/null @@ -1,24 +0,0 @@ -vector: MODULE - -SYNMODE m_index = RANGE(1:10); -NEWMODE vector = ARRAY (m_index) INT; - -DCL a, b, c vector; - -dump: PROC( a vector LOC, c CHAR ); - DCL i m_index := 5; - DO FOR i IN m_index; - WRITETEXT( STDOUT, "%C(%C)=%C ", c, i, a(i) ); - OD; - WRITETEXT( STDOUT, "%/" ); -END dump; - -a := vector [ 1, -1, 2, -2, 3, -3, 4, -4, 5, -5 ]; -b := a; -b(4) := 4; -b(7) := 7; -c := vector [(*): 0]; - -dump(a,'a'); - -END vector; diff --git a/gdb/testsuite/gdb.chill/pr-5016.exp b/gdb/testsuite/gdb.chill/pr-5016.exp deleted file mode 100644 index 1d3a5d4..0000000 --- a/gdb/testsuite/gdb.chill/pr-5016.exp +++ /dev/null @@ -1,62 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-5016" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto dump -# OBSOLETE # Linux thinks type is "_cint" (and so does sparc-sun-sunos4, alpha-dec-osf2.0) -# OBSOLETE #setup_xfail "i*86-pc-linux*-gnu" "sparc-sun-sunos4*" "alpha-dec-osf2*" -# OBSOLETE gdb_test "whatis i" "type = m_index" "whatis int-range" -# OBSOLETE gdb_test_exact "ptype m_index" "type = RANGE (1:10)" "ptype m_index" -# OBSOLETE gdb_test_exact "whatis a" "type = /*LOC*/ vector" -# OBSOLETE gdb_test "ptype a" "type = /\\*LOC\\*/ ARRAY \\(1:10\\) (INT|int)" -# OBSOLETE gdb_test "step" "" -# OBSOLETE gdb_test_exact "whatis i" "type = long" "whatis loop counter i" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-5020.ch b/gdb/testsuite/gdb.chill/pr-5020.ch deleted file mode 100644 index 6aba793..0000000 --- a/gdb/testsuite/gdb.chill/pr-5020.ch +++ /dev/null @@ -1,19 +0,0 @@ - -PR_5020: MODULE - dummy_pr_5020: PROC (); - END; - NEWMODE x = STRUCT (l LONG, b BOOL); - NEWMODE aset = SET (aa, bb); - - DCL y ARRAY ('a':'b') x; - DCL setarr ARRAY (aset) x; - DCL intarr ARRAY(10:11) x; - DCL boolarr ARRAY (BOOL) x; - - y('a').l, setarr(aa).l, intarr(10).l, boolarr(FALSE).l := 10; - y('a').b, setarr(aa).b, intarr(10).b, boolarr(FALSE).b := TRUE; - y('b').l, setarr(bb).l, intarr(11).l, boolarr(TRUE).l := 111; - y('b').b, setarr(bb).b, intarr(11).b, boolarr(TRUE).b := FALSE; - - dummy_pr_5020 (); -END; diff --git a/gdb/testsuite/gdb.chill/pr-5020.exp b/gdb/testsuite/gdb.chill/pr-5020.exp deleted file mode 100644 index aad219d..0000000 --- a/gdb/testsuite/gdb.chill/pr-5020.exp +++ /dev/null @@ -1,85 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-5020" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE # This is needed (at least on SunOS4) to make sure the -# OBSOLETE # the symbol table is read. -# OBSOLETE gdb_test "break chillvars.ch:3" "" -# OBSOLETE gdb_test "delete 1" "" -# OBSOLETE -# OBSOLETE gdb_test "set width 0" "" -# OBSOLETE gdb_test "set print sevenbit-strings" "" -# OBSOLETE gdb_test "set print address off" "" -# OBSOLETE -# OBSOLETE test_pr_5020 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_pr_5020 {} { -# OBSOLETE global gdb_prompt -# OBSOLETE runto dummy_pr_5020 -# OBSOLETE gdb_test_exact "print y" \ -# OBSOLETE {= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]} -# OBSOLETE gdb_test_exact "print boolarr" \ -# OBSOLETE {= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]} -# OBSOLETE gdb_test_exact "print intarr" \ -# OBSOLETE {= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]} -# OBSOLETE gdb_test_exact "print setarr" \ -# OBSOLETE {= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]} -# OBSOLETE gdb_test "set print pretty" "" -# OBSOLETE gdb_test_exact "print y" \ -# OBSOLETE {= [('a'): [ -# OBSOLETE .l: 10, -# OBSOLETE .b: TRUE -# OBSOLETE ], ('b'): [ -# OBSOLETE .l: 111, -# OBSOLETE .b: FALSE -# OBSOLETE ]]} "print y pretty" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-5022.ch b/gdb/testsuite/gdb.chill/pr-5022.ch deleted file mode 100644 index aeaad4e..0000000 --- a/gdb/testsuite/gdb.chill/pr-5022.ch +++ /dev/null @@ -1,12 +0,0 @@ -PR_5022: MODULE - dummy_pr_5022: PROC (); - END; - DCL p PTR; - DCL i INT; - - p := NULL; - dummy_pr_5022 (); - i := 13; - p := ->i; - dummy_pr_5022 (); -END; diff --git a/gdb/testsuite/gdb.chill/pr-5022.exp b/gdb/testsuite/gdb.chill/pr-5022.exp deleted file mode 100644 index 3060950..0000000 --- a/gdb/testsuite/gdb.chill/pr-5022.exp +++ /dev/null @@ -1,70 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-5022" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE # This is needed (at least on SunOS4) to make sure the -# OBSOLETE # the symbol table is read. -# OBSOLETE gdb_test "break gdbme.ch:3" "" -# OBSOLETE gdb_test "delete 1" "" -# OBSOLETE -# OBSOLETE gdb_test "set width 0" "" -# OBSOLETE gdb_test "set print sevenbit-strings" "" -# OBSOLETE -# OBSOLETE test_pr_5022 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc test_pr_5022 {} { -# OBSOLETE global gdb_prompt -# OBSOLETE runto dummy_pr_5022 -# OBSOLETE gdb_test "p p" " = NULL" "print NULL pointer" -# OBSOLETE gdb_test "continue" "" -# OBSOLETE gdb_test "p p" {= PTR\(H'[0-9a-fA-F]+\)} "print non-NULL pointer" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-5646-grt.ch b/gdb/testsuite/gdb.chill/pr-5646-grt.ch deleted file mode 100644 index b7a9002..0000000 --- a/gdb/testsuite/gdb.chill/pr-5646-grt.ch +++ /dev/null @@ -1,5 +0,0 @@ -x: MODULE -NEWMODE a_set = SET (a, b, c, d); -NEWMODE a_ps = POWERSET a_set; -GRANT a_ps; -END; diff --git a/gdb/testsuite/gdb.chill/pr-5646.ch b/gdb/testsuite/gdb.chill/pr-5646.ch deleted file mode 100644 index 8c14cb8..0000000 --- a/gdb/testsuite/gdb.chill/pr-5646.ch +++ /dev/null @@ -1,15 +0,0 @@ -y: MODULE - -<> USE_SEIZE_FILE "pr-5646-grt.grt" <> -SEIZE a_ps; - -p: PROC (); - - DCL xx a_ps; - - xx := [a, b]; -END p; - -p(); - -END y; diff --git a/gdb/testsuite/gdb.chill/pr-5646.exp b/gdb/testsuite/gdb.chill/pr-5646.exp deleted file mode 100644 index dc093b9..0000000 --- a/gdb/testsuite/gdb.chill/pr-5646.exp +++ /dev/null @@ -1,64 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "pr-5646-grt" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-5646" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto p -# OBSOLETE gdb_test "next" "" -# OBSOLETE gdb_test_exact "print xx" {= [a:b]} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-5984.ch b/gdb/testsuite/gdb.chill/pr-5984.ch deleted file mode 100644 index 3e74a56..0000000 --- a/gdb/testsuite/gdb.chill/pr-5984.ch +++ /dev/null @@ -1,8 +0,0 @@ -x: module -- line 1 - p:proc (t char (20) varying); -- 2 - writetext(stdout, t); -- 3 - end p; -- 4 - -- 5 - p("Jason Dark.%/"); -- 6 - p("Hello World.%/"); -- 7 -end x; diff --git a/gdb/testsuite/gdb.chill/pr-5984.exp b/gdb/testsuite/gdb.chill/pr-5984.exp deleted file mode 100644 index 826ec57..0000000 --- a/gdb/testsuite/gdb.chill/pr-5984.exp +++ /dev/null @@ -1,57 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-5984" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" ; -# OBSOLETE -# OBSOLETE gdb_test "break pr-5984.ch:6" "" -# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-5984.ch:6" -# OBSOLETE gdb_expect -re "$gdb_prompt $" -# OBSOLETE gdb_test "next" "Jason Dark.*" "next over Jason Dark" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-6292.ch b/gdb/testsuite/gdb.chill/pr-6292.ch deleted file mode 100644 index c2ed953..0000000 --- a/gdb/testsuite/gdb.chill/pr-6292.ch +++ /dev/null @@ -1,17 +0,0 @@ -hack : module - -dcl i int; - -fred : proc (a int in, b int loc); - writetext(stdout, "a was '%C'; b was '%C'.%/", a, b); - b + := 1; -end fred; - -klaus : proc (); - writetext(stdout, "here's klaus calling.%/"); -end klaus; - -i:=12; -writetext(stdout, "done.%/"); - -end hack; diff --git a/gdb/testsuite/gdb.chill/pr-6292.exp b/gdb/testsuite/gdb.chill/pr-6292.exp deleted file mode 100644 index 4daf382..0000000 --- a/gdb/testsuite/gdb.chill/pr-6292.exp +++ /dev/null @@ -1,58 +0,0 @@ -# OBSOLETE # Copyright 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-6292" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" ; -# OBSOLETE -# OBSOLETE gdb_test "break pr-6292.ch:15" "" -# OBSOLETE send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $" -# OBSOLETE gdb_test_exact "call klaus()" {here's klaus calling.} -# OBSOLETE gdb_test {set fred(10, i)} {a was '10'; b was '12'.} -# OBSOLETE gdb_test "print i" { = 13} "print i after call" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-6632-grt.ch b/gdb/testsuite/gdb.chill/pr-6632-grt.ch deleted file mode 100644 index e9434f1..0000000 --- a/gdb/testsuite/gdb.chill/pr-6632-grt.ch +++ /dev/null @@ -1,34 +0,0 @@ -markus1: MODULE - -SYNMODE m_dummy = SET (dummy_1, - dummy_2, - dummy_3, - dummy_4, - dummy_5, - dummy_6, - dummy_7, - dummy_8, - dummy_9, - dummy_10, - dummy_11, - dummy_12, - dummy_13, - dummy_14, - dummy_15, - dummy_16, - dummy_17, - dummy_18, - dummy_19, - dummy_20, - dummy_21, - dummy_22, - dummy_23, - dummy_24, - dummy_25, - dummy_26); - -SYNMODE m_dummy_range = m_dummy(dummy_6 : dummy_22); - -GRANT m_dummy, m_dummy_range; - -END markus1; diff --git a/gdb/testsuite/gdb.chill/pr-6632.ch b/gdb/testsuite/gdb.chill/pr-6632.ch deleted file mode 100644 index b82c7ae..0000000 --- a/gdb/testsuite/gdb.chill/pr-6632.ch +++ /dev/null @@ -1,31 +0,0 @@ -markus: MODULE - -<> USE_SEIZE_FILE "pr-6632-grt.grt" <> -SEIZE m_dummy, m_dummy_range; - -DCL v m_dummy_range; - -NEWMODE is_str_descr = STRUCT (p PTR, - l INT, - flag STRUCT (x UBYTE, - y SET (aa, bb, cc, dd, ee, ff))); -DCL des is_str_descr; - -NEWMODE is_cb_debug = STRUCT (i INT, - channel m_dummy_range, - p PTR); -NEWMODE is_cb_debug_array = ARRAY (0:20) is_cb_debug; -DCL cb_debug is_cb_debug_array; -DCL cb_debug_index INT := 0; - -p: PROC (pp is_str_descr IN, x m_dummy_range IN) - DO WITH cb_debug(cb_debug_index); - channel := x; - OD; -END p; - -p (des, dummy_10); -WRITETEXT (stdout, "cb_debug(%C).channel := %C%/", - cb_debug_index, cb_debug(cb_debug_index).channel); - -END markus; diff --git a/gdb/testsuite/gdb.chill/pr-6632.exp b/gdb/testsuite/gdb.chill/pr-6632.exp deleted file mode 100644 index 9f7d623..0000000 --- a/gdb/testsuite/gdb.chill/pr-6632.exp +++ /dev/null @@ -1,66 +0,0 @@ -# OBSOLETE # Copyright 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "pr-6632-grt" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-6632" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto p -# OBSOLETE gdb_test "whatis x" {type = m_dummy_range} -# OBSOLETE gdb_test_exact "ptype x" {type = m_dummy (dummy_6:dummy_22)} -# OBSOLETE gdb_test "print x" { = dummy_10} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-8134.exp b/gdb/testsuite/gdb.chill/pr-8134.exp deleted file mode 100644 index d98c0d8..0000000 --- a/gdb/testsuite/gdb.chill/pr-8134.exp +++ /dev/null @@ -1,65 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE # Note we use pr-8136.ch for pr-8134.exp as well as pr-8136.exp. -# OBSOLETE set testfile2 "func1" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-8134" -# OBSOLETE set srcfile ${srcdir}/$subdir/pr-8136.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto p1 -# OBSOLETE gdb_test "print first" "= 1" -# OBSOLETE gdb_test "print last" "= 10" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-8136.ch b/gdb/testsuite/gdb.chill/pr-8136.ch deleted file mode 100644 index b380110..0000000 --- a/gdb/testsuite/gdb.chill/pr-8136.ch +++ /dev/null @@ -1,34 +0,0 @@ --- NOTE: This test is used for pr-3134.exp as well as pr-8136. -func: MODULE - -<> USE_SEIZE_FILE "func1.grt" <> -SEIZE ALL; - -NEWMODE m_struct = STRUCT (i LONG, str CHARS(50) VARYING); -DCL insarr ARRAY (1:10) INT; - -DCL setrange m_setrange := e5; - -DCL ps m_ps := [ e3, e7:e9 ]; -DCL range_ps m_rangeps := [ 2, 3, 4, 28 ]; - -p1: PROC (first INT IN, last INT IN, s m_struct IN); - - DCL foo LONG := 3; - - startall: PROC () - DO FOR i := first to last; - insarr(i) := i; - OD; - DO FOR i := first TO last; - WRITETEXT (stdout, "insarr(%C) := %C%/", i, insarr(i)); - OD; - END startall; - - startall (); - -END p1; - -p1 (LOWER (insarr), UPPER (insarr), [ 10, "This is a string." ]); - -END func; diff --git a/gdb/testsuite/gdb.chill/pr-8136.exp b/gdb/testsuite/gdb.chill/pr-8136.exp deleted file mode 100644 index 2dd5281..0000000 --- a/gdb/testsuite/gdb.chill/pr-8136.exp +++ /dev/null @@ -1,63 +0,0 @@ -# OBSOLETE # Copyright 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "func1" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-8136" -# OBSOLETE set srcfile ${srcdir}/$subdir/pr-8136.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto p1 -# OBSOLETE gdb_test "print ps" {= \[e3, e7:e9\]} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-8405.ch b/gdb/testsuite/gdb.chill/pr-8405.ch deleted file mode 100644 index a9b2531..0000000 --- a/gdb/testsuite/gdb.chill/pr-8405.ch +++ /dev/null @@ -1,19 +0,0 @@ -emptybit: MODULE - -SYNMODE b8 = BOOLS(8); -SYN bit8 b8 = B'00000000'; - -SYNMODE char_m = CHARS(40) VARYING; - -SYNMODE stru_m = STRUCT (c char_m, b b8, boo BOOL); -DCL xx stru_m; - -SYNMODE m_stru = STRUCT (c char_m, i LONG, boo BOOL); -DCL yy m_stru; - -SYNMODE m_arr = ARRAY (1:10) LONG; -DCL zz m_arr; - -WRITETEXT (stdout, "%C%/", bit8); - -END emptybit; diff --git a/gdb/testsuite/gdb.chill/pr-8405.exp b/gdb/testsuite/gdb.chill/pr-8405.exp deleted file mode 100644 index 31aa6d5..0000000 --- a/gdb/testsuite/gdb.chill/pr-8405.exp +++ /dev/null @@ -1,61 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE gdb_test "set var \$i:=xx" "" -# OBSOLETE gdb_test "print \$i" {= \[.c: "", .b: B'00000000', .boo: FALSE\]} -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE # Check to see if we have an executable to test. If not, then either we -# OBSOLETE # haven't tried to compile one, or the compilation failed for some reason. -# OBSOLETE # In either case, just notify the user and skip the tests in this file. -# OBSOLETE -# OBSOLETE set testfile "pr-8405" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE if ![file exists $binfile] then { -# OBSOLETE warning "$binfile does not exist; tests suppressed." 0 -# OBSOLETE } else { -# OBSOLETE do_tests -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/pr-8742.ch b/gdb/testsuite/gdb.chill/pr-8742.ch deleted file mode 100644 index 0541149..0000000 --- a/gdb/testsuite/gdb.chill/pr-8742.ch +++ /dev/null @@ -1,32 +0,0 @@ -hugo : module - - synmode a = range(1:10); - synmode p = powerset a; - - synmode s = set (sa, sb, sc); - synmode s_ps = powerset s; - - x: proc (ps p); - dcl i a; - do for i in ps; - writetext (stdout, "%C ", i); - od; - writetext(stdout, "%/"); - end x; - - y : proc (ps s_ps); - dcl i s; - do for i in ps; - writetext (stdout, "%C ", i); - od; - writetext(stdout, "%/"); - end y; - - dummy: proc (); - end dummy; - - x([1,2,3]); - y([sa, sc]); - dummy (); - -end hugo; diff --git a/gdb/testsuite/gdb.chill/pr-8742.exp b/gdb/testsuite/gdb.chill/pr-8742.exp deleted file mode 100644 index a7b10d0..0000000 --- a/gdb/testsuite/gdb.chill/pr-8742.exp +++ /dev/null @@ -1,64 +0,0 @@ -# OBSOLETE # Copyright 1992, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-8742" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto dummy -# OBSOLETE -# OBSOLETE # Haven't investigated why these fail on mips-sgi-irix* -# OBSOLETE setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*" -# OBSOLETE gdb_test {call x(p [1, 3, 5])} "1 3 5 " "pass int powerset tuple" -# OBSOLETE setup_xfail "mips*-sgi-irix*" -# OBSOLETE gdb_test {call y(s_ps [sc])} "sc " "pass set powerset tuple" -# OBSOLETE setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*" -# OBSOLETE gdb_test {call x([1, 3, 5])} "1 3 5 " "pass modeless int powerset tuple" -# OBSOLETE setup_xfail "mips*-sgi-irix*" -# OBSOLETE gdb_test {call y([sc])} "sc " "pass modeless set powerset tuple" -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-8894-grt.ch b/gdb/testsuite/gdb.chill/pr-8894-grt.ch deleted file mode 100644 index 5720170..0000000 --- a/gdb/testsuite/gdb.chill/pr-8894-grt.ch +++ /dev/null @@ -1,6 +0,0 @@ -yy: MODULE - -SYNMODE m_byte = INT (0:255); -GRANT ALL; - -END yy; diff --git a/gdb/testsuite/gdb.chill/pr-8894.ch b/gdb/testsuite/gdb.chill/pr-8894.ch deleted file mode 100644 index 391d56b..0000000 --- a/gdb/testsuite/gdb.chill/pr-8894.ch +++ /dev/null @@ -1,12 +0,0 @@ -xx: MODULE - -<> USE_SEIZE_FILE "pr-8894-grt.grt" <> -SEIZE m_byte; - -SYNMODE m_struct = STRUCT (a, b, c m_byte); - -DCL v m_struct; - -v.a := 100; - -END xx; diff --git a/gdb/testsuite/gdb.chill/pr-8894.exp b/gdb/testsuite/gdb.chill/pr-8894.exp deleted file mode 100644 index 1ef4448..0000000 --- a/gdb/testsuite/gdb.chill/pr-8894.exp +++ /dev/null @@ -1,61 +0,0 @@ -# OBSOLETE # Copyright 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "pr-8894-grt" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "pr-8894" -# OBSOLETE set srcfile ${srcdir}/$subdir/$testfile.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE gdb_test "print size(m_byte)" { = 2} -# OBSOLETE gdb_test "print size(m_struct)" { = 6} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/pr-9095.ch b/gdb/testsuite/gdb.chill/pr-9095.ch deleted file mode 100644 index 61ffb70..0000000 --- a/gdb/testsuite/gdb.chill/pr-9095.ch +++ /dev/null @@ -1,13 +0,0 @@ -gdb1: MODULE - -SYNMODE m_arr1 = ARRAY (1:10) UBYTE; -SYNMODE m_struct = STRUCT ( i LONG, - p REF m_arr1); -SYNMODE m_arr2 = ARRAY (0:10) REF m_struct; - -DCL v_arr1 m_arr1 INIT := [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; -DCL v_struct m_struct INIT := [ 10, ->v_arr1 ]; -DCL v_arr2 m_arr2 INIT := [ (5): ->v_struct, (ELSE): NULL ]; - -WRITETEXT (stdout, "v_arr2(5)->.p->(5) = %C%/", v_arr2(5)->.p->(5)); -END gdb1; diff --git a/gdb/testsuite/gdb.chill/pr-9095.exp b/gdb/testsuite/gdb.chill/pr-9095.exp deleted file mode 100644 index 44bb2c3..0000000 --- a/gdb/testsuite/gdb.chill/pr-9095.exp +++ /dev/null @@ -1,62 +0,0 @@ -# OBSOLETE # Copyright 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE runto pr-9095.ch:12 -# OBSOLETE gdb_test {p v_arr2(5)->.p(5)} "reference value used as function" \ -# OBSOLETE "bad call using pointer" -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE # Check to see if we have an executable to test. If not, then either we -# OBSOLETE # haven't tried to compile one, or the compilation failed for some reason. -# OBSOLETE # In either case, just notify the user and skip the tests in this file. -# OBSOLETE -# OBSOLETE set testfile "pr-9095" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE if ![file exists $binfile] then { -# OBSOLETE warning "$binfile does not exist; tests suppressed." 0 -# OBSOLETE } else { -# OBSOLETE do_tests -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/pr-9946.ch b/gdb/testsuite/gdb.chill/pr-9946.ch deleted file mode 100644 index 3d9210a..0000000 --- a/gdb/testsuite/gdb.chill/pr-9946.ch +++ /dev/null @@ -1,10 +0,0 @@ -x: module - -synmode aset = SET (stopped, moving); - -DCL xyz aset; - -xyz := moving; -xyz := SUCC (xyz); - -END x; diff --git a/gdb/testsuite/gdb.chill/pr-9946.exp b/gdb/testsuite/gdb.chill/pr-9946.exp deleted file mode 100644 index f0c48aa..0000000 --- a/gdb/testsuite/gdb.chill/pr-9946.exp +++ /dev/null @@ -1,79 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Fred Fish. (fnf@cygnus.com) -# OBSOLETE # Martin Pottendorfer (pottendo@aut.alcatel.at) -# OBSOLETE # -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "pr-9946" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE return [gdb_test "show language" ".* source language is \"chill\".*" \ -# OBSOLETE "set language to \"chill\""] -# OBSOLETE } -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if ![set_lang_chill] then { -# OBSOLETE runto x_ -# OBSOLETE gdb_test "next" "" -# OBSOLETE # check comparison of SET's -# OBSOLETE gdb_test {print xyz=moving} { = TRUE} -# OBSOLETE gdb_test {print xyz/=moving} { = FALSE} -# OBSOLETE gdb_test {print xyzmoving} { = FALSE} -# OBSOLETE gdb_test {print xyz>=moving} { = TRUE} -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/result.ch b/gdb/testsuite/gdb.chill/result.ch deleted file mode 100644 index b8c65e7..0000000 --- a/gdb/testsuite/gdb.chill/result.ch +++ /dev/null @@ -1,29 +0,0 @@ -test_result: MODULE - - DCL i INT := 5; - - SYNMODE m_struct = STRUCT (l LONG, b BOOL); - DCL v_struct m_struct := [ 20, TRUE ]; - - simple_func: PROC () RETURNS (INT); - DCL j INT := i; - RESULT 10; - i + := 2; - RESULT j + 2; - i + := 2; - END simple_func; - - ret_struct: PROC () RETURNS (m_struct) - DCL v m_struct := [ 33, FALSE ]; - RESULT v; - v.l := 18; - END ret_struct; - - i := simple_func (); - i := simple_func (); - i * := 10; - - v_struct := ret_struct (); - - i := 33; -- for gdb -END test_result; diff --git a/gdb/testsuite/gdb.chill/result.exp b/gdb/testsuite/gdb.chill/result.exp deleted file mode 100644 index 8c9a897..0000000 --- a/gdb/testsuite/gdb.chill/result.exp +++ /dev/null @@ -1,77 +0,0 @@ -# OBSOLETE # Copyright 1994, 1995 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "result" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE gdb_test "set width 0" "" -# OBSOLETE gdb_test "set print sevenbit-strings" "" -# OBSOLETE gdb_test "set print address off" "" -# OBSOLETE -# OBSOLETE # simple function -# OBSOLETE runto simple_func -# OBSOLETE gdb_test "step 2" "" -# OBSOLETE gdb_test "print j" "= 5" -# OBSOLETE gdb_test "p RESULT" "= 10" -# OBSOLETE gdb_test "continue" "" -# OBSOLETE gdb_test "print i" "= 7" -# OBSOLETE gdb_test "step 4" "" -# OBSOLETE gdb_test "set RESULT := 50" "" -# OBSOLETE gdb_test "finish" "" -# OBSOLETE gdb_test "step" "" -# OBSOLETE gdb_test "print i" "= 50" -# OBSOLETE -# OBSOLETE # returning a structure -# OBSOLETE runto ret_struct -# OBSOLETE gdb_test "step 2" "" -# OBSOLETE gdb_test "p result" {\[.l: 33, .b: FALSE\]} -# OBSOLETE gdb_test "set var result := \[383, TRUE\]" "" -# OBSOLETE gdb_test "finish" "" -# OBSOLETE gdb_test "p v_struct" {\[.l: 383, .b: TRUE\]} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/string.ch b/gdb/testsuite/gdb.chill/string.ch deleted file mode 100644 index 3503c46..0000000 --- a/gdb/testsuite/gdb.chill/string.ch +++ /dev/null @@ -1,24 +0,0 @@ -ss: MODULE - -/* These declarations are from Cygnus PR chill/9078. */ - SYNMODE m_char20 = CHARS(20) VARYING; - - DCL foo m_char20 INIT := "Moser "; - DCL bar m_char20 INIT := "Wilfried"; - - DCL foo1 CHARS(5) INIT := "12345"; - DCL bar1 CHARS(5) INIT := "abcde"; - -/* This is Cynus PR chill/5696. */ - -DCL s20 CHARS(20) VARYING; - -DCL s10 CHARS(10); - - -s20 := "Moser Wilfried"; -S10 := "1234567890"; - -WRITETEXT (stdout, "s20 := ""%C"", s10 := ""%C""%/", s20, s10); - -END ss; diff --git a/gdb/testsuite/gdb.chill/string.exp b/gdb/testsuite/gdb.chill/string.exp deleted file mode 100644 index 41b2104..0000000 --- a/gdb/testsuite/gdb.chill/string.exp +++ /dev/null @@ -1,73 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "string" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE # These tests based on Cygnus PR chill/5696. -# OBSOLETE runto string.ch:22 -# OBSOLETE gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring" -# OBSOLETE gdb_test "p s20(1)" { = 'o'} "print vstring element" -# OBSOLETE gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)" -# OBSOLETE gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)" -# OBSOLETE gdb_test "p s10" { = "1234567890"} "print simple string" -# OBSOLETE gdb_test "p s10(1)" { = '2'} "print string element" -# OBSOLETE gdb_test "p s10(1:3)" { = "234"} "print string slice (:)" -# OBSOLETE gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)" -# OBSOLETE -# OBSOLETE gdb_test "p length(s10)" { = 10} "print string length" -# OBSOLETE gdb_test "p length(s20)" { = 14} "print varying string length" -# OBSOLETE gdb_test "p lower(s10)" { = 0} "print string lower" -# OBSOLETE gdb_test "p upper(s10)" { = 9} "print string upper" -# OBSOLETE gdb_test "p lower(s20)" { = 0} "print varying string lower" -# OBSOLETE gdb_test "p upper(s20)" { = 19} "print varying string upper" -# OBSOLETE -# OBSOLETE # These tests are based on Cygnus PR chill/9078. -# OBSOLETE gdb_test "print foo // bar" { = "Moser Wilfried"} -# OBSOLETE gdb_test "print foo // bar1" { = "Moser abcde"} -# OBSOLETE gdb_test "print foo1 // bar1" { = "12345abcde"} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/tests1.ch b/gdb/testsuite/gdb.chill/tests1.ch deleted file mode 100644 index 3afdd90..0000000 --- a/gdb/testsuite/gdb.chill/tests1.ch +++ /dev/null @@ -1,240 +0,0 @@ --- Copyright 1992, 1995, 1996 Free Software Foundation, Inc. - --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - --- Please email any bugs, comments, and/or additions to this file to: --- bug-gdb@prep.ai.mit.edu - --- --- test program 1 (refer to tests1.exp) --- - -/* These functions are defined in libchill.a */ - -runtime: SPEC MODULE -DCL chill_argc long; -DCL chill_argv REF ARRAY (0:1000) REF CHARS (1000) VARYING; -__print_event: PROC (arg0 ptr, - arg1 ptr) END; -__print_buffer: PROC (arg0 ptr, - arg1 ptr) END; -GRANT ALL; -END; - -tests1: module; - -seize __print_event, - __print_buffer; - -newmode set1 = set(aaa, bbb, ccc); -newmode nset1 = set(na = 1, nb = 34, nc = 20); -newmode r11 = range (0 : upper(ubyte)); -newmode r12 = range (0 : upper(uint)); ---newmode r13 = range (0 : upper(ulong)); -- bug in gnuchill -newmode r14 = range (lower(byte) : upper(byte)); -newmode r15 = range (lower(int) : upper(int)); -newmode r16 = range (lower(long): upper(long)); -newmode r2 = set1(bbb : ccc); -newmode r3 = nset1(na : na); -newmode r4 = nset1(nc : nb); -newmode r5 = nset1(lower(nset1) : upper(nset1)); - -newmode pm1 = powerset set(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); -newmode pm2 = powerset byte (1:8); -newmode pm3 = powerset int (-32768:32767); -newmode pm4 = powerset long (-32768:32768); -newmode pm5 = powerset long (lower(long):upper(long)); -newmode ref1 = ref pm1; -newmode ref2 = ref byte; -newmode ref3 = ptr; -synmode ref4 = ptr; -synmode syn_int = int; - -newmode prm1 = proc (); -newmode prm2 = proc (bool in, int out, long inout) returns (char); -newmode prm3 = proc (pm1, ref1 loc) returns (ref3); -newmode prm4 = proc () exceptions(ex1, ex2, ex3); -newmode prm5 = proc (r11, r16 inout, r5 out) returns (r2) exceptions (ex1); - -newmode ev1m = event; -newmode ev2m = event (42); - -newmode bu1m = buffer ref1; -newmode bu2m = buffer (42) ubyte; - -newmode strm1 = char (5); -synmode strm2 = char (7) varying; - -synmode bstr1 = bit(20); ---newmode bstr2 = bit(10) varying; - -newmode arr1m = array(1:100) set1; -newmode arr2m = array(1:100, 1:100) set1; -newmode arr3m = array(r11, r12, r14) set1; -newmode arr4m = array(r2) array (r3) array (r4, r5) pm1; -newmode arr5m = array(1:10) int; -newmode arr6m = array(1:5, 1:3, 1:2) long; - -newmode stru1m = struct (a, b long, - case b of - (42): ch1 chars(20), - (52): ch2 chars(10) - else ch3 chars(1) - esac); - -newmode stru2m = struct (f set1, - case f of - (aaa): ch1 char(20), - (bbb): ch2 char(10) varying - else ch3 char(0) varying - esac); -newmode stru3m = struct (f r3, - case f of - (na): ch1 char(20) - esac); -newmode stru4m = struct (i long, - case of - : i1, i11 int, - b1 bool, - c1 char, - : i2, i22 long, - bs2 bools (10), - : - s3 struct (i3 int, - case of - : foo long - else bar char - esac) - else - x stru2m - esac, - y stru3m); - -synmode m_xyzmode = struct (next ref m_xyzmode, - i long); - --- set mode locations -dcl s1l set1 := ccc; -dcl s2l nset1 := nb; - --- range mode locations -dcl rl1 r11 := 3; -dcl rl2 r11 := lower(r11); -dcl rl3 r11 := upper(r11); - -dcl rl5 r12 := 65530; -dcl rl6 r12 := lower(r12); -dcl rl7 r12 := upper(r12); - ---dcl rl9 r13 := 128; ---dcl rl10 r13 := lower(r13); ---dcl rl11 r13 := upper(r13); - -dcl rl13 r14 := -121; -dcl rl14 r14 := lower(r14); -dcl rl15 r14 := upper(r14); - -dcl rl17 r15 := -32720; -dcl rl18 r15 := lower(r15); -dcl rl19 r15 := upper(r15); - -dcl rl21 r16 := 2147483643; -dcl rl22 r16 := lower(r16); -dcl rl23 r16 := upper(r16); - --- powerset mode locations -dcl pl1 pm1 := [p1:p10]; -dcl pl2 pm1 := []; -dcl pl3 pm1 := [p1, p10]; -dcl pl4 pm1 := [p1:p2, p4:p6, p8:p10]; -dcl pl5 pm1 := [p1:p4, p6, p8:p10]; -dcl pl6 pm1 := [p1, p3:p8, p10]; - -dcl pl7 pm2 := [1:8]; -dcl pl8 pm3 := [-32768:32767]; ---dcl pl9 pm5 := [-2147483648:2147483647]; - --- reference mode locations -dcl ref3l ref3; -dcl ref4l ref4; -dcl ref5l, ref6l, ref7l, ref8l ptr; -dcl syn_intl1 syn_int := 42; -dcl intl1 int := -42; - --- synchronization mode locations -dcl ev1l ev1m; -dcl ev2l ev2m; -dcl bu1l bu1m; -dcl bu2l bu2m; - --- timing mode locations -dcl til1 time; - --- string mode locations -dcl strl1, strl2 strm2; -dcl bstrl1 bstr1 := B'10101010101010101010'; - --- array mode locations -dcl arrl1 arr1m; -dcl arrl2 arr5m := [1, -1, 32767, -32768, 0, 10, 11, 12, 13, 42]; -dcl arrl3 arr6m := [(1:5): [(1:3): [(1:2): -2147483648]]]; -dcl arrl4 arr6m := [(1:2): [(1:3): [(1:2): -2147483648]], - (3): [(1:3): [(1:2): 100]], - (4:5): [(1:3): [(1:2): -2147483648]]]; -dcl arrl5 array(1:10) nset1; - --- structure mode locations -dcl strul1 stru1m := [-2147483648, 42, "12345678900987654321"]; - -dummyfunc: proc(); -end dummyfunc; - -ref3l:=->pl1; -- newmode ref -ref4l:=->pl1; -- synmode ref -ref5l:=->pl1; -- ptr - -ref6l:=->syn_intl1; -- ref to synmode -ref7l:=->intl1; -- ref to predefined mode -ref8l:=->pl1; -- ref to newmode - -strl1 := "ha" // C'6e' // "s" // "i" // C'00'; -strl2 := C'00' // "ope"; - -__print_event(addr(ev1l), addr("ev1l")); -__print_event(addr(ev2l), addr("ev2l")); -__print_buffer(addr(bu1l), addr("bu1m")); -__print_buffer(addr(bu2l), addr("bu2m")); - -til1 := abstime(1970, 3, 12, 10, 43, 0); -writetext(stdout, "lower(pm3) = %C; upper(pm3) = %C%..%/", - lower(pm3), upper(pm3)); -writetext(stdout, "lower(pm5) = %C; upper(pm5) = %C%..%/", - lower(pm5), upper(pm5)); ---writetext(stdout, "lower(pl9) = %C; upper(pl9) = %C%..%/", --- lower(pl9), upper(pl9)); -writetext(stdout, "date = %C%..%/", til1); - -writetext(stdout, "slice1 = %C%..%/", strl1(3 : 5)); -writetext(stdout, "slice2 = %C%..%/", strl2(0 : 3)); ---writetext(stdout, "slice3 = %C%..%/", strl1(0 up 20)); -writetext(stdout, "slice4 = %C%..%/", bstrl1(0)); ---writetext(stdout, "slice5 = %C%..%/", arrl3(1:5)); - - -writetext(stdout, "done.%/"); - -dummyfunc(); - -end tests1; diff --git a/gdb/testsuite/gdb.chill/tests1.exp b/gdb/testsuite/gdb.chill/tests1.exp deleted file mode 100644 index d3c647d..0000000 --- a/gdb/testsuite/gdb.chill/tests1.exp +++ /dev/null @@ -1,822 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file tests various Chill values, expressions, and types. -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "tests1" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE verbose "loading file '$binfile'" -# OBSOLETE gdb_load $binfile -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE send_gdb "break dummyfunc\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE send_gdb "run\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't set breakpoint (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Testing printing of a specific value. Increment passcount for -# OBSOLETE # success or issue fail message for failure. In both cases, return -# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout -# OBSOLETE # is a serious error, generates a special fail message, and causes -# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail -# OBSOLETE # as well. -# OBSOLETE # -# OBSOLETE # Args are: -# OBSOLETE # -# OBSOLETE # First one is string to send_gdb to gdb -# OBSOLETE # Second one is string to match gdb result to -# OBSOLETE # Third one is an optional message to be printed -# OBSOLETE -# OBSOLETE proc test_print_accept { args } { -# OBSOLETE global gdb_prompt -# OBSOLETE global passcount -# OBSOLETE global verbose -# OBSOLETE -# OBSOLETE if [llength $args]==3 then { -# OBSOLETE set message [lindex $args 2] -# OBSOLETE } else { -# OBSOLETE set message [lindex $args 0] -# OBSOLETE } -# OBSOLETE set sendthis [lindex $args 0] -# OBSOLETE set expectthis [lindex $args 1] -# OBSOLETE set result [gdb_test $sendthis ".* = ${expectthis}" $message] -# OBSOLETE if $result==0 {incr passcount} -# OBSOLETE return $result -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Testing printing of a specific value. Increment passcount for -# OBSOLETE # success or issue fail message for failure. In both cases, return -# OBSOLETE # a 1 to indicate that more tests can proceed. However a timeout -# OBSOLETE # is a serious error, generates a special fail message, and causes -# OBSOLETE # a 0 to be returned to indicate that more tests are likely to fail -# OBSOLETE # as well. -# OBSOLETE -# OBSOLETE # various tests if modes are treated correctly -# OBSOLETE # using ptype -# OBSOLETE proc test_modes {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing chill modes" -# OBSOLETE set passcount 0 -# OBSOLETE -# OBSOLETE # discrete modes -# OBSOLETE test_print_accept "ptype BYTE" "byte" -# OBSOLETE test_print_accept "ptype UBYTE" "ubyte" -# OBSOLETE test_print_accept "ptype INT" "int" -# OBSOLETE test_print_accept "ptype UINT" "uint" -# OBSOLETE test_print_accept "ptype LONG" "long" -# OBSOLETE test_print_accept "ptype ULONG" "ulong" -# OBSOLETE test_print_accept "ptype BOOL" "bool" -# OBSOLETE test_print_accept "ptype CHAR" "char" -# OBSOLETE -# OBSOLETE test_print_accept "ptype set1" "SET \[(\]aaa, bbb, ccc\[)\]" \ -# OBSOLETE "print unnumbered set mode" -# OBSOLETE test_print_accept "ptype nset1" "SET \[(\]na = 1, nb = 34, nc = 20\[)\]" \ -# OBSOLETE "print numbered set mode" -# OBSOLETE -# OBSOLETE # mp: -# OBSOLETE # display maybe in hex values ? -# OBSOLETE # -# OBSOLETE test_print_accept "ptype r11" "ubyte \\(0:255\\)" \ -# OBSOLETE "print ubyte range mode" -# OBSOLETE test_print_accept "ptype r12" "uint \\(0:65535\\)" \ -# OBSOLETE "print uint range mode" -# OBSOLETE # test_print_accept "ptype r13" "ulong \\(0:4294967295\\)" \ -# OBSOLETE # "print ulong range mode" -# OBSOLETE test_print_accept "ptype r14" "byte \\(-128:127\\)" \ -# OBSOLETE "print byte range mode" -# OBSOLETE test_print_accept "ptype r15" "int \\(-32768:32767\\)" \ -# OBSOLETE "print int range mode" -# OBSOLETE test_print_accept "ptype r16" "long \\(-2147483648:2147483647\\)" \ -# OBSOLETE "print long range mode" -# OBSOLETE -# OBSOLETE test_print_accept "ptype r2" "set1 \\(bbb:ccc\\)" \ -# OBSOLETE "print unnumbered set range mode" -# OBSOLETE test_print_accept "ptype r3" "nset1 \\(na:na\\)" \ -# OBSOLETE "print numbered set range mode" -# OBSOLETE # really this order ? -# OBSOLETE # I'm not sure what should happen for the next two tests. -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype r4" "nset1 \\(nb = 34:nc = 20\\)" \ -# OBSOLETE "print numbered set range mode" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype r5" "nset1 \\(na = 1, nb = 34, nc = 20\\)" \ -# OBSOLETE "print numbered set range mode" -# OBSOLETE -# OBSOLETE # powerset modes -# OBSOLETE test_print_accept "ptype pm1" \ -# OBSOLETE "POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \ -# OBSOLETE "print powerset mode 1" -# OBSOLETE test_print_accept "ptype pm2" "POWERSET byte \\(1:8\\)" \ -# OBSOLETE "print powerset mode 2" -# OBSOLETE test_print_accept "ptype pm3" "POWERSET int \\(-32768:32767\\)" \ -# OBSOLETE "print powerset mode 3" -# OBSOLETE test_print_accept "ptype pm4" "POWERSET long \\(-32768:32768\\)" \ -# OBSOLETE "print powerset mode 4" -# OBSOLETE test_print_accept "ptype pm5" \ -# OBSOLETE "POWERSET long \\(-2147483648:2147483647\\)" \ -# OBSOLETE "print powerset mode 5" -# OBSOLETE -# OBSOLETE # reference modes -# OBSOLETE test_print_accept "ptype ref1" "REF pm1" \ -# OBSOLETE "print reference to powerset mode" -# OBSOLETE test_print_accept "ptype ref2" "REF byte" \ -# OBSOLETE "print reference to byte" -# OBSOLETE test_print_accept "ptype ref3" "PTR" \ -# OBSOLETE "print free reference type" -# OBSOLETE -# OBSOLETE # procedure modes -# OBSOLETE # FIXME: we have to talk about this ... -# OBSOLETE test_print_accept "ptype prm1" \ -# OBSOLETE "REF PROC \[(\]\[)\]" \ -# OBSOLETE "print procedure mode 1" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype prm2" \ -# OBSOLETE "REF PROC \[(\]bool in, int out long inout\[)\] RETURNS \[(\]char\[)\]" \ -# OBSOLETE "print procedure mode 2" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype prm3" \ -# OBSOLETE "REF PROC \[(\]pm1, ref loc\[)\] RETURNS \[(\]ref3\[)\]" \ -# OBSOLETE "print procedure mode 3" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype prm4" \ -# OBSOLETE "\[(\] \[)\] EXCEPTIONS \[(\]ex1, ex2, ex3\[)\]" \ -# OBSOLETE "print procedure mode 4" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype prm5" \ -# OBSOLETE "REF PROC \[(\]r11, r16 inout, r5 out\[)\] RETURNS \[(\]r2\[)\] EXCEPTIONS \[(\]ex1\[)\]" \ -# OBSOLETE "print procedure mode 5" -# OBSOLETE -# OBSOLETE # synchronization modes -# OBSOLETE # FIXME: since gdb doesn't process events & buffers so far, this has be -# OBSOLETE # filled later... -# OBSOLETE xfail "synchronization mode handling" -# OBSOLETE -# OBSOLETE # timing modes -# OBSOLETE test_print_accept "ptype DURATION" "duration" -# OBSOLETE test_print_accept "ptype TIME" "time" -# OBSOLETE -# OBSOLETE # string modes -# OBSOLETE # some tests are done in chillvars.exp -# OBSOLETE test_print_accept "ptype strm1" "CHARS \\(5\\)" "print char string mode" -# OBSOLETE test_print_accept "ptype strm2" "CHARS \[(\]7\[)\] VARYING" \ -# OBSOLETE "print varying char string mode" -# OBSOLETE test_print_accept "ptype bstr1" "BOOLS \\(20\\)" "print bit string mode" -# OBSOLETE -# OBSOLETE test_print_accept "ptype B'000'" "BOOLS \\(3\\)" "bit string literal" -# OBSOLETE test_print_accept "ptype B'11110000'" "BOOLS \\(8\\)" "bit string literal" -# OBSOLETE # FIXME: adjust error message -# OBSOLETE gdb_test "ptype B'00110211'" {.*Too-large digit.*[.]} \ -# OBSOLETE "reject invalid bitstring" -# OBSOLETE -# OBSOLETE # array modes -# OBSOLETE # some tests are done in chillvars.exp -# OBSOLETE test_print_accept "ptype arr1m" "ARRAY \\(1:100\\) set1" \ -# OBSOLETE "print array mode 1" -# OBSOLETE test_print_accept "ptype arr2m" "ARRAY \\(1:100\\) ARRAY \\(1:100\\) set1"\ -# OBSOLETE "print array mode 2" -# OBSOLETE test_print_accept "ptype arr3m" "ARRAY \\(0:255\\) ARRAY \\(0:65535\\) ARRAY \\(-128:127\\) set1" \ -# OBSOLETE "print array mode 3" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype arr4m" "ARRAY \\(b:c\\) ARRAY \\(na = 1:na = 1\\) ARRAY \\(nc:nb\\) ARRAY \\(na = 1:nc = 20\\) POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \ -# OBSOLETE "print array mode 4" -# OBSOLETE -# OBSOLETE # structure modes -# OBSOLETE # some checks are in chillvars.exp -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype stru1m" "STRUCT \\(.*a long,.*b long,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\).*ELSE.*ch3 CHARS \\(1\\).*ESAC.*\\)" \ -# OBSOLETE "print structure mode 1" -# OBSOLETE #setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype stru2m" "STRUCT \\(.*f set1,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\) VARYING.*ELSE.*ch3 CHARS \\(0\\) VARYING.*ESAC.*\\)" \ -# OBSOLETE "print structure mode 2" -# OBSOLETE #setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype stru3m" "STRUCT \\(.*f r3,.*CASE OF.*:.*ch1 CHARS \\(20\\).*ESAC.*\\)" \ -# OBSOLETE "print structure mode 3" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype stru4m" "STRUCT \\(.*i long,.*CASE OF.*:.*i1 int,.*i11 int,.*b1 bool,.*c1 char.*:.*i2 long,.*i22 long,.*bs2 BOOLS \\(10\\).*:.*s3 STRUCT \\(.*i3 int,.*CASE OF.*:.*foo long.*ELSE.*bar char.*ESAC.*\\).*ELSE.*x stru2m.*ESAC,.*y stru3m.*\\)" \ -# OBSOLETE "print structure mode 4" -# OBSOLETE -# OBSOLETE -# OBSOLETE if $passcount then { -# OBSOLETE pass "$passcount correct modes printed" -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # various tests if locations are treated correctly -# OBSOLETE # read access using ptype, print, whatis -# OBSOLETE proc test_locations {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE set passcount 0 -# OBSOLETE verbose "testing read access to locations" -# OBSOLETE # various location tests can be found in chillvars.exp -# OBSOLETE -# OBSOLETE # set locations -# OBSOLETE test_print_accept "ptype s1l" "SET \\(aaa, bbb, ccc\\)" \ -# OBSOLETE "print mode of set location" -# OBSOLETE test_print_accept "whatis s1l" "set1" \ -# OBSOLETE "print modename of set location" -# OBSOLETE test_print_accept "print s1l" "ccc" "print set location" -# OBSOLETE test_print_accept "ptype s2l" "SET \\(na = 1, nb = 34, nc = 20\\)" \ -# OBSOLETE "print mode of numbered set location" -# OBSOLETE test_print_accept "whatis s2l" "nset1" \ -# OBSOLETE "print mode name of numbered set location" -# OBSOLETE test_print_accept "print s2l" "nb" "print numberes set location" -# OBSOLETE -# OBSOLETE # range modes -# OBSOLETE test_print_accept "ptype rl1" "ubyte \\(0:255\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl1" "r11" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl1" "3" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl2" "ubyte \\(0:255\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl2" "r11" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl2" "0" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl3" "ubyte \\(0:255\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl3" "r11" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl3" "255" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl5" "uint \\(0:65535\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl5" "r12" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl5" "65530" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl6" "uint \\(0:65535\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl6" "r12" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl6" "0" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl7" "uint \\(0:65535\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl7" "r12" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl7" "65535" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE # test_print_accept "ptype rl9" "ulong \\(0:4294967295\\)" \ -# OBSOLETE # "print mode of range location" -# OBSOLETE # test_print_accept "whatis rl9" "r13" \ -# OBSOLETE # "print mode name of range location" -# OBSOLETE # test_print_accept "print rl9" "128" \ -# OBSOLETE # "print range location" -# OBSOLETE -# OBSOLETE # test_print_accept "ptype rl10" "ulong \\(0:4294967295\\)" \ -# OBSOLETE # "print mode of range location" -# OBSOLETE # test_print_accept "whatis rl10" "r13" \ -# OBSOLETE # "print mode name of range location" -# OBSOLETE # test_print_accept "print rl10" "0" \ -# OBSOLETE # "print range location" -# OBSOLETE -# OBSOLETE # test_print_accept "ptype rl11" "ulong \\(0:4294967295\\)" \ -# OBSOLETE # "print mode of range location" -# OBSOLETE # test_print_accept "whatis rl11" "r13" \ -# OBSOLETE # "print mode name of range location" -# OBSOLETE # test_print_accept "print rl11" "4294967295" \ -# OBSOLETE # "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl13" "byte \\(-128:127\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl13" "r14" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl13" "-121" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl14" "byte \\(-128:127\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl14" "r14" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl14" "-128" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl15" "byte \\(-128:127\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl15" "r14" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl15" "127" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl17" "int \\(-32768:32767\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl17" "r15" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl17" "-32720" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl18" "int \\(-32768:32767\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl18" "r15" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl18" "-32768" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl19" "int \\(-32768:32767\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl19" "r15" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl19" "32767" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl21" "long \\(-2147483648:2147483647\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl21" "r16" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl21" "2147483643" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl22" "long \\(-2147483648:2147483647\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl22" "r16" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl22" "-2147483648" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype rl23" "long \\(-2147483648:2147483647\\)" \ -# OBSOLETE "print mode of range location" -# OBSOLETE test_print_accept "whatis rl23" "r16" \ -# OBSOLETE "print mode name of range location" -# OBSOLETE test_print_accept "print rl23" "2147483647" \ -# OBSOLETE "print range location" -# OBSOLETE -# OBSOLETE # powerset locations -# OBSOLETE test_print_accept "ptype pl1" \ -# OBSOLETE "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \ -# OBSOLETE "print mode of powerset location 1" -# OBSOLETE test_print_accept "whatis pl1" "pm1" \ -# OBSOLETE "print mode mode name of powerset location" -# OBSOLETE test_print_accept "print pl1" \ -# OBSOLETE "\[\[\]p1:p10\[\]\]" \ -# OBSOLETE "print powerset location 1" -# OBSOLETE test_print_accept "print pl2" {\[\]} \ -# OBSOLETE "print powerset location 2" -# OBSOLETE test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \ -# OBSOLETE "print powerset location 3" -# OBSOLETE test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \ -# OBSOLETE "print powerset location 4" -# OBSOLETE test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \ -# OBSOLETE "print powerset location 5" -# OBSOLETE test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \ -# OBSOLETE "print powerset location 6" -# OBSOLETE -# OBSOLETE test_print_accept "ptype pl7" \ -# OBSOLETE "POWERSET byte \\(1:8\\)" \ -# OBSOLETE "print mode of byte powerset location" -# OBSOLETE test_print_accept "whatis pl7" "pm2" \ -# OBSOLETE "print modename of byte powerset location" -# OBSOLETE test_print_accept "print pl7" {\[1:8\]} \ -# OBSOLETE "print powerset location 7" -# OBSOLETE -# OBSOLETE test_print_accept "ptype pl8" \ -# OBSOLETE "POWERSET int \\(-32768:32767\\)" \ -# OBSOLETE "print mode of int powerset location" -# OBSOLETE test_print_accept "whatis pl8" "pm3" \ -# OBSOLETE "print modename of int powerset location" -# OBSOLETE test_print_accept "print pl8" {\[-32768:32767\]} \ -# OBSOLETE "print powerset location 8" -# OBSOLETE -# OBSOLETE # test_print_accept "ptype pl9" \ -# OBSOLETE # "POWERSET long \\(-2147483648:2147483647\\)" \ -# OBSOLETE # "print mode of long powerset location" -# OBSOLETE # test_print_accept "whatis pl9" "pm5" \ -# OBSOLETE # "print modename of long powerset location" -# OBSOLETE # test_print_accept "print pl9" {\[-2147483648:2147483647\]} \ -# OBSOLETE # "print powerset location 9" -# OBSOLETE -# OBSOLETE # reference modes -# OBSOLETE test_print_accept "ptype ref3l" "PTR" "print mode of reference location" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "whatis ref3l" "ref3" \ -# OBSOLETE "print modename of reference location" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print ref3l" "ref3\\(H'.*\\)" \ -# OBSOLETE "print reference location" -# OBSOLETE test_print_accept "ptype ref4l" "PTR" "print mode of reference location" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "whatis ref4l" "ref4" \ -# OBSOLETE "print modename of reference location" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print ref4l" "ref4\\(H'.*\\)" \ -# OBSOLETE "print reference location" -# OBSOLETE test_print_accept "ptype ref5l" "PTR" "print mode of reference location" -# OBSOLETE test_print_accept "whatis ref5l" "PTR" \ -# OBSOLETE "print modename of reference location" -# OBSOLETE test_print_accept "print ref5l" "PTR\\(H'.*\\)" \ -# OBSOLETE "print reference location" -# OBSOLETE -# OBSOLETE # dereference a little bit.. -# OBSOLETE test_print_accept "print ref6l->syn_int" "42" \ -# OBSOLETE "dereference reference to synmode location" -# OBSOLETE test_print_accept "print ref7l->int" "-42" \ -# OBSOLETE "dereference reference to predefined mode location" -# OBSOLETE test_print_accept "print ref8l->pm1" \ -# OBSOLETE "\[\[\]p1:p10\[\]\]" \ -# OBSOLETE "dereference reference to newmode location" -# OBSOLETE -# OBSOLETE # synchronization mode locations -# OBSOLETE # FIXME: synchronization modes are not supported so far... -# OBSOLETE xfail "no synchronization mode location support, not implemented yet" -# OBSOLETE -# OBSOLETE # timing mode locations -# OBSOLETE # FIXME: callbacks to abstime, inttime not implemented -# OBSOLETE xfail "timing modes not implemented properly yet" -# OBSOLETE -# OBSOLETE # char string locations -# OBSOLETE # some tests are don in chillvars.exp -# OBSOLETE test_print_accept "ptype strl1" \ -# OBSOLETE "CHARS \\(7\\) VARYING" \ -# OBSOLETE "print varying string location" -# OBSOLETE test_print_accept "whatis strl1" "strm2" \ -# OBSOLETE "print string locationa mode name" -# OBSOLETE test_print_accept "print strl1" \ -# OBSOLETE {\"hansi\^\(0\)\"} \ -# OBSOLETE "print string location" -# OBSOLETE # string elements -# OBSOLETE test_print_accept "print strl1(0)" "\'h\'" \ -# OBSOLETE "print string element 1" -# OBSOLETE test_print_accept "print strl1(5)" {'\^[(]0[)]'} \ -# OBSOLETE "print string element 2" -# OBSOLETE test_print_accept "print strl1(3)" "\'s\'" \ -# OBSOLETE "print string element 3" -# OBSOLETE test_print_accept "ptype strl1(0)" "char" \ -# OBSOLETE "print mode of string element" -# OBSOLETE # slices -# OBSOLETE test_print_accept "print strl1(3:4)" "\"si\"" \ -# OBSOLETE "print string slice 1" -# OBSOLETE test_print_accept "print strl1(0:5)" \ -# OBSOLETE {\"hansi\^\(0\)\"} \ -# OBSOLETE "print string slice 2" -# OBSOLETE test_print_accept "print strl1(0:0)" "\"h\"" \ -# OBSOLETE "print string slice 3" -# OBSOLETE test_print_accept "print strl1(0 up 6)" \ -# OBSOLETE {\"hansi\^\(0\)\"} \ -# OBSOLETE "print string slice 4" -# OBSOLETE # FIXME: adjust error message, when implented -# OBSOLETE gdb_test "print strl1(6 up 1)" \ -# OBSOLETE ".*slice.*out of range.*" \ -# OBSOLETE "print invalid string slice length" -# OBSOLETE gdb_test "print strl1(-1 up 5)" \ -# OBSOLETE ".*slice.*out of range.*" \ -# OBSOLETE "print invalid string slice length" -# OBSOLETE gdb_test "print strl1(-1:5)" \ -# OBSOLETE ".*slice.*out of range.*" \ -# OBSOLETE "print invalid string slice" -# OBSOLETE gdb_test "print strl1(-1:7)" \ -# OBSOLETE ".*slice.*out of range.*" \ -# OBSOLETE "print invalid string slice" -# OBSOLETE gdb_test "print strl1(0 up -1)" \ -# OBSOLETE ".*slice.*out of range.*" \ -# OBSOLETE "print invalid string slice length" -# OBSOLETE gdb_test "print strl1(0 up 0)" {""} -# OBSOLETE -# OBSOLETE # bitstring locations -# OBSOLETE test_print_accept "ptype bstr1" \ -# OBSOLETE "BOOLS \\(20\\)" \ -# OBSOLETE "print mode of bitstring location" -# OBSOLETE test_print_accept "whatis bstrl1" "bstr1" \ -# OBSOLETE "print mode name of bitstring location" -# OBSOLETE test_print_accept "print bstrl1" \ -# OBSOLETE "B'10101010101010101010'" \ -# OBSOLETE "print bitstring location" -# OBSOLETE -# OBSOLETE test_print_accept "ptype bstrl1(0)" "bool|BOOL" \ -# OBSOLETE "print mode of bitstring element" -# OBSOLETE test_print_accept "print bstrl1(0)" "TRUE" \ -# OBSOLETE "print bitstring element 1" -# OBSOLETE test_print_accept "print bstrl1(19)" "FALSE" \ -# OBSOLETE "print bitstring element 2" -# OBSOLETE test_print_accept "print bstrl1(10)" "TRUE" \ -# OBSOLETE "print bitstring element 3" -# OBSOLETE -# OBSOLETE test_print_accept "print bstrl1(0:19)" \ -# OBSOLETE "B'10101010101010101010'" \ -# OBSOLETE "print bitstring location slice 1" -# OBSOLETE test_print_accept "print bstrl1(0:0)" \ -# OBSOLETE "B'1'" \ -# OBSOLETE "print bitstring location slice 2" -# OBSOLETE test_print_accept "print bstrl1(3:9)" \ -# OBSOLETE "B'0101010'" \ -# OBSOLETE "print bitstring location slice 3" -# OBSOLETE test_print_accept "print bstrl1(0 up 20)" \ -# OBSOLETE "B'10101010101010101010'" \ -# OBSOLETE "print bitstring location slice 4" -# OBSOLETE test_print_accept "print bstrl1(19 up 1)" \ -# OBSOLETE "B'0'" \ -# OBSOLETE "print bitstring location slice 5" -# OBSOLETE gdb_test "print bstrl1(20 up 1)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "print invalid bitstring slice (20 up 1)" -# OBSOLETE gdb_test "print bstrl1(-4:5)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "print invalid bitstring slice (-4:5)" -# OBSOLETE gdb_test "print bstrl1(-1:up 1)" \ -# OBSOLETE ".*invalid expression syntax.*" \ -# OBSOLETE "print invalid bitstring slice (-1:ip 1)" -# OBSOLETE gdb_test "print bstrl1(-1:20)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "print invalid bitstring slice (-1:20)" -# OBSOLETE gdb_test "print bstrl1(0 up -1)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "print invalid bitstring slice (0 up -1)" -# OBSOLETE test_print_accept "print bstrl1(4 up 0)" "B''" -# OBSOLETE -# OBSOLETE # array mode locations -# OBSOLETE gdb_test_exact "ptype arrl1" \ -# OBSOLETE "ARRAY (1:100) set1" \ -# OBSOLETE "print mode of array location" -# OBSOLETE gdb_test "whatis arrl1" "arr1m" \ -# OBSOLETE "print mode name of array location" -# OBSOLETE gdb_test_exact "print arrl1" {[(1:100): aaa]} \ -# OBSOLETE "print array location" -# OBSOLETE test_print_accept "ptype arrl1(1)" \ -# OBSOLETE "SET \\(aaa, bbb, ccc\\)" \ -# OBSOLETE "print mode of array element" -# OBSOLETE gdb_test_exact "print arrl3" \ -# OBSOLETE {[(1:5): [(1:3): [(1:2): -2147483648]]]} \ -# OBSOLETE "print array location 2" -# OBSOLETE gdb_test_exact "print arrl3(1)" \ -# OBSOLETE {[(1:3): [(1:2): -2147483648]]} \ -# OBSOLETE "print array location 3" -# OBSOLETE gdb_test_exact "ptype arrl3(1)" \ -# OBSOLETE {ARRAY (1:3) ARRAY (1:2) long} \ -# OBSOLETE "print mode of array element" -# OBSOLETE test_print_accept "print arrl3(5)" \ -# OBSOLETE {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \ -# OBSOLETE "print array location 4" -# OBSOLETE test_print_accept "print arrl3(1,1)" \ -# OBSOLETE {\[\(1:2\): -2147483648\]} \ -# OBSOLETE "print array location 5" -# OBSOLETE test_print_accept "ptype arrl3(1,1)" \ -# OBSOLETE {ARRAY \(1:2\) long} \ -# OBSOLETE "print mode of array element" -# OBSOLETE test_print_accept "print arrl3(5,3)" \ -# OBSOLETE {\[\(1:2\): -2147483648\]} \ -# OBSOLETE "print array location 6" -# OBSOLETE test_print_accept "print arrl3(1,1,1)" \ -# OBSOLETE "-2147483648" \ -# OBSOLETE "print array location 7" -# OBSOLETE test_print_accept "print arrl3(5,3,2)" \ -# OBSOLETE "-2147483648" \ -# OBSOLETE "print array location 8" -# OBSOLETE test_print_accept "print arrl3(1)(3)(2)" \ -# OBSOLETE "-2147483648" \ -# OBSOLETE "print array location 9" -# OBSOLETE -# OBSOLETE # reject the following range fails -# OBSOLETE # FIXME: adjust error messages -# OBSOLETE gdb_test "print arrl3(-1)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 1" -# OBSOLETE gdb_test "print arrl3(6)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 2" -# OBSOLETE gdb_test "print arrl3(0,0)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 3" -# OBSOLETE gdb_test "print arrl3(1,0)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 4" -# OBSOLETE gdb_test "print arrl3(1,4)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 5" -# OBSOLETE gdb_test "print arrl3(6,4)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 6" -# OBSOLETE gdb_test "print arrl3(1,1,0)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 7" -# OBSOLETE gdb_test "print arrl3(6,4,0)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 8" -# OBSOLETE gdb_test "print arrl3(1,1,3)" \ -# OBSOLETE ".*out of range.*" \ -# OBSOLETE "check invalid array indices 9" -# OBSOLETE -# OBSOLETE gdb_test "print arrl3(0)(0)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 10" -# OBSOLETE gdb_test "print arrl3(1)(0)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 11" -# OBSOLETE gdb_test "print arrl3(1)(4)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 12" -# OBSOLETE gdb_test "print arrl3(6)(4)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 13" -# OBSOLETE gdb_test "print arrl3(1)(1)(0)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 14" -# OBSOLETE gdb_test "print arrl3(6)(4)(0)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 15" -# OBSOLETE gdb_test "print arrl3(1)(1)(3)" \ -# OBSOLETE ".* array or string index out of range.*" \ -# OBSOLETE "check invalid array indices 16" -# OBSOLETE -# OBSOLETE # slices -# OBSOLETE test_print_accept "print arrl4(1:3)" \ -# OBSOLETE {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \ -# OBSOLETE "print array slice 1" -# OBSOLETE test_print_accept "ptype arrl4(1:3)" \ -# OBSOLETE {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \ -# OBSOLETE "print mode of array slice" -# OBSOLETE # The next one is bogus: -# OBSOLETE # test_print_accept "print arrl4(5, 2:3, 1)" \ -# OBSOLETE # # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \ -# OBSOLETE # {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \ -# OBSOLETE # "print array slice 2" -# OBSOLETE test_print_accept "print arrl4(1 up 4)" \ -# OBSOLETE {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \ -# OBSOLETE "print array slice 3" -# OBSOLETE # The next two are bogus: -# OBSOLETE # test_print_accept "print arrl4(3, 2 up 1)" \ -# OBSOLETE # {\[\(2:3\): \[\(1:2\): 100\]\]} \ -# OBSOLETE # "print array slice 4" -# OBSOLETE # test_print_accept "print arrl4(1:2, 1 up 1, 2)" \ -# OBSOLETE # {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \ -# OBSOLETE # "print array slice 4" -# OBSOLETE # reject invalid slices -# OBSOLETE # FIXME: adjust error messages -# OBSOLETE gdb_test "print arrl4(5:6)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 1" -# OBSOLETE gdb_test "print arrl4(0:1)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 2" -# OBSOLETE gdb_test "print arrl4(0:6)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 3" -# OBSOLETE gdb_test "print arrl4(3:2)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 4" -# OBSOLETE gdb_test "print arrl4(1,3:4)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 5" -# OBSOLETE gdb_test "print arrl4(1,0:1)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 6" -# OBSOLETE gdb_test "print arrl4(1,0:4)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 7" -# OBSOLETE gdb_test "print arrl4(1,3:2)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 8" -# OBSOLETE gdb_test "print arrl4(5 up 2)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 9" -# OBSOLETE gdb_test "print arrl4(-1 up 1)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 10" -# OBSOLETE gdb_test "print arrl4(-1 up 7)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 11" -# OBSOLETE gdb_test "print arrl4(1 up 0)" \ -# OBSOLETE ".*slice out of range.*" \ -# OBSOLETE "check invalid range 12" -# OBSOLETE gdb_test "print arrl4(1,3 up 1)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 13" -# OBSOLETE gdb_test "print arrl4(1,-1 up 1)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 14" -# OBSOLETE gdb_test "print arrl4(1,-1 up 5)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 15" -# OBSOLETE gdb_test "print arrl4(1,2 up 0)" \ -# OBSOLETE ".*syntax error.*" \ -# OBSOLETE "check invalid range 16" -# OBSOLETE -# OBSOLETE # structure modes -# OBSOLETE # some tests are in chillvars.exp -# OBSOLETE # FIXME: no tag processing implemented do maybe adjust these tests -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "ptype stru1m" \ -# OBSOLETE "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \ -# OBSOLETE "print mode of structure location 1" -# OBSOLETE test_print_accept "whatis strul1" "stru1m" \ -# OBSOLETE "print mode name of structure location 1" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print strul1" \ -# OBSOLETE {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \ -# OBSOLETE "print structure location 1" -# OBSOLETE test_print_accept "print strul1.a" \ -# OBSOLETE "-2147483648" \ -# OBSOLETE "print field of structure location 1" -# OBSOLETE test_print_accept "print strul1.b" "42" \ -# OBSOLETE "print field of structure location 1" -# OBSOLETE test_print_accept "print strul1.ch1" \ -# OBSOLETE "\"12345678900987654321\"" \ -# OBSOLETE "print field of structure location 1" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print strul1.ch2" \ -# OBSOLETE "\"1234567890\"" \ -# OBSOLETE "print field of structure location 1" -# OBSOLETE # setup_xfail "*-*-*" -# OBSOLETE test_print_accept "print strul1.ch3" \ -# OBSOLETE "\"1\"" \ -# OBSOLETE "print field of structure location 1" -# OBSOLETE -# OBSOLETE if $passcount then { -# OBSOLETE pass "$passcount correct locations printed" -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # This is chill/9434 -# OBSOLETE -# OBSOLETE proc test_9434 {} { -# OBSOLETE global passcount -# OBSOLETE -# OBSOLETE verbose "testing pr-9434" -# OBSOLETE -# OBSOLETE test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE test_modes -# OBSOLETE test_locations -# OBSOLETE test_9434 -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/tests2.ch b/gdb/testsuite/gdb.chill/tests2.ch deleted file mode 100644 index cf29866..0000000 --- a/gdb/testsuite/gdb.chill/tests2.ch +++ /dev/null @@ -1,193 +0,0 @@ --- Copyright 1992, 1995 Free Software Foundation, Inc. - --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - --- Please email any bugs, comments, and/or additions to this file to: --- bug-gdb@prep.ai.mit.edu - --- --- test program 2 (refer to tests2.exp) --- - -tests2: module; - --- testpattern -syn pat1 ulong = H'aaaaaaaa; -syn pat2 ulong = H'55555555; - --- discrete modes -newmode bytem = struct ( - p1 ulong, - m byte, - p2 ulong); -newmode ubytem = struct ( - p1 ulong, - m ubyte, - p2 ulong); -newmode intm = struct ( - p1 ulong, - m int, - p2 ulong); -newmode uintm = struct ( - p1 ulong, - m uint, - p2 ulong); -newmode longm = struct ( - p1 ulong, - m long, - p2 ulong); -newmode ulongm = struct ( - p1 ulong, - m ulong, - p2 ulong); -newmode boolm = struct ( - p1 ulong, - m bool, - p2 ulong); -newmode charm1 = struct ( - p1 ulong, - m char(4), - p2 ulong); -newmode charm2 = struct ( - p1 ulong, - m char(7), - p2 ulong); -newmode charm3 = struct ( - p1 ulong, - m char(8) varying, - p2 ulong); -newmode charm4 = struct ( - p1 ulong, - m char, - p2 ulong); -newmode bitm1 = struct ( - p1 ulong, - m bit(8), - p2 ulong); -newmode bitm2 = struct ( - p1 ulong, - m bit(10), - p2 ulong); -newmode setm1 = struct ( - p1 ulong, - m set (a, b, c, d, e, f, g, h), - p2 ulong); -newmode nset1 = struct ( - p1 ulong, - m set (na = 2147483648, nb = 1024, nc = 4294967295), - p2 ulong); -newmode rm1 = struct ( - p1 ulong, - m range (lower(byte):upper(byte)), - p2 ulong); -newmode rm2 = struct ( - p1 ulong, - m range (lower(int):upper(int)), - p2 ulong); -newmode rm3 = struct ( - p1 ulong, - m range (lower(long):upper(long)), - p2 ulong); -newmode pm1 = struct ( - p1 ulong, - m powerset set (pa, pb, pc, pd, pe, pf, pg, ph), - p2 ulong); -newmode pm2 = struct ( - p1 ulong, - m powerset int (1:32), - p2 ulong); --- this should be rejected by the gnuchill compiler ! -newmode pm3 = struct ( - p1 ulong, --- m powerset long (lower(long): upper(long)), - p2 ulong); -newmode refm1 = struct ( - p1 ulong, - m ptr, - p2 ulong); -newmode refm2 = struct ( - p1 ulong, - m ref bytem, - p2 ulong); -newmode prm1 = struct ( - p1 ulong, - m proc (), - p2 ulong); -newmode tim1 = struct ( - p1 ulong, - m time, - p2 ulong); -newmode tim2 = struct ( - p1 ulong, - m duration, - p2 ulong); -newmode rem1 = struct ( - p1 ulong, - m real, - p2 ulong); -newmode rem2 = struct ( - p1 ulong, - m long_real, - p2 ulong); -newmode arrm1 = struct ( - p1 ulong, - m array(1:3, 1:2) int, - p2 ulong); -newmode strum1 = struct ( - p1 ulong, - m struct (a, b int, ch char(4)), - p2 ulong); - - --- dummyfunction for breakpoints -dummyfunc: proc(); -end dummyfunc; - - -dcl b1 bytem init := [pat1, -128, pat2]; -dcl ub1 ubytem init := [pat1, 0, pat2]; -dcl i1 intm init := [pat1, -32768, pat2]; -dcl ui1 uintm init := [pat1, 0, pat2]; -dcl l1 longm init := [pat1, -2147483648, pat2]; -dcl ul1 ulongm init := [pat1, 0, pat2]; -dcl bo1 boolm init := [pat1, true, pat2]; -dcl c1 charm1 init := [pat1, "1234", pat2]; -dcl c2 charm2 init := [pat1, "1234567", pat2]; -dcl c3 charm3 init := [pat1, "12345678", pat2]; -dcl c4 charm4 init := [pat1, C'00', pat2]; -dcl bi1 bitm1 init := [pat1, B'01011010', pat2]; -dcl bi2 bitm2 init := [pat1, B'1010110101', pat2]; -dcl se1 setm1 init := [pat1, a, pat2]; -dcl nse1 nset1 init := [pat1, na, pat2]; -dcl r1 rm1 init := [pat1, -128, pat2]; -dcl r2 rm2 init := [pat1, -32768, pat2]; -dcl r3 rm3 init := [pat1, -2147483648, pat2]; -dcl p1 pm1 init := [pat1, [pa], pat2]; -dcl p2 pm2 init := [pat1, [1], pat2]; --- dcl p3 pm3 init := [pat1, [-1], pat2]; -- FIXME: bug in gnuchill -dcl ref1 refm1 init := [pat1, null, pat2]; -dcl ref2 refm2 init := [pat1, null, pat2]; -dcl pr1 prm1; -dcl ti1 tim1 init := [pat1, 0, pat2]; -dcl ti2 tim2 init := [pat1, 0, pat2]; -dcl re1 rem1 init := [pat1, 0.0, pat2]; -dcl re2 rem2 init := [pat1, 0.0, pat2]; -dcl arrl1 arrm1 init:=[pat1, [(1:3): [0,0]], pat2]; -dcl strul1 strum1 init := [pat1, [.a: 0, .b: 0, .ch: "0000"], pat2]; - -pr1 := [pat1, dummyfunc, pat2]; -dummyfunc(); - -end tests2; diff --git a/gdb/testsuite/gdb.chill/tests2.exp b/gdb/testsuite/gdb.chill/tests2.exp deleted file mode 100644 index a8df589..0000000 --- a/gdb/testsuite/gdb.chill/tests2.exp +++ /dev/null @@ -1,271 +0,0 @@ -# OBSOLETE # Copyright 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Set the current language to chill. This counts as a test. If it -# OBSOLETE # fails, then we skip the other tests. -# OBSOLETE -# OBSOLETE set testfile "tests2" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE global infinity -# OBSOLETE if [istarget "i*86-*-sysv4*"] then { -# OBSOLETE set infinity "inf" -# OBSOLETE } else { -# OBSOLETE set infinity "Infinity" -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc set_lang_chill {} { -# OBSOLETE global gdb_prompt -# OBSOLETE global binfile objdir subdir -# OBSOLETE -# OBSOLETE if ![file exists $objdir/$subdir/$binfile] then { -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE verbose "loading file '$objdir/$subdir/$binfile'" -# OBSOLETE gdb_load $objdir/$subdir/$binfile -# OBSOLETE -# OBSOLETE send_gdb "set language chill\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" {} -# OBSOLETE timeout { fail "set language chill (timeout)" ; return 0 } -# OBSOLETE } -# OBSOLETE -# OBSOLETE send_gdb "show language\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".* source language is \"chill\".*$gdb_prompt $" { -# OBSOLETE pass "set language to \"chill\"" -# OBSOLETE send_gdb "break dummyfunc\n" -# OBSOLETE gdb_expect { -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE send_gdb "run\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE return 1 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't set breakpoint (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -re ".*$gdb_prompt $" { -# OBSOLETE fail "setting language to \"chill\"" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE timeout { -# OBSOLETE fail "can't show language (timeout)" -# OBSOLETE return 0 -# OBSOLETE } -# OBSOLETE } -# OBSOLETE } -# OBSOLETE -# OBSOLETE # checks if structure was accessed correctly -# OBSOLETE proc test_write { args } { -# OBSOLETE global gdb_prompt -# OBSOLETE -# OBSOLETE if [llength $args]==5 then { -# OBSOLETE set message [lindex $args 4] -# OBSOLETE set extended [lindex $args 3] -# OBSOLETE set matchval [lindex $args 2] -# OBSOLETE } elseif [llength $args]==4 then { -# OBSOLETE set message [lindex $args 3] -# OBSOLETE set matchval [lindex $args 2] -# OBSOLETE set extended "" -# OBSOLETE } elseif [llength $args]==3 then { -# OBSOLETE set message [lindex $args 2] -# OBSOLETE set extended "" -# OBSOLETE } else { -# OBSOLETE warning "test ($args) write called with wrong number of arguments" -# OBSOLETE return -# OBSOLETE } -# OBSOLETE -# OBSOLETE set location [lindex $args 0] -# OBSOLETE set value [lindex $args 1] -# OBSOLETE if ![info exists matchval] then { -# OBSOLETE set matchval $value -# OBSOLETE } -# OBSOLETE verbose "loc: $location, val: $value, msg: $message, ext: $extended, match: $matchval" -# OBSOLETE -# OBSOLETE verbose "setting var $value..." -# OBSOLETE send_gdb "set var $location.m$extended := $value\n" -# OBSOLETE gdb_expect -re ".*$gdb_prompt $" {} -# OBSOLETE gdb_test "print $location" \ -# OBSOLETE ".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\ -# OBSOLETE "$message" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # test write access from gdb (setvar x:=y) from gdb -# OBSOLETE proc write_access { } { -# OBSOLETE global infinity -# OBSOLETE -# OBSOLETE verbose "testing write access to locations" -# OBSOLETE -# OBSOLETE # discrete modes -# OBSOLETE test_write b1 127 "byte write 1" -# OBSOLETE test_write b1 -128 "byte write 2" -# OBSOLETE test_write b1 0 "byte write 3" -# OBSOLETE test_write ub1 255 "ubyte write 1" -# OBSOLETE test_write ub1 0 "ubyte write 2" -# OBSOLETE test_write ub1 42 "ubyte write 3" -# OBSOLETE test_write i1 32767 "int write 1" -# OBSOLETE test_write i1 -32768 "int write 2" -# OBSOLETE test_write i1 0 "int write 3" -# OBSOLETE test_write ui1 65535 "uint write 1" -# OBSOLETE test_write ui1 0 "uint write 2" -# OBSOLETE test_write ui1 123 "uint write 3" -# OBSOLETE test_write l1 2147483647 "long write 1" -# OBSOLETE test_write l1 -2147483648 "long write 2" -# OBSOLETE test_write l1 0 "long write 3" -# OBSOLETE test_write ul1 4294967295 "ulong write 1" -# OBSOLETE test_write ul1 0 "ulong write 2" -# OBSOLETE test_write ul1 1000000 "ulong write 3" -# OBSOLETE test_write bo1 FALSE "bool write 1" -# OBSOLETE test_write bo1 TRUE "bool write 2" -# OBSOLETE test_write c1 \"1234\" "char write 1" -# OBSOLETE test_write c2 \"1234567\" "char write 2" -# OBSOLETE test_write c3 \"654321\" "char write 3" -# OBSOLETE test_write c4 C'65' 'e' "char write 4" -# OBSOLETE test_write bi1 B'10100101' "bitstring write 1" -# OBSOLETE test_write bi2 B'0101001010' "bitstring write 2" -# OBSOLETE test_write se1 a "set write 1" -# OBSOLETE test_write se1 h "set write 2" -# OBSOLETE # The following two use numbered sets with too-large values. -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_write nse1 nb "numbered set write 1" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE test_write nse1 nc "numbered set write 2" -# OBSOLETE test_write r1 127 "range write 1" -# OBSOLETE test_write r2 32767 "range write 2" -# OBSOLETE test_write r3 2147483647 "range write 3" -# OBSOLETE -# OBSOLETE # powerset modes -# OBSOLETE test_write p1 {[pa:ph]} {\[pa:ph\]} "powerset write 1" -# OBSOLETE test_write p1 {[pa, pc:pf, ph]} {\[pa, pc:pf, ph\]} "powerset write 2" -# OBSOLETE test_write p1 {[pa, pc, pe, pg]} {\[pa, pc, pe, pg\]} "powerset write 3" -# OBSOLETE test_write p1 {[]} {\[\]} "powerset write 4" -# OBSOLETE test_write p2 {[1:32]} {\[1:32\]} "powerset write 5" -# OBSOLETE test_write p2 {[1, 3:30, 32]} {\[1, 3:30, 32\]} "powerset write 6" -# OBSOLETE test_write p2 {[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]} {\[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31\]} \ -# OBSOLETE "powerset write 7" -# OBSOLETE test_write p2 {[]} {\[\]} "powerset write 8" -# OBSOLETE -# OBSOLETE # Fixme: this should be rejected by gnuchill -# OBSOLETE # test_write p3 {[-2147483648:2147483647]} {\[-2147483648:2147483647\]} \ -# OBSOLETE # "powerset write 9" -# OBSOLETE # test_write p3 {[-2147483648, -1000000:1000000, 2147483647]} \ -# OBSOLETE # {\[-2147483648, -1000000:1000000, 2147483647\]} \ -# OBSOLETE # "powerset write 10" -# OBSOLETE # test_write p3 {[-99, -97, -95, 1001, 1003, 1005]} \ -# OBSOLETE # {\[-99, -97, -95, 1001, 1003, 1005\]} "powerset write 11" -# OBSOLETE # test_write p3 {[]} {\[\]} "powerset write 12" -# OBSOLETE -# OBSOLETE # reference modes -# OBSOLETE test_write ref1 ->ref1 {H'[0-9a-fA-F]+} "reference write 1" -# OBSOLETE test_write ref2 ->b1 {H'[0-9a-fA-F]+} "reference write 2" -# OBSOLETE test_write ref1 NULL "reference write 3" -# OBSOLETE test_write ref2 NULL "reference write 4" -# OBSOLETE -# OBSOLETE # procedure modes -# OBSOLETE test_write pr1 NULL "procefure write 1" -# OBSOLETE # FIXME: remove when NULL is understood -# OBSOLETE test_write pr1 0 NULL "procefure write 2" -# OBSOLETE test_write pr1 dummyfunc {H'[0-9a-fA-F]+ } "procedure write 3" -# OBSOLETE -# OBSOLETE # timing modes, FIXME when callbacks to timefunctions are implemented -# OBSOLETE #test_write ti1 abstime(1970, 3, 12, 10, 43, 0) {} "time write 1" -# OBSOLETE #test_write ti2 -# OBSOLETE xfail "timing modes not implemented yet" -# OBSOLETE -# OBSOLETE # real modes -# OBSOLETE # This ones -# OBSOLETE test_write re1 42.03 {42.0[0-9]*} "real write 1" -# OBSOLETE test_write re1 0 "real write 2" -# OBSOLETE test_write re1 "1e+38" {1e\+38|1\.0[0-9]*e\+38|9\.9[0-9]*e\+37} \ -# OBSOLETE "real write 3" -# OBSOLETE setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*" -# OBSOLETE test_write re1 "1e+39" $infinity "real write 4" -# OBSOLETE test_write re2 42.03 {42.0[0-9]*} "real write 5" -# OBSOLETE test_write re2 0 "real write 6" -# OBSOLETE test_write re2 "1e+308" {1e\+308} "real write 7" -# OBSOLETE setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*" -# OBSOLETE test_write re2 "1e+309" $infinity "real write 8" -# OBSOLETE # array modes -# OBSOLETE test_write arrl1 {[(1:3): [(1:2): -128]]} {\[\(1:3\): \[\(1:2\): -128\]\]}\ -# OBSOLETE "array write 1" -# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\ -# OBSOLETE "array write 2" -# OBSOLETE test_write arrl1 {[(1): [(1:2): 127], (2): [(1:2): -128], (3): [(1:2): 127]]} {\[\(1\): \[\(1:2\): 127\], \(2\): \[\(1:2\): -128\], \(3\): \[\(1:2\): 127\]\]}\ -# OBSOLETE "array write 3" -# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\ -# OBSOLETE "array write 4" -# OBSOLETE setup_xfail "*-*-*" -# OBSOLETE # Bogus test case - type mismatch? -# OBSOLETE test_write arrl1 {[(1): 127, (2): -128]} "array write 5" -# OBSOLETE test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\ -# OBSOLETE "array write 6" -# OBSOLETE -# OBSOLETE # structure modes -# OBSOLETE test_write strul1 {[.a: -32768, .b: 32767, .ch: "ZZZZ"]} \ -# OBSOLETE {\[\.a: -32768, \.b: 32767, \.ch: \"ZZZZ\"\]} \ -# OBSOLETE "structure write 1" -# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \ -# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \ -# OBSOLETE "structure write 2" -# OBSOLETE test_write strul1 -32768 {\[\.a: -32768, \.b: 0, \.ch: \"0000\"\]} \ -# OBSOLETE {.a} "structure write 3" -# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \ -# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \ -# OBSOLETE "structure write 4" -# OBSOLETE test_write strul1 -32768 {\[\.a: 0, \.b: -32768, \.ch: \"0000\"\]} \ -# OBSOLETE {.b} "structure write 5" -# OBSOLETE test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \ -# OBSOLETE {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \ -# OBSOLETE "structure write 6" -# OBSOLETE test_write strul1 \"HUGO\" {\[\.a: 0, \.b: 0, \.ch: \"HUGO\"\]} \ -# OBSOLETE {.ch} "structure write 7" -# OBSOLETE } -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE set binfile "tests2.exe" -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE -# OBSOLETE gdb_test "set print sevenbit-strings" ".*" -# OBSOLETE -# OBSOLETE if [set_lang_chill] then { -# OBSOLETE write_access -# OBSOLETE } else { -# OBSOLETE warning "$test_name tests suppressed." -# OBSOLETE } diff --git a/gdb/testsuite/gdb.chill/tuples.ch b/gdb/testsuite/gdb.chill/tuples.ch deleted file mode 100644 index 24709f8..0000000 --- a/gdb/testsuite/gdb.chill/tuples.ch +++ /dev/null @@ -1,86 +0,0 @@ -x: MODULE - -SYNMODE m_arri = ARRAY(1:5) INT; -DCL v_arri m_arri := [ -1, -2, -3, -4, -5 ]; - -SYNMODE m_arrui = ARRAY(1:5) UINT; -DCL v_arrui m_arrui := [ 1, 2, 3, 4, 5 ]; - -SYNMODE r1 = RANGE (1:5); -SYNMODE m_arrb = ARRAY(r1) BYTE; -DCL v_arrb m_arrb := [ -3, -4, -5, -6, -7 ]; - -SYNMODE m_arrub = ARRAY(r1) UBYTE; -DCL v_arrub m_arrub := [ 3, 4, 5, 6, 7 ]; - -SYNMODE m_arrc = ARRAY (1:5) CHAR; -DCL v_arrc m_arrc := [ '1', '2', '3', '4', '5' ]; - -SYNMODE m_ps = POWERSET r1; -DCL v_ps m_ps := [ 1, 3, 5 ]; - -DCL v_cv CHARS(20) VARYING := "foo"; - -SYNMODE m_arrbool = ARRAY(r1) BOOL; -DCL v_arrbool m_arrbool := [ true, false, true, false, true ]; - -DCL j r1 := 4; - -DCL i INT; - -newmode vstruct = struct (a, b long, - case b of - (42): ch8 chars(20), - (52): i long - else ch1 char - esac); - -DCL vstr vstruct := [ .a: 10, .b: 52, .i: 100 ]; - -i := 0; - -END x; - -setmode: MODULE /* This is from Cygnus PR chill/5024. */ - -NEWMODE day = SET( monday, tuesday, wednesday, thursday, friday, saturday, sunday ); -NEWMODE dow = POWERSET day; - -DCL d day; -DCL w dow; - -printdow: PROC( w dow ); - DCL d day; - DO FOR d in w; - WRITETEXT( stdout, "%C ", d ); - OD; -END; - -d := monday; -w := dow[monday : friday]; -printdow( w ); - -printdow( dow[LOWER(dow) : UPPER(dow)] ); - -END setmode; - -PR8643: MODULE - -SYNMODE m_set = SET (a, b, c, d); -SYNMODE m_ps = POWERSET m_set; - -SYNMODE m_s1 = STRUCT (str CHARS(40) VARYING, i INT, ps m_ps); -DCL vs1 m_s1; - -SYNMODE m_s2 = STRUCT (i LONG, s m_s1); -DCL vs2 m_s2; - -SYNMODE m_arr = ARRAY (1:3) BYTE; -SYNMODE m_s3 = STRUCT (i LONG, a m_arr); -DCL vs3 m_s3; - -DCL i LONG; - -i := 24; - -END PR8643; diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp deleted file mode 100644 index ba08539..0000000 --- a/gdb/testsuite/gdb.chill/tuples.exp +++ /dev/null @@ -1,161 +0,0 @@ -# OBSOLETE # Copyright 1995, 1996 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile "tuples" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE runto tuples.ch:40 -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]} -# OBSOLETE gdb_test_exact "set v_arri := \[ 33, 44, 55, 66, 77 \]" {} -# OBSOLETE gdb_test_exact "print v_arri" {= [(1): 33, (2): 44, (3): 55, (4): 66, (5): 77]} "after assignment 1 to v_arri" -# OBSOLETE gdb_test_exact "set v_arri := \[-33, -44, -55, -66, -77\]" {} -# OBSOLETE gdb_test_exact "print v_arri" {= [(1): -33, (2): -44, (3): -55, (4): -66, (5): -77]} {after assignment 2 to v_arri} -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arrui" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]} -# OBSOLETE gdb_test_exact "set v_arrui := \[ 11, 11, 11, 11, 11 \]" {} -# OBSOLETE gdb_test_exact "print v_arrui" {= [(1:5): 11]} "after assignment to v_arrui" -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arrb" {= [(1): -3, (2): -4, (3): -5, (4): -6, (5): -7]} -# OBSOLETE -# OBSOLETE gdb_test_exact "set v_arrb := \[ -9, -8, -7, -6, -5 \]" {} -# OBSOLETE gdb_test_exact "print v_arrb" {= [(1): -9, (2): -8, (3): -7, (4): -6, (5): -5]} "after assignment to v_arrb" -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arrub" {= [(1): 3, (2): 4, (3): 5, (4): 6, (5): 7]} -# OBSOLETE gdb_test_exact "set v_arrub := \[ 77, 77, 77, 77, 77 \]" {} -# OBSOLETE gdb_test_exact "print v_arrub" {= [(1:5): 77]} "v_arrub after assignment" -# OBSOLETE -# OBSOLETE gdb_test_exact "print j" {= 4} -# OBSOLETE gdb_test_exact "print j := 3+4" {= 7} -# OBSOLETE gdb_test_exact "print j := r1(3)" {= 3} -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arrc" {= [(1): '1', (2): '2', (3): '3', (4): '4', (5): '5']} -# OBSOLETE gdb_test_exact "set v_arrc := \[ 'a', 'b', 'c', 'd', 'e' \]" {} -# OBSOLETE gdb_test_exact "print v_arrc" {= [(1): 'a', (2): 'b', (3): 'c', (4): 'd', (5): 'e']} "v_arrc after assignment" -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_ps" {= [1, 3, 5]} -# OBSOLETE gdb_test_exact "set v_ps := \[ 2, 4 \]" {} -# OBSOLETE gdb_test_exact "print v_ps" {= [2, 4]} {v_ps after assignment} -# OBSOLETE gdb_test_exact "print v_ps := \[\]" {= []} {assign [] to v_ps} -# OBSOLETE -# OBSOLETE gdb_test_exact "print m_arri\[1, 2, 3, 4, 5\]" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]} -# OBSOLETE gdb_test_exact "print m_arrub\[45, 46, 47, 48, 49\]" {= [(1): 45, (2): 46, (3): 47, (4): 48, (5): 49]} -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_cv" {= "foo"} -# OBSOLETE gdb_test_exact "set v_cv := \"foo-bar\"" {} -# OBSOLETE gdb_test_exact "print v_cv" {= "foo-bar"} "v_cv after assignment" -# OBSOLETE gdb_test_exact "set v_cv(3) := ' '" {} -# OBSOLETE gdb_test_exact "print v_cv" {= "foo bar"} "v_cv after element assignment" -# OBSOLETE -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): TRUE, (2): FALSE, (3): TRUE, (4): FALSE, (5): TRUE]} -# OBSOLETE gdb_test_exact "set v_arrbool := \[ false, false, false, false, false \]" {} -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:5): FALSE]} "v_arrbool after assignment 1" -# OBSOLETE gdb_test_exact "set v_arrbool := \[true, true, true, true, true\]" {} -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:5): TRUE]} "v_arrbool after assignment 2" -# OBSOLETE gdb_test_exact "set v_arrbool(3) := false" {} -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1:2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after element assignment" -# OBSOLETE -# OBSOLETE gdb_test_exact "set v_arrbool(1 up 2) := \[ false, true \]" {} -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after slice assignment 1" -# OBSOLETE gdb_test_exact "set v_arrbool(3 : 5) := \[ true, true, false \]" {} -# OBSOLETE gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2" -# OBSOLETE -# OBSOLETE gdb_test_exact "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]" {} -# OBSOLETE gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment" -# OBSOLETE gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment" -# OBSOLETE -# OBSOLETE # These tests are from Cygnus PR chill/5024: -# OBSOLETE gdb_test "break printdow" "" -# OBSOLETE gdb_test "continue" "" -# OBSOLETE gdb_test_exact "set var w:= dow\[monday\]" {} -# OBSOLETE gdb_test "print w" " = \\\[monday\\\]" \ -# OBSOLETE "print bitstring after assignment" -# OBSOLETE gdb_test_exact "set var w:=\[\]" {} -# OBSOLETE gdb_test "print w" " = \\\[\\\]" \ -# OBSOLETE "print bitstring after assignment of \[\]" -# OBSOLETE -# OBSOLETE # These tests are from Cygnus PR chill/8643: -# OBSOLETE runto tuples.ch:40 -# OBSOLETE gdb_test_exact "set var vs1 := \[ \"foo\", 41, \[ b \] \]" {} -# OBSOLETE gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \ -# OBSOLETE "print vs1 after tuple assign 1" -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]" {} -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \ -# OBSOLETE "print vs1 after tuple assign 2" -# OBSOLETE -# OBSOLETE gdb_test_exact "set var \$i := m_s1\[\"foo\", 42, \[a \]\]" {} -# OBSOLETE gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \ -# OBSOLETE "print \$i after tuple assign 1" -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]" {} -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \ -# OBSOLETE "print \$i after tuple assign 2" -# OBSOLETE -# OBSOLETE gdb_test_exact "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]" {} -# OBSOLETE gdb_test_exact "print vs2" \ -# OBSOLETE { = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \ -# OBSOLETE "print vs2 after tuple assign 1" -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]" {} -# OBSOLETE setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*" -# OBSOLETE gdb_test_exact "print vs2" \ -# OBSOLETE { = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \ -# OBSOLETE "print vs2 after tuple assign 2" -# OBSOLETE -# OBSOLETE gdb_test_exact "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]" {} -# OBSOLETE gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \ -# OBSOLETE "print vs3 after tuple assign" -# OBSOLETE gdb_test_exact "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]" {} -# OBSOLETE gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \ -# OBSOLETE "print \$k after tuple assign" -# OBSOLETE -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.chill/xstruct-grt.ch b/gdb/testsuite/gdb.chill/xstruct-grt.ch deleted file mode 100644 index abd0d5e..0000000 --- a/gdb/testsuite/gdb.chill/xstruct-grt.ch +++ /dev/null @@ -1,12 +0,0 @@ -pot1: MODULE - -SYNMODE m_array1 = ARRAY (2:3) ulong; -SYNMODE m_struct = STRUCT (f1 int, - f2 REF m_array1, - f3 m_array1); -SYNMODE m_array3 = ARRAY (5:6) m_struct; -SYNMODE m_array4 = ARRAY (7:8) ARRAY (9:10) m_struct; - -GRANT all; - -END pot1; diff --git a/gdb/testsuite/gdb.chill/xstruct.ch b/gdb/testsuite/gdb.chill/xstruct.ch deleted file mode 100644 index d8471c8..0000000 --- a/gdb/testsuite/gdb.chill/xstruct.ch +++ /dev/null @@ -1,16 +0,0 @@ -pottendo: MODULE - -<> USE_SEIZE_FILE "xstruct-grt.grt" <> -SEIZE m_array3; -SEIZE m_array4; - -SYNMODE m_x = STRUCT (i long, - ar m_array3); -SYNMODE m_y = STRUCT (i long, - ar m_array4); - -DCL x LONG; - -x := 10; - -END pottendo; diff --git a/gdb/testsuite/gdb.chill/xstruct.exp b/gdb/testsuite/gdb.chill/xstruct.exp deleted file mode 100644 index f70e6c8..0000000 --- a/gdb/testsuite/gdb.chill/xstruct.exp +++ /dev/null @@ -1,66 +0,0 @@ -# OBSOLETE # Copyright 1992, 1994, 1997, 1999 Free Software Foundation, Inc. -# OBSOLETE -# OBSOLETE # This program is free software; you can redistribute it and/or modify -# OBSOLETE # it under the terms of the GNU General Public License as published by -# OBSOLETE # the Free Software Foundation; either version 2 of the License, or -# OBSOLETE # (at your option) any later version. -# OBSOLETE # -# OBSOLETE # This program is distributed in the hope that it will be useful, -# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of -# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# OBSOLETE # GNU General Public License for more details. -# OBSOLETE # -# OBSOLETE # You should have received a copy of the GNU General Public License -# OBSOLETE # along with this program; if not, write to the Free Software -# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# OBSOLETE -# OBSOLETE # Please email any bugs, comments, and/or additions to this file to: -# OBSOLETE # bug-gdb@prep.ai.mit.edu -# OBSOLETE -# OBSOLETE # This file was written by Per Bothner. (bothner@cygnus.com) -# OBSOLETE -# OBSOLETE if $tracelevel then { -# OBSOLETE strace $tracelevel -# OBSOLETE } -# OBSOLETE -# OBSOLETE if [skip_chill_tests] then { continue } -# OBSOLETE -# OBSOLETE set testfile2 "xstruct-grt" -# OBSOLETE set srcfile2 ${srcdir}/$subdir/${testfile2}.ch -# OBSOLETE set objfile2 ${objdir}/$subdir/${testfile2}.o -# OBSOLETE if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile2}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE set testfile "xstruct" -# OBSOLETE set srcfile ${srcdir}/$subdir/${testfile}.ch -# OBSOLETE set binfile ${objdir}/${subdir}/${testfile}.exe -# OBSOLETE if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } { -# OBSOLETE perror "Couldn't compile ${srcfile}" -# OBSOLETE return -1 -# OBSOLETE } -# OBSOLETE -# OBSOLETE proc do_tests {} { -# OBSOLETE global prms_id bug_id subdir objdir srcdir binfile gdb_prompt -# OBSOLETE -# OBSOLETE set prms_id 0 -# OBSOLETE set bug_id 0 -# OBSOLETE -# OBSOLETE # Start with a fresh gdb. -# OBSOLETE -# OBSOLETE gdb_exit -# OBSOLETE gdb_start -# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir -# OBSOLETE gdb_load $binfile -# OBSOLETE -# OBSOLETE gdb_test "set language chill" "" -# OBSOLETE -# OBSOLETE gdb_test "set var \$i := m_x\[\]" "" -# OBSOLETE gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]} -# OBSOLETE -# OBSOLETE gdb_test "set var \$j := m_y\[\]" "" -# OBSOLETE gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]} -# OBSOLETE } -# OBSOLETE -# OBSOLETE do_tests diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp index 6c9be34..32742b9 100644 --- a/gdb/testsuite/gdb.fortran/exprs.exp +++ b/gdb/testsuite/gdb.fortran/exprs.exp @@ -17,7 +17,8 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu -# This file was adapted from (OBSOLETE) Chill tests by Stan Shebs (shebs@cygnus.com). +# This file was adapted from old Chill tests by Stan Shebs +# (shebs@cygnus.com). if $tracelevel then { strace $tracelevel diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp index 175549c..ceb6156 100644 --- a/gdb/testsuite/gdb.fortran/types.exp +++ b/gdb/testsuite/gdb.fortran/types.exp @@ -17,7 +17,8 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu -# This file was adapted from (OBSOLETE) Chill tests by Stan Shebs (shebs@cygnus.com). +# This file was adapted from old Chill tests by Stan Shebs +# (shebs@cygnus.com). if $tracelevel then { strace $tracelevel diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog index 8b4426b..2e2a82e 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog @@ -1,3 +1,9 @@ +2002-12-13 Jeff Johnston + + * mi-basics.exp: Change tests for -environment-directory. Also add + tests for -environment-cd, -environment-pwd, and -environment-path. + Part of fix for PR gdb/741. + 2002-11-05 Jeff Johnston * gdb792.cc: New file to test patch for PR gdb/792. diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp index 4913d8f..98ffe1d 100644 --- a/gdb/testsuite/gdb.mi/mi-basics.exp +++ b/gdb/testsuite/gdb.mi/mi-basics.exp @@ -148,26 +148,98 @@ proc test_dir_specification {} { global srcdir global subdir - # Clear the search directories, then specify one to be searched + # Add to the search directories, display, then reset back to default # Tests: - # -environment-directory # -environment-directory arg + # -environment-directory + # -environment-directory -r #exp_internal 1 - mi_gdb_test "202-environment-directory" \ - "\\\^done" \ + mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \ + "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \ + "environment-directory arg operation" + + mi_gdb_test "203-environment-directory" \ + "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \ + "environment-directory empty-string operation" + + mi_gdb_test "204-environment-directory -r" \ + "\\\^done,source-path=\"\\\$cdir.\\\$cwd\"" \ "environment-directory operation" - mi_gdb_test "203-environment-directory ${srcdir}/${subdir}" \ - "\\\^done" \ - "environment-directory arg operation" #exp_internal 0 } +proc test_cwd_specification {} { + global mi_gdb_prompt + global objdir + global subdir + + # Change the working directory, then print the current working directory + # Tests: + # -environment-cd ${objdir} + # -environment-pwd + + mi_gdb_test "205-environment-cd ${objdir}" \ + "\\\^done" \ + "environment-cd arg operation" + + mi_gdb_test "206-environment-pwd" \ + "\\\^done,cwd=\"${objdir}\"" \ + "environment-pwd operation" +} + +proc test_path_specification {} { + global mi_gdb_prompt + global orig_path + global objdir + global srcdir + + # Add to the path, display, then reset + # Tests: + # -environment-path + # -environment-path dir1 dir2 + # -environment-path -r dir + # -environment-path -r + +#exp_internal 1 + + send_gdb "-environment-path\n" + gdb_expect 20 { + -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { + set orig_path $expect_out(1,string); + } + timeout { + perror "-environment-path (timeout)" ; + return + } + } + + mi_gdb_test "207-environment-path" \ + "\\\^done,path=\"$orig_path\"" \ + "environment-path no-args operation" + + mi_gdb_test "208-environment-path $srcdir $objdir" \ + "\\\^done,path=\"$srcdir.$objdir.$orig_path\"" \ + "environment-path dir1 dir2 operation" + + mi_gdb_test "209-environment-path -r $objdir" \ + "\\\^done,path=\"$objdir.$orig_path\"" \ + "environment-path -r dir operation" + + mi_gdb_test "210-environment-path -r" \ + "\\\^done,path=\"$orig_path\"" \ + "environment-path -r operation" + +#exp_internal 0 +} + if [test_mi_interpreter_selection] { test_exec_and_symbol_mi_operatons test_breakpoints_deletion test_dir_specification + test_cwd_specification + test_path_specification } mi_gdb_exit diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp index f678975..9507351 100644 --- a/gdb/testsuite/gdb.trace/tfind.exp +++ b/gdb/testsuite/gdb.trace/tfind.exp @@ -53,8 +53,13 @@ if [istarget "m68k-*-elf"] then { set testfile "actions" set srcfile ${testfile}.c set binfile $objdir/$subdir/$testfile - if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile -O1" \ - executable {debug additional_flags=-w}] != "" } { + + # Why does this test require '-O1' level optimization? (In + # general, the optimization level should be left under the control + # of the test framework (target_list and so on), so if we don't + # have to override it in individual tests like this, we shouldn't.) + if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \ + executable {debug additional_flags=-w optimize=-O1}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } gdb_load $binfile diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index aae7365..a339221 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -27,17 +27,6 @@ load_lib libgloss.exp global GDB -# OBSOLETE global CHILL_LIB -# OBSOLETE global CHILL_RT0 - -# OBSOLETE if ![info exists CHILL_LIB] { -# OBSOLETE set CHILL_LIB [findfile $base_dir/../../gcc/ch/runtime/libchill.a "$base_dir/../../gcc/ch/runtime/libchill.a" [transform -lchill]] -# OBSOLETE } -# OBSOLETE verbose "using CHILL_LIB = $CHILL_LIB" 2 -# OBSOLETE if ![info exists CHILL_RT0] { -# OBSOLETE set CHILL_RT0 [findfile $base_dir/../../gcc/ch/runtime/chillrt0.o "$base_dir/../../gcc/ch/runtime/chillrt0.o" ""] -# OBSOLETE } -# OBSOLETE verbose "using CHILL_RT0 = $CHILL_RT0" 2 if [info exists TOOL_EXECUTABLE] { set GDB $TOOL_EXECUTABLE; @@ -920,26 +909,6 @@ proc skip_cplus_tests {} { return 0 } -# OBSOLETE # * For crosses, the CHILL runtime doesn't build because it -# OBSOLETE # can't find setjmp.h, stdio.h, etc. -# OBSOLETE # * For AIX (as of 16 Mar 95), (a) there is no language code for -# OBSOLETE # CHILL in output_epilog in gcc/config/rs6000/rs6000.c, (b) collect2 -# OBSOLETE # does not get along with AIX's too-clever linker. -# OBSOLETE # * On Irix5, there is a bug whereby set of bool, etc., don't get -# OBSOLETE # TYPE_LOW_BOUND for the bool right because force_to_range_type doesn't -# OBSOLETE # work with stub types. -# OBSOLETE # Lots of things seem to fail on the PA, and since it's not a supported -# OBSOLETE # chill target at the moment, don't run the chill tests. - -# OBSOLETE proc skip_chill_tests {} { -# OBSOLETE if ![info exists do_chill_tests] { -# OBSOLETE return 1; -# OBSOLETE } -# OBSOLETE eval set skip_chill [expr ![isnative] || [istarget "*-*-aix*"] || [istarget "*-*-irix5*"] || [istarget "*-*-irix6*"] || [istarget "alpha-*-osf*"] || [istarget "hppa*-*-*"]] -# OBSOLETE verbose "Skip chill tests is $skip_chill" -# OBSOLETE return $skip_chill -# OBSOLETE } - # Skip all the tests in the file if you are not on an hppa running # hpux target. diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index de775b6..399aac6 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -212,7 +212,7 @@ proc mi_delete_breakpoints {} { -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" { # This happens if there were no breakpoints } - timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return } + timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return } } # The correct output is not "No breakpoints or watchpoints." but an @@ -234,6 +234,7 @@ proc mi_delete_breakpoints {} { proc mi_gdb_reinitialize_dir { subdir } { global mi_gdb_prompt + global MIFLAGS global suppress_flag if { $suppress_flag } { @@ -244,8 +245,9 @@ proc mi_gdb_reinitialize_dir { subdir } { return ""; } - send_gdb "104-environment-directory\n" - gdb_expect 60 { + if { $MIFLAGS == "-i=mi1" } { + send_gdb "104-environment-directory\n" + gdb_expect 60 { -re ".*Reinitialize source path to empty.*y or n. " { warning "Got confirmation prompt for dir reinitialization." send_gdb "y\n" @@ -256,6 +258,14 @@ proc mi_gdb_reinitialize_dir { subdir } { } -re "$mi_gdb_prompt$" {} timeout {error "Dir reinitialization failed (timeout)"} + } + } else { + send_gdb "104-environment-directory -r\n" + gdb_expect 60 { + -re "104\\\^done,source-path=.*\r\n$mi_gdb_prompt$" {} + -re "$mi_gdb_prompt$" {} + timeout {error "Dir reinitialization failed (timeout)"} + } } send_gdb "105-environment-directory $subdir\n" @@ -263,7 +273,7 @@ proc mi_gdb_reinitialize_dir { subdir } { -re "Source directories searched.*$mi_gdb_prompt$" { verbose "Dir set to $subdir" } - -re "105\\\^done\r\n$mi_gdb_prompt$" { + -re "105\\\^done.*\r\n$mi_gdb_prompt$" { # FIXME: We return just the prompt for now. verbose "Dir set to $subdir" # perror "Dir \"$subdir\" failed." diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 9338c57..9f4cde7 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -250,7 +250,8 @@ thread_from_lwp (ptid_t ptid) err = td_thr_get_info_p (&th, &ti); if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); + error ("thread_from_lwp: cannot get thread info: %s", + thread_db_err_str (err)); return BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); } @@ -272,7 +273,8 @@ lwp_from_thread (ptid_t ptid) err = td_thr_get_info_p (&th, &ti); if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); + error ("lwp_from_thread: cannot get thread info: %s", + thread_db_err_str (err)); return BUILD_LWP (ti.ti_lid, GET_PID (ptid)); } @@ -292,7 +294,13 @@ thread_db_load (void) handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW); if (handle == NULL) - return 0; + { + fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n", + LIBTHREAD_DB_SO, dlerror ()); + fprintf_filtered (gdb_stderr, + "GDB will not be able to debug pthreads.\n\n"); + return 0; + } /* Initialize pointers to the dynamic library functions we will use. Essential functions first. */ @@ -679,7 +687,8 @@ check_event (ptid_t ptid) err = td_thr_get_info_p (msg.th_p, &ti); if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); + error ("check_event: cannot get thread info: %s", + thread_db_err_str (err)); ptid = BUILD_THREAD (ti.ti_tid, GET_PID (ptid)); @@ -944,7 +953,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) err = td_thr_get_info_p (th_p, &ti); if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); + error ("find_new_threads_callback: cannot get thread info: %s", + thread_db_err_str (err)); if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) return 0; /* A zombie -- ignore. */ @@ -987,7 +997,7 @@ thread_db_pid_to_str (ptid_t ptid) err = td_thr_get_info_p (&th, &ti); if (err != TD_OK) - error ("Cannot get thread info for thread %ld: %s", + error ("thread_db_pid_to_str: cannot get thread info for %ld: %s", (long) GET_THREAD (ptid), thread_db_err_str (err)); if (ti.ti_state == TD_THR_ACTIVE && ti.ti_lid != 0) diff --git a/gdb/thread.c b/gdb/thread.c index fa5eb27..6ef4840 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -262,6 +262,9 @@ do_captured_list_thread_ids (struct ui_out *uiout, struct thread_info *tp; int num = 0; + prune_threads (); + target_find_new_threads (); + ui_out_tuple_begin (uiout, "thread-ids"); for (tp = thread_list; tp; tp = tp->next) @@ -296,7 +299,7 @@ load_infrun_state (ptid_t ptid, struct breakpoint **through_sigtramp_breakpoint, CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, - CORE_ADDR *step_frame_address, + struct frame_id *step_frame_id, int *handling_longjmp, int *another_trap, int *stepping_through_solib_after_catch, @@ -322,7 +325,7 @@ load_infrun_state (ptid_t ptid, *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint; *step_range_start = tp->step_range_start; *step_range_end = tp->step_range_end; - *step_frame_address = tp->step_frame_address; + *step_frame_id = tp->step_frame_id; *handling_longjmp = tp->handling_longjmp; *another_trap = tp->another_trap; *stepping_through_solib_after_catch = tp->stepping_through_solib_after_catch; @@ -345,7 +348,7 @@ save_infrun_state (ptid_t ptid, struct breakpoint *through_sigtramp_breakpoint, CORE_ADDR step_range_start, CORE_ADDR step_range_end, - CORE_ADDR step_frame_address, + const struct frame_id *step_frame_id, int handling_longjmp, int another_trap, int stepping_through_solib_after_catch, @@ -371,7 +374,7 @@ save_infrun_state (ptid_t ptid, tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint; tp->step_range_start = step_range_start; tp->step_range_end = step_range_end; - tp->step_frame_address = step_frame_address; + tp->step_frame_id = (*step_frame_id); tp->handling_longjmp = handling_longjmp; tp->another_trap = another_trap; tp->stepping_through_solib_after_catch = stepping_through_solib_after_catch; @@ -422,12 +425,12 @@ info_threads_command (char *arg, int from_tty) struct thread_info *tp; ptid_t current_ptid; struct frame_info *cur_frame; - int saved_frame_level = frame_relative_level (selected_frame); + int saved_frame_level = frame_relative_level (deprecated_selected_frame); int counter; char *extra_info; /* Avoid coredumps which would happen if we tried to access a NULL - selected_frame. */ + deprecated_selected_frame. */ if (!target_has_stack) error ("No stack."); @@ -453,8 +456,8 @@ info_threads_command (char *arg, int from_tty) puts_filtered (" "); switch_to_thread (tp->ptid); - if (selected_frame) - print_only_stack_frame (selected_frame, -1, 0); + if (deprecated_selected_frame) + print_only_stack_frame (deprecated_selected_frame, -1, 0); else printf_filtered ("[No stack.]\n"); } @@ -468,12 +471,12 @@ info_threads_command (char *arg, int from_tty) * of the stack (leaf frame). */ counter = saved_frame_level; - cur_frame = find_relative_frame (selected_frame, &counter); + cur_frame = find_relative_frame (deprecated_selected_frame, &counter); if (counter != 0) { /* Ooops, can't restore, tell user where we are. */ warning ("Couldn't restore frame in current thread, at frame 0"); - print_stack_frame (selected_frame, -1, 0); + print_stack_frame (deprecated_selected_frame, -1, 0); } else { @@ -714,7 +717,8 @@ do_captured_thread_select (struct ui_out *uiout, #endif ui_out_text (uiout, ")]"); - print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1); + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), 1); return GDB_RC_OK; } diff --git a/gdb/top.c b/gdb/top.c index 3d5783f..d25bc3b 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1952,7 +1952,7 @@ init_main (void) write_history_p = 0; /* Setup important stuff for command line editing. */ - rl_completion_entry_function = (int (*)()) readline_line_completion_function; + rl_completion_entry_function = readline_line_completion_function; rl_completer_word_break_characters = get_gdb_completer_word_break_characters (); rl_completer_quote_characters = get_gdb_completer_quote_characters (); diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 67cd6b5..9717526 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1865,7 +1865,7 @@ finish_tfind_command (char *msg, struct symbol *old_func; char *reply; - old_frame_addr = FRAME_FP (get_current_frame ()); + old_frame_addr = get_frame_base (get_current_frame ()); old_func = find_pc_function (read_pc ()); putpkt (msg); @@ -1951,13 +1951,14 @@ finish_tfind_command (char *msg, if (old_func == find_pc_function (read_pc ()) && (old_frame_addr == 0 || - FRAME_FP (get_current_frame ()) == 0 || - old_frame_addr == FRAME_FP (get_current_frame ()))) + get_frame_base (get_current_frame ()) == 0 || + old_frame_addr == get_frame_base (get_current_frame ()))) source_only = -1; else source_only = 1; - print_stack_frame (selected_frame, frame_relative_level (selected_frame), + print_stack_frame (deprecated_selected_frame, + frame_relative_level (deprecated_selected_frame), source_only); do_displays (); } @@ -2107,7 +2108,7 @@ trace_find_line_command (char *args, int from_tty) { if (args == 0 || *args == 0) { - sal = find_pc_line ((get_current_frame ())->pc, 0); + sal = find_pc_line (get_frame_pc (get_current_frame ()), 0); sals.nelts = 1; sals.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line)); diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index df138d0..88ad5e7 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,41 @@ +2002-12-08 Elena Zannoni + + Import of readline 4.3. + Fix PR gdb/675 + * tuiWin.c: Include readline/readline.h. + (tui_update_gdb_sizes): Use accessor function rl_get_screen_size. + (tuiResizeAll): Ditto. + +2002-12-06 Elena Zannoni + + * tuiStack.c (tuiShowFrameInfo): Fix typo. + +2002-11-29 Andrew Cagney + + * tui/tui-hooks.c: Update to use deprecated_selected_frame. + * tui/tui.c, tui/tuiDisassem.c, tui/tuiRegs.c: Ditto. + * tui/tuiSource.c, tui/tuiSourceWin.c, tui/tuiWin.c: Ditto. + +2002-11-28 Andrew Cagney + + * tuiStack.c (tuiShowFrameInfo): Use find_frame_sal instead of + find_pc_line. + +2002-11-23 Andrew Cagney + + * tuiStack.c (tuiShowFrameInfo): Use get_frame_type instead of + deprecated_frame_in_dummy. Fix coding style. + +2002-11-21 Stephane Carrez + + * tui-hooks.c (tui_init_hook): Don't enable the TUI if a specific + interpreter is installed. + +2002-11-18 Andrew Cagney + + * tuiStack.c (tuiShowFrameInfo): Use get_frame_type instead of + signal_handler_caller. + 2002-11-10 Andrew Cagney * tuiStack.c (tuiShowFrameInfo): Replace frame_in_dummy with diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index e1aad9f..ff36d49 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -147,7 +147,7 @@ tui_registers_changed_hook (void) { struct frame_info *fi; - fi = selected_frame; + fi = deprecated_selected_frame; if (fi && tui_refreshing_registers == 0) { tui_refreshing_registers = 1; @@ -163,7 +163,7 @@ tui_register_changed_hook (int regno) { struct frame_info *fi; - fi = selected_frame; + fi = deprecated_selected_frame; if (fi && tui_refreshing_registers == 0) { tui_refreshing_registers = 1; @@ -245,7 +245,7 @@ tui_selected_frame_level_changed_hook (int level) { struct frame_info *fi; - fi = selected_frame; + fi = deprecated_selected_frame; /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if desired. */ if (fi) @@ -279,7 +279,7 @@ tui_print_frame_info_listing_hook (struct symtab *s, int line, int stopline, int noerror) { select_source_symtab (s); - tuiShowFrameInfo (selected_frame); + tuiShowFrameInfo (deprecated_selected_frame); } /* Called when the target process died or is detached. @@ -419,6 +419,10 @@ tui_event_loop (void) static void tui_init_hook (char *argv0) { + /* Don't enable the TUI if a specific interpreter is installed. */ + if (interpreter_p) + return; + /* Install exit handler to leave the screen in a good shape. */ atexit (tui_exit); diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index a7c16bc..d5cde22 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -395,8 +395,8 @@ tui_enable (void) tui_version = 1; tui_active = 1; - if (selected_frame) - tuiShowFrameInfo (selected_frame); + if (deprecated_selected_frame) + tuiShowFrameInfo (deprecated_selected_frame); /* Restore TUI keymap. */ tui_set_key_mode (tui_current_key_mode); diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c index f79cc12..93d2df4 100644 --- a/gdb/tui/tuiDisassem.c +++ b/gdb/tui/tuiDisassem.c @@ -420,7 +420,7 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection, content = (TuiWinContent) disassemWin->generic.content; if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (selected_frame->pc); + s = find_pc_symtab (deprecated_selected_frame->pc); else s = cursal.symtab; diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c index 928eb41..6fc63d9 100644 --- a/gdb/tui/tuiRegs.c +++ b/gdb/tui/tuiRegs.c @@ -638,7 +638,7 @@ _tuiRegisterFormat (char *buf, int bufLen, int regNum, stream = tui_sfileopen (bufLen); gdb_stdout = stream; cleanups = make_cleanup (tui_restore_gdbout, (void*) old_stdout); - gdbarch_print_registers_info (current_gdbarch, stream, selected_frame, + gdbarch_print_registers_info (current_gdbarch, stream, deprecated_selected_frame, regNum, 1); /* Save formatted output in the buffer. */ @@ -679,7 +679,7 @@ _tuiSetGeneralRegsContent (int refreshValuesOnly) { return (_tuiSetRegsContent (0, NUM_GENERAL_REGS - 1, - selected_frame, + deprecated_selected_frame, TUI_GENERAL_REGS, refreshValuesOnly)); @@ -705,7 +705,7 @@ _tuiSetSpecialRegsContent (int refreshValuesOnly) endRegNum = FP0_REGNUM - 1; ret = _tuiSetRegsContent (START_SPECIAL_REGS, endRegNum, - selected_frame, + deprecated_selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly); @@ -725,7 +725,7 @@ _tuiSetGeneralAndSpecialRegsContent (int refreshValuesOnly) endRegNum = FP0_REGNUM - 1; ret = _tuiSetRegsContent ( - 0, endRegNum, selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly); + 0, endRegNum, deprecated_selected_frame, TUI_SPECIAL_REGS, refreshValuesOnly); return ret; } /* _tuiSetGeneralAndSpecialRegsContent */ @@ -743,7 +743,7 @@ _tuiSetFloatRegsContent (TuiRegisterDisplayType dpyType, int refreshValuesOnly) startRegNum = FP0_REGNUM; ret = _tuiSetRegsContent (startRegNum, NUM_REGS - 1, - selected_frame, + deprecated_selected_frame, dpyType, refreshValuesOnly); diff --git a/gdb/tui/tuiSource.c b/gdb/tui/tuiSource.c index f682786..ceccd64 100644 --- a/gdb/tui/tuiSource.c +++ b/gdb/tui/tuiSource.c @@ -340,7 +340,7 @@ tuiVerticalSourceScroll (TuiScrollDirection scrollDirection, struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (selected_frame->pc); + s = find_pc_symtab (deprecated_selected_frame->pc); else s = cursal.symtab; diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index c0c7868..ae844ce 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -355,7 +355,7 @@ tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo, struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab == (struct symtab *) NULL) - s = find_pc_symtab (selected_frame->pc); + s = find_pc_symtab (deprecated_selected_frame->pc); else s = cursal.symtab; diff --git a/gdb/tui/tuiStack.c b/gdb/tui/tuiStack.c index 506cdab..69a6b6c 100644 --- a/gdb/tui/tuiStack.c +++ b/gdb/tui/tuiStack.c @@ -349,10 +349,7 @@ tuiShowFrameInfo (struct frame_info *fi) int sourceAlreadyDisplayed; struct symtab_and_line sal; - sal = find_pc_line (fi->pc, - (fi->next != (struct frame_info *) NULL && - !fi->next->signal_handler_caller && - !deprecated_frame_in_dummy (fi->next))); + find_frame_sal (fi, &sal); sourceAlreadyDisplayed = sal.symtab != 0 && tuiSourceIsDisplayed (sal.symtab->filename); diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index 484c60a..9ad82f5 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -46,6 +46,7 @@ #include #include +#include #include "defs.h" #include "command.h" #include "symtab.h" @@ -417,8 +418,9 @@ void tui_update_gdb_sizes () { char cmd[50]; - extern int screenheight, screenwidth; /* in readline */ + int screenheight, screenwidth; + rl_get_screen_size (&screenheight, &screenwidth); /* Set to TUI command window dimension or use readline values. */ sprintf (cmd, "set width %d", tui_active ? cmdWin->generic.width : screenwidth); @@ -634,8 +636,9 @@ void tuiResizeAll (void) { int heightDiff, widthDiff; - extern int screenheight, screenwidth; /* in readline */ + int screenheight, screenwidth; + rl_get_screen_size (&screenheight, &screenwidth); widthDiff = screenwidth - termWidth (); heightDiff = screenheight - termHeight (); if (heightDiff || widthDiff) @@ -1397,13 +1400,13 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) tuiUpdateSourceWindow (winInfo, cursal.symtab, lineOrAddr, TRUE); } - else if (selected_frame != (struct frame_info *) NULL) + else if (deprecated_selected_frame != (struct frame_info *) NULL) { TuiLineOrAddress line; struct symtab_and_line cursal = get_current_source_symtab_and_line (); - s = find_pc_symtab (selected_frame->pc); + s = find_pc_symtab (deprecated_selected_frame->pc); if (winInfo->generic.type == SRC_WIN) line.lineNo = cursal.line; else diff --git a/gdb/ui-out.c b/gdb/ui-out.c index da7740f..d98cf16 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -45,7 +45,7 @@ struct ui_out_hdr is always available. Stack/nested level 0 is reserved for the top-level result. */ -enum { MAX_UI_OUT_LEVELS = 5 }; +enum { MAX_UI_OUT_LEVELS = 6 }; struct ui_out_level { diff --git a/gdb/utils.c b/gdb/utils.c index 31c5f3d..999d5a5 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -20,23 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* FIXME: cagney/2002-02-28: The GDB coding standard indicates that - "defs.h" should be included first. Unfortunatly some systems - (currently Debian GNU/Linux) include the via - and they clash with "bfd.h"'s definiton of true/false. The correct - fix is to remove true/false from "bfd.h", however, until that - happens, hack around it by including "config.h" and - first. */ - -#include "config.h" - -#ifdef HAVE_CURSES_H -#include -#endif -#ifdef HAVE_TERM_H -#include -#endif - #include "defs.h" #include "gdb_assert.h" #include @@ -68,6 +51,13 @@ #include /* For MAXPATHLEN */ +#ifdef HAVE_CURSES_H +#include +#endif +#ifdef HAVE_TERM_H +#include +#endif + #include #ifdef USE_MMALLOC diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index eae7db6..6872de8 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -800,7 +800,7 @@ CORE_ADDR v850_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi; fi = fi->next) - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, regnum); else if (fi->saved_regs[regnum] != 0) return read_memory_unsigned_integer (fi->saved_regs[regnum], @@ -826,7 +826,7 @@ v850_frame_chain (struct frame_info *fi) callers_pc = FRAME_SAVED_PC (fi); /* If caller is a call-dummy, then our FP bears no relation to his FP! */ fp = v850_find_callers_reg (fi, E_FP_RAW_REGNUM); - if (PC_IN_CALL_DUMMY (callers_pc, fp, fp)) + if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp)) return fp; /* caller is call-dummy: return oldest value of FP */ /* Caller is NOT a call-dummy, so everything else should just work. @@ -883,7 +883,7 @@ v850_pop_frame (void) struct frame_info *frame = get_current_frame (); int regnum; - if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame)) generic_pop_dummy_frame (); else { @@ -895,7 +895,7 @@ v850_pop_frame (void) read_memory_unsigned_integer (frame->saved_regs[regnum], v850_register_raw_size (regnum))); - write_register (E_SP_REGNUM, FRAME_FP (frame)); + write_register (E_SP_REGNUM, get_frame_base (frame)); } flush_cached_frames (); @@ -1009,7 +1009,7 @@ v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp) CORE_ADDR v850_frame_saved_pc (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM); else return v850_find_callers_reg (fi, E_RP_REGNUM); @@ -1111,7 +1111,7 @@ v850_frame_init_saved_regs (struct frame_info *fi) /* The call dummy doesn't save any registers on the stack, so we can return now. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return; /* Find the beginning of this function, so we can analyze its @@ -1197,6 +1197,10 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, 0); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + for (i = 0; v850_processor_type_table[i].regnames != NULL; i++) { if (v850_processor_type_table[i].mach == info.bfd_arch_info->mach) @@ -1233,13 +1237,10 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_init_extra_frame_info (gdbarch, v850_init_extra_frame_info); set_gdbarch_frame_init_saved_regs (gdbarch, v850_frame_init_saved_regs); set_gdbarch_frame_chain (gdbarch, v850_frame_chain); - set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register); set_gdbarch_saved_pc_after_call (gdbarch, v850_saved_pc_after_call); set_gdbarch_frame_saved_pc (gdbarch, v850_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue); set_gdbarch_frame_chain_valid (gdbarch, generic_file_frame_chain_valid); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); /* * Miscelany @@ -1262,7 +1263,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, v850_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value); @@ -1272,13 +1272,11 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_nil); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); diff --git a/gdb/valops.c b/gdb/valops.c index 129332e..1278b88 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -662,7 +662,7 @@ value_assign (struct value *toval, struct value *fromval) /* Since modifying a register can trash the frame chain, we save the old frame and then restore the new frame afterwards. */ - get_frame_id (selected_frame, &old_frame); + old_frame = get_frame_id (deprecated_selected_frame); /* Figure out which frame this is in currently. */ if (VALUE_LVAL (toval) == lval_register) @@ -673,7 +673,7 @@ value_assign (struct value *toval, struct value *fromval) else { for (frame = get_current_frame (); - frame && FRAME_FP (frame) != VALUE_FRAME (toval); + frame && get_frame_base (frame) != VALUE_FRAME (toval); frame = get_prev_frame (frame)) ; value_reg = VALUE_FRAME_REGNUM (toval); @@ -1475,7 +1475,7 @@ hand_function_call (struct value *function, int nargs, struct value **args) if (CALL_DUMMY_LOCATION == ON_STACK) { write_memory (start_sp, (char *) dummy1, sizeof_dummy1); - if (USE_GENERIC_DUMMY_FRAMES) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); } @@ -1493,7 +1493,7 @@ hand_function_call (struct value *function, int nargs, struct value **args) sp = old_sp; real_pc = text_end - sizeof_dummy1; write_memory (real_pc, (char *) dummy1, sizeof_dummy1); - if (USE_GENERIC_DUMMY_FRAMES) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1); } @@ -1506,14 +1506,14 @@ hand_function_call (struct value *function, int nargs, struct value **args) errcode = target_write_memory (real_pc, (char *) dummy1, sizeof_dummy1); if (errcode != 0) error ("Cannot write text segment -- call_function failed"); - if (USE_GENERIC_DUMMY_FRAMES) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1); } if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) { real_pc = funaddr; - if (USE_GENERIC_DUMMY_FRAMES) + if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) /* NOTE: cagney/2002-04-13: The entry point is going to be modified with a single breakpoint. */ generic_save_call_dummy_addr (CALL_DUMMY_ADDRESS (), @@ -3384,7 +3384,7 @@ value_of_local (const char *name, int complain) int i; struct value * ret; - if (selected_frame == 0) + if (deprecated_selected_frame == 0) { if (complain) error ("no frame selected"); @@ -3392,7 +3392,7 @@ value_of_local (const char *name, int complain) return 0; } - func = get_frame_function (selected_frame); + func = get_frame_function (deprecated_selected_frame); if (!func) { if (complain) @@ -3421,7 +3421,7 @@ value_of_local (const char *name, int complain) return NULL; } - ret = read_var_value (sym, selected_frame); + ret = read_var_value (sym, deprecated_selected_frame); if (ret == 0 && complain) error ("`%s' argument unreadable", name); return ret; @@ -3448,7 +3448,7 @@ struct value * value_slice (struct value *array, int lowbound, int length) { struct type *slice_range_type, *slice_type, *range_type; - LONGEST lowerbound, upperbound, offset; + LONGEST lowerbound, upperbound; struct value *slice; struct type *array_type; array_type = check_typedef (VALUE_TYPE (array)); @@ -3499,7 +3499,7 @@ value_slice (struct value *array, int lowbound, int length) else { struct type *element_type = TYPE_TARGET_TYPE (array_type); - offset + LONGEST offset = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type)); slice_type = create_array_type ((struct type *) NULL, element_type, slice_range_type); diff --git a/gdb/varobj.c b/gdb/varobj.c index cd15f7c..0c9f048 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -396,6 +396,27 @@ static struct vlist **varobj_table; /* Creates a varobj (not its children) */ +/* Return the full FRAME which corresponds to the given CORE_ADDR + or NULL if no FRAME on the chain corresponds to CORE_ADDR. */ + +static struct frame_info * +find_frame_addr_in_frame_chain (CORE_ADDR frame_addr) +{ + struct frame_info *frame = NULL; + + if (frame_addr == (CORE_ADDR) 0) + return NULL; + + while (1) + { + frame = get_prev_frame (frame); + if (frame == NULL) + return NULL; + if (get_frame_base (frame) == frame_addr) + return frame; + } +} + struct varobj * varobj_create (char *objname, char *expression, CORE_ADDR frame, enum varobj_type type) @@ -420,8 +441,14 @@ varobj_create (char *objname, /* Allow creator to specify context of variable */ if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME)) - fi = selected_frame; + fi = deprecated_selected_frame; else + /* FIXME: cagney/2002-11-23: This code should be doing a + lookup using the frame ID and not just the frame's + ``address''. This, of course, means an interface change. + However, with out that interface change ISAs, such as the + ia64 with its two stacks, won't work. Similar goes for the + case where there is a frameless function. */ fi = find_frame_addr_in_frame_chain (frame); /* frame = -2 means always use selected frame */ @@ -460,8 +487,8 @@ varobj_create (char *objname, Since select_frame is so benign, just call it for all cases. */ if (fi != NULL) { - get_frame_id (fi, &var->root->frame); - old_fi = selected_frame; + var->root->frame = get_frame_id (fi); + old_fi = deprecated_selected_frame; select_frame (fi); } @@ -871,7 +898,7 @@ varobj_update (struct varobj **varp, struct varobj ***changelist) /* Save the selected stack frame, since we will need to change it in order to evaluate expressions. */ - get_frame_id (selected_frame, &old_fid); + old_fid = get_frame_id (deprecated_selected_frame); /* Update the root variable. value_of_root can return NULL if the variable is no longer around, i.e. we stepped out of @@ -1317,8 +1344,7 @@ new_root_variable (void) var->root->lang = NULL; var->root->exp = NULL; var->root->valid_block = NULL; - var->root->frame.base = 0; - var->root->frame.pc = 0; + var->root->frame = null_frame_id; var->root->use_selected_frame = 0; var->root->rootvar = NULL; diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index e82227f..359029d 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -157,11 +157,37 @@ vax_frame_init_saved_regs (struct frame_info *frame) frame->saved_regs[PS_REGNUM] = frame->frame + 4; } +/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp. */ + +static CORE_ADDR +vax_sigtramp_saved_pc (struct frame_info *frame) +{ + CORE_ADDR sigcontext_addr; + char *buf; + int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr); + int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT; + + buf = alloca (ptrbytes); + /* Get sigcontext address, it is the third parameter on the stack. */ + if (frame->next) + sigcontext_addr = read_memory_typed_address + (FRAME_ARGS_ADDRESS (frame->next) + FRAME_ARGS_SKIP + sigcontext_offs, + builtin_type_void_data_ptr); + else + sigcontext_addr = read_memory_typed_address + (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr); + + /* Don't cause a memory_error when accessing sigcontext in case the stack + layout has changed or the stack is corrupt. */ + target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes); + return extract_typed_address (buf, builtin_type_void_func_ptr); +} + static CORE_ADDR vax_frame_saved_pc (struct frame_info *frame) { - if (frame->signal_handler_caller) - return (sigtramp_saved_pc (frame)); /* XXXJRT */ + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) + return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */ return (read_memory_integer (frame->frame + 16, 4)); } @@ -606,6 +632,10 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + tdep->osabi = osabi; /* Register info */ @@ -664,8 +694,8 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7); - set_gdbarch_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); /* Breakpoint info */ diff --git a/gdb/version.in b/gdb/version.in index 5d8bf3d1..654208a 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2002-11-15-cvs +2002-12-23-cvs diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 93bd108..f3fb0a7 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -473,7 +473,7 @@ psapi_get_dll_name (DWORD BaseAddress, char *dll_name_ret) dll_name_ret, MAX_PATH); if (len == 0) - error ("Error getting dll name: %u\n", GetLastError ()); + error ("Error getting dll name: %u\n", (unsigned) GetLastError ()); if ((DWORD) (mi.lpBaseOfDll) == BaseAddress) return 1; @@ -502,6 +502,7 @@ struct so_stuff { struct so_stuff *next; DWORD load_addr; + DWORD end_addr; int loaded; struct objfile *objfile; char name[1]; @@ -578,6 +579,7 @@ register_loaded_dll (const char *name, DWORD load_addr) char *p; WIN32_FIND_DATA w32_fd; HANDLE h = FindFirstFile(name, &w32_fd); + MEMORY_BASIC_INFORMATION m; size_t len; if (h == INVALID_HANDLE_VALUE) @@ -601,6 +603,12 @@ register_loaded_dll (const char *name, DWORD load_addr) so = (struct so_stuff *) xmalloc (sizeof (struct so_stuff) + strlen (ppath) + 8 + 1); so->loaded = 0; so->load_addr = load_addr; + if (!VirtualQueryEx (current_process_handle, (void *) load_addr, &m, + sizeof (m))) + so->end_addr = (DWORD) m.AllocationBase + m.RegionSize; + else + so->end_addr = load_addr + 0x2000; /* completely arbitrary */ + so->next = NULL; so->objfile = NULL; strcpy (so->name, ppath); @@ -708,6 +716,16 @@ handle_unload_dll (void *dummy) return 0; } +char * +solib_address (CORE_ADDR address) +{ + struct so_stuff *so; + for (so = &solib_start; so->next != NULL; so = so->next) + if (address >= so->load_addr && address <= so->end_addr) + return so->name; + return NULL; +} + /* Return name of last loaded DLL. */ char * child_solib_loaded_library_pathname (int pid) @@ -749,7 +767,7 @@ solib_symbols_add (char *name, int from_tty, CORE_ADDR load_addr) memset (§ion_addrs, 0, sizeof (section_addrs)); section_addrs.other[0].name = ".text"; section_addrs.other[0].addr = load_addr; - return safe_symbol_file_add (name, from_tty, NULL, 0, OBJF_SHARED); + return safe_symbol_file_add (name, from_tty, §ion_addrs, 0, OBJF_SHARED); } /* Load DLL symbol info. */ @@ -1198,6 +1216,7 @@ get_child_debug_event (int pid, struct target_waitstatus *ourstatus) ourstatus->kind = TARGET_WAITKIND_LOADED; ourstatus->value.integer = 0; retval = main_thread_id; + re_enable_breakpoints_in_shlibs (); break; case UNLOAD_DLL_DEBUG_EVENT: @@ -1305,6 +1324,7 @@ do_initial_child_stuff (DWORD pid) memset (¤t_event, 0, sizeof (current_event)); push_target (&child_ops); child_init_thread_list (); + disable_breakpoints_in_shlibs (1); child_clear_solibs (); clear_proceed_status (); init_wait_for_inferior (); @@ -1366,6 +1386,7 @@ child_attach (char *args, int from_tty) pid = strtoul (args, 0, 0); ok = DebugActiveProcess (pid); + saw_create = 0; if (!ok) error ("Can't attach to process."); @@ -1618,7 +1639,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env) } if (!ret) - error ("Error creating process %s, (error %d)\n", exec_file, GetLastError ()); + error ("Error creating process %s, (error %d)\n", exec_file, (unsigned) GetLastError ()); CloseHandle (pi.hThread); CloseHandle (pi.hProcess); diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c index 78e9c49..69495b8 100644 --- a/gdb/x86-64-linux-nat.c +++ b/gdb/x86-64-linux-nat.c @@ -456,6 +456,17 @@ static struct core_fns linux_elf_core_fns = { #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif +/* SSE register? */ +/* FIXME: cagney/2002-11-15: Once the i386 and x86-64 are integrated, + this will go. */ + +int +i386_sse_regnum_p (int regnum) +{ + return (regnum < NUM_REGS + && (XMM0_REGNUM <= (regnum) && (regnum) < MXCSR_REGNUM)); +} + /* Return the address of register REGNUM. BLOCKEND is the value of u.u_ar0, which should point to the registers. */ CORE_ADDR diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c index b8385a6..e43bdbe 100644 --- a/gdb/x86-64-linux-tdep.c +++ b/gdb/x86-64-linux-tdep.c @@ -125,7 +125,7 @@ x86_64_linux_sigtramp_saved_pc (struct frame_info *frame) CORE_ADDR x86_64_linux_saved_pc_after_call (struct frame_info *frame) { - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return x86_64_linux_sigtramp_saved_pc (frame); return read_memory_integer (read_register (SP_REGNUM), 8); @@ -135,7 +135,7 @@ x86_64_linux_saved_pc_after_call (struct frame_info *frame) CORE_ADDR x86_64_linux_frame_saved_pc (struct frame_info *frame) { - if (frame->signal_handler_caller) + if ((get_frame_type (frame) == SIGTRAMP_FRAME)) return x86_64_linux_sigtramp_saved_pc (frame); return cfi_get_ra (frame); } @@ -157,7 +157,7 @@ x86_64_linux_frame_chain (struct frame_info *fi) ULONGEST addr; CORE_ADDR fp, pc; - if (!fi->signal_handler_caller) + if (!(get_frame_type (fi) == SIGTRAMP_FRAME)) { fp = cfi_frame_chain (fi); if (fp) @@ -175,17 +175,34 @@ x86_64_linux_frame_chain (struct frame_info *fi) return fp; } -void +CORE_ADDR x86_64_init_frame_pc (int fromleaf, struct frame_info *fi) { CORE_ADDR addr; - if (fi->next && fi->next->signal_handler_caller) + if (get_next_frame (fi) && (get_frame_type (fi->next) == SIGTRAMP_FRAME)) { - addr = fi->next->next->frame + addr = get_frame_base (get_next_frame (get_next_frame (fi))) + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - fi->pc = read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); + return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); } else - cfi_init_frame_pc (fromleaf, fi); + return cfi_init_frame_pc (fromleaf, fi); +} + + +static void +x86_64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + x86_64_init_abi (info, gdbarch); +} + +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_x86_64_linux_tdep (void); + +void +_initialize_x86_64_linux_tdep (void) +{ + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_LINUX, + x86_64_linux_init_abi); } diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index d9356ec..4b3f45b 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -176,15 +176,6 @@ x86_64_register_virtual_type (int regno) return *x86_64_register_info_table[regno].type; } -/* FIXME: cagney/2002-11-11: Once the i386 and x86-64 targets are - merged, this function can go away. */ -int -i386_fp_regnum_p (int regnum) -{ - return (regnum < NUM_REGS - && (FP0_REGNUM && FP0_REGNUM <= (regnum) && (regnum) < FPC_REGNUM)); -} - /* x86_64_register_convertible is true if register N's virtual format is different from its raw format. Note that this definition assumes that the host supports IEEE 32-bit floats, since it doesn't say @@ -922,7 +913,7 @@ x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr) return breakpoint; } -static void +void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -1026,6 +1017,8 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* FIXME: kettenis/20021026: This one is GNU/Linux-specific too. */ set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_in_sigtramp); + set_gdbarch_num_pseudo_regs (gdbarch, 0); + /* Build call frame information (CFI) from DWARF2 frame debug info. */ set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info); @@ -1033,7 +1026,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_init_extra_frame_info (gdbarch, cfi_init_extra_frame_info); /* Frame PC initialization is handled by using CFI. */ - set_gdbarch_init_frame_pc (gdbarch, x86_64_init_frame_pc); + set_gdbarch_deprecated_init_frame_pc (gdbarch, x86_64_init_frame_pc); /* Cons up virtual frame pointer for trace. */ set_gdbarch_virtual_frame_pointer (gdbarch, cfi_virtual_frame_pointer); @@ -1044,86 +1037,9 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); } -static struct gdbarch * -x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) -{ - struct gdbarch_tdep *tdep; - struct gdbarch *gdbarch; - enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; - - /* Try to determine the OS ABI of the object we're loading. */ - if (info.abfd != NULL) - osabi = gdbarch_lookup_osabi (info.abfd); - - /* Find a candidate among extant architectures. */ - for (arches = gdbarch_list_lookup_by_info (arches, &info); - arches != NULL; - arches = gdbarch_list_lookup_by_info (arches->next, &info)) - { - /* Make sure the OS ABI selection matches. */ - tdep = gdbarch_tdep (arches->gdbarch); - if (tdep && tdep->osabi == osabi) - return arches->gdbarch; - } - - /* Allocate space for the new architecture. */ - tdep = XMALLOC (struct gdbarch_tdep); - gdbarch = gdbarch_alloc (&info, tdep); - - tdep->osabi = osabi; - - /* FIXME: kettenis/20021025: The following calls are going to - disappear when we integrate the x86_64 target into the i386 - target. */ - - set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext); - - set_gdbarch_max_register_raw_size (gdbarch, 16); - set_gdbarch_max_register_virtual_size (gdbarch, 16); - - set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - - set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc); - set_gdbarch_decr_pc_after_break (gdbarch, 1); - set_gdbarch_function_start_offset (gdbarch, 0); - - set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); - - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); - - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); - set_gdbarch_call_dummy_address (gdbarch, entry_point_address); - set_gdbarch_call_dummy_start_offset (gdbarch, 0); - set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); - set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); - set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_call_dummy_p (gdbarch, 1); - set_gdbarch_call_dummy_words (gdbarch, NULL); - set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy); - set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0); - - set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point); - - set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); - - /* FIXME: kettenis/20021025: These already are the default. */ - - set_gdbarch_register_virtual_size (gdbarch, generic_register_size); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 0); - - x86_64_init_abi (info, gdbarch); - - return gdbarch; -} - void _initialize_x86_64_tdep (void) { - register_gdbarch_init (bfd_arch_i386, x86_64_gdbarch_init); - /* Initialize the table saying where each register starts in the register file. */ { @@ -1136,18 +1052,4 @@ _initialize_x86_64_tdep (void) offset += x86_64_register_info_table[i].size; } } - - tm_print_insn = gdb_print_insn_x86_64; - tm_print_insn_info.mach = bfd_mach_x86_64; - - /* Add the variable that controls the disassembly flavour. */ - { - struct cmd_list_element *new_cmd; - - new_cmd = add_set_enum_cmd ("disassembly-flavour", no_class, - valid_flavours, &disassembly_flavour, "\ -Set the disassembly flavour, the valid values are \"att\" and \"intel\", \ -and the default value is \"att\".", &setlist); - add_show_from_set (new_cmd, &showlist); - } } diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h index 4e73206..6977f9b 100644 --- a/gdb/x86-64-tdep.h +++ b/gdb/x86-64-tdep.h @@ -35,7 +35,8 @@ gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc; gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call; gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp; CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi); -void x86_64_init_frame_pc (int fromleaf, struct frame_info *fi); +CORE_ADDR x86_64_init_frame_pc (int fromleaf, struct frame_info *fi); +void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch); #endif diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index e2fe8d2..e93f93b 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -150,17 +150,25 @@ struct coff_symfile_info CORE_ADDR toc_offset; }; -static struct deprecated_complaint storclass_complaint = -{"Unexpected storage class: %d", 0, 0}; - -static struct deprecated_complaint bf_notfound_complaint = -{"line numbers off, `.bf' symbol not found", 0, 0}; +static void +bf_notfound_complaint (void) +{ + complaint (&symfile_complaints, "line numbers off, `.bf' symbol not found"); +} -static struct deprecated_complaint ef_complaint = -{"Mismatched .ef symbol ignored starting at symnum %d", 0, 0}; +static void +ef_complaint (int arg1) +{ + complaint (&symfile_complaints, + "Mismatched .ef symbol ignored starting at symnum %d", arg1); +} -static struct deprecated_complaint eb_complaint = -{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0}; +static void +eb_complaint (int arg1) +{ + complaint (&symfile_complaints, + "Mismatched .eb symbol ignored starting at symnum %d", arg1); +} static void xcoff_initial_scan (struct objfile *, int); @@ -483,9 +491,7 @@ record_include_begin (struct coff_symbol *cs) /* This can happen with old versions of GCC. GCC 2.3.3-930426 does not exhibit this on a test case which a user said produced the message for him. */ - static struct deprecated_complaint msg = - {"Nested C_BINCL symbols", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, "Nested C_BINCL symbols"); } ++inclDepth; @@ -502,9 +508,7 @@ record_include_end (struct coff_symbol *cs) if (inclDepth == 0) { - static struct deprecated_complaint msg = - {"Mismatched C_BINCL/C_EINCL pair", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, "Mismatched C_BINCL/C_EINCL pair"); } allocate_include_entry (); @@ -766,9 +770,8 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset, unsigned endoff { if (endoffset >= limit_offset) { - static struct deprecated_complaint msg = - {"Bad line table offset in C_EINCL directive", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, + "Bad line table offset in C_EINCL directive"); return; } limit_offset = endoffset; @@ -864,8 +867,6 @@ static char * xcoff_next_symbol_text (struct objfile *objfile) { struct internal_syment symbol; - static struct deprecated_complaint msg = - {"Unexpected symbol continuation", 0, 0}; char *retval; /* FIXME: is this the same as the passed arg? */ objfile = this_symtab_psymtab->objfile; @@ -873,7 +874,7 @@ xcoff_next_symbol_text (struct objfile *objfile) bfd_coff_swap_sym_in (objfile->obfd, raw_symbol, &symbol); if (symbol.n_zeroes) { - complain (&msg); + complaint (&symfile_complaints, "Unexpected symbol continuation"); /* Return something which points to '\0' and hope the symbol reading code does something reasonable. */ @@ -890,7 +891,7 @@ xcoff_next_symbol_text (struct objfile *objfile) } else { - complain (&msg); + complaint (&symfile_complaints, "Unexpected symbol continuation"); /* Return something which points to '\0' and hope the symbol reading code does something reasonable. */ @@ -1282,7 +1283,7 @@ read_xcoff_symtab (struct partial_symtab *pst) if (context_stack_depth <= 0) { /* We attempted to pop an empty context stack */ - complain (&ef_complaint, cs->c_symnum); + ef_complaint (cs->c_symnum); within_function = 0; break; } @@ -1290,7 +1291,7 @@ read_xcoff_symtab (struct partial_symtab *pst) /* Stack must be empty now. */ if (context_stack_depth > 0 || new == NULL) { - complain (&ef_complaint, cs->c_symnum); + ef_complaint (cs->c_symnum); within_function = 0; break; } @@ -1332,9 +1333,8 @@ read_xcoff_symtab (struct partial_symtab *pst) case C_UNTAG: case C_ENTAG: { - static struct deprecated_complaint msg = - {"Unrecognized storage class %d.", 0, 0}; - complain (&msg, cs->c_sclass); + complaint (&symfile_complaints, "Unrecognized storage class %d.", + cs->c_sclass); } break; @@ -1376,13 +1376,13 @@ read_xcoff_symtab (struct partial_symtab *pst) { if (context_stack_depth <= 0) { /* We attempted to pop an empty context stack */ - complain (&eb_complaint, cs->c_symnum); + eb_complaint (cs->c_symnum); break; } new = pop_context (); if (depth-- != new->depth) { - complain (&eb_complaint, cs->c_symnum); + eb_complaint (cs->c_symnum); break; } if (local_symbols && context_stack_depth > 0) @@ -1520,7 +1520,8 @@ process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile) break; default: - complain (&storclass_complaint, cs->c_sclass); + complaint (&symfile_complaints, "Unexpected storage class: %d", + cs->c_sclass); /* FALLTHROUGH */ case C_DECL: @@ -1603,9 +1604,7 @@ read_symbol (struct internal_syment *symbol, int symno) ->symtbl; if (symno < 0 || symno >= nsyms) { - static struct deprecated_complaint msg = - {"Invalid symbol offset", 0, 0}; - complain (&msg); + complaint (&symfile_complaints, "Invalid symbol offset"); symbol->n_value = 0; symbol->n_scnum = -1; return; @@ -1634,7 +1633,7 @@ static int read_symbol_lineno (int symno) { struct objfile *objfile = this_symtab_psymtab->objfile; - boolean xcoff64 = bfd_xcoff_is_xcoff64 (objfile->obfd); + int xcoff64 = bfd_xcoff_is_xcoff64 (objfile->obfd); struct coff_symfile_info *info = (struct coff_symfile_info *)objfile->sym_private; @@ -1647,7 +1646,7 @@ read_symbol_lineno (int symno) if (symno < 0) { - complain (&bf_notfound_complaint); + bf_notfound_complaint (); return 0; } @@ -1680,7 +1679,7 @@ read_symbol_lineno (int symno) symno += symbol->n_numaux + 1; } - complain (&bf_notfound_complaint); + bf_notfound_complaint (); return 0; gotit: @@ -2117,6 +2116,14 @@ swap_sym (struct internal_syment *symbol, union internal_auxent *aux, } static void +function_outside_compilation_unit_complaint (const char *arg1) +{ + complaint (&symfile_complaints, + "function `%s' appears to be defined outside of all compilation units", + arg1); +} + +static void scan_xcoff_symtab (struct objfile *objfile) { CORE_ADDR toc_offset = 0; /* toc offset value in data section. */ @@ -2441,9 +2448,8 @@ scan_xcoff_symtab (struct objfile *objfile) default: { - static struct deprecated_complaint msg = - {"Storage class %d not recognized during scan", 0, 0}; - complain (&msg, sclass); + complaint (&symfile_complaints, + "Storage class %d not recognized during scan", sclass); } /* FALLTHROUGH */ @@ -2563,11 +2569,6 @@ scan_xcoff_symtab (struct objfile *objfile) case C_DECL: case C_STSYM: { - - static struct deprecated_complaint function_outside_compilation_unit = { - "function `%s' appears to be defined outside of all compilation units", 0, 0 - }; - char *p; swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol, &ssymnum, objfile); @@ -2747,7 +2748,7 @@ scan_xcoff_symtab (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -2768,7 +2769,7 @@ scan_xcoff_symtab (struct objfile *objfile) char *name = xmalloc (name_len + 1); memcpy (name, namestring, name_len); name[name_len] = '\0'; - complain (&function_outside_compilation_unit, name); + function_outside_compilation_unit_complaint (name); xfree (name); } symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -2819,7 +2820,8 @@ scan_xcoff_symtab (struct objfile *objfile) time searching to the end of every string looking for a backslash. */ - complain (&unknown_symchar_complaint, p[1]); + complaint (&symfile_complaints, + "unknown symbol descriptor `%c'", p[1]); /* Ignore it; perhaps it is an extension that we don't know about. */ diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index f111516..fb7ff3c 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -333,7 +333,7 @@ xstormy16_pop_frame (void) if (fi == NULL) return; /* paranoia */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { generic_pop_dummy_frame (); } @@ -466,7 +466,7 @@ xstormy16_scan_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, if (fi) { /* In a call dummy, don't touch the frame. */ - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) return start_addr; /* Grab the frame-relative values of SP and FP, needed below. @@ -756,7 +756,7 @@ xstormy16_frame_saved_pc (struct frame_info *fi) { CORE_ADDR saved_pc; - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { saved_pc = deprecated_read_register_dummy (fi->pc, fi->frame, E_PC_REGNUM); @@ -817,7 +817,7 @@ xstormy16_init_extra_frame_info (int fromleaf, struct frame_info *fi) static CORE_ADDR xstormy16_frame_chain (struct frame_info *fi) { - if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) + if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame)) { /* Call dummy's frame is the same as caller's. */ return fi->frame; @@ -1023,6 +1023,10 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch = gdbarch_alloc (&info, 0); + /* NOTE: cagney/2002-12-06: This can be deleted when this arch is + ready to unwind the PC first (see frame.c:get_prev_frame()). */ + set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default); + /* * Basic register fields and methods. */ @@ -1055,8 +1059,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc); set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue); set_gdbarch_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid); - set_gdbarch_frame_args_address (gdbarch, default_frame_address); - set_gdbarch_frame_locals_address (gdbarch, default_frame_address); set_gdbarch_in_function_epilogue_p (gdbarch, xstormy16_in_function_epilogue_p); @@ -1084,7 +1086,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) * Call Dummies * * These values and methods are used when gdb calls a target function. */ - set_gdbarch_use_generic_dummy_frames (gdbarch, 1); set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame); set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address); set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value); @@ -1095,13 +1096,11 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, xstormy16_use_struct_convention); - set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT); set_gdbarch_call_dummy_address (gdbarch, entry_point_address); set_gdbarch_call_dummy_start_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0); set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1); set_gdbarch_call_dummy_length (gdbarch, 0); - set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy); set_gdbarch_call_dummy_p (gdbarch, 1); set_gdbarch_call_dummy_words (gdbarch, call_dummy_words); set_gdbarch_sizeof_call_dummy_words (gdbarch, 0); diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c index e06f343..e1aa8fa 100644 --- a/gdb/z8k-tdep.c +++ b/gdb/z8k-tdep.c @@ -166,12 +166,6 @@ z8k_frame_chain (struct frame_info *thisframe) return 0; } -void -init_frame_pc (void) -{ - internal_error (__FILE__, __LINE__, "failed internal consistency check"); -} - /* Put here the code to store, into a struct frame_saved_regs, the addresses of the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special @@ -249,7 +243,7 @@ frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp) pc = skip_adjust (get_pc_function_start (fip->pc), &locals); { - adr = FRAME_FP (fip) - locals; + adr = get_frame_base (fip) - locals; for (i = 0; i < 8; i++) { int word = read_memory_short (pc); @@ -327,8 +321,8 @@ z8k_print_register_hook (int regno) { unsigned char l[4]; - frame_register_read (selected_frame, regno, l + 0); - frame_register_read (selected_frame, regno + 1, l + 2); + frame_register_read (deprecated_selected_frame, regno, l + 0); + frame_register_read (deprecated_selected_frame, regno + 1, l + 2); printf_unfiltered ("\t"); printf_unfiltered ("0x%02x%02x%02x%02x", l[0], l[1], l[2], l[3]); } @@ -337,10 +331,10 @@ z8k_print_register_hook (int regno) { unsigned char l[8]; - frame_register_read (selected_frame, regno, l + 0); - frame_register_read (selected_frame, regno + 1, l + 2); - frame_register_read (selected_frame, regno + 2, l + 4); - frame_register_read (selected_frame, regno + 3, l + 6); + frame_register_read (deprecated_selected_frame, regno, l + 0); + frame_register_read (deprecated_selected_frame, regno + 1, l + 2); + frame_register_read (deprecated_selected_frame, regno + 2, l + 4); + frame_register_read (deprecated_selected_frame, regno + 3, l + 6); printf_unfiltered ("\t"); printf_unfiltered ("0x%02x%02x%02x%02x%02x%02x%02x%02x", @@ -351,7 +345,7 @@ z8k_print_register_hook (int regno) unsigned short rval; int i; - frame_register_read (selected_frame, regno, (char *) (&rval)); + frame_register_read (deprecated_selected_frame, regno, (char *) (&rval)); printf_unfiltered ("\n"); for (i = 0; i < 10; i += 2) @@ -469,8 +463,8 @@ z8k_print_registers_info (struct gdbarch *gdbarch, void z8k_do_registers_info (int regnum, int all) { - z8k_print_registers_info (current_gdbarch, gdb_stdout, selected_frame, - regnum, all); + z8k_print_registers_info (current_gdbarch, gdb_stdout, + deprecated_selected_frame, regnum, all); } void -- cgit v1.1