summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/29k-share/README9
-rw-r--r--gdb/29k-share/udi/udi2go32.c607
-rw-r--r--gdb/29k-share/udi/udiids.h48
-rw-r--r--gdb/29k-share/udi/udip2soc.c1250
-rw-r--r--gdb/29k-share/udi/udiphcfg.h44
-rw-r--r--gdb/29k-share/udi/udiphunix.h81
-rw-r--r--gdb/29k-share/udi/udiproc.h308
-rw-r--r--gdb/29k-share/udi/udipt29k.h87
-rw-r--r--gdb/29k-share/udi/udiptcfg.h19
-rw-r--r--gdb/29k-share/udi/udisoc.h184
-rw-r--r--gdb/29k-share/udi/udr.c427
-rw-r--r--gdb/29k-share/udi_soc9
-rw-r--r--gdb/ChangeLog4467
-rw-r--r--gdb/MAINTAINERS110
-rw-r--r--gdb/Makefile.in1427
-rw-r--r--gdb/NEWS78
-rw-r--r--gdb/PROBLEMS19
-rw-r--r--gdb/README89
-rw-r--r--gdb/abug-rom.c23
-rw-r--r--gdb/ada-exp.tab.c2389
-rw-r--r--gdb/ada-exp.y4
-rw-r--r--gdb/ada-lang.c5945
-rw-r--r--gdb/ada-lang.h255
-rw-r--r--gdb/ada-lex.c3174
-rw-r--r--gdb/ada-tasks.c366
-rw-r--r--gdb/ada-typeprint.c463
-rw-r--r--gdb/ada-valprint.c412
-rw-r--r--gdb/aix-thread.c1707
-rw-r--r--gdb/alpha-osf1-tdep.c4
-rw-r--r--gdb/alpha-tdep.c106
-rw-r--r--gdb/arc-tdep.c1475
-rw-r--r--gdb/arch-utils.c88
-rw-r--r--gdb/arch-utils.h27
-rw-r--r--gdb/arm-linux-tdep.c2
-rw-r--r--gdb/arm-tdep.c233
-rw-r--r--gdb/avr-tdep.c20
-rw-r--r--gdb/ax-general.c1
-rw-r--r--gdb/bcache.c75
-rw-r--r--gdb/bcache.h62
-rw-r--r--gdb/blockframe.c310
-rw-r--r--gdb/breakpoint.c202
-rw-r--r--gdb/breakpoint.h10
-rw-r--r--gdb/buildsym.c59
-rw-r--r--gdb/buildsym.h8
-rw-r--r--gdb/c-exp.y4
-rw-r--r--gdb/c-lang.c6
-rw-r--r--gdb/c-typeprint.c97
-rw-r--r--gdb/ch-exp.c4466
-rw-r--r--gdb/ch-lang.c1326
-rw-r--r--gdb/ch-lang.h82
-rw-r--r--gdb/ch-typeprint.c680
-rw-r--r--gdb/ch-valprint.c1210
-rw-r--r--gdb/cli/cli-cmds.c1
-rw-r--r--gdb/cli/cli-decode.c145
-rw-r--r--gdb/cli/cli-decode.h23
-rw-r--r--gdb/cli/cli-dump.c26
-rw-r--r--gdb/cli/cli-interp.c114
-rw-r--r--gdb/cli/cli-script.c1
-rw-r--r--gdb/cli/cli-setshow.c23
-rw-r--r--gdb/coffread.c37
-rw-r--r--gdb/command.h77
-rw-r--r--gdb/config.in11
-rw-r--r--gdb/config/alpha/alpha.mt2
-rw-r--r--gdb/config/alpha/nm-linux.h2
-rw-r--r--gdb/config/alpha/tm-alphalinux.h2
-rw-r--r--gdb/config/arc/arc.mt6
-rw-r--r--gdb/config/arc/tm-arc.h672
-rw-r--r--gdb/config/arm/nm-linux.h2
-rw-r--r--gdb/config/arm/tm-linux.h2
-rw-r--r--gdb/config/arm/xm-nbsd.h2
-rw-r--r--gdb/config/d30v/d30v.mt10
-rw-r--r--gdb/config/d30v/tm-d30v.h646
-rw-r--r--gdb/config/djgpp/fnchange.lst29
-rw-r--r--gdb/config/fr30/fr30.mt10
-rw-r--r--gdb/config/fr30/tm-fr30.h466
-rw-r--r--gdb/config/frv/frv.mt5
-rw-r--r--gdb/config/frv/tm-frv.h62
-rw-r--r--gdb/config/h8300/tm-h8300.h8
-rw-r--r--gdb/config/h8500/tm-h8500.h6
-rw-r--r--gdb/config/i386/i386aix.mh18
-rw-r--r--gdb/config/i386/i386aix.mt14
-rw-r--r--gdb/config/i386/i386aout.mt4
-rw-r--r--gdb/config/i386/i386gnu.mh4
-rw-r--r--gdb/config/i386/i386gnu.mt6
-rw-r--r--gdb/config/i386/i386m3.mh12
-rw-r--r--gdb/config/i386/i386m3.mt6
-rw-r--r--gdb/config/i386/i386mach.mh18
-rw-r--r--gdb/config/i386/i386nw.mt2
-rw-r--r--gdb/config/i386/i386os9k.mt6
-rw-r--r--gdb/config/i386/i386sco5.mt2
-rw-r--r--gdb/config/i386/i386sol2.mh3
-rw-r--r--gdb/config/i386/i386sol2.mt4
-rw-r--r--gdb/config/i386/i386v.mt2
-rw-r--r--gdb/config/i386/nm-fbsd.h4
-rw-r--r--gdb/config/i386/nm-i386.h4
-rw-r--r--gdb/config/i386/nm-i386aix.h86
-rw-r--r--gdb/config/i386/nm-i386bsd.h2
-rw-r--r--gdb/config/i386/nm-i386gnu.h (renamed from gdb/config/i386/nm-gnu.h)21
-rw-r--r--gdb/config/i386/nm-i386lynx.h2
-rw-r--r--gdb/config/i386/nm-i386mach.h60
-rw-r--r--gdb/config/i386/nm-i386sco.h11
-rw-r--r--gdb/config/i386/nm-i386sco5.h52
-rw-r--r--gdb/config/i386/nm-i386sol2.h2
-rw-r--r--gdb/config/i386/nm-i386v.h41
-rw-r--r--gdb/config/i386/nm-i386v4.h2
-rw-r--r--gdb/config/i386/nm-i386v42mp.h2
-rw-r--r--gdb/config/i386/nm-linux.h7
-rw-r--r--gdb/config/i386/nm-m3.h46
-rw-r--r--gdb/config/i386/nm-ptx4.h4
-rw-r--r--gdb/config/i386/nm-x86-64linux.h (renamed from gdb/config/i386/nm-x86-64.h)2
-rw-r--r--gdb/config/i386/obsd.mh8
-rw-r--r--gdb/config/i386/obsd.mt3
-rw-r--r--gdb/config/i386/tm-cygwin.h7
-rw-r--r--gdb/config/i386/tm-fbsd.h67
-rw-r--r--gdb/config/i386/tm-go32.h40
-rw-r--r--gdb/config/i386/tm-i386.h348
-rw-r--r--gdb/config/i386/tm-i386aix.h96
-rw-r--r--gdb/config/i386/tm-i386gnu.h56
-rw-r--r--gdb/config/i386/tm-i386lynx.h9
-rw-r--r--gdb/config/i386/tm-i386m3.h112
-rw-r--r--gdb/config/i386/tm-i386mk.h76
-rw-r--r--gdb/config/i386/tm-i386nw.h49
-rw-r--r--gdb/config/i386/tm-i386sco5.h63
-rw-r--r--gdb/config/i386/tm-i386sol2.h23
-rw-r--r--gdb/config/i386/tm-i386v4.h60
-rw-r--r--gdb/config/i386/tm-linux.h87
-rw-r--r--gdb/config/i386/tm-nbsd.h40
-rw-r--r--gdb/config/i386/tm-nbsdaout.h8
-rw-r--r--gdb/config/i386/tm-obsd.h77
-rw-r--r--gdb/config/i386/tm-ptx.h32
-rw-r--r--gdb/config/i386/tm-ptx4.h2
-rw-r--r--gdb/config/i386/tm-symmetry.h33
-rw-r--r--gdb/config/i386/tm-vxworks.h4
-rw-r--r--gdb/config/i386/tm-x86-64linux.h (renamed from gdb/config/sparc/tm-nbsdaout.h)24
-rw-r--r--gdb/config/i386/x86-64linux.mh2
-rw-r--r--gdb/config/i386/x86-64linux.mt6
-rw-r--r--gdb/config/i386/xm-i386aix.h58
-rw-r--r--gdb/config/i386/xm-i386m3.h66
-rw-r--r--gdb/config/i386/xm-i386mach.h56
-rw-r--r--gdb/config/i386/xm-i386mk.h52
-rw-r--r--gdb/config/i386/xm-i386v4.h2
-rw-r--r--gdb/config/i386/xm-nbsd.h2
-rw-r--r--gdb/config/i386/xm-ptx.h2
-rw-r--r--gdb/config/i386/xm-ptx4.h4
-rw-r--r--gdb/config/i960/mon960.mt11
-rw-r--r--gdb/config/i960/nindy960.mt6
-rw-r--r--gdb/config/i960/tm-i960.h690
-rw-r--r--gdb/config/i960/tm-mon960.h138
-rw-r--r--gdb/config/i960/tm-nindy960.h212
-rw-r--r--gdb/config/i960/tm-vx960.h104
-rw-r--r--gdb/config/i960/vxworks960.mt12
-rw-r--r--gdb/config/ia64/ia64.mt2
-rw-r--r--gdb/config/ia64/nm-aix.h2
-rw-r--r--gdb/config/ia64/nm-linux.h2
-rw-r--r--gdb/config/ia64/tm-aix.h2
-rw-r--r--gdb/config/ia64/tm-linux.h2
-rw-r--r--gdb/config/ia64/xm-aix.h2
-rw-r--r--gdb/config/m32r/tm-m32r.h10
-rw-r--r--gdb/config/m68k/apollo68b.mh10
-rw-r--r--gdb/config/m68k/apollo68b.mt6
-rw-r--r--gdb/config/m68k/apollo68v.mh20
-rw-r--r--gdb/config/m68k/hp300bsd.mh12
-rw-r--r--gdb/config/m68k/hp300bsd.mt6
-rw-r--r--gdb/config/m68k/hp300hpux.mh16
-rw-r--r--gdb/config/m68k/hp300hpux.mt16
-rw-r--r--gdb/config/m68k/nm-linux.h2
-rw-r--r--gdb/config/m68k/nm-m68klynx.h2
-rw-r--r--gdb/config/m68k/nm-sysv4.h2
-rw-r--r--gdb/config/m68k/tm-delta68.h8
-rw-r--r--gdb/config/m68k/tm-linux.h10
-rw-r--r--gdb/config/m68k/tm-m68k.h343
-rw-r--r--gdb/config/m68k/tm-m68klynx.h2
-rw-r--r--gdb/config/m68k/tm-m68kv4.h2
-rw-r--r--gdb/config/m68k/tm-sun2os4.h2
-rw-r--r--gdb/config/m68k/tm-sun3os4.h2
-rw-r--r--gdb/config/m68k/tm-vx68.h2
-rw-r--r--gdb/config/m68k/xm-m68kv4.h2
-rw-r--r--gdb/config/m68k/xm-nbsd.h2
-rw-r--r--gdb/config/m88k/delta88.mh12
-rw-r--r--gdb/config/m88k/delta88.mt6
-rw-r--r--gdb/config/m88k/delta88v4.mh16
-rw-r--r--gdb/config/m88k/delta88v4.mt6
-rw-r--r--gdb/config/m88k/m88k.mh8
-rw-r--r--gdb/config/m88k/m88k.mt6
-rw-r--r--gdb/config/m88k/nm-delta88v4.h46
-rw-r--r--gdb/config/m88k/nm-m88k.h50
-rw-r--r--gdb/config/m88k/tm-delta88.h56
-rw-r--r--gdb/config/m88k/tm-delta88v4.h64
-rw-r--r--gdb/config/m88k/tm-m88k.h1174
-rw-r--r--gdb/config/m88k/xm-delta88.h88
-rw-r--r--gdb/config/m88k/xm-delta88v4.h2
-rw-r--r--gdb/config/m88k/xm-dgux.h110
-rw-r--r--gdb/config/mcore/mcore.mt1
-rw-r--r--gdb/config/mcore/tm-mcore.h161
-rw-r--r--gdb/config/mips/irix5.mt2
-rw-r--r--gdb/config/mips/irix6.mh2
-rw-r--r--gdb/config/mips/irix6.mt2
-rw-r--r--gdb/config/mips/nm-irix5.h6
-rw-r--r--gdb/config/mips/nm-linux.h2
-rw-r--r--gdb/config/mips/tm-embed.h3
-rw-r--r--gdb/config/mips/tm-irix5.h15
-rw-r--r--gdb/config/mips/tm-irix6.h28
-rw-r--r--gdb/config/mips/tm-linux.h13
-rw-r--r--gdb/config/mips/tm-mips.h273
-rw-r--r--gdb/config/mips/tm-mips64.h2
-rw-r--r--gdb/config/mips/tm-mipsm3.h2
-rw-r--r--gdb/config/mips/tm-mipsv4.h5
-rw-r--r--gdb/config/mips/tm-nbsd.h5
-rw-r--r--gdb/config/mips/tm-vxmips.h2
-rw-r--r--gdb/config/mips/xm-irix5.h2
-rw-r--r--gdb/config/mips/xm-mipsv4.h2
-rw-r--r--gdb/config/mn10200/tm-mn10200.h13
-rw-r--r--gdb/config/ns32k/xm-nbsd.h2
-rw-r--r--gdb/config/pa/hppa.mt2
-rw-r--r--gdb/config/pa/nm-hppao.h2
-rw-r--r--gdb/config/pa/tm-hppa.h30
-rw-r--r--gdb/config/pa/tm-hppa64.h8
-rw-r--r--gdb/config/powerpc/aix.mt2
-rw-r--r--gdb/config/powerpc/aix432.mh19
-rw-r--r--gdb/config/powerpc/linux.mh4
-rw-r--r--gdb/config/powerpc/linux.mt3
-rw-r--r--gdb/config/powerpc/nbsd.mh2
-rw-r--r--gdb/config/powerpc/nbsd.mt2
-rw-r--r--gdb/config/powerpc/nm-linux.h2
-rw-r--r--gdb/config/powerpc/ppc-eabi.mt2
-rw-r--r--gdb/config/powerpc/ppc-sim.mt2
-rw-r--r--gdb/config/powerpc/ppcle-eabi.mt2
-rw-r--r--gdb/config/powerpc/ppcle-sim.mt2
-rw-r--r--gdb/config/powerpc/tm-linux.h2
-rw-r--r--gdb/config/powerpc/tm-vxworks.h2
-rw-r--r--gdb/config/powerpc/vxworks.mt2
-rw-r--r--gdb/config/powerpc/xm-aix.h2
-rw-r--r--gdb/config/romp/rtbsd.mh8
-rw-r--r--gdb/config/rs6000/aix4.mt2
-rw-r--r--gdb/config/rs6000/nm-rs6000ly.h2
-rw-r--r--gdb/config/rs6000/rs6000.mt2
-rw-r--r--gdb/config/rs6000/rs6000lynx.mt2
-rw-r--r--gdb/config/rs6000/tm-rs6000.h5
-rw-r--r--gdb/config/rs6000/tm-rs6000ly.h2
-rw-r--r--gdb/config/rs6000/xm-aix4.h2
-rw-r--r--gdb/config/sh/tm-linux.h2
-rw-r--r--gdb/config/sparc/nbsdaout.mh4
-rw-r--r--gdb/config/sparc/nbsdaout.mt3
-rw-r--r--gdb/config/sparc/nbsdelf.mh4
-rw-r--r--gdb/config/sparc/nbsdelf.mt3
-rw-r--r--gdb/config/sparc/nm-linux.h4
-rw-r--r--gdb/config/sparc/nm-nbsd.h28
-rw-r--r--gdb/config/sparc/nm-sparclynx.h2
-rw-r--r--gdb/config/sparc/nm-sun4sol2.h2
-rw-r--r--gdb/config/sparc/tm-linux.h2
-rw-r--r--gdb/config/sparc/tm-nbsd.h5
-rw-r--r--gdb/config/sparc/tm-sp64.h4
-rw-r--r--gdb/config/sparc/tm-sp64linux.h4
-rw-r--r--gdb/config/sparc/tm-sp64sim.h2
-rw-r--r--gdb/config/sparc/tm-sparc.h6
-rw-r--r--gdb/config/sparc/tm-sparclet.h8
-rw-r--r--gdb/config/sparc/tm-sparclynx.h2
-rw-r--r--gdb/config/sparc/tm-sun4os4.h2
-rw-r--r--gdb/config/sparc/tm-sun4sol2.h2
-rw-r--r--gdb/config/sparc/tm-vxsparc.h2
-rw-r--r--gdb/config/sparc/xm-nbsd.h22
-rw-r--r--gdb/config/sparc/xm-sun4sol2.h2
-rw-r--r--gdb/config/tm-linux.h2
-rw-r--r--gdb/config/vax/nm-vax.h2
-rw-r--r--gdb/config/vax/tm-vax.h27
-rw-r--r--gdb/config/vax/tm-vaxbsd.h41
-rw-r--r--gdb/config/vax/vax.mt2
-rw-r--r--gdb/config/z8k/tm-z8k.h6
-rwxr-xr-xgdb/configure815
-rw-r--r--gdb/configure.host30
-rw-r--r--gdb/configure.in12
-rw-r--r--gdb/configure.tgt82
-rw-r--r--gdb/corefile.c20
-rw-r--r--gdb/cp-valprint.c2
-rw-r--r--gdb/cpu32bug-rom.c23
-rw-r--r--gdb/cris-tdep.c26
-rw-r--r--gdb/cxux-nat.c1074
-rw-r--r--gdb/d10v-tdep.c159
-rw-r--r--gdb/d30v-tdep.c2730
-rw-r--r--gdb/dbug-rom.c27
-rw-r--r--gdb/dbxread.c2
-rw-r--r--gdb/defs.h26
-rw-r--r--gdb/doc/ChangeLog118
-rw-r--r--gdb/doc/gdb.texinfo2196
-rw-r--r--gdb/doc/gdbint.texinfo580
-rw-r--r--gdb/doc/stabs.texinfo6
-rw-r--r--gdb/doublest.c1
-rw-r--r--gdb/dst.h3342
-rw-r--r--gdb/dstread.c3194
-rw-r--r--gdb/dwarf2cfi.c578
-rw-r--r--gdb/dwarf2read.c208
-rw-r--r--gdb/dwarfread.c16
-rw-r--r--gdb/elfread.c24
-rw-r--r--gdb/eval.c16
-rw-r--r--gdb/event-loop.c20
-rw-r--r--gdb/event-top.c61
-rw-r--r--gdb/event-top.h2
-rw-r--r--gdb/expprint.c28
-rw-r--r--gdb/expression.h31
-rw-r--r--gdb/f-exp.y4
-rw-r--r--gdb/f-typeprint.c2
-rw-r--r--gdb/fbsd-proc.c1
-rw-r--r--gdb/findvar.c16
-rw-r--r--gdb/fr30-tdep.c1202
-rw-r--r--gdb/frame.c210
-rw-r--r--gdb/frame.h72
-rw-r--r--gdb/frv-tdep.c1173
-rw-r--r--gdb/gcore.c50
-rw-r--r--gdb/gdb-events.c31
-rw-r--r--gdb/gdb-events.h7
-rwxr-xr-xgdb/gdb-events.sh18
-rwxr-xr-xgdb/gdb_indent.sh5
-rw-r--r--gdb/gdb_locale.h (renamed from gdb/config/romp/xm-rtbsd.h)43
-rw-r--r--gdb/gdb_obstack.h (renamed from gdb/config/i386/xm-i386gnu.h)19
-rw-r--r--gdb/gdbarch.c531
-rw-r--r--gdb/gdbarch.h321
-rwxr-xr-xgdb/gdbarch.sh132
-rw-r--r--gdb/gdbinit.in4
-rw-r--r--gdb/gdbserver/ChangeLog412
-rw-r--r--gdb/gdbserver/Makefile.in9
-rw-r--r--gdb/gdbserver/acconfig.h15
-rw-r--r--gdb/gdbserver/aclocal.m4124
-rw-r--r--gdb/gdbserver/config.in36
-rwxr-xr-xgdb/gdbserver/configure327
-rw-r--r--gdb/gdbserver/configure.in63
-rw-r--r--gdb/gdbserver/configure.srv5
-rw-r--r--gdb/gdbserver/gdbreplay.c18
-rw-r--r--gdb/gdbserver/i387-fp.c6
-rw-r--r--gdb/gdbserver/i387-fp.h4
-rw-r--r--gdb/gdbserver/inferiors.c156
-rw-r--r--gdb/gdbserver/linux-arm-low.c40
-rw-r--r--gdb/gdbserver/linux-i386-low.c43
-rw-r--r--gdb/gdbserver/linux-low.c876
-rw-r--r--gdb/gdbserver/linux-low.h71
-rw-r--r--gdb/gdbserver/linux-mips-low.c51
-rw-r--r--gdb/gdbserver/linux-ppc-low.c44
-rw-r--r--gdb/gdbserver/linux-sh-low.c40
-rw-r--r--gdb/gdbserver/linux-x86-64-low.c26
-rw-r--r--gdb/gdbserver/regcache.c78
-rw-r--r--gdb/gdbserver/regcache.h15
-rw-r--r--gdb/gdbserver/remote-utils.c100
-rw-r--r--gdb/gdbserver/server.c58
-rw-r--r--gdb/gdbserver/server.h55
-rw-r--r--gdb/gdbserver/target.c69
-rw-r--r--gdb/gdbserver/target.h14
-rw-r--r--gdb/gdbtypes.c177
-rw-r--r--gdb/gdbtypes.h60
-rw-r--r--gdb/gnu-v2-abi.c23
-rw-r--r--gdb/gnu-v3-abi.c36
-rw-r--r--gdb/h8300-tdep.c25
-rw-r--r--gdb/h8500-tdep.c1
-rw-r--r--gdb/hpread.c43
-rw-r--r--gdb/i386-linux-nat.c19
-rw-r--r--gdb/i386-linux-tdep.c177
-rw-r--r--gdb/i386-nat.c8
-rw-r--r--gdb/i386-sol2-tdep.c10
-rw-r--r--gdb/i386-tdep.c999
-rw-r--r--gdb/i386-tdep.h81
-rw-r--r--gdb/i386aix-nat.c754
-rw-r--r--gdb/i386b-nat.c219
-rw-r--r--gdb/i386bsd-nat.c53
-rw-r--r--gdb/i386bsd-tdep.c229
-rw-r--r--gdb/i386fbsd-nat.c11
-rw-r--r--gdb/i386gnu-nat.c16
-rw-r--r--gdb/i386gnu-tdep.c (renamed from gdb/config/i386/tm-i386v.h)33
-rw-r--r--gdb/i386ly-tdep.c61
-rw-r--r--gdb/i386m3-nat.c852
-rw-r--r--gdb/i386mach-nat.c344
-rw-r--r--gdb/i386nbsd-tdep.c14
-rw-r--r--gdb/i386obsd-nat.c60
-rw-r--r--gdb/i386v-nat.c52
-rw-r--r--gdb/i386v4-nat.c160
-rw-r--r--gdb/i387-tdep.c161
-rw-r--r--gdb/i387-tdep.h7
-rw-r--r--gdb/i960-tdep.c2111
-rw-r--r--gdb/ia64-tdep.c13
-rw-r--r--gdb/infcmd.c185
-rw-r--r--gdb/inferior.h10
-rw-r--r--gdb/infrun.c3183
-rw-r--r--gdb/interps.c659
-rw-r--r--gdb/interps.h74
-rw-r--r--gdb/irix5-nat.c1054
-rw-r--r--gdb/jv-exp.y48
-rw-r--r--gdb/jv-lang.c1
-rw-r--r--gdb/language.c35
-rw-r--r--gdb/language.h2
-rw-r--r--gdb/linux-proc.c15
-rw-r--r--gdb/m2-exp.y4
-rw-r--r--gdb/m32r-tdep.c1
-rw-r--r--gdb/m68hc11-tdep.c331
-rw-r--r--gdb/m68k-tdep.c488
-rw-r--r--gdb/m68klinux-nat.c2
-rw-r--r--gdb/m88k-nat.c580
-rw-r--r--gdb/m88k-tdep.c1322
-rw-r--r--gdb/macrocmd.c10
-rw-r--r--gdb/macroexp.c2
-rw-r--r--gdb/macroscope.c2
-rw-r--r--gdb/macrotab.c2
-rw-r--r--gdb/macrotab.h4
-rw-r--r--gdb/main.c85
-rw-r--r--gdb/maint.c21
-rw-r--r--gdb/mcore-tdep.c224
-rw-r--r--gdb/mdebugread.c8
-rw-r--r--gdb/memattr.c29
-rw-r--r--gdb/mi/ChangeLog10
-rw-r--r--gdb/mi/gdbmi.texinfo12
-rw-r--r--gdb/mi/mi-cmd-disas.c1
-rw-r--r--gdb/mi/mi-cmd-var.c1
-rw-r--r--gdb/mi/mi-cmds.c2
-rw-r--r--gdb/mi/mi-cmds.h6
-rw-r--r--gdb/mi/mi-events.c148
-rw-r--r--gdb/mi/mi-interp.c500
-rw-r--r--gdb/mi/mi-main.c187
-rw-r--r--gdb/mi/mi.h43
-rw-r--r--gdb/minsyms.c12
-rw-r--r--gdb/mips-irix-tdep.c95
-rw-r--r--gdb/mips-linux-tdep.c17
-rw-r--r--gdb/mips-tdep.c2213
-rw-r--r--gdb/mn10200-tdep.c1
-rw-r--r--gdb/mn10300-tdep.c13
-rw-r--r--gdb/mon960-rom.c1
-rw-r--r--gdb/monitor.c17
-rw-r--r--gdb/monitor.h3
-rw-r--r--gdb/ns32k-tdep.c57
-rw-r--r--gdb/objfiles.c19
-rw-r--r--gdb/objfiles.h16
-rw-r--r--gdb/os9kread.c3242
-rw-r--r--gdb/osabi.c22
-rw-r--r--gdb/osabi.h4
-rw-r--r--gdb/p-exp.y4
-rw-r--r--gdb/p-typeprint.c2
-rw-r--r--gdb/p-valprint.c2
-rw-r--r--gdb/pa64solib.c14
-rw-r--r--gdb/parse.c17
-rw-r--r--gdb/parser-defs.h7
-rw-r--r--gdb/ppc-linux-nat.c23
-rw-r--r--gdb/ppc-linux-tdep.c411
-rw-r--r--gdb/ppc-tdep.h8
-rw-r--r--gdb/ppcnbsd-nat.c2
-rw-r--r--gdb/ppcnbsd-tdep.c8
-rw-r--r--gdb/printcmd.c5
-rw-r--r--gdb/proc-api.c16
-rw-r--r--gdb/procfs.c37
-rw-r--r--gdb/rdi-share/devsw.c2
-rw-r--r--gdb/rdi-share/host.h10
-rw-r--r--gdb/rdi-share/hostchan.c2
-rw-r--r--gdb/rdi-share/hostchan.h10
-rw-r--r--gdb/rdi-share/serdrv.c2
-rw-r--r--gdb/rdi-share/serpardr.c2
-rw-r--r--gdb/rdi-share/unixcomm.c4
-rw-r--r--gdb/regcache.c972
-rw-r--r--gdb/regcache.h79
-rw-r--r--gdb/remote-bug.c2054
-rw-r--r--gdb/remote-es.c6
-rw-r--r--gdb/remote-est.c25
-rw-r--r--gdb/remote-nindy.c1524
-rw-r--r--gdb/remote-nrom.c702
-rw-r--r--gdb/remote-os9k.c2468
-rw-r--r--gdb/remote-rdi.c36
-rw-r--r--gdb/remote-rdp.c2
-rw-r--r--gdb/remote-sim.c96
-rw-r--r--gdb/remote-vx29k.c182
-rw-r--r--gdb/remote-vx960.c320
-rw-r--r--gdb/remote.c498
-rw-r--r--gdb/rom68k-rom.c24
-rw-r--r--gdb/rs6000-nat.c228
-rw-r--r--gdb/rs6000-tdep.c1081
-rw-r--r--gdb/s390-nat.c38
-rw-r--r--gdb/s390-tdep.c22
-rw-r--r--gdb/ser-e7kpc.c12
-rw-r--r--gdb/sh-tdep.c273
-rw-r--r--gdb/signals/signals.c24
-rw-r--r--gdb/solib-irix.c725
-rw-r--r--gdb/solib-osf.c9
-rw-r--r--gdb/solib-svr4.c22
-rw-r--r--gdb/somsolib.c8
-rw-r--r--gdb/source.c2
-rw-r--r--gdb/sparc-tdep.c93
-rw-r--r--gdb/sparcl-tdep.c2
-rw-r--r--gdb/stabsread.c262
-rw-r--r--gdb/stabsread.h20
-rw-r--r--gdb/stack.c124
-rw-r--r--gdb/std-regs.c1
-rw-r--r--gdb/symfile.c37
-rw-r--r--gdb/symmisc.c40
-rw-r--r--gdb/symtab.c192
-rw-r--r--gdb/symtab.h102
-rw-r--r--gdb/target.c201
-rw-r--r--gdb/target.h42
-rw-r--r--gdb/testsuite/ChangeLog137
-rw-r--r--gdb/testsuite/Makefile.in4
-rw-r--r--gdb/testsuite/config/gdbserver.exp52
-rwxr-xr-xgdb/testsuite/configure46
-rw-r--r--gdb/testsuite/configure.in1
-rw-r--r--gdb/testsuite/gdb.arch/altivec-abi.exp18
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp4
-rw-r--r--gdb/testsuite/gdb.base/attach.exp24
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp18
-rw-r--r--gdb/testsuite/gdb.base/d10v.ld188
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp7
-rw-r--r--gdb/testsuite/gdb.base/interrupt.exp10
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp19
-rw-r--r--gdb/testsuite/gdb.base/overlays.exp60
-rw-r--r--gdb/testsuite/gdb.base/page.exp47
-rw-r--r--gdb/testsuite/gdb.base/readline.exp190
-rw-r--r--gdb/testsuite/gdb.base/return.exp17
-rw-r--r--gdb/testsuite/gdb.base/selftest.exp18
-rw-r--r--gdb/testsuite/gdb.base/shlib-call.exp5
-rw-r--r--gdb/testsuite/gdb.chill/ChangeLog14
-rw-r--r--gdb/testsuite/gdb.chill/builtins.exp882
-rw-r--r--gdb/testsuite/gdb.chill/callch.exp138
-rw-r--r--gdb/testsuite/gdb.chill/chillvars.exp632
-rw-r--r--gdb/testsuite/gdb.chill/enum.exp170
-rw-r--r--gdb/testsuite/gdb.chill/gch1041.exp152
-rw-r--r--gdb/testsuite/gdb.chill/gch1272.exp172
-rw-r--r--gdb/testsuite/gdb.chill/gch1280.exp152
-rw-r--r--gdb/testsuite/gdb.chill/gch922.exp366
-rw-r--r--gdb/testsuite/gdb.chill/gch981.exp498
-rw-r--r--gdb/testsuite/gdb.chill/misc.exp200
-rw-r--r--gdb/testsuite/gdb.chill/powerset.exp374
-rw-r--r--gdb/testsuite/gdb.chill/pr-4975.exp134
-rw-r--r--gdb/testsuite/gdb.chill/pr-5016.exp123
-rw-r--r--gdb/testsuite/gdb.chill/pr-5020.exp170
-rw-r--r--gdb/testsuite/gdb.chill/pr-5022.exp140
-rw-r--r--gdb/testsuite/gdb.chill/pr-5646.exp128
-rw-r--r--gdb/testsuite/gdb.chill/pr-5984.exp114
-rw-r--r--gdb/testsuite/gdb.chill/pr-6292.exp116
-rw-r--r--gdb/testsuite/gdb.chill/pr-6632.exp132
-rw-r--r--gdb/testsuite/gdb.chill/pr-8134.exp130
-rw-r--r--gdb/testsuite/gdb.chill/pr-8136.exp126
-rw-r--r--gdb/testsuite/gdb.chill/pr-8405.exp122
-rw-r--r--gdb/testsuite/gdb.chill/pr-8742.exp128
-rw-r--r--gdb/testsuite/gdb.chill/pr-8894.exp122
-rw-r--r--gdb/testsuite/gdb.chill/pr-9095.exp124
-rw-r--r--gdb/testsuite/gdb.chill/pr-9946.exp158
-rw-r--r--gdb/testsuite/gdb.chill/result.exp154
-rw-r--r--gdb/testsuite/gdb.chill/string.exp146
-rw-r--r--gdb/testsuite/gdb.chill/tests1.exp1644
-rw-r--r--gdb/testsuite/gdb.chill/tests2.exp542
-rw-r--r--gdb/testsuite/gdb.chill/tuples.exp322
-rw-r--r--gdb/testsuite/gdb.chill/xstruct.exp132
-rw-r--r--gdb/testsuite/gdb.fortran/exprs.exp2
-rw-r--r--gdb/testsuite/gdb.fortran/types.exp2
-rwxr-xr-xgdb/testsuite/gdb.hp/configure40
-rw-r--r--gdb/testsuite/gdb.hp/configure.in2
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in27
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.threads-hp/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in15
-rw-r--r--gdb/testsuite/gdb.java/jv-print.exp4
-rw-r--r--gdb/testsuite/gdb.threads/print-threads.c58
-rw-r--r--gdb/testsuite/gdb.threads/print-threads.exp156
-rw-r--r--gdb/testsuite/gdb.threads/schedlock.c44
-rw-r--r--gdb/testsuite/gdb.threads/schedlock.exp353
-rw-r--r--gdb/testsuite/lib/gdb.exp82
-rw-r--r--gdb/thread.c1
-rw-r--r--gdb/top.c104
-rw-r--r--gdb/tracepoint.c2
-rw-r--r--gdb/tui/ChangeLog5
-rw-r--r--gdb/tui/tui.c2
-rw-r--r--gdb/typeprint.c22
-rw-r--r--gdb/ui-file.c94
-rw-r--r--gdb/ui-file.h7
-rw-r--r--gdb/ui-out.c4
-rw-r--r--gdb/utils.c19
-rw-r--r--gdb/uw-thread.c8
-rw-r--r--gdb/v850-tdep.c157
-rw-r--r--gdb/valarith.c30
-rw-r--r--gdb/valops.c328
-rw-r--r--gdb/valprint.c7
-rw-r--r--gdb/value.h9
-rw-r--r--gdb/values.c30
-rw-r--r--gdb/varobj.c94
-rw-r--r--gdb/vax-tdep.c127
-rw-r--r--gdb/vax-tdep.h8
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/win32-nat.c4
-rw-r--r--gdb/wince.c2
-rw-r--r--gdb/wrapper.c26
-rw-r--r--gdb/wrapper.h6
-rw-r--r--gdb/x86-64-linux-nat.c69
-rw-r--r--gdb/x86-64-tdep.c43
-rw-r--r--gdb/x86-64-tdep.h4
-rw-r--r--gdb/xcoffread.c1
-rw-r--r--gdb/xstormy16-tdep.c9
-rw-r--r--gdb/z8k-tdep.c22
585 files changed, 57949 insertions, 54644 deletions
diff --git a/gdb/29k-share/README b/gdb/29k-share/README
deleted file mode 100644
index 5e19715ffad..00000000000
--- a/gdb/29k-share/README
+++ /dev/null
@@ -1,9 +0,0 @@
-The files in this directory are shared with other debuggers and
-debug interfaces that use Advanced Micro Devices' UDI (universal debug
-interface) protocol. The protocol provides a common interface among
-debuggers, logic analyzers, emulators, and embedded systems that use
-AMD 29000 family processors.
-
-Do not change these files without coordinating with Advanced Micro
-Devices, Embedded Processor Division, 5204 E. Ben White Blvd, Austin, TX 78741.
-Maybe postmaster@cayman.amd.com can direct you to the current maintainers.
diff --git a/gdb/29k-share/udi/udi2go32.c b/gdb/29k-share/udi/udi2go32.c
deleted file mode 100644
index 63d98ae4017..00000000000
--- a/gdb/29k-share/udi/udi2go32.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
-
-Interface from UDI calls in 32-bit mode to go32 in 16-bit mode.
-Communication is done through a single interrupt vector, which passes
-data through two linear buffers.
-
-Call:
- AH = 0xfe
- AL = UDI function number
- ECX = IN length
- ESI = pointer to IN buffer
- EDI = pointer to OUT buffer
-
-Return:
- EAX = return value of UDI function
-
-Vector:
- 0x21
-
-*/
-#ifdef __GO32__
-
-#include <stdlib.h>
-#include "udiproc.h"
-#include "udisoc.h"
-
-char dfe_errmsg[500];
-
-static char in_buffer[4096];
-static char out_buffer[4096];
-static char *in_ptr;
-static char *out_ptr;
-
-#define IN_INIT() in_ptr = in_buffer
-#define IN_VAL(t,v) *((t *)in_ptr)++ = v
-#define IN_DATA(ptr, cnt) memcpy(in_ptr, ptr, cnt), in_ptr += cnt
-
-#define OUT_INIT() out_ptr = out_buffer
-#define OUT_VAL(t) (*((t *)out_ptr)++)
-#define OUT_DATA(ptr, cnt) memcpy(ptr, out_ptr, cnt), out_ptr += cnt
-
-static int DO_CALL(int function)
-{
- asm("pushl %esi");
- asm("pushl %edi");
- asm("movb %0, %%al" : : "g" (function));
- asm("movl _in_ptr, %ecx");
- asm("movl $_in_buffer, %esi");
- asm("subl %esi, %ecx");
- asm("movl $_out_buffer, %edi");
- asm("movb $0xfe, %ah");
- asm("int $0x21");
- asm("popl %edi");
- asm("popl %esi");
-}
-
-/*----------------------------------------------------------------------*/
-
-#ifdef TEST_UDI
-int main()
-{
- int r;
- long p2;
- short p1;
- IN_INIT();
- IN_VAL(long, 11111111);
- IN_VAL(short, 2222);
- IN_DATA("Hello, world\n", 17);
-
- r = DO_CALL(42);
-
- OUT_INIT();
- p1 = OUT_VAL(short);
- p2 = OUT_VAL(long);
- printf("main: p1=%d p2=%d rv=%d\n", p1, p2, r);
- return r;
-}
-#endif
-
-/*----------------------------------------------------------------------*/
-
-unsupported(char *s)
-{
- printf("unsupported UDI host call %s\n", s);
- abort();
-}
-
-UDIError UDIConnect (
- char *Configuration, /* In */
- UDISessionId *Session /* Out */
- )
-{
- int r;
- out_buffer[0] = 0; /* DJ - test */
- IN_INIT();
- IN_DATA(Configuration, strlen(Configuration)+1);
-
- r = DO_CALL(UDIConnect_c);
-
- OUT_INIT();
- *Session = OUT_VAL(UDISessionId);
- return r;
-}
-
-UDIError UDIDisconnect (
- UDISessionId Session, /* In */
- UDIBool Terminate /* In */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(UDISessionId, Session);
- IN_VAL(UDIBool, Terminate);
-
- return DO_CALL(UDIDisconnect_c);
-}
-
-UDIError UDISetCurrentConnection (
- UDISessionId Session /* In */
- )
-{
- IN_INIT();
- IN_VAL(UDISessionId, Session);
-
- return DO_CALL(UDISetCurrentConnection_c);
-}
-
-UDIError UDICapabilities (
- UDIUInt32 *TIPId, /* Out */
- UDIUInt32 *TargetId, /* Out */
- UDIUInt32 DFEId, /* In */
- UDIUInt32 DFE, /* In */
- UDIUInt32 *TIP, /* Out */
- UDIUInt32 *DFEIPCId, /* Out */
- UDIUInt32 *TIPIPCId, /* Out */
- char *TIPString /* Out */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(UDIUInt32, DFEId);
- IN_VAL(UDIUInt32, DFE);
- r = DO_CALL(UDICapabilities_c);
- OUT_INIT();
- *TIPId = OUT_VAL(UDIUInt32);
- *TargetId = OUT_VAL(UDIUInt32);
- *TIP = OUT_VAL(UDIUInt32);
- *DFEIPCId = OUT_VAL(UDIUInt32);
- *TIPIPCId = OUT_VAL(UDIUInt32);
- strcpy(TIPString, out_ptr);
- return r;
-}
-
-UDIError UDIEnumerateTIPs (
- UDIInt (*UDIETCallback) /* In */
- ( char *Configuration ) /* In to callback() */
- )
-{
- UDIETCallback("montip.exe");
-}
-
-UDIError UDIGetErrorMsg (
- UDIError ErrorCode, /* In */
- UDISizeT MsgSize, /* In */
- char *Msg, /* Out */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- if (MsgSize > 4000)
- MsgSize = 4000;
- IN_INIT();
- IN_VAL(UDIError, ErrorCode);
- IN_VAL(UDISizeT, MsgSize);
-
- r = DO_CALL(UDIGetErrorMsg_c);
-
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- OUT_DATA(Msg, *CountDone);
- return r;
-}
-
-UDIError UDIGetTargetConfig (
- UDIMemoryRange KnownMemory[], /* Out */
- UDIInt *NumberOfRanges, /* In/Out */
- UDIUInt32 ChipVersions[], /* Out */
- UDIInt *NumberOfChips /* In/Out */
- )
-{
- int r, i;
- int nr = *NumberOfRanges;
- int nc = *NumberOfChips;
- IN_INIT();
- IN_VAL(UDIInt, *NumberOfRanges);
- IN_VAL(UDIInt, *NumberOfChips);
- r = DO_CALL(UDIGetTargetConfig_c);
- if (r == UDIErrorIncomplete)
- return r;
- OUT_INIT();
- *NumberOfRanges = OUT_VAL(UDIInt);
- *NumberOfChips = OUT_VAL(UDIInt);
- for (i=0; i<nr; i++)
- {
- KnownMemory[i].Space = OUT_VAL(short);
- KnownMemory[i].Offset = OUT_VAL(CPUOffset);
- KnownMemory[i].Size = OUT_VAL(CPUSizeT);
- }
- for (i=0; i<nc; i++)
- {
- ChipVersions[i] = OUT_VAL(UDIUInt32);
- }
- return r;
-}
-
-UDIError UDICreateProcess (
- UDIPId *PId /* Out */
- )
-{
- int r = DO_CALL(UDICreateProcess_c);
-
- OUT_INIT();
- *PId = OUT_VAL(UDIPId);
-
- return r;
-}
-
-UDIError UDISetCurrentProcess (
- UDIPId PId /* In */
- )
-{
- IN_INIT();
- IN_VAL(UDIPId, PId);
-
- return DO_CALL(UDISetCurrentProcess_c);
-}
-
-UDIError UDIDestroyProcess (
- UDIPId PId /* In */
- )
-{
- IN_INIT();
- IN_VAL(UDIPId, PId);
-
- return DO_CALL(UDIDestroyProcess_c);
-}
-
-UDIError UDIInitializeProcess (
- UDIMemoryRange ProcessMemory[], /* In */
- UDIInt NumberOfRanges, /* In */
- UDIResource EntryPoint, /* In */
- CPUSizeT StackSizes[], /* In */
- UDIInt NumberOfStacks, /* In */
- char *ArgString /* In */
- )
-{
- int i, r;
- IN_INIT();
- IN_VAL(UDIInt, NumberOfRanges);
- for (i=0; i<NumberOfRanges; i++)
- {
- IN_VAL(short, ProcessMemory[i].Space);
- IN_VAL(CPUOffset, ProcessMemory[i].Offset);
- IN_VAL(CPUSizeT, ProcessMemory[i].Size);
- }
- IN_VAL(short, EntryPoint.Space);
- IN_VAL(CPUOffset, EntryPoint.Offset);
- IN_VAL(UDIInt, NumberOfStacks);
- for (i=0; i<NumberOfStacks; i++)
- IN_VAL(CPUSizeT, StackSizes[i]);
- IN_DATA(ArgString, strlen(ArgString)+1);
-
- return DO_CALL(UDIInitializeProcess_c);
-}
-
-UDIError UDIRead (
- UDIResource From, /* In */
- UDIHostMemPtr To, /* Out */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool HostEndian /* In */
- )
-{
- int cleft = Count, cthis, dthis;
- int cdone = 0, r, bsize=2048/Size;
-
- while (cleft)
- {
- cthis = (cleft<bsize) ? cleft : bsize;
- IN_INIT();
- IN_VAL(short, From.Space);
- IN_VAL(CPUOffset, From.Offset);
- IN_VAL(UDICount, cthis);
- IN_VAL(UDISizeT, Size);
- IN_VAL(UDIBool, HostEndian);
-
- r = DO_CALL(UDIRead_c);
-
- OUT_INIT();
- dthis = OUT_VAL(UDICount);
- OUT_DATA(To, dthis*Size);
- cdone += dthis;
- To += dthis*Size;
-
- if (r != UDINoError)
- {
- *CountDone = cdone;
- return r;
- }
- cleft -= cthis;
- }
- *CountDone = cdone;
- return UDINoError;
-}
-
-UDIError UDIWrite (
- UDIHostMemPtr From, /* In */
- UDIResource To, /* In */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool HostEndian /* In */
- )
-{
- int cleft = Count, cthis, dthis;
- int cdone = 0, r, bsize=2048/Size;
-
- while (cleft)
- {
- cthis = (cleft<bsize) ? cleft : bsize;
- IN_INIT();
- IN_VAL(short, To.Space);
- IN_VAL(CPUOffset, To.Offset);
- IN_VAL(UDICount, cthis);
- IN_VAL(UDISizeT, Size);
- IN_VAL(UDIBool, HostEndian);
- IN_DATA(From, cthis*Size);
- From += cthis*Size;
-
- r = DO_CALL(UDIWrite_c);
-
- OUT_INIT();
- cdone += OUT_VAL(UDICount);
-
- if (r != UDINoError)
- {
- *CountDone = cdone;
- return r;
- }
- cleft -= cthis;
- }
- *CountDone = cdone;
- return UDINoError;
-}
-
-UDIError UDICopy (
- UDIResource From, /* In */
- UDIResource To, /* In */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool Direction /* In */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(short, From.Space);
- IN_VAL(CPUOffset, From.Offset);
- IN_VAL(short, To.Space);
- IN_VAL(CPUOffset, To.Offset);
- IN_VAL(UDICount, Count);
- IN_VAL(UDISizeT, Size);
- IN_VAL(UDIBool, Direction);
-
- r = DO_CALL(UDICopy_c);
-
- OUT_INIT();
- *CountDone = OUT_VAL(UDICount);
-
- return r;
-}
-
-UDIError UDIExecute (
- void
- )
-{
- return DO_CALL(UDIExecute_c);
-}
-
-UDIError UDIStep (
- UDIUInt32 Steps, /* In */
- UDIStepType StepType, /* In */
- UDIRange Range /* In */
- )
-{
- IN_INIT();
- IN_VAL(UDIUInt32, Steps);
- IN_VAL(UDIStepType, StepType);
- IN_VAL(UDIRange, Range);
-
- return DO_CALL(UDIStep_c);
-}
-
-UDIVoid UDIStop (
- void
- )
-{
- DO_CALL(UDIStop_c);
-}
-
-UDIError UDIWait (
- UDIInt32 MaxTime, /* In */
- UDIPId *PId, /* Out */
- UDIUInt32 *StopReason /* Out */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(UDIInt32, MaxTime);
- r = DO_CALL(UDIWait_c);
- OUT_INIT();
- *PId = OUT_VAL(UDIPId);
- *StopReason = OUT_VAL(UDIUInt32);
- return r;
-}
-
-UDIError UDISetBreakpoint (
- UDIResource Addr, /* In */
- UDIInt32 PassCount, /* In */
- UDIBreakType Type, /* In */
- UDIBreakId *BreakId /* Out */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(short, Addr.Space);
- IN_VAL(CPUOffset, Addr.Offset);
- IN_VAL(UDIInt32, PassCount);
- IN_VAL(UDIBreakType, Type);
-
- r = DO_CALL(UDISetBreakpoint_c);
-
- OUT_INIT();
- *BreakId = OUT_VAL(UDIBreakId);
- return r;
-}
-
-UDIError UDIQueryBreakpoint (
- UDIBreakId BreakId, /* In */
- UDIResource *Addr, /* Out */
- UDIInt32 *PassCount, /* Out */
- UDIBreakType *Type, /* Out */
- UDIInt32 *CurrentCount /* Out */
- )
-{
- int r;
- IN_INIT();
- IN_VAL(UDIBreakId, BreakId);
-
- r = DO_CALL(UDIQueryBreakpoint_c);
-
- OUT_INIT();
- Addr->Space = OUT_VAL(short);
- Addr->Offset = OUT_VAL(CPUOffset);
- *PassCount = OUT_VAL(UDIInt32);
- *Type = OUT_VAL(UDIBreakType);
- *CurrentCount = OUT_VAL(UDIInt32);
-
- return r;
-}
-
-UDIError UDIClearBreakpoint (
- UDIBreakId BreakId /* In */
- )
-{
- IN_INIT();
- IN_VAL(UDIBreakId, BreakId);
-
- return DO_CALL(UDIClearBreakpoint_c);
-}
-
-UDIError UDIGetStdout (
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- IN_INIT();
- if (BufSize > 4000)
- BufSize = 4000;
- IN_VAL(UDISizeT,BufSize);
- r = DO_CALL(UDIGetStdout_c);
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- if (*CountDone <= BufSize)
- OUT_DATA(Buf, *CountDone);
- return r;
-}
-
-UDIError UDIGetStderr (
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- IN_INIT();
- if (BufSize > 4000)
- BufSize = 4000;
- IN_VAL(UDISizeT,BufSize);
- r = DO_CALL(UDIGetStderr_c);
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- OUT_DATA(Buf, *CountDone);
- return r;
-}
-
-UDIError UDIPutStdin (
- UDIHostMemPtr Buf, /* In */
- UDISizeT Count, /* In */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- IN_INIT();
- if (Count > 4000)
- Count = 4000;
- IN_VAL(UDISizeT,Count);
- IN_DATA(Buf, Count);
- r = DO_CALL(UDIPutStdin_c);
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- return r;
-}
-
-UDIError UDIStdinMode (
- UDIMode *Mode /* Out */
- )
-{
- int r;
- IN_INIT();
- r = DO_CALL(UDIStdinMode_c);
- OUT_INIT();
- *Mode = OUT_VAL(UDIMode);
- return r;
-}
-
-UDIError UDIPutTrans (
- UDIHostMemPtr Buf, /* In */
- UDISizeT Count, /* In */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- IN_INIT();
- if (Count > 4000)
- Count = 4000;
- IN_VAL(UDISizeT,Count);
- IN_DATA(Buf, Count);
- r = DO_CALL(UDIPutTrans_c);
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- return r;
-}
-
-UDIError UDIGetTrans (
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- )
-{
- int r;
- IN_INIT();
- if (BufSize > 4000)
- BufSize = 4000;
- IN_VAL(UDISizeT,BufSize);
- r = DO_CALL(UDIGetTrans_c);
- OUT_INIT();
- *CountDone = OUT_VAL(UDISizeT);
- OUT_DATA(Buf, *CountDone);
- return r;
-}
-
-UDIError UDITransMode (
- UDIMode *Mode /* Out */
- )
-{
- int r;
- IN_INIT();
- r = DO_CALL(UDITransMode_c);
- OUT_INIT();
- *Mode = OUT_VAL(UDIMode);
- return r;
-}
-
-#define DFEIPCIdCompany 0x0001 /* Company ID AMD */
-#define DFEIPCIdProduct 0x1 /* Product ID 0 */
-#define DFEIPCIdVersion 0x125 /* 1.2.5 */
-
-unsigned UDIGetDFEIPCId ()
-{
- return((((UDIUInt32)DFEIPCIdCompany) << 16) |(DFEIPCIdProduct << 12) | DFEIPCIdVersion);
-}
-
-#endif /* __GO32__ */
diff --git a/gdb/29k-share/udi/udiids.h b/gdb/29k-share/udi/udiids.h
deleted file mode 100644
index 5f805e46905..00000000000
--- a/gdb/29k-share/udi/udiids.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* This file contains the DFE and TIP IDs to be used by AMD products for
- the UDICapabilities call.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
- /* Company Codes -- AMD assigns these */
-#define UDICompanyCode_AMD 1
-
- /* Build a UDIID given a CompanyProdCode and 3 version pieces */
-#define UDIID(CompanyProdCode, v1,v2,v3) ((((CompanyProdCode) & 0xfffff)<<12)+\
- (((v1)&0xf)<<8) + (((v2)&0xf)<<4) + ((v3)&0xf))
-
-
- /* Extract a CompanyProdCode or a Version from a UDIID */
-#define UDIID_CompanyProdCode(id) (((id)>>12) & 0xfffff)
-#define UDIID_Version(id) ((id)&0xfff)
-
-
-#define UDIAMDProduct(ProdCode) ((UDICompanyCode_AMD<<4) + (ProdCode&0xf))
-
- /* AMD DFE Product Codes */
-#define UDIProductCode_Mondfe UDIAMDProduct(0)
-#define UDIProductCode_XRAY UDIAMDProduct(1)
-#define UDIProductCode_TIPTester UDIAMDProduct(2)
-
- /* AMD TIP Product Codes (need not be distinct from DFE Product Codes) */
-#define UDIProductCode_Montip UDIAMDProduct(0)
-#define UDIProductCode_Isstip UDIAMDProduct(1)
-
-
-#define UDILatestVersion 0x120 /* UDI 1.2.0, can be used in DFE and TIP desired UDI params */
-
diff --git a/gdb/29k-share/udi/udip2soc.c b/gdb/29k-share/udi/udip2soc.c
deleted file mode 100644
index c8af3fee285..00000000000
--- a/gdb/29k-share/udi/udip2soc.c
+++ /dev/null
@@ -1,1250 +0,0 @@
-/* Copyright 1993, 1998 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-static char udip2soc_c[]="@(#)udip2soc.c 2.11 Daniel Mann";
-static char udip2soc_c_AMD[]="@(#)udip2soc.c 2.8, AMD";
-/*
-* This module converts UDI Procedural calls into
-* UDI socket messages for UNIX.
-* It is used by DFE client processes
-********************************************************************** HISTORY
-*/
-/* This is all unneeded on DOS machines. */
-#ifndef __GO32__
-
-#include <stdio.h>
-#include <string.h>
-
-/* Before sys/file.h for Unixware. */
-#include <sys/types.h>
-
-#include <sys/file.h>
-
-/* This used to say sys/fcntl.h, but the only systems I know of that
- require that are old (pre-4.3, at least) BSD systems, which we
- probably don't need to worry about. */
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <signal.h>
-#include <sys/errno.h>
-#include "udiproc.h"
-#include "udisoc.h"
-
-extern int errno;
-extern int sys_nerr;
-extern int udr_errno;
-extern char* getenv();
-
-/* local type decs. and macro defs. not in a .h file ************* MACRO/TYPE
-*/
-#define version_c 0x121 /* DFE-IPC version id */
-#define TRUE -1
-#define FALSE 0
-#define PORT_NUM 7000
-#define MAX_SESSIONS 5 /* maximum DFE-TIP connections */
-#define SOC_BUF_SIZE 4* 1024 /* size of socket comms buffer */
-#define SBUF_SIZE 500 /* size of string buffer */
-#define ERRMSG_SIZE 500 /* size of error message buffer */
-
-typedef struct connection_str /* record of connect session */
-{
- int in_use;
- char connect_id[20]; /* connection identifier */
- char domain_string[20]; /* dommaing for conection */
- char tip_string[30]; /* TIP host name for AF_INET */
- char tip_exe[80]; /* TIP exe name */
- int dfe_sd; /* associated DFE socket */
- int tip_pid; /* pid of TIP process */
- struct sockaddr_in dfe_sockaddr;
- struct sockaddr_in tip_sockaddr_in;
- struct sockaddr tip_sockaddr;
-} connection_t;
-
-typedef struct session_str
-{
- int in_use;
- connection_t* soc_con_p; /* associated connection */
- UDISessionId tip_id; /* associated TIP session ID */
-} session_t;
-
-/* global dec/defs. which are not in a .h file ************* EXPORT DEC/DEFS
-*/
-UDIError dfe_errno;
-char dfe_errmsg[ERRMSG_SIZE];/* error string */
-
-/* local dec/defs. which are not in a .h file *************** LOCAL DEC/DEFS
-*/
-LOCAL connection_t soc_con[MAX_SESSIONS];
-LOCAL session_t session[MAX_SESSIONS];
-LOCAL UDR udr;
-LOCAL UDR* udrs = &udr; /* UDR for current session */
-LOCAL int current; /* int-id for current session */
-LOCAL char sbuf[SBUF_SIZE]; /* String handler buffer */
-LOCAL char config_file[80]; /* path/name for config file */
-
-/***************************************************************** UDI_CONNECT
-* Establish a new FDE to TIP conection. The file "./udi_soc" or
-* "/etc/udi_soc" may be examined to obtain the conection information
-* if the "Config" parameter is not a completd "line entry".
-*
-* NOTE: the Session string must not start whith white-space characters.
-* Format of string is:
-* <session> <domain> <soc_name|host_name> <tip_exe|port> <pass to UDIconnect>
-* soc2cayman AF_INET cayman 7000 <not supported>
-* soc2tip AF_UNIX astring tip.exe ...
-*/
-UDIError
-UDIConnect(Config, Session)
- char *Config; /* in -- identification string */
- UDISessionId *Session; /* out -- session ID */
-{
- UDIInt32 service_id = UDIConnect_c;
- int domain;
- int cnt=0;
- int rcnt, pos, params_pos=0;
- char *tip_main_string;
- char *env_p;
- struct hostent *tip_info_p;
- FILE *fd;
-#if 0
- FILE *f_p;
-#endif
- UDIUInt32 TIPIPCId;
- UDIUInt32 DFEIPCId;
-
-#if 0 /* This is crap. It assumes that udi_soc is executable! */
- sprintf(sbuf, "which udi_soc");
- f_p = popen(sbuf, "r");
- if(f_p)
- { while( (sbuf[cnt++]=getc(f_p)) != EOF);
- sbuf[cnt-2]=0;
- }
- pclose(f_p);
-#endif
-
- for (rcnt=0;
- rcnt < MAX_SESSIONS && session[rcnt].in_use;
- rcnt++);
-
- if (rcnt >= MAX_SESSIONS)
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR: Too many sessions already open");
- return UDIErrorIPCLimitation;
- }
-
- /* One connection can be multiplexed between several sessions. */
-
- for (cnt=0;
- cnt < MAX_SESSIONS && soc_con[cnt].in_use;
- cnt++);
-
- if (cnt >= MAX_SESSIONS)
- {
- sprintf(dfe_errmsg,
- "DFE-ipc ERROR: Too many connections already open");
- return UDIErrorIPCLimitation;
- }
-
- *Session = rcnt;
- session[rcnt].soc_con_p = &soc_con[cnt];
-
- if (strchr(Config, ' ')) /* test if file entry given */
- {
- soc_con[cnt].in_use = TRUE;
- sscanf(Config, "%s %s %s %s %n",
- soc_con[cnt].connect_id,
- soc_con[cnt].domain_string,
- soc_con[cnt].tip_string,
- soc_con[cnt].tip_exe,
- &params_pos);
- tip_main_string = Config + params_pos;
- }
- else /* here if need to read udi_soc file */
- {
- strcpy(config_file, "udi_soc");
- env_p = getenv("UDICONF");
- if (env_p)
- strcpy(config_file, env_p);
-
- fd = fopen(config_file, "r");
-
- if (!fd)
- {
- sprintf(dfe_errmsg, "UDIConnect, can't open udi_soc file:\n%s ",
- strerror(errno));
- dfe_errno = UDIErrorCantOpenConfigFile;
- goto tip_failure;
- }
-
- while (1)
- {
- if (fscanf(fd, "%s %s %s %s %[^\n]\n",
- soc_con[cnt].connect_id,
- soc_con[cnt].domain_string,
- soc_con[cnt].tip_string,
- soc_con[cnt].tip_exe,
- sbuf) == EOF)
- break;
-
- if (strcmp(Config, soc_con[cnt].connect_id) != 0)
- continue;
-
- soc_con[cnt].in_use = TRUE; /* here if entry found */
-
- tip_main_string = sbuf;
- break;
- }
-
- fclose(fd);
- if (!soc_con[cnt].in_use)
- {
- sprintf(dfe_errmsg,
- "UDIConnect, can't find `%s' entry in udi_soc file",
- Config);
- dfe_errno = UDIErrorNoSuchConfiguration;
- goto tip_failure;
- }
- }
-/*----------------------------------------------------------- SELECT DOMAIN */
- if (strcmp(soc_con[cnt].domain_string, "AF_UNIX") == 0)
- domain = AF_UNIX;
- else if (strcmp(soc_con[cnt].domain_string, "AF_INET") == 0)
- domain = AF_INET;
- else
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR: socket address family not known");
- dfe_errno = UDIErrorBadConfigFileEntry;
- goto tip_failure;
- }
-
-/*---------------------------------------------------- MULTIPLEXED SOCKET ? */
-/* If the requested session requires communication with
- a TIP which already has a socket connection established,
- then we do not create a new socket but multiplex the
- existing one. A TIP is said to use the same socket if
- socket-name/host-name and the domain are the same.
- */
- for (rcnt=0; rcnt < MAX_SESSIONS; rcnt++)
- {
- if (soc_con[rcnt].in_use
- && rcnt != cnt
- && strcmp(soc_con[cnt].domain_string,
- soc_con[rcnt].domain_string) == 0
- && strcmp(soc_con[cnt].tip_string,
- soc_con[rcnt].tip_string) == 0)
- {
- session[*Session].soc_con_p = &soc_con[rcnt];
- soc_con[cnt].in_use = FALSE; /* don't need new connect */
- goto tip_connect;
- }
- }
-/*------------------------------------------------------------------ SOCKET */
- soc_con[cnt].dfe_sd = socket(domain, SOCK_STREAM, 0);
- if (soc_con[cnt].dfe_sd == -1)
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR, socket() call failed %s ",
- strerror (errno));
- dfe_errno = UDIErrorUnknownError;
- goto tip_failure;
- }
-
-/*--------------------------------------------------------- AF_UNIX CONNECT */
- if (domain == AF_UNIX)
- {
- if (strcmp(soc_con[cnt].tip_string, "*") == 0)
- {
- for (pos = 0; pos < 20; pos++)
- {
- int f;
-
- sprintf(soc_con[cnt].tip_string,"/tmp/U%d", getpid() + pos);
- f = open(soc_con[cnt].tip_string, O_CREAT);
- if (f == -1)
- continue;
-
- close(f);
- unlink(soc_con[cnt].tip_string);
- break;
- }
-
- if (pos >= 20)
- {
- sprintf(dfe_errmsg,
- "DFE-ipc ERROR, can't create random socket name");
- dfe_errno = UDIErrorCantConnect;
- goto tip_failure;
- }
- }
-
- soc_con[cnt].tip_sockaddr.sa_family = domain;
- memcpy(soc_con[cnt].tip_sockaddr.sa_data,
- soc_con[cnt].tip_string,
- sizeof(soc_con[cnt].tip_sockaddr.sa_data));
- if (connect(soc_con[cnt].dfe_sd,
- &soc_con[cnt].tip_sockaddr,
- sizeof(soc_con[cnt].tip_sockaddr)))
- { /* if connect() fails assume TIP not yet started */
-/*------------------------------------------------------------ AF_UNIX EXEC */
- int pid;
- int statusp;
- char *arg0;
-
- arg0 = strrchr(soc_con[cnt].tip_exe,'/');
-
- if (arg0)
- arg0++;
- else
- arg0 = soc_con[cnt].tip_exe;
-
- pid = vfork();
-
- if (pid == 0) /* Child */
- {
- execlp(soc_con[cnt].tip_exe,
- arg0,
- soc_con[cnt].domain_string,
- soc_con[cnt].tip_string,
- NULL);
- _exit(1);
- }
-
- if (waitpid(pid, &statusp, WNOHANG))
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR: can't exec the TIP");
- dfe_errno = UDIErrorCantStartTIP;
- goto tip_failure;
- }
-
- pos = 3;
- for (pos = 3; pos > 0; pos--)
- {
- if (!connect(soc_con[cnt].dfe_sd,
- &soc_con[cnt].tip_sockaddr,
- sizeof(soc_con[cnt].tip_sockaddr)))
- break;
- sleep(1);
- }
-
- if (pos == 0)
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR, connect() call failed: %s",
- strerror (errno));
- dfe_errno = UDIErrorCantConnect;
- goto tip_failure;
- }
- }
- }
-/*--------------------------------------------------------- AF_INET CONNECT */
- else if (domain == AF_INET)
- {
- fprintf(stderr,
- "DFE-ipc WARNING, need to have first started remote TIP");
-
- soc_con[cnt].tip_sockaddr_in.sin_family = domain;
- soc_con[cnt].tip_sockaddr_in.sin_addr.s_addr =
- inet_addr(soc_con[cnt].tip_string);
- if (soc_con[cnt].tip_sockaddr_in.sin_addr.s_addr == -1)
- {
- tip_info_p = gethostbyname(soc_con[cnt].tip_string);
- if (tip_info_p == NULL)
- {
- sprintf(dfe_errmsg,"DFE-ipc ERROR, No such host %s",
- soc_con[cnt].tip_string);
- dfe_errno = UDIErrorNoSuchConnection;
- goto tip_failure;
- }
- memcpy((char *)&soc_con[cnt].tip_sockaddr_in.sin_addr,
- tip_info_p->h_addr,
- tip_info_p->h_length);
- }
- soc_con[cnt].tip_sockaddr_in.sin_port
- = htons(atoi(soc_con[cnt].tip_exe));
-
- if (connect(soc_con[cnt].dfe_sd,
- (struct sockaddr *) &soc_con[cnt].tip_sockaddr_in,
- sizeof(soc_con[cnt].tip_sockaddr_in)))
- {
- sprintf(dfe_errmsg, "DFE-ipc ERROR, connect() call failed %s ",
- strerror (errno));
- dfe_errno = UDIErrorCantConnect;
- goto tip_failure;
- }
- }
-/*------------------------------------------------------------- TIP CONNECT */
- if (cnt == 0) udr_create(udrs, soc_con[cnt].dfe_sd, SOC_BUF_SIZE);
-
-tip_connect:
- current = cnt;
- session[*Session].in_use = TRUE; /* session id is now in use */
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
-
- DFEIPCId = (company_c << 16) + (product_c << 12) + version_c;
- udr_UDIUInt32(udrs, &DFEIPCId);
-
- udr_string(udrs, tip_main_string);
-
- udr_sendnow(udrs);
-
- udrs->udr_op = UDR_DECODE; /* recv all "out" parameters */
- udr_UDIUInt32(udrs, &TIPIPCId);
- if ((TIPIPCId & 0xfff) < version_c)
- sprintf(dfe_errmsg, "DFE-ipc: Obsolete TIP Specified");
-
- udr_UDIInt32(udrs, &soc_con[cnt].tip_pid);
-
- udr_UDISessionId(udrs, &session[*Session].tip_id);
-
- udr_UDIError(udrs, &dfe_errno);
- if (dfe_errno > 0) UDIKill(*Session, 0);
-
- return dfe_errno;
-
-tip_failure:
-
- soc_con[cnt].in_use = FALSE;
- session[*Session].in_use = FALSE;
-/* XXX - Should also close dfe_sd, but not sure what to do if muxed */
- return dfe_errno;
-}
-
-/************************************************************** UDI_Disconnect
-* UDIDisconnect() should be called before exiting the
-* DFE to ensure proper shut down of the TIP.
-*/
-UDIError UDIDisconnect(Session, Terminate)
-UDISessionId Session;
-UDIBool Terminate;
-{
- int cnt;
- UDIInt32 service_id = UDIDisconnect_c;
- if(Session < 0 || Session > MAX_SESSIONS)
- {
- sprintf(dfe_errmsg," SessionId not valid (%d)", Session);
- return UDIErrorNoSuchConfiguration;
- }
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISessionId(udrs, &session[Session].tip_id);
- udr_UDIBool(udrs, &Terminate);
- udr_sendnow(udrs);
-
- session[Session].in_use = FALSE; /* session id is now free */
- for (cnt=0; cnt < MAX_SESSIONS; cnt++)
- if(session[cnt].in_use
- && session[cnt].soc_con_p == session[Session].soc_con_p
- ) break;
- if(cnt >= MAX_SESSIONS) /* test if socket not multiplexed */
- if(shutdown(session[Session].soc_con_p->dfe_sd, 2))
- {
- sprintf(dfe_errmsg, "DFE-ipc WARNING: socket shutdown failed");
- return UDIErrorIPCInternal;
- }
- else
- session[Session].soc_con_p->in_use = 0;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************************** UDI_KILL
-* UDIKill() is used to send a signal to the TIP.
-* This is a private IPC call.
-*/
-UDIError UDIKill(Session, Signal)
-UDISessionId Session;
-UDIInt32 Signal;
-{
- int cnt;
- UDIInt32 service_id = UDIKill_c;
- if(Session < 0 || Session > MAX_SESSIONS)
- {
- sprintf(dfe_errmsg," SessionId not valid (%d)", Session);
- return UDIErrorNoSuchConfiguration;
- }
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISessionId(udrs, &session[Session].tip_id);
- udr_UDIInt32(udrs, &Signal);
- udr_sendnow(udrs);
-
- session[Session].in_use = FALSE; /* session id is now free */
- for (cnt=0; cnt < MAX_SESSIONS; cnt++)
- if(session[cnt].in_use
- && session[cnt].soc_con_p == session[Session].soc_con_p
- ) break;
- if(cnt < MAX_SESSIONS) /* test if socket not multiplexed */
- if(shutdown(session[Session].soc_con_p->dfe_sd, 2))
- {
- sprintf(dfe_errmsg, "DFE-ipc WARNING: socket shutdown failed");
- return UDIErrorIPCInternal;
- }
- else
- session[Session].soc_con_p->in_use = 0;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************** UDI_Set_Current_Connection
-* If you are connected to multiple TIPs, you can change
-* TIPs using UDISetCurrentConnection().
-*/
-UDIError UDISetCurrentConnection(Session)
-UDISessionId Session;
-{
- UDIInt32 service_id = UDISetCurrentConnection_c;
-
- if(Session < 0 || Session > MAX_SESSIONS)
- return UDIErrorNoSuchConfiguration;
- if(!session[Session].in_use) /* test if not in use yet */
- return UDIErrorNoSuchConnection;
-
- current = Session;
- /* change socket or multiplex the same socket */
- udrs->sd = session[Session].soc_con_p->dfe_sd;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISessionId(udrs, &session[Session].tip_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************************ UDI_Capabilities
-* The DFE uses UDICapabilities() to both inform the TIP
-* of what services the DFE offers and to inquire of the
-* TIP what services the TIP offers.
-*/
-UDIError UDICapabilities(TIPId, TargetId, DFEId, DFE, TIP, DFEIPCId,
- TIPIPCId, TIPString)
-UDIUInt32 *TIPId; /* out */
-UDIUInt32 *TargetId; /* out */
-UDIUInt32 DFEId; /* in */
-UDIUInt32 DFE; /* in */
-UDIUInt32 *TIP; /* out */
-UDIUInt32 *DFEIPCId; /* out */
-UDIUInt32 *TIPIPCId; /* out */
-char *TIPString; /* out */
-{
- UDIInt32 service_id = UDICapabilities_c;
- int size;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIInt32(udrs, &DFEId);
- udr_UDIInt32(udrs, &DFE);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" paramters */
- udr_UDIInt32(udrs, TIPId);
- udr_UDIInt32(udrs, TargetId);
- udr_UDIInt32(udrs, TIP);
- udr_UDIInt32(udrs, DFEIPCId);
- *DFEIPCId = (company_c << 16) + (product_c << 12) + version_c;
- udr_UDIInt32(udrs, TIPIPCId);
- udr_string(udrs, sbuf);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- size = strlen(sbuf);
- if(size +1 > 80) return -1; /* test if sufficient space */
- strcpy(TIPString, sbuf);
- return dfe_errno;
-}
-
-/********************************************************** UDI_Enumerate_TIPs
-* Used by the DFE to enquire about available TIP
-* connections.
-*/
-UDIError UDIEnumerateTIPs(UDIETCallback)
- int (*UDIETCallback)(); /* In -- function to callback */
-{
- FILE *fp;
-
- fp = fopen(config_file, "r");
- if(fp == NULL)
- return UDIErrorCantOpenConfigFile;
- while(fgets( sbuf, SBUF_SIZE, fp))
- if(UDIETCallback( sbuf) == UDITerminateEnumeration)
- break;
- fclose( fp);
- return UDINoError; /* return success */
-}
-
-/*********************************************************** UDI_GET_ERROR_MSG
-* Some errors are target specific. They are indicated
-* by a negative error return value. The DFE uses
-* UDIGetErrorMsg() to get the descriptive text for
-* the error message which can then be displayed to
-* the user.
-*/
-UDIError UDIGetErrorMsg(error_code, msg_len, msg, CountDone)
-UDIError error_code; /* In */
-UDISizeT msg_len; /* In -- allowed message space */
-char* msg; /* Out -- length of message*/
-UDISizeT *CountDone; /* Out -- number of characters */
-{
- UDIInt32 service_id = UDIGetErrorMsg_c;
- int size;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIError(udrs, &error_code);
- udr_UDISizeT(udrs, &msg_len);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_string(udrs, sbuf);
- udr_UDISizeT(udrs, CountDone);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- size = strlen(sbuf);
- if(size +1 > msg_len) return -1; /* test if sufficient space */
- strcpy(msg, sbuf);
- return dfe_errno;
-}
-
-/******************************************************* UDI_GET_TARGET_CONFIG
-* UDIGetTargetConfig() gets information about the target.
-*/
-UDIError UDIGetTargetConfig(KnownMemory, NumberOfRanges, ChipVersions,
- NumberOfChips)
-UDIMemoryRange KnownMemory[]; /* Out */
-UDIInt *NumberOfRanges; /* In and Out */
-UDIUInt32 ChipVersions[]; /* Out */
-UDIInt *NumberOfChips; /* In and Out */
-{
- UDIInt32 service_id = UDIGetTargetConfig_c;
- int cnt;
- int MaxOfRanges = *NumberOfRanges;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIInt(udrs, NumberOfRanges);
- udr_UDIInt(udrs, NumberOfChips);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" paramters */
- for(cnt=1; cnt <= MaxOfRanges; cnt++)
- udr_UDIMemoryRange(udrs, &KnownMemory[cnt-1]);
- udr_UDIInt(udrs, NumberOfRanges);
- udr_UDIInt(udrs, NumberOfChips);
- for(cnt=1; cnt <= *NumberOfChips; cnt++)
- udr_UDIUInt32(udrs, &ChipVersions[cnt -1]);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/********************************************************** UDI_CREATE_PRCOESS
-* UDICreateProcess() tells the target OS that a
-* process is to be created and gets a PID back unless
-* there is some error.
-*/
-UDIError UDICreateProcess(pid)
-UDIPId *pid; /* out */
-{
- UDIInt32 service_id = UDICreateProcess_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIPId(udrs, pid);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/***************************************************** UDI_Set_Current_Process
-* UDISetCurrentProcess uses a pid supplied by
-* UDICreateProcess and sets it as the default for all
-* udi calls until a new one is set. A user of a
-*/
-UDIError UDISetCurrentProcess (pid)
-UDIPId pid; /* In */
-{
- UDIInt32 service_id = UDISetCurrentProcess_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIPId(udrs, &pid);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/****************************************************** UDI_INITIALISE_PROCESS
-* UDIInitializeProcess() prepare process for
-* execution. (Reset processor if process os processor).
-*/
-UDIError UDIInitializeProcess( ProcessMemory, NumberOfRanges, EntryPoint,
- StackSizes, NumberOfStacks, ArgString)
-UDIMemoryRange ProcessMemory[]; /* In */
-UDIInt NumberOfRanges; /* In */
-UDIResource EntryPoint; /* In */
-CPUSizeT *StackSizes; /* In */
-UDIInt NumberOfStacks; /* In */
-char *ArgString; /* In */
-{
- UDIInt32 service_id = UDIInitializeProcess_c;
- int cnt;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIInt(udrs, &NumberOfRanges);
- for(cnt = 0; cnt < NumberOfRanges; cnt++)
- udr_UDIMemoryRange(udrs, &ProcessMemory[cnt] );
- udr_UDIResource(udrs, &EntryPoint);
- udr_UDIInt(udrs, &NumberOfStacks);
- for(cnt = 0; cnt < NumberOfStacks; cnt++)
- udr_CPUSizeT(udrs, &StackSizes[cnt]);
- udr_string(udrs, ArgString);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/********************************************************* UDI_DESTROY_PROCESS
-* UDIDestroyProcess() frees a process resource
-* previously created by UDICreateProcess().
-*/
-UDIError UDIDestroyProcess(pid)
-UDIPId pid; /* in */
-{
- UDIInt32 service_id = UDIDestroyProcess_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIPId(udrs, &pid);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/****************************************************************** UDI_READ
-* UDIRead() reads a block of objects from a target
-* address space to host space.
-*/
-
-UDIError UDIRead (from, to, count, size, count_done, host_endian)
-UDIResource from; /* in - source address on target */
-UDIHostMemPtr to; /* out - destination address on host */
-UDICount count; /* in -- count of objects to be transferred */
-UDISizeT size; /* in -- size of each object */
-UDICount *count_done; /* out - count actually transferred */
-UDIBool host_endian; /* in -- flag for endian information */
-{
- UDIInt32 service_id = UDIRead_c;
- int byte_count;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIResource(udrs, &from);
- udr_UDICount(udrs, &count);
- udr_UDISizeT(udrs, &size);
- udr_UDIBool(udrs, &host_endian);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" paramters */
- udr_UDICount(udrs, count_done);
- byte_count = (*count_done) * size;
- if(*count_done > 0 && *count_done <= count)
- udr_bytes(udrs, to, byte_count);
- if(udr_errno) return udr_errno;
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/****************************************************************** UDI_WRITE
-* UDIWrite() writes a block of objects from host
-* space to a target address+space.
-*/
-UDIError UDIWrite( from, to, count, size, count_done, host_endian )
-UDIHostMemPtr from; /* in -- source address on host */
-UDIResource to; /* in -- destination address on target */
-UDICount count; /* in -- count of objects to be transferred */
-UDISizeT size; /* in -- size of each object */
-UDICount *count_done; /* out - count actually transferred */
-UDIBool host_endian; /* in -- flag for endian information */
-{
- UDIInt32 service_id = UDIWrite_c;
- int byte_count = count * size;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIResource(udrs, &to);
- udr_UDICount(udrs, &count);
- udr_UDISizeT(udrs, &size);
- udr_UDIBool(udrs, &host_endian);
- udr_bytes(udrs, from, byte_count);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" paramters */
- udr_UDICount(udrs, count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************************** UDI_COPY
-* UDICopy() copies a block of objects from one target
-* get address/space to another target address/space.
-*/
-UDIError UDICopy(from, to, count, size, count_done, direction )
-UDIResource from; /* in -- destination address on target */
-UDIResource to; /* in -- source address on target */
-UDICount count; /* in -- count of objects to be transferred */
-UDISizeT size; /* in -- size of each object */
-UDICount *count_done; /* out - count actually transferred */
-UDIBool direction; /* in -- high-to-low or reverse */
-{
- UDIInt32 service_id = UDICopy_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIResource(udrs, &from);
- udr_UDIResource(udrs, &to);
- udr_UDICount(udrs, &count);
- udr_UDISizeT(udrs, &size);
- udr_UDIBool(udrs, &direction);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDICount(udrs, count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/***************************************************************** UDI_EXECUTE
-* UDIExecute() continues execution of the default
-* process from the current PC.
-*/
-UDIError UDIExecute()
-{
- UDIInt32 service_id = UDIExecute_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************************** UDI_STEP
-* UDIStep() specifies a number of "instruction"
-* steps to make.
-*/
-UDIError UDIStep(steps, steptype, range)
-UDIUInt32 steps; /* in -- number of steps */
-UDIStepType steptype; /* in -- type of stepping to be done */
-UDIRange range; /* in -- range if StepInRange is TRUE */
-{
- UDIInt32 service_id = UDIStep_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIInt32(udrs, &steps);
- udr_UDIStepType(udrs, &steptype);
- udr_UDIRange(udrs, &range);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************************** UDI_STOP
-* UDIStop() stops the default process
-*/
-UDIVoid UDIStop()
-{
- if (strcmp(session[current].soc_con_p->domain_string, "AF_UNIX") == 0)
- kill(session[current].soc_con_p->tip_pid, SIGINT);
- else
- udr_signal(udrs);
-
-/* XXX - should clean up session[] and soc_con[] structs here as well... */
-
- return;
-}
-
-/******************************************************************** UDI_WAIT
-* UDIWait() returns the state of the target procesor.
-*/
-UDIError UDIWait(maxtime, pid, stop_reason)
-UDIInt32 maxtime; /* in -- maximum time to wait for completion */
-UDIPId *pid; /* out -- pid of process which stopped if any */
-UDIUInt32 *stop_reason; /* out -- PC where process stopped */
-{
- UDIInt32 service_id = UDIWait_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIInt32(udrs, &maxtime);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIPId(udrs, pid);
- udr_UDIUInt32(udrs, stop_reason);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/********************************************************** UDI_SET_BREAKPOINT
-* UDISetBreakpoint() sets a breakpoint at an adress
-* and uses the passcount to state how many
-* times that instruction should be hit before the
-* break occurs.
-*/
-UDIError UDISetBreakpoint (addr, passcount, type, break_id)
-UDIResource addr; /* in -- where breakpoint gets set */
-UDIInt32 passcount; /* in -- passcount for breakpoint */
-UDIBreakType type; /* in -- breakpoint type */
-UDIBreakId *break_id; /* out - assigned break id */
-{
- UDIInt32 service_id = UDISetBreakpoint_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIResource(udrs, &addr);
- udr_UDIInt32(udrs, &passcount);
- udr_UDIBreakType(udrs, &type);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIBreakId(udrs, break_id);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************** UDI_QUERY_BREAKPOINT
-*/
-UDIError UDIQueryBreakpoint (break_id, addr, passcount, type, current_count)
-UDIBreakId break_id; /* in -- assigned break id */
-UDIResource *addr; /* out - where breakpoint was set */
-UDIInt32 *passcount; /* out - trigger passcount for breakpoint */
-UDIBreakType *type; /* out - breakpoint type */
-UDIInt32 *current_count; /* out - current count for breakpoint */
-{
- UDIInt32 service_id = UDIQueryBreakpoint_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIBreakId(udrs, &break_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIResource(udrs, addr);
- udr_UDIInt32(udrs, passcount);
- udr_UDIBreakType(udrs, type);
- udr_UDIInt32(udrs, current_count);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/******************************************************** UDI_CLEAR_BREAKPOINT
-* UDIClearBreakpoint() is used to clear a breakpoint.
-*/
-UDIError UDIClearBreakpoint (break_id)
-UDIBreakId break_id; /* in -- assigned break id */
-{
- UDIInt32 service_id = UDIClearBreakpoint_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIBreakId(udrs, &break_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************************** UDI_GET_STDOUT
-* UDIGetStdout() is called when a call to
-* UDIWait() indicates there is STD output data ready.
-*/
-UDIError UDIGetStdout(buf, bufsize, count_done)
-UDIHostMemPtr buf; /* out -- buffer to be filled */
-UDISizeT bufsize; /* in -- buffer size in bytes */
-UDISizeT *count_done; /* out -- number of bytes written to buf */
-{
- UDIInt32 service_id = UDIGetStdout_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISizeT(udrs, &bufsize);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDISizeT(udrs, count_done);
- udr_bytes(udrs, buf, *count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************************** UDI_GET_STDERR
-* UDIGetStderr() is called when a call to
-* UDIWait() indicates there is STDERR output data ready
-*/
-UDIError UDIGetStderr(buf, bufsize, count_done)
-UDIHostMemPtr buf; /* out -- buffer to be filled */
-UDISizeT bufsize; /* in -- buffer size in bytes */
-UDISizeT *count_done; /* out -- number of bytes written to buf */
-{
- UDIInt32 service_id = UDIGetStderr_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISizeT(udrs, &bufsize);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDISizeT(udrs, count_done);
- udr_bytes(udrs, buf, *count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/*************************************************************** UDI_PUT_STDIN
-* UDIPutStdin() is called whenever the DFE wants to
-* deliver an input character to the TIP.
-*/
-UDIError UDIPutStdin (buf, count, count_done)
-UDIHostMemPtr buf; /* in -- buffer to be filled */
-UDISizeT count; /* in -- buffer size in bytes */
-UDISizeT *count_done; /* out - number of bytes written to buf */
-{
- UDIInt32 service_id = UDIPutStdin_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISizeT(udrs, &count);
- udr_bytes(udrs, buf, count);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDISizeT(udrs, count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************************** UDI_STDIN_MODE
-* UDIStdinMode() is used to change the mode that chazcters
-* are fetched from the user.
-*/
-UDIError UDIStdinMode(mode)
-UDIMode *mode; /* out - */
-{
- UDIInt32 service_id = UDIStdinMode_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIMode(udrs, mode);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/*************************************************************** UDI_PUT_TRANS
-* UDIPutTrans() is used to feed input to the passthru mode.
-*/
-UDIError UDIPutTrans (buf, count, count_done)
-UDIHostMemPtr buf; /* in -- buffer address containing input data */
-UDISizeT count; /* in -- number of bytes in buf */
-UDISizeT *count_done; /* out-- number of bytes transfered */
-{
- UDIInt32 service_id = UDIPutTrans_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISizeT(udrs, &count);
- udr_bytes(udrs, buf, count);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDISizeT(udrs, count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/*************************************************************** UDI_GET_TRANS
-* UDIGetTrans() is used to get output lines from the
-* passthru mode.
-*/
-UDIError UDIGetTrans (buf, bufsize, count_done)
-UDIHostMemPtr buf; /* out -- buffer to be filled */
-UDISizeT bufsize; /* in -- size of buf */
-UDISizeT *count_done; /* out -- number of bytes in buf */
-{
- UDIInt32 service_id = UDIGetTrans_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDISizeT(udrs, &bufsize);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDISizeT(udrs, count_done);
- udr_bytes(udrs, buf, *count_done);
- udr_UDIError(udrs, &dfe_errno); /* get any TIP error */
- return dfe_errno;
-}
-
-/************************************************************** UDI_Trans_Mode
-* UDITransMode() is used to change the mode that the
-* transparent routines operate in.
-*/
-UDIError UDITransMode(mode)
-UDIMode *mode; /* out -- selected mode */
-{
- UDIInt32 service_id = UDITransMode_c;
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
- udr_UDIMode(udrs, mode);
- udr_sendnow(udrs);
- if(udr_errno) return udr_errno;
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- udr_UDIError(udrs, &dfe_errno);
- return dfe_errno;
-}
-
-/******************************************************************** UDI_TEST
-*/
-UDIError UDITest( cnt, str_p, array)
-UDISizeT cnt;
-UDIHostMemPtr str_p;
-UDIInt32 array[];
-{
- UDIInt32 service_id = UDITest_c;
- UDIInt16 scnt = cnt;
- UDISizeT r_cnt;
- char buf[256];
-
- udr_errno = 0;
- udrs->udr_op = UDR_ENCODE; /* send all "in" parameters */
- udr_UDIInt32(udrs, &service_id);
-
- printf("send cnt=%d scnt=%d\n", cnt, scnt);
- udr_UDISizeT(udrs, &cnt);
- udr_UDIInt16(udrs, &scnt);
- printf(" array[0]=0x%x array[1]=0x%x array[2]=0x%x array[3]=0x%x\n",
- array[0], array[1], array[2], array[3]);
- udr_bytes(udrs, (char*)array, 4*sizeof(UDIInt32));
- printf(" string=%s\n", str_p);
- udr_string(udrs, str_p);
- udr_sendnow(udrs);
- if(udr_errno)
- { fprintf(stderr, " DFE-ipc Send ERROR\n");
- return udr_errno;
- }
-
- udrs->udr_op = UDR_DECODE; /* receive all "out" parameters */
- printf("recv ");
- udr_UDISizeT(udrs, &r_cnt);
- udr_UDIInt16(udrs, &scnt);
- printf(" rcnt=%d scnt=%d\n", r_cnt, scnt);
- udr_bytes(udrs, (char*)array, 4*sizeof(UDIInt32));
-
- printf(" array[0]=0x%x array[1]=0x%x array[2]=0x%x array[3]=0x%x\n",
- array[0], array[1], array[2], array[3]);
- udr_string(udrs, str_p);
- printf(" string=%s\n", str_p);
-
- udr_UDIError(udrs, &dfe_errno);
- return dfe_errno;
-}
-
-
-
-UDIUInt32 UDIGetDFEIPCId()
-{
- return ((company_c << 16) + (product_c << 12) + version_c);
-}
-#endif /* __GO32__ */
diff --git a/gdb/29k-share/udi/udiphcfg.h b/gdb/29k-share/udi/udiphcfg.h
deleted file mode 100644
index e9eff0a3c86..00000000000
--- a/gdb/29k-share/udi/udiphcfg.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This file just picks the correct udiphxxx.h depending on the host.
- The two hosts that are now defined are UNIX and MSDOS.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/*
- * For the moment, we will default to BSD_IPC; this might change if/when
- * another type of IPC (Mach? SysV?) is implemented.
- */
-
-#if 0
-
-/* We don't seem to have a copy of udiphdos.h. Furthermore, all the
- things in udiphunix.h are pretty much generic 32-bit machine defines
- which don't have anything to do with IPC. */
-
-#ifdef DOS_IPC
-#include "udiphdos.h"
-#else
-/*#ifdef BSD_IPC */
-#include "udiphunix.h"
-#endif
-
-#else
-
-#include "udiphunix.h"
-
-#endif
diff --git a/gdb/29k-share/udi/udiphunix.h b/gdb/29k-share/udi/udiphunix.h
deleted file mode 100644
index 172fbbfd85b..00000000000
--- a/gdb/29k-share/udi/udiphunix.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Originally called "udiphsun.h", however it was not very
- Sun-specific; now it is used for generic-unix-with-bsd-ipc.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* This file is to be used to reconfigure the UDI Procedural interface
- for a given host. This file should be placed so that it will be
- included from udiproc.h. Everything in here may need to be changed
- when you change either the host CPU or its compiler. Nothing in
- here should change to support different targets. There are multiple
- versions of this file, one for each of the different host/compiler
- combinations in use.
-*/
-
-#define UDIStruct struct /* _packed not needed on unix */
-/* First, we need some types */
-/* Types with at least the specified number of bits */
-typedef double UDIReal64; /* 64-bit real value */
-typedef float UDIReal32; /* 32-bit real value */
-
-typedef unsigned long UDIUInt32; /* unsigned integers */
-typedef unsigned short UDIUInt16;
-typedef unsigned char UDIUInt8;
-
-typedef long UDIInt32; /* 32-bit integer */
-typedef short UDIInt16; /* 16-bit integer */
-typedef char UDIInt8; /* unreliable signedness */
-
-/* To aid in supporting environments where the DFE and TIP use
-different compilers or hosts (like DOS 386 on one side, 286 on the
-other, or different Unix machines connected by sockets), we define
-two abstract types - UDIInt and UDISizeT.
-UDIInt should be defined to be int except for host/compiler combinations
-that are intended to talk to existing UDI components that have a different
-sized int. Similarly for UDISizeT.
-*/
-typedef int UDIInt;
-typedef unsigned int UDIUInt;
-
-typedef unsigned int UDISizeT;
-
-/* Now two void types. The first is for function return types,
-the other for pointers to no particular type. Since these types
-are used solely for documentational clarity, if your host/compiler
-doesn't support either one, replace them with int and char *
-respectively.
-*/
-typedef void UDIVoid; /* void type */
-typedef void * UDIVoidPtr; /* void pointer type */
-typedef void * UDIHostMemPtr; /* Arbitrary memory pointer */
-
-/* Now we want a type optimized for boolean values. Normally this
- would be int, but on some machines (Z80s, 8051s, etc) it might
- be better to map it onto a char
-*/
-typedef int UDIBool;
-
-/* Now indicate whether your compiler support full ANSI style
- prototypes. If so, use #if 1. If not use #if 0.
-*/
-#if 0
-#define UDIParams(x) x
-#else
-#define UDIParams(x) ()
-#endif
diff --git a/gdb/29k-share/udi/udiproc.h b/gdb/29k-share/udi/udiproc.h
deleted file mode 100644
index 0cc1c2049c1..00000000000
--- a/gdb/29k-share/udi/udiproc.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/* local type decs. and macro defs.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "udiphcfg.h" /* Get host specific configuration */
-#include "udiptcfg.h" /* Get target specific configuration */
-
-/* Here are all of the CPU Families for which UDI is currently defined */
-#define Am29K 1 /* AMD's Am290xx and Am292xx parts */
-
-typedef UDIInt UDIError;
-typedef UDIInt UDISessionId;
-typedef UDIInt UDIPId;
-typedef UDIInt UDIStepType;
-typedef UDIInt UDIBreakType;
-typedef UDIUInt UDIBreakId;
-typedef UDIUInt UDIMode;
-
-typedef UDIStruct
-{
- CPUSpace Space;
- CPUOffset Offset;
-} UDIResource;
-
-typedef UDIStruct
-{
- CPUOffset Low;
- CPUOffset High;
-} UDIRange;
-
-typedef UDIStruct
-{
- CPUSpace Space;
- CPUOffset Offset;
- CPUSizeT Size;
- } UDIMemoryRange;
-
-/* Values for UDIStepType parameters */
-#define UDIStepNatural 0x0000
-#define UDIStepOverTraps 0x0001
-#define UDIStepOverCalls 0x0002
-#define UDIStepInRange 0x0004
-#define UDIStepNatural 0x0000
-
-/* Values for UDIBreakType parameters */
-#define UDIBreakFlagExecute 0x0001
-#define UDIBreakFlagRead 0x0002
-#define UDIBreakFlagWrite 0x0004
-#define UDIBreakFlagFetch 0x0008
-
-/* Special values for UDIWait MaxTime parameter */
-#define UDIWaitForever (UDIInt32) -1 /* Infinite time delay */
-
-/* Special values for PId */
-#define UDIProcessProcessor -1 /* Raw Hardware, if possible */
-
-/* Values for UDIWait StopReason */
-#define UDIGrossState 0xff
-#define UDITrapped 0 /* Fine state - which trap */
-#define UDINotExecuting 1
-#define UDIRunning 2
-#define UDIStopped 3
-#define UDIWarned 4
-#define UDIStepped 5
-#define UDIWaiting 6
-#define UDIHalted 7
-#define UDIStdoutReady 8 /* fine state - size */
-#define UDIStderrReady 9 /* fine state - size */
-#define UDIStdinNeeded 10 /* fine state - size */
-#define UDIStdinModeX 11 /* fine state - mode */
-#define UDIBreak 12 /* Fine state - Breakpoint Id */
-#define UDIExited 13 /* Fine state - exit code */
-
-/* Enumerate the return values from the callback function
- for UDIEnumerateTIPs.
-*/
-#define UDITerminateEnumeration 0
-#define UDIContinueEnumeration 1
-
-/* Enumerate values for Terminate parameter to UDIDisconnect */
-#define UDITerminateSession 1
-#define UDIContinueSession 0
-
-/* Error codes */
-#define UDINoError 0 /* No error occured */
-#define UDIErrorNoSuchConfiguration 1
-#define UDIErrorCantHappen 2
-#define UDIErrorCantConnect 3
-#define UDIErrorNoSuchConnection 4
-#define UDIErrorNoConnection 5
-#define UDIErrorCantOpenConfigFile 6
-#define UDIErrorCantStartTIP 7
-#define UDIErrorConnectionUnavailable 8
-#define UDIErrorTryAnotherTIP 9
-#define UDIErrorExecutableNotTIP 10
-#define UDIErrorInvalidTIPOption 11
-#define UDIErrorCantDisconnect 12
-#define UDIErrorUnknownError 13
-#define UDIErrorCantCreateProcess 14
-#define UDIErrorNoSuchProcess 15
-#define UDIErrorUnknownResourceSpace 16
-#define UDIErrorInvalidResource 17
-#define UDIErrorUnsupportedStepType 18
-#define UDIErrorCantSetBreakpoint 19
-#define UDIErrorTooManyBreakpoints 20
-#define UDIErrorInvalidBreakId 21
-#define UDIErrorNoMoreBreakIds 22
-#define UDIErrorUnsupportedService 23
-#define UDIErrorTryAgain 24
-#define UDIErrorIPCLimitation 25
-#define UDIErrorIncomplete 26
-#define UDIErrorAborted 27
-#define UDIErrorTransDone 28
-#define UDIErrorCantAccept 29
-#define UDIErrorTransInputNeeded 30
-#define UDIErrorTransModeX 31
-#define UDIErrorInvalidSize 32
-#define UDIErrorBadConfigFileEntry 33
-#define UDIErrorIPCInternal 34
-/* TBD */
-
-/****************************************************************** PROCEDURES
-*/
-
-UDIError UDIConnect UDIParams((
- char *Configuration, /* In */
- UDISessionId *Session /* Out */
- ));
-
-UDIError UDIDisconnect UDIParams((
- UDISessionId Session, /* In */
- UDIBool Terminate /* In */
- ));
-
-UDIError UDISetCurrentConnection UDIParams((
- UDISessionId Session /* In */
- ));
-
-UDIError UDICapabilities UDIParams((
- UDIUInt32 *TIPId, /* Out */
- UDIUInt32 *TargetId, /* Out */
- UDIUInt32 DFEId, /* In */
- UDIUInt32 DFE, /* In */
- UDIUInt32 *TIP, /* Out */
- UDIUInt32 *DFEIPCId, /* Out */
- UDIUInt32 *TIPIPCId, /* Out */
- char *TIPString /* Out */
- ));
-
-UDIError UDIEnumerateTIPs UDIParams((
- UDIInt (*UDIETCallback) /* In */
- UDIParams(( char *Configuration )) /* In to callback() */
- ));
-
-UDIError UDIGetErrorMsg UDIParams((
- UDIError ErrorCode, /* In */
- UDISizeT MsgSize, /* In */
- char *Msg, /* Out */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDIGetTargetConfig UDIParams((
- UDIMemoryRange KnownMemory[], /* Out */
- UDIInt *NumberOfRanges, /* In/Out */
- UDIUInt32 ChipVersions[], /* Out */
- UDIInt *NumberOfChips /* In/Out */
- ));
-
-UDIError UDICreateProcess UDIParams((
- UDIPId *PId /* Out */
- ));
-
-UDIError UDISetCurrentProcess UDIParams((
- UDIPId PId /* In */
- ));
-
-UDIError UDIDestroyProcess UDIParams((
- UDIPId PId /* In */
- ));
-
-UDIError UDIInitializeProcess UDIParams((
- UDIMemoryRange ProcessMemory[], /* In */
- UDIInt NumberOfRanges, /* In */
- UDIResource EntryPoint, /* In */
- CPUSizeT StackSizes[], /* In */
- UDIInt NumberOfStacks, /* In */
- char *ArgString /* In */
- ));
-
-UDIError UDIRead UDIParams((
- UDIResource From, /* In */
- UDIHostMemPtr To, /* Out */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool HostEndian /* In */
- ));
-
-UDIError UDIWrite UDIParams((
- UDIHostMemPtr From, /* In */
- UDIResource To, /* In */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool HostEndian /* In */
- ));
-
-UDIError UDICopy UDIParams((
- UDIResource From, /* In */
- UDIResource To, /* In */
- UDICount Count, /* In */
- UDISizeT Size, /* In */
- UDICount *CountDone, /* Out */
- UDIBool Direction /* In */
- ));
-
-UDIError UDIExecute UDIParams((
- void
- ));
-
-UDIError UDIStep UDIParams((
- UDIUInt32 Steps, /* In */
- UDIStepType StepType, /* In */
- UDIRange Range /* In */
- ));
-
-UDIVoid UDIStop UDIParams((
- void
- ));
-
-UDIError UDIWait UDIParams((
- UDIInt32 MaxTime, /* In */
- UDIPId *PId, /* Out */
- UDIUInt32 *StopReason /* Out */
- ));
-
-UDIError UDISetBreakpoint UDIParams((
- UDIResource Addr, /* In */
- UDIInt32 PassCount, /* In */
- UDIBreakType Type, /* In */
- UDIBreakId *BreakId /* Out */
- ));
-
-UDIError UDIQueryBreakpoint UDIParams((
- UDIBreakId BreakId, /* In */
- UDIResource *Addr, /* Out */
- UDIInt32 *PassCount, /* Out */
- UDIBreakType *Type, /* Out */
- UDIInt32 *CurrentCount /* Out */
- ));
-
-UDIError UDIClearBreakpoint UDIParams((
- UDIBreakId BreakId /* In */
- ));
-
-UDIError UDIGetStdout UDIParams((
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDIGetStderr UDIParams((
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDIPutStdin UDIParams((
- UDIHostMemPtr Buf, /* In */
- UDISizeT Count, /* In */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDIStdinMode UDIParams((
- UDIMode *Mode /* Out */
- ));
-
-UDIError UDIPutTrans UDIParams((
- UDIHostMemPtr Buf, /* In */
- UDISizeT Count, /* In */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDIGetTrans UDIParams((
- UDIHostMemPtr Buf, /* Out */
- UDISizeT BufSize, /* In */
- UDISizeT *CountDone /* Out */
- ));
-
-UDIError UDITransMode UDIParams((
- UDIMode *Mode /* Out */
- ));
diff --git a/gdb/29k-share/udi/udipt29k.h b/gdb/29k-share/udi/udipt29k.h
deleted file mode 100644
index 5de2f3ff860..00000000000
--- a/gdb/29k-share/udi/udipt29k.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* This file is to be used to reconfigure the UDI Procedural interface
- for a given target.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* This file should be placed so that it will be
- included from udiproc.h. Everything in here will probably need to
- be changed when you change the target processor. Nothing in here
- should need to change when you change hosts or compilers.
-*/
-
-/* Select a target CPU Family */
-#define TargetCPUFamily Am29K
-
-/* Enumerate the processor specific values for Space in a resource */
-#define UDI29KDRAMSpace 0
-#define UDI29KIOSpace 1
-#define UDI29KCPSpace0 2
-#define UDI29KCPSpace1 3
-#define UDI29KIROMSpace 4
-#define UDI29KIRAMSpace 5
-#define UDI29KLocalRegs 8
-#define UDI29KGlobalRegs 9
-#define UDI29KRealRegs 10
-#define UDI29KSpecialRegs 11
-#define UDI29KTLBRegs 12 /* Not Am29005 */
-#define UDI29KACCRegs 13 /* Am29050 only */
-#define UDI29KICacheSpace 14 /* Am2903x only */
-#define UDI29KAm29027Regs 15 /* When available */
-#define UDI29KPC 16
-#define UDI29KDCacheSpace 17 /* When available */
-
-/* Enumerate the Co-processor registers */
-#define UDI29KCP_F 0
-#define UDI29KCP_Flag 8
-#define UDI29KCP_I 12
-#define UDI29KCP_ITmp 16
-#define UDI29KCP_R 20
-#define UDI29KCP_S 28
-#define UDI29KCP_RTmp 36
-#define UDI29KCP_STmp 44
-#define UDI29KCP_Stat 52
-#define UDI29KCP_Prec 56
-#define UDI29KCP_Reg0 60
-#define UDI29KCP_Reg1 68
-#define UDI29KCP_Reg2 76
-#define UDI29KCP_Reg3 84
-#define UDI29KCP_Reg4 92
-#define UDI29KCP_Reg5 100
-#define UDI29KCP_Reg6 108
-#define UDI29KCP_Reg7 116
-#define UDI29KCP_Mode 124
-
-/* Enumerate the stacks in StackSizes array */
-#define UDI29KMemoryStack 0
-#define UDI29KRegisterStack 1
-
-/* Enumerate the chips for ChipVersions array */
-#define UDI29K29KVersion 0
-#define UDI29K29027Version 1
-
-/* Define special value for elements of ChipVersions array for
- * chips not present */
-#define UDI29KChipNotPresent -1
-
-typedef UDIInt32 UDICount;
-typedef UDIUInt32 UDISize;
-
-typedef UDIInt CPUSpace;
-typedef UDIUInt32 CPUOffset;
-typedef UDIUInt32 CPUSizeT;
diff --git a/gdb/29k-share/udi/udiptcfg.h b/gdb/29k-share/udi/udiptcfg.h
deleted file mode 100644
index 1641a53bcd4..00000000000
--- a/gdb/29k-share/udi/udiptcfg.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "udipt29k.h"
diff --git a/gdb/29k-share/udi/udisoc.h b/gdb/29k-share/udi/udisoc.h
deleted file mode 100644
index bc68b3944ec..00000000000
--- a/gdb/29k-share/udi/udisoc.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* This module defines constants used in the UDI IPC modules.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-static char udisoc_h[]="@(#)udisoc.h 2.6 Daniel Mann";
-static char udisoc_h_AMD[]="@(#)udisoc.h 2.4, AMD";
-
-#define LOCAL static
-#define company_c 1 /* AMD Company id */
-#define product_c 1 /* socket IPC id */
-
-/* Enumerate the UDI procedure services
-*/
-#define UDIConnect_c 0
-#define UDIDisconnect_c 1
-#define UDISetCurrentConnection_c 2
-#define UDICapabilities_c 3
-#define UDIEnumerateTIPs_c 4
-#define UDIGetErrorMsg_c 5
-#define UDIGetTargetConfig_c 6
-#define UDICreateProcess_c 7
-#define UDISetCurrentProcess_c 8
-#define UDIDestroyProcess_c 9
-#define UDIInitializeProcess_c 10
-#define UDIRead_c 11
-#define UDIWrite_c 12
-#define UDICopy_c 13
-#define UDIExecute_c 14
-#define UDIStep_c 15
-#define UDIStop_c 16
-#define UDIWait_c 17
-#define UDISetBreakpoint_c 18
-#define UDIQueryBreakpoint_c 19
-#define UDIClearBreakpoint_c 20
-#define UDIGetStdout_c 21
-#define UDIGetStderr_c 22
-#define UDIPutStdin_c 23
-#define UDIStdinMode_c 24
-#define UDIPutTrans_c 25
-#define UDIGetTrans_c 26
-#define UDITransMode_c 27
-#define UDITest_c 28
-#define UDIKill_c 29
-
-#define udr_UDIInt8(udrs, obj) udr_work(udrs, obj, 1)
-#define udr_UDIInt16(udrs, obj) udr_work(udrs, obj, 2)
-#define udr_UDIInt32(udrs, obj) udr_work(udrs, obj, 4)
-#define udr_UDIInt(udrs, obj) udr_work(udrs, obj, 4)
-
-#define udr_UDIUInt8(udrs, obj) udr_work(udrs, obj, 1)
-#define udr_UDIUInt16(udrs, obj) udr_work(udrs, obj, 2)
-#define udr_UDIUInt32(udrs, obj) udr_work(udrs, obj, 4)
-#define udr_UDIUInt(udrs, obj) udr_work(udrs, obj, 4)
-
-#define udr_UDIBool(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_UDICount(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_UDISize(udrs, obj) udr_UDIUInt32(udrs, obj)
-#define udr_CPUSpace(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_CPUOffset(udrs, obj) udr_UDIUInt32(udrs, obj)
-#define udr_CPUSizeT(udrs, obj) udr_UDIUInt32(udrs, obj)
-#define udr_UDIBreakId(udrs,obj) udr_UDIUInt(udrs, obj)
-#define udr_UDISizeT(udrs, obj) udr_UDIUInt(udrs, obj)
-#define udr_UDIMode(udrs, obj) udr_UDIUInt(udrs, obj)
-
-#define udr_UDIHostMemPtr(udrs, obj) udr_UDIUInt32(udrs, obj)
-#define udr_UDIVoidPtr(udrs, obj) udr_UDIUInt32(udrs, obj)
-#define udr_UDIPId(udrs, obj) udr_UDIUInt(udrs, obj)
-#define udr_UDISessionId(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_UDIError(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_UDIStepType(udrs, obj) udr_UDIInt32(udrs, obj)
-#define udr_UDIBreakType(udrs, obj) udr_UDIInt32(udrs, obj)
-
-
-#define UDR_ENCODE 1
-#define UDR_DECODE 2
-
-typedef struct UDR_str
-{
- int udr_op; /* UDR operation */
- int previous_op;
- int sd;
- int bufsize;
- char* buff;
- char* getbytes;
- char* putbytes;
- char* putend;
- int domain;
- char* soc_name;
-} UDR;
-
-/******************************************* Declare UDR suport functions */
-int udr_create UDIParams((
- UDR* udrs,
- int sd,
- int size
- ));
-
-int udr_free UDIParams((
- UDR* udrs,
- ));
-
-int udr_signal UDIParams((
- UDR* udrs,
- ));
-
-int udr_sendnow UDIParams((
- UDR* udrs
- ));
-
-int udr_work UDIParams((
- UDR* udrs,
- void* object_p,
- int size
- ));
-
-int udr_UDIResource UDIParams((
- UDR* udrs,
- UDIResource* object_p
- ));
-
-int udr_UDIRange UDIParams((
- UDR* udrs,
- UDIRange* object_p
- ));
-
-int udr_UDIMemoryRange UDIParams((
- UDR* udrs,
- UDIMemoryRange* object_p
- ));
-
-int udr_UDIMemoryRange UDIParams((
- UDR* udrs,
- UDIMemoryRange* object_p
- ));
-
-int udr_int UDIParams((
- UDR* udrs,
- int* int_p
- ));
-
-int udr_bytes UDIParams((
- UDR* udrs,
- char* ptr,
- int len
- ));
-
-char* udr_inline UDIParams((
- UDR* udrs,
- int size
- ));
-
-char* udr_getpos UDIParams((
- UDR* udrs
- ));
-int udr_setpos UDIParams((
- UDR* udrs,
- char* pos
- ));
-
-int udr_readnow UDIParams((
- UDR* udrs,
- int size
- ));
-
-int udr_align UDIParams((
- UDR* udrs,
- int size,
- ));
diff --git a/gdb/29k-share/udi/udr.c b/gdb/29k-share/udi/udr.c
deleted file mode 100644
index 10a9f38c6ae..00000000000
--- a/gdb/29k-share/udi/udr.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/* This module supports sending and receiving data objects over a
- socket conection.
-
- Copyright 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-static char udr_c[]="@(#)udr.c 2.8 Daniel Mann";
-static char udr_c_AMD[]="@(#)udr.c 2.3, AMD";
-/*
-* All data is serialised into a character stream,
-* and de-serialised back into the approproiate objects.
-********************************************************************** HISTORY
-*/
-/* This is all unneeded on DOS machines. */
-#ifndef __GO32__
-
-#include <stdio.h>
-#include <sys/types.h>
-
-/* This used to say sys/fcntl.h, but the only systems I know of that
- require that are old (pre-4.3, at least) BSD systems, which we
- probably don't need to worry about. */
-#include <fcntl.h>
-
-#include <sys/socket.h>
-#include "udiproc.h"
-#include "udisoc.h"
-
-extern int errno;
-extern char* malloc();
-
-/* local type decs. and macro defs. not in a .h file ************* MACRO/TYPE
-*/
-
-/* global dec/defs. which are not in a .h file ************* EXPORT DEC/DEFS
-*/
-int udr_errno; /* error occurs during UDR service */
-
-/* local dec/defs. which are not in a .h file *************** LOCAL DEC/DEFS
-*/
-
-/****************************************************************** UDR_CREATE
-* Build UDR structure for character stream processing.
-*/
-int udr_create(udrs, sd, size)
-UDR* udrs;
-int sd;
-int size;
-{
- udrs->sd = sd;
- if(!udrs->buff) udrs->buff = malloc(size);
- udrs->getbytes = udrs->buff; /* set the buffer to the start */
- udrs->putbytes = udrs->buff;
- udrs->putend = udrs->buff;
- udrs->udr_op = -1; /* don't know the direction */
- udrs->previous_op = -1; /* don't know the direction */
- udrs->bufsize = size;
- return 0;
-}
-
-/******************************************************************** UDR_FREE
-* Free USR structure and close socket.
-*/
-int udr_free(udrs)
-UDR* udrs;
-{
- close(udrs->sd);
- free(udrs->buff);
- return 0;
-}
-
-/****************************************************************** UDR_SIGNAL
-* Send a signal to the process at the other end of the socket,
-* indicating that it should expect to recieve a new message shortly.
-*/
-int udr_signal(udrs)
-UDR* udrs;
-{
- if(send(udrs->sd, "I", 1, MSG_OOB) == -1)
- { perror("ERROR, udr_signal(), send(...MSG_OOB)");
- udr_errno = UDIErrorIPCInternal;
- return -1; /* return error code */
- }
- return 0;
-}
-
-/***************************************************************** UDR_SENDNOW
-* used to flush the current character stream buffer to
-* the associated socket. */
-int udr_sendnow(udrs)
-UDR* udrs;
-{
- int size = (UDIUInt32)(udrs->putend) - (UDIUInt32)(udrs->buff);
- if(udrs->previous_op == 0)
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- udrs->putbytes = udrs->buff;
- udrs->putend = udrs->buff;
- if (write(udrs->sd, udrs->buff, size) == -1)
- { perror("ERROR, udr_sendnow(), write() call: ");
- udr_errno = UDIErrorIPCInternal;
- return -1; /* return error code */
- }
- return 0;
-}
-
-/******************************************************************** UDR_WORK
-* Function to send or recieve data from the buffers supporting
-* socket communication. The buffer contains serialised objects
-* sent/recieved over a socket connection.
-*/
-int udr_work(udrs, object_p, size)
-UDR* udrs;
-void* object_p;
-int size;
-{
- int cnt, remain;
-
- if(udrs->udr_op != udrs->previous_op)
- { if(udrs->previous_op == 0)
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- udrs->previous_op= udrs->udr_op;
- udrs->putbytes = udrs->buff;
- udrs->getbytes = udrs->buff;
- }
-
- if(udrs->udr_op == UDR_ENCODE)
- { /* write data into character stream buffer */
- if( (UDIUInt32)(udrs->putbytes) + size >
- (UDIUInt32)(udrs->buff) + (UDIUInt32)(udrs->bufsize) )
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- memcpy(udrs->putbytes, (char*)object_p, size);
- udrs->putbytes += size;
- if(udrs->putbytes > udrs->putend) udrs->putend = udrs->putbytes;
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
- { /* need more data in character stream buffer */
- remain = (UDIUInt32)(udrs->bufsize) -
- ( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->buff) );
- if( ((UDIUInt32)(udrs->bufsize) + (UDIUInt32)(udrs->buff)
- - (UDIUInt32)(udrs->getbytes)) < size)
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- cnt = read(udrs->sd, (char*)udrs->putbytes, remain);
- if(cnt == -1) perror("ERROR udr_work(), read() failure: ");
- udrs->putbytes += cnt;
- if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
- { udr_errno = UDIErrorIPCInternal;
- return -1; /* return error code */
- }
- } /* read data from character stream buffer */
- memcpy((char*)object_p, udrs->getbytes, size);
- udrs->getbytes += size;
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- return 0;
-}
-
-/************************************************************* UDR_UDIResource
-*/
-int udr_UDIResource(udrs, object_p)
-UDR* udrs;
-UDIResource* object_p;
-{
- int retval;
-
- retval = udr_CPUSpace(udrs, &object_p->Space);
- retval = retval | udr_CPUOffset(udrs, &object_p->Offset);
- return retval;
-}
-
-/**************************************************************** UDR_UDIRange
-*/
-int udr_UDIRange(udrs, object_p)
-UDR* udrs;
-UDIRange* object_p;
-{
- int retval;
-
- retval = udr_CPUOffset(udrs, &object_p->Low);
- retval = retval | udr_CPUOffset(udrs, &object_p->High);
- return retval;
-}
-
-/********************************************************** UDR_UDIMemoryRange
-*/
-int udr_UDIMemoryRange(udrs, object_p)
-UDR* udrs;
-UDIMemoryRange* object_p;
-{
- int retval;
-
- retval = udr_CPUSpace(udrs, &object_p->Space);
- retval = retval | udr_CPUOffset(udrs, &object_p->Offset);
- retval = retval | udr_CPUSizeT(udrs, &object_p->Size);
- return retval;
-}
-
-/****************************************************************** UDR_string
-*/
-int udr_string(udrs, sp)
-UDR* udrs;
-char* sp;
-{
- int len, retval;
-
- if(udrs->udr_op == UDR_ENCODE)
- {
- if(sp)
- { len = strlen(sp) + 1;
- retval = udr_UDIInt32(udrs, &len);
- retval = retval | udr_work(udrs, sp, len);
- }
- else /* deal with NULL pointer */
- { len = 0;
- retval = udr_UDIInt32(udrs, &len);
- }
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- retval = udr_UDIInt32(udrs, &len);
- if(len)
- retval = retval | udr_work(udrs, sp, len);
- else *sp = '\0'; /* terminate string */
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- return retval;
-}
-
-/******************************************************************* UDR_BYTES
-*/
-int udr_bytes(udrs, ptr, len)
-UDR* udrs;
-char* ptr;
-int len;
-{
- return udr_work(udrs, ptr, len);
-}
-
-/********************************************************************* UDR_INT
-*/
-int udr_int(udrs, int_p)
-UDR* udrs;
-int* int_p;
-{
- int ret_val;
- UDIInt32 udr_obj; /* object of know size */
-
- if(udrs->udr_op == UDR_ENCODE)
- {
- udr_obj = *int_p; /* copy into know object size */
- return udr_UDIInt32(udrs, &udr_obj);
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- ret_val = udr_UDIInt32(udrs, &udr_obj); /* get object of known size */
- *int_p = udr_obj;
- return ret_val;
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
-}
-
-/****************************************************************** UDR_INLINE
-*/
-char* udr_inline(udrs, size)
-UDR* udrs;
-int size;
-{
- if(udrs->udr_op != udrs->previous_op)
- { if(udrs->previous_op == 0)
- { udr_errno = UDIErrorIPCInternal;
- return 0;
- }
- udrs->previous_op= udrs->udr_op;
- udrs->putbytes = udrs->buff;
- udrs->getbytes = udrs->buff;
- }
- if(udrs->udr_op == UDR_ENCODE)
- {
- if(udrs->putbytes + size > udrs->bufsize + udrs->buff)
- return 0;
- udrs->putbytes += size;
- return udrs->putbytes - size;
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- if(udrs->getbytes + size > udrs->bufsize + udrs->buff)
- return 0;
- udrs->getbytes += size;
- return udrs->getbytes - size;
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return 0;
- }
-}
-
-/****************************************************************** UDR_GETPOS
-*/
-char* udr_getpos(udrs)
-UDR* udrs;
-{
- if(udrs->udr_op == UDR_ENCODE)
- {
- return udrs->putbytes;
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- return udrs->getbytes;
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return 0;
- }
-}
-
-/****************************************************************** UDR_SETPOS
-*/
-int udr_setpos(udrs, pos)
-UDR* udrs;
-char* pos;
-{
- if( ((UDIUInt32)pos > (UDIUInt32)(udrs->buff) + (UDIUInt32)(udrs->bufsize))
- || ((UDIUInt32)pos < (UDIUInt32)(udrs->buff) ) )
- { udr_errno = UDIErrorIPCInternal;
- return 0;
- }
- if(udrs->udr_op == UDR_ENCODE)
- {
- udrs->putbytes = pos;
- return 1;
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- udrs->getbytes = pos;
- return 1;
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return 0;
- }
-}
-
-/***************************************************************** UDR_READNOW
-* Try and ensure "size" bytes are available in the
-* receive buffer character stream.
-*/
-int udr_readnow(udrs, size)
-UDR* udrs;
-int size;
-{
- int cnt, remain;
-
- if(udrs->udr_op == UDR_ENCODE)
- {
- udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- else if(udrs->udr_op == UDR_DECODE)
- {
- if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
- { /* need more data in character stream buffer */
- remain = (UDIUInt32)(udrs->bufsize) -
- ( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->buff) );
- cnt = read(udrs->sd, (char*)udrs->putbytes, remain);
- if(cnt == -1) perror("ERROR udr_work(), read() failure: ");
- udrs->putbytes += cnt;
- if( (UDIUInt32)(udrs->putbytes)-(UDIUInt32)(udrs->getbytes) < size )
- { fprintf(stderr,"ERROR, udr_readnow() too few bytes in stream\n");
- return -1; /* return error code */
- }
- }
- }
- else
- { udr_errno = UDIErrorIPCInternal;
- return -1;
- }
- return 0;
-}
-
-/******************************************************************* UDR_ALIGN
-*/
-int udr_align(udrs, size)
-UDR* udrs;
-int size;
-{
- char* align;
- int offset;
-
- align = udr_getpos(udrs);
- offset = size - ((int)align & (size -1));
- offset = offset & (size -1);
- if(offset) udr_setpos(udrs, align + offset);
-}
-#endif /* __GO32__ */
diff --git a/gdb/29k-share/udi_soc b/gdb/29k-share/udi_soc
deleted file mode 100644
index 343317f255f..00000000000
--- a/gdb/29k-share/udi_soc
+++ /dev/null
@@ -1,9 +0,0 @@
-# @(#)udi_soc 2.1 Daniel Mann
-# NOTE: the Session string must not start whith white-space characters.
-# Format of string is:
-# <session> <domain> <soc_name|host_name> <tip_exe> <pass to UDIconnect>
-soc2cayman AF_INET cayman /bin/udi_tip ...
-soc2tip AF_UNIX astring tip.exe ...
-cuba AF_UNIX soc_name ../bin.68020/udi_tip stuff to pass
-cayman AF_INET cayman this_entry_not_matter stuff to pass
-iss AF_UNIX * sun4/isstip -r osboot
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6745068e53b..25a0285b7de 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,48 +1,4203 @@
-2002-05-28 Keith Seitz <keiths@redhat.com>
-
- * cli/cli-interp.c: New file. Almost entirely from Apple's
- sources. Collected and moved here.
- * mi/mi-interp.c: Ditto.
- * mi/mi-events.c: Ditto.
- * mi/mi.h: New file.
- * Makefile.in: Add new files.
- Update dependencies on interps.h.
- * defs.h (selected_frame_level_changed_hook): Add declaration.
- * wrapper.c (captured_execute_command): New function.
- (do_captured_execute_command): New function.
- * wrapper.h (captured_execute_command): Declare.
- * top.c (catcher): If the caught command changes the uiout on us,
- try to do something sane, like using the current interpreter's
- uiout.
- * mi/mi-main.c (captured_execute_command): Use catch_exception
- instead of catch_errors.
- (mi_execute_command_wrapper): Remove. Using catch_errors now.
- (mi_input): Make global.
- (mi_load_progress): Ditto.
- Use interpreter functions instead of interpreter_p.
- (mi_command_loop): Moved to mi-interp.c
- (mi0_command_loop): Ditto.
- (mi1_command_loop): Ditto.
- (mi_init_ui): Remove.
- (_initialize_mi_main): Remove. No longer needed.
-
- From Jim Ingham <jingham@apple.com>:
- * event-loop.c (start_event_loop): Poll the interpreter's event loop
- as well as gdb...
- * event-top.c (gdb_setup_readline, gdb_disable_readline): New functions,
- used by console & mi to grab & relinquish control of the readline input.
- * event-top.h (gdb_setup_readline, gdb_disable_readline): Declare.
- * main.c (captured_main): Copy the interpreter name, since we will
- eventually use it as a set variable.
- * top.c (gdb_init): Use the interpreter mechanism to startup the stdin
- handling.
- * interps.c: New file. (Originally called interpreter.c by Apple)
- * interps.h: New file. (Originally called interpreter.h by Apple)
- * mi/mi-cmds.c, mi/mi-cmds.h: Add mi commands -interpreter-set and
- -interpreter-exec.
- * mi/mi-main.c: Add the interpreter functions.
- (mi_execute_command): Don't print the prompt if the command return
- is MI_CMD_QUIET.
+2002-08-24 Mark Kettenis <kettenis@gnu.org>
+
+ * valprint.c (print_longest) [CC_HAS_LONG_LONG &&
+ PRINTF_HAS_LONG_LONG]: Cast val_long to (long long) or (unsigned
+ long long) to prevent compiler warning on 64-bit systems.
+
+2002-08-23 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (STORE_RETURN_VALUE): Add regcache parameter.
+ (DEPRECATED_STORE_RETURN_VALUE): New method.
+ (EXTRACT_RETURN_VALUE): Make buffer parameter a void pointer.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * values.c (set_return_value): Pass current_regcache to
+ STORE_RETURN_VALUE.
+ * arch-utils.h (legacy_store_return_value): Declare.
+ * arch-utils.c (legacy_store_return_value): New function.
+ (legacy_extract_return_value): Update parameters.
+
+ * config/pa/tm-hppa.h (DEPRECATED_STORE_RETURN_VALUE): Rename
+ STORE_RETURN_VALUE.
+ * config/pa/tm-hppa64.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/z8k/tm-z8k.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/sparc/tm-sparclet.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/mn10200/tm-mn10200.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/m68k/tm-linux.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/m68k/tm-delta68.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/m32r/tm-m32r.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/h8500/tm-h8500.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+ * config/h8300/tm-h8300.h (DEPRECATED_STORE_RETURN_VALUE): Ditto.
+
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * i386-tdep.c (i386_extract_return_value): Update.
+ * arch-utils.c (legacy_extract_return_value): Update.
+ * frv-tdep.c (frv_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * d10v-tdep.c (d10v_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * m68k-tdep.c (m68k_gdbarch_init): Update.
+ * mcore-tdep.c (mcore_gdbarch_init): Update.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * x86-64-tdep.c (x86_64_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * avr-tdep.c (avr_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ * i386-tdep.c (i386_gdbarch_init): Update.
+
+2002-08-23 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Add entries for bfd/elf32-ppcqnx.c,
+ bfd/elf32-ppc.c, bfd/elf32-sh.c and bfd/elf32-shqnx.c.
+
+2002-08-24 Mark Kettenis <kettenis@gnu.org>
+
+ * PROBLEMS: Refer to GDB 5.3 instead of 5.2. Mention FreeBSD
+ problems.
+
+2002-08-23 Joel Brobecker <brobecker@gnat.com>
+
+ * infrun.c (handle_inferior_event): Move a comment outside of a
+ function call, in order to avoid indent reformatting this part
+ of the code in an unreadable way.
+
+2002-08-23 Grace Sainsbury <graces@redhat.com>
+
+ * infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg
+ when breakpoints fail. Move general breakpoint error messages to
+ insert_breakpoints.
+ * breakpoint.c (insert_breakpoints): Change warnings when
+ breakpoints are nto inserted to specify the type. Remove call to
+ memory_error when hardware breakpoints can't be inserted. Remove
+ multiple calls to warning so all messages are sent to the user at
+ once.
+ (delete_breakpoints): Make insert error messsages more explicit.
+
+2002-08-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * ChangeLog: Move gdbserver entries after GDB 5.2 to
+ gdbserver/ChangeLog.
+
+2002-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c: Include "objfiles.h".
+ (i386_svr4_init_abi): Set in_solib_call_trampoline and
+ skip_trampoline_code.
+ * config/i386/tm-i386v4.h: Don't include "config/tm-sysv4.h".
+ (CPLUS_MARKER): Define to '.'.
+
+ * linux-proc.c (struct linux_corefile_thread_data): Add num_notes
+ member.
+ (linux_corefile_thread_callback): Increase args->num_notes.
+ (linux_make_note_section): Initialize thread_args.num_notes, and
+ use it to determine whether notes for any threads were created.
+
+2002-08-23 Donn Terry <dterry@microsoft.com>
+
+ * proc-api.c (rw_table): Do not include a row for PCDSTOP if the
+ corresponding macro is not defined. Likewise for PCNICE, PCSHOLD
+ and PCUNKILL.
+ (write_with_trace): Conditionalize out the switch branch handling
+ PCSHOLD if the corresponding macro is not defined. Likewise for
+ PRSABORT and PRSTOP.
+ This change will be needed by the Interix port.
+
+2002-08-22 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (struct rs6000_framedata): Add saved_ev and
+ ev_offset fields.
+ (skip_prologue): Add support for BookE/e500 instructions.
+ (e500_extract_return_value): New function.
+ (frame_get_saved_regs): Add support for saving ev registers and
+ pseudo gpr's.
+ (e500_store_return_value): New function.
+ (rs6000_gdbarch_init): Move up default intializations of
+ deprecated_extract_return_value and store_return_value. Overwrite
+ init of store_return_value with e500 specific version.
+ Set extract_return_value for e500.
+
+2002-08-22 Elena Zannoni <ezannoni@redhat.com>
+
+ * blockframe.c (generic_call_dummy_register_unwind): Use
+ regcache_cooked_read to catch cases in which the variable is
+ stored in a pseudo register.
+
+2002-08-22 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Mention that the i960 has been made obsolete.
+ * Makefile.in (SFILES): Delete remote-nrom.c, remote-nindy.c and
+ i960-tdep.c
+ (remote-nrom.o): Obsolete target.
+ (remote-nindy.o, i960-tdep.o): Ditto.
+ * remote-nrom.c: Make file obsolete.
+ * remote-nindy.c, remote-vx960.c: Ditto.
+ * config/i960/vxworks960.mt, config/i960/nindy960.mt: Ditto.
+ * config/i960/mon960.mt, config/i960/tm-i960.h: Ditto.
+ * config/i960/tm-vx960.h, config/i960/tm-nindy960.h: Ditto.
+ * config/i960/tm-mon960.h, i960-tdep.c: Ditto.
+ * configure.tgt: Make i960-*-bout*, i960-nindy-coff*,
+ i960-*-coff*, i960-nindy-elf*, i960-*-elf*, i960-*-nindy* and
+ i960-*-vxworks* obsolete.
+ * MAINTAINERS: Note that the i960 is obsolete.
+
+2002-08-21 Corinna Vinschen <vinschen@redhat.com
+
+ * aix-thread.c (aix_thread_detach): Disable thread debugging on
+ detach to allow reinitialization.
+
+2002-08-22 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Change the s390 target to s390-linux-gnu (second
+ attempt).
+
+2002-08-22 Jim Blandy <jimb@redhat.com>
+
+ * coffread.c (coff_symfile_read): Don't try to read the line
+ number table from disk if the image file doesn't have a symbol
+ table; we'll never actually look at the info anyway, and Windows
+ ships DLL's with bogus file offsets for the line number data.
+
+2002-08-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have
+ an e500 executable.
+
+2002-08-21 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (MSYMBOL_IS_SPECIAL): Replace macro with function.
+ (MSYMBOL_SIZE): Replace macro with function.
+ (DEFAULT_MIPS_TYPE): Delete unused macro.
+ * config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): Delete unused macro.
+ * config/mips/tm-embed.h (DEFAULT_MIPS_TYPE): Delete unused macro.
+
+2002-08-21 Jim Blandy <jimb@redhat.com>
+
+ * valops.c (value_cast): Simplify and correct logic for doing a
+ static cast from a pointer to a base class to a pointer to a
+ derived class.
+
+2002-08-21 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (default_print_registers_info): Replace
+ do_registers_info.
+ (registers_info): Use gdbarch_print_registers_info instead of
+ DO_REGISTERS_INFO.
+ * inferior.h (default_print_registers_info): Replace
+ do_registers_info.
+ * gdbarch.sh (PRINT_REGISTERS_INFO): New method.
+ (DO_REGISTERS_INFO): Change to a predicate function.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-08-21 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Add target-changed event.
+ * gdb-events.c: Regenerated.
+ * gdb-events.c: Regenerated.
+ * valops.c (value_assign): Add target-changed event notification
+ to inlval_register, lval_memory, and lval_reg_frame_relative.
+
+2002-08-21 Joel Brobecker <brobecker@gnat.com>
+
+ * NEWS: Add an entry regarding the improvement of the next/step
+ operation on Alpha Tru64 multi-processor machines.
+
+2002-08-21 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Update dependencies for mi/ cli/ and tui/
+ directores.
+ * Makefile.in: Update all _h macro definitions.
+ * Makefile.in (install-gdbtk): Move to install section.
+ (rdi-share/libangsd.a): Move to end of file.
+
+2002-08-19 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (frame_register_unwind): When a register, set addrp to
+ the register's byte.
+
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): These are only
+ used locally, so move them from the target machine header to here.
+ (mips_set_processor_type, mips_register_name, mips32_next_pc,
+ mips16_next_pc, cached_proc_desc, mips_set_processor_type):
+ Make static.
+ * config/mips/tm-mips.h (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Delete.
+
+2002-08-20 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Mention that the Apollo line was made obsolete.
+ * configure.tgt: Make m68*-apollo*-bsd*, m68*-hp-bsd*, and
+ m68*-hp-hpux* obsolete.
+ * configure.host: Make m68*-apollo*-sysv*, m68*-apollo*-bsd*,
+ m68*-hp-bsd* and m68*-hp-hpux* obsolete.
+ * buildsym.c (make_blockvector): Make static.
+ * buildsym.h (make_blockvector): Make extern declaration obsolete.
+ * Makefile.in (HFILES_NO_SRCDIR): Remove dst.h
+ (ALLDEPFILES): Remove dstread.c.
+ (dstread.o): Obsolete make rule.
+ * dstread.c: Makefile obsolete.
+ * dst.h: Ditto.
+ * config/m68k/hp300hpux.mt: Ditto.
+ * config/m68k/hp300hpux.mh: Ditto.
+ * config/m68k/hp300bsd.mt: Ditto.
+ * config/m68k/hp300bsd.mh: Ditto.
+ * config/m68k/apollo68b.mt: Ditto.
+ * config/m68k/apollo68v.mh: Ditto.
+ * config/m68k/apollo68b.mh: Ditto.
+
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_in_return_stub): Make static.
+ (mips_gdbarch_init): Set in_solib_return_trampoline.
+ * config/mips/tm-mips.h (IN_SOLIB_RETURN_TRAMPOLINE): Delete.
+
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Add.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * arch-utils.c, arch-utils.h (generic_in_solib_return_trampoline):
+ Add.
+ * infrun.c (IN_SOLIB_RETURN_TRAMPOLINE): Delete default definition.
+
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_skip_stub, mips_in_call_stub): Make static.
+ (mips_gdbarch_init): Set skip_trampoline_code,
+ in_solib_call_trampoline.
+ * config/mips/tm-mips.h (REGISTER_NAME): Delete.
+ (IN_SOLIB_CALL_TRAMPOLINE, SKIP_TRAMPOLINE_CODE): Delete.
+
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-tdep.h (struct gdbarch_tdep): Add ev registers.
+
+ * rs6000-tdep.c (rs6000_register_virtual_type): Return 64 bit
+ vector type for ev registers.
+ (e500_pseudo_register_read): New function.
+ (e500_pseudo_register_write): New function.
+ (e500_dwarf2_reg_to_regnum): New function.
+ (PPC_UISA_NOFP_SPRS): New macro.
+ (PPC_EV_REGS): New macro.
+ (PPC_GPRS_PSEUDO_REGS): New macro.
+ (registers_e500): New register set for e500.
+ (variants): Add e500 variant.
+ (rs6000_gdbarch_init): Move setting of pc, sp, fp regnums to
+ before setting architectural dependent variations. Initialize ev
+ registers numbers. Add case for e500 architecture. Set the
+ number of pseudo registers.
+
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c: Clean up comments.
+
+2002-08-20 Andrew Cagney <cagney@redhat.com>
+
+ * h8300-tdep.c: Re-indent file.
+
+2002-08-20 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (LDFLAGS): Allow the configure script to establish a
+ default for this.
+
+2002-08-20 Keith Seitz <keiths@redhat.com>
+
+ * breakpoints.c (watch_command_1): Use internal breakpoint
+ when setting a watchpoint_scope breakpoint.
+
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbtypes.c (build_builtin_type_vec64): Add name to type.
+ (build_builtin_type_vec64i): Ditto.
+ (build_builtin_type_vec128): Ditto.
+ (build_builtin_type_vec128i): Ditto.
+
+2002-08-19 Michael Snyder <msnyder@redhat.com>
+
+ * config/mips/tm-mips.h (ELF_MAKE_MSYMBOL_SPECIAL): Delete.
+ (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Change into functions.
+ (FIX_CALL_DUMMY, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME,
+ POP_FRAME, INIT_EXTRA_FRAME_INFO): Delete.
+ (CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET,
+ CALL_DUMMY_ADDRESS): Delete.
+ * mips-tdep.c (mips_elf_make_msymbol_special, mips_msymbol_size,
+ mips_msymbol_is_special, mips_fix_call_dummy): New functions.
+ (mips_gdbarch_init): Set elf_make_msymbol_special, pop_frame,
+ push_dummy_frame, fix_call_dummy, init_extra_frame_info,
+ push_return_address.
+ (mips_register_raw_size, mips_eabi_use_struct_convention,
+ mips_n32n64_use_struct_convention, mips_o32_use_struct_convention,
+ mips_o32_reg_struct_has_addr, mips_frame_saved_pc, mips_frame_chain,
+ mips_init_extra_frame_info, mips_eabi_push_arguments,
+ mips_n32n64_push_arguments, mips_push_return_address,
+ mips_push_dummy_frame, mips_pop_frame, mips_skip_prologue,
+ mips_breakpoint_from_pc, mips_call_dummy_address): Make static.
+
+2002-08-19 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_frame_num_args): New function.
+ (mips_gdbarch_init): Set frame_chain, frameless_function_invocation,
+ frame_saved_pc, frame_args_address, frame_locals_address,
+ frame_num_args, and frame_args_skip.
+ * config/mips/tm-mips.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION,
+ FRAME_SAVED_PC, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS,
+ FRAME_NUM_ARGS, FRAME_ARGS_SKIP): Delete.
+ * config/mips/tm-mipsv4.h (FRAME_CHAIN_VALID): Delete.
+
+2002-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * config/mips/tm-mips.h (STORE_STRUCT_RETURN): Delete.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Delete.
+ * mips-tdep.c (mips_store_struct_return): New function.
+ (mips_extract_struct_value_address): New function.
+ (mips_gdbarch_init): Set store_struct_return and
+ extract_struct_value_address.
+
+2002-08-20 David Carlton <carlton@math.stanford.edu>
+
+ * dwarf2read.c (dwarf2_build_psymtabs): Check that
+ dwarf_line_offset is nonzero before creating dwarf_line_buffer.
+ (read_file_scope): Check that line_header is nonzero before
+ decoding macro information.
+
+2002-08-20 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.h (FP_REGNUM_P): Change such that we don't incorrectly
+ flag the general-purpose registers as floating-point on targets
+ that don't support the floating-point registers.
+
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (altivec_register_p): Delete.
+ (rs6000_do_altivec_registers): Delete.
+ (rs6000_altivec_registers_info): Delete.
+ (rs6000_do_registers_info): Delete.
+ (_initialize_rs6000_tdep): Remove command 'info powerpc altivec'.
+ (rs6000_gdbarch_init): Remove setting of do_registers_info.
+
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * infcmd.c (do_registers_info): Print vector registers in hex
+ format only.
+ (print_vector_info): Check that printing registers
+ makes sense.
+ (print_float_info): Ditto.
+
+2002-08-20 Andrew Cagney <ac131313@redhat.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ (mips_o32_extract_return_value): Rewrite.
+ (mips_o32_store_return_value): Rewrite.
+ (mips_o32_xfer_return_value): New function.
+ (mips_xfer_register): Tweak debug print message. Allow for
+ buf_offset when dumping the value transfered.
+
+2002-08-20 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/tm-nbsd.h (MIPS_DEFAULT_ABI): Delete.
+ * config/mips/tm-linux.h (MIPS_DEFAULT_ABI): Delete.
+ * config/mips/tm-irix5.h (MIPS_DEFAULT_ABI): Delete.
+ * config/mips/tm-irix6.h (MIPS_DEFAULT_ABI): Delete.
+ * mips-tdep.c (mips_gdbarch_init) [MIPS_DEFAULT_ABI]: Delete code.
+
+2002-08-14 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_frame_chain): Check for call-dummy frames.
+
+2002-08-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (struct reg): Add field to indicate a pseudo
+ register.
+ (P): New macro to define a register as a pseudo register.
+ (R, R4, R8, R16, FR32, R64, R0): Updated.
+ (struct variant): Add new fields for number of pseudo registers
+ and number of total registers.
+ (tot_num_registers): New macro replacing....
+ (num_registers): ...deleted macro.
+ (num_registers): New function.
+ (num_pseudo_registers): New function.
+ (variants): Update all variants to intialize new fields correctly.
+ Postpone initialization of number of pseudo regs and real regs.
+ (init_variants): New function.
+ (rs6000_gdbarch_init): Initialize variants. Update calculation of
+ registers offsets.
+
+2002-08-19 David Carlton <carlton@math.stanford.edu>
+
+ * valops.c (search_struct_field): Change error message to treat
+ return value of 0 from value_static_field as meaning that field is
+ optimized out.
+ (value_struct_elt_for_reference): Ditto.
+ * values.c (value_static_field): Treat an unresolved location the
+ same as a nonexistent symbol. Fix PR gdb/635.
+ * gnu-v2-abi.c (gnuv2_value_rtti_type): Eliminate test for being
+ enclosed. Fix PR gdb/574.
+ * MAINTAINERS: Add self to Write After Approval list.
+
+2002-08-19 Andrew Cagney <ac131313@redhat.com>
+
+ * mips-tdep.c (mips_xfer_register): New function.
+ (mips_n32n64_extract_return_value): Rewrite.
+ (mips_gdbarch_init): For N32 and N64, set extract_return_value
+ instead of deprecated_extract_return_value.
+
+2002-08-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (TDEP): Delete macro.
+ (branch_dest): Replace use of TDEP macro with its body.
+ (rs6000_pop_frame): Ditto.
+ (rs6000_push_arguments): Ditto.
+ (rs6000_skip_trampoline_code): Ditto.
+ (rs6000_frame_saved_pc): Ditto.
+ (rs6000_frame_chain): Ditto.
+ (rs6000_register_name): Ditto.
+ (rs6000_register_byte): Ditto.
+ (rs6000_register_raw_size): Ditto.
+ (rs6000_register_virtual_type): Ditto.
+ (rs6000_register_convertible): Ditto.
+ (rs6000_convert_from_func_ptr_addr): Ditto.
+
+2002-08-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define
+ conditionally.
+ (JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and
+ MIPS_LINUX_JB_ELEMENT_SIZE.
+ * mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca
+ for MAX_REGISTER_RAW_SIZE arrays.
+ (mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and
+ MIPS_LINUX_JB_ELEMENT_SIZE.
+
+2002-08-19 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * i387-tdep.c (i387_print_float_info): Fix typo in comment.
+
+2002-08-19 Aidan Skinner <aidan@velvet.net>
+
+ * Makefile.in (SFILES): Add ada-exp.y ada-lang.c ada-typeprint.c
+ ada-valprint.c ada-tasks.c.
+ (YYFILES): Add ada-exp.y.
+ (ada-exp.tab.c ada-lex.c ada-lang.o): New target.
+ (ada-tasks.o ada-typeprint.o ada-valprint.o): New target.
+ (ada-exp.tab.o): New target.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (regcache_xfer_part): New function.
+ (regcache_raw_read_part): New function.
+ (regcache_raw_write_part): New function.
+ (regcache_cooked_read_part): New function.
+ (regcache_cooked_write_part): New function.
+ * regcache.h (regcache_raw_read_part): Declare.
+ (regcache_raw_write_part): Declare.
+ (regcache_cooked_read_part): Declare.
+ (regcache_cooked_write_part): Declare.
+
+2002-08-18 Daniel Jacobowitz <drow@mvista.com>
+
+ * remote.c (remote_open_1): Add async_p.
+ (remote_async_open_1): Delete.
+ (open_remote_target): Delete.
+ (remote_open, extended_remote_open): Update calls to remote_open_1.
+ (remote_async_open, extended_remote_async_open): Call
+ remote_open_1 instead of remote_async_open_1.
+
+2002-08-19 Mark Kettenis <kettenis@gnu.org>
+
+ * blockframe.c: Fix a few coding standard violations.
+
+2002-08-19 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-i386sco5.h (START_INFERIOR_TRAPS_EXPECTED): Moved
+ here from ...
+ * config/i386/tm-i386sco5.h: ... here. File removed.
+ * config/i386/i386sco5.mt (TM_FILE): Set to tm-i386v4.h.
+
+ * config/i386/nm-i386v.h (START_INFERIOR_TRAPS_EXPECTED): New define.
+ * config/i386/i386aout.mt (TDEPFILES): Add i387-tdep.o
+ (TM_FILE): Set to tm-i386.h.
+ * config/i386/i386v.mt (TM_FILE): Set to tm-i386.h.
+ * config/i386/tm-i386v.h: Remove file.
+ * config/i386/tm-ptx.h [!SEQUENT_PTX4]: Include "i386/tm-i386.h"
+ instead of "i386/tm-i386v.h".
+ (START_INFERIOR_TRAPS_EXPECTED): Remove define.
+ * config/i386/tm-symmetry: Include "i386/tm-i386.h" instead of
+ "i386/tm-i386v.h".
+ (START_INFERIOR_TRAPS_EXPECTED): Remove define.
+ * config/i386/tm-vxworks.h: Include "i386/tm-i386.h" instead of
+ "i386/tm-i386.h".
+
+2002-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-i386v.h: Add protection against
+ multiple-inclusion.
+ (i386_register_u_addr): Remove prototype.
+ (register_u_addr): New prototype.
+ (REGISTER_U_ADDR): Redefine accordingly.
+ * i386v-nat.c: Improve several comments.
+ (i386_register_u_addr): Change signature and rename to
+ register_u_addr. Use FP_REGNUM_P. Rewrite slightly to get rid of
+ ubase variable.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * config/mips/tm-mips.h (STORE_RETURN_VALUE): Delete macro.
+ (DEPRECATED_EXTRACT_RETURN_VALUE): Delete macro.
+ * mips-tdep.c (mips_gdbarch_init): Set store_return_value and
+ deprecated_extract_return_value.
+ (mips_o32_push_arguments, mips_o64_push_arguments): Clone and
+ rename mips_o32o64_push_arguments.
+ (mips_gdbarch_init): Update.
+ (mips_extract_return_value): Delete.
+ (mips_o32_extract_return_value): Clone mips_extract_return_value.
+ (mips_o64_extract_return_value): Clone mips_extract_return_value.
+ (mips_eabi_extract_return_value): Clone mips_extract_return_value.
+ (mips_n32n64_extract_return_value): Clone
+ mips_extract_return_value.
+ (mips_store_return_value): Delete.
+ (mips_o32_store_return_value): Clone mips_store_return_value.
+ (mips_o64_store_return_value): Clone mips_store_return_value.
+ (mips_eabi_store_return_value): Clone mips_store_return_value.
+ (mips_n32n64_store_return_value): Clone mips_store_return_value.
+
+2002-08-18 Aidan Skinner <aidan@velvet.net>
+
+ * ada-lang.c: Use gdb_string.h instead of <string.h>.
+ * ada-typeprint.c: Use gdb_string.h instead of <string.h>.
+
+2002-08-18 Aidan Skinner <aidan@velvet.net>
+
+ * ada-lang.c: Run through gdb_indent.sh.
+ * ada-lang.h: Run through gdb_indent.sh.
+ * ada-tasks.c: Run through gdb_indent.sh.
+ * ada-typeprint.c: Run through gdb_indent.sh.
+ * ada-valprint.c: Run through gdb_indent.sh.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * osabi.c (gdbarch_init_osabi): Don't complain about an unknown
+ ABI.
+
+2002-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * i386b-nat.c [FETCH_INFERIOR_REGISTERS]: Remove dead code.
+
+ * config/i386/nm-i386bsd.h (FLOAT_INFO): Remove redundant #undef.
+ * i386b-nat.c [FLOAT_INFO]: Remove dead code.
+
+ * i386-tdep.c (i386_do_pop_frame, i386_store_return_value): Call
+ write_register_gen instead of write_register_bytes.
+
+ * NEWS: Mention that the i[3456]-*mach3*, i[3456]-*-mach* and
+ i[3456]-*-osf1mk* configurations have been made obsolete.
+ * configure.host: Make i[3456]86-*-mach3*, i[3456]86-*mach* and
+ i[3456]86-*-osf1mk* hosts obsolete.
+ * confighure.tgt: Make i[3456]86-*-mach3*, i[3456]86-*-osf1mk*
+ targets obsolete.
+ * config/i386/i386mach.mh, config/i386/nm-i386mach.h,
+ config/i386/xm-i386mach.h, config/i386/i386m3.mh,
+ config/i386/i386m3.mt, config/i386/nm-m3.h,
+ config/i386/tm-i386m3.h, config/i386/xm-i386m3.h,
+ config/i386/i386mk.mh, config/i386/i386mk.mt,
+ config/i386/tm-i386mk.h, config/i386/xm-i386mk.h: Make files
+ obsolete.
+ * i386mach-nat.c, i386m3-nat.c: Make files obsolete.
+ * Makefile.in (ALLDEPFILES): Remove i386mach.c i386m3-nat.c
+ (i386mach-nat.o, i386m3-nat.o):Make targets obsolete.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * config/pa/tm-hppa.h (hppa_store_return_value): Declare.
+ (hppa_value_returned_from_stack): Declare.
+ (hppa_extract_return_value): Declare.
+ * config/pa/hppa.mt: New file.
+ * configure.tgt: Recognize hppa*-*-*.
+ * MAINTAINERS: Change HPPA target to hppa-elf. Still broken.
+
+2002-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Fix typo in
+ comment.
+
+2002-08-17 Mark Kettenis <kettenis@gnu.org>
+
+ * top.c (gdb_rl_operate_and_get_next): Make sure
+ operate-and-get-next functions correctly even when the history
+ list is completely filled.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Target Instruction Set Architectures): Rename
+ Target/Architectures. Replace vax-dec-vms5.5 with vax-netbsd.
+ Replace s390-linux with s390-linux-gnu. Remove i386-aout,
+ mcore-pe, mips64-elf, sparc64-elf. Remove i586-pc-msdosdjgpp,
+ already listed under Host/Native.
+
+ * configure.tgt: Combine i[3456]86-*-coff*, i[3456]86-*-elf*,
+ i[3456]86-*-pe*, and i[3456]86-*-aout* into i[3456]86-*-*. Add
+ mips*-*-*.
+
+2002-08-17 Andrew Cagney <ac131313@redhat.com>
+
+ * config/ia64/ia64.mt: New file.
+ * config/alpha/alpha.mt: New file.
+ * MAINTAINERS: Change the alpha target to alpha-elf and IA-64 to
+ ia64-linux-gnu. Mention that ia64-elf is broken.
+ * configure.tgt: Add alpha*-*-* and ia64*-*-* patterns.
+
+2002-08-17 Mark Kettenis <kettenis@elgar.kettenis.dyndns.org>
+
+ * i386-tdep.c (i386_svr4_init_abi, i386_nw_init_abi): Use
+ generic_func_frame_valid instead of func_frame_valid.
+
+2002-08-16 Joel Brobecker <brobecker@gnat.com>
+
+ * alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately,
+ procfs appears to be broken when debugging on multi-processor
+ machines. So enable software single stepping in order to avoid
+ using the procfs interface to do next/step operations, using
+ internal breakpoints instead.
+
+ * infrun.c (handle_inferior_event): Readjust the stop_pc by
+ DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to
+ make this pc address equal to the value it would have if the
+ system stepping capability was used. Also set a new flag used
+ to ensure that we don't readjust the PC one more time later.
+
+ * breakpoint.c (bpstat_stop_status): Do not adjust the PC
+ address by DECR_PC_AFTER_BREAK when software single step is
+ in use for this architecture, as this has already been taken
+ care of in handle_inferior_event().
+
+2002-08-16 Joel Brobecker <brobecker@gnat.com>
+
+ * infrun.c (handle_inferior_event): Minor reformatting, to make
+ a rather long condition expression easier to read.
+
+2002-08-16 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdbtk.o): Move to end of file.
+ (gdbtk-bp.o, gdbtk-cmds.o): Ditto.
+ (gdbtk-hooks.o, gdbtk-register.o): Ditto.
+ (gdbtk-stack.o, gdbtk-varobj.o): Ditto.
+ (gdbtk-wrapper.o, gdbres.o): Ditto.
+
+2002-08-16 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (copying.o): Separate out compile rule.
+ (hpux-thread.o, procfs.o, signals.o): Ditto.
+ (v850ice.o, z8k-tdep.o): Ditto.
+ (tui-file.o): Move to TUI section.
+ (xdr_ptrace.o, xdr_rdb.o, xdr_ld.o): Move to separate section.
+ (nindy.o, Onindy.o, ttyflush.o): Move to separate section.
+
+2002-08-16 Joel Brobecker <brobecker@gnat.com>
+
+ * i386-tdep.c (i386_pe_skip_trampoline_code): renamed from
+ skip_trampoline_code, for better namespace-proofing.
+
+ * i386-tdep.h (i386_pe_skip_trampoline_code): Add declaration.
+
+2002-08-16 Joel Brobecker <brobecker@gnat.com>
+
+ * config/i386/tm-cygwin.h: Remove some "#if 0"'ed macros.
+
+2002-08-16 Joel Brobecker <brobecker@gnat.com>
+
+ * infrun.c (handle_inferior_event): When receiving a SIGTRAP
+ signal, check whether we hit a breakpoint before checking for a
+ single step breakpoint. Otherwise, GDB fails to notice that a
+ breakpoint has been hit when stepping onto a breakpoint.
+
+2002-08-16 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh (clear_gdb_event_hooks): New function.
+ * gdb-events.c: Regenerate.
+ * gdb-events.h: Regenerate.
+
+2002-08-16 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.c (bpstat_stop_status): Rename not_a_breakpoint to
+ not_a_sw_breakpoint.
+ * breakpoint.h (bpstat_stop_status): Add parameter names.
+
+2002-08-16 Grace Sainsbury <graces@redhat.com>
+
+ * remote.c (remote_insert_hw_breakpoint)
+ (remote_remove_hw_breakpoint): Fix calculation of length field
+ for Z-packet.
+
+2002-08-15 Michael Snyder <msnyder@redhat.com>
+
+ * irix5-nat.c (supply_gregset): Allocate plenty-big buffer
+ (32 bytes) instead of using MAX_REGISTER_RAW_SIZE.
+ (supply_fpregset): Ditto.
+
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW, REGISTER_CONVERTIBLE,
+ MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE): Delete.
+ (TARGET_READ_SP): Delete.
+ (DO_REGISTERS_INFO): Delete.
+ (FUNCTION_START_OFFSET, IN_SIGTRAMP, REGISTER_VIRTUAL_SIZE):
+ Delete.
+ (REGISTER_CONVERT_FROM_TYPE, REGISTER_CONVERT_TO_TYPE): Convert
+ from macros to functions.
+
+ * mips-tdep.c (mips_gdbarch_init): Set the above in the gdbarch.
+ (mips_register_convertible, mips_register_convert_to_virtual,
+ mips_register_convert_to_raw): Make static.
+ (mips_read_sp): New function.
+ (mips_gdbarch_init): Set gdbarch read_sp to mips_read_sp.
+ (mips_do_registers_info): Make static.
+ (mips_gdbarch_init): Insert mips_do_registers_info into gdbarch.
+ (in_sigtramp): Make static, rename to mips_pc_in_sigtramp.
+ (mips_register_convert_from_type, mips_register_convert_to_type):
+ New functions.
+ (mips_gdbarch_init): Set up function_start_offset,
+ register_virtual_size, pc_in_sigtramp.
+
+2002-08-15 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (vector_info): New function.
+ (_initialize_infcmd): Add command "info vector".
+ (print_vector_info): New function.
+
+ * gdbarch.sh (PRINT_VECTOR_INFO): New method
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-08-15 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to
+ ``print_all''. Only print vector registers when ``print_all''.
+
+2002-08-15 Andrew Cagney <ac131313@redhat.com>
+
+ * i387-tdep.h (i387_print_float_info): Add `args' parameter.
+ * i387-tdep.c (i387_print_float_info): Add `args' parameter.
+
+ * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method.
+ Add `args' parameter.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * arm-tdep.c (arm_print_float_info): Add the parameter `args'.
+
+ * infcmd.c (float_info): Call print_float_info.
+ (print_float_info): New function. By default, print the
+ floating-point registers.
+
+ * arch-utils.h (default_print_float_info): Delete declaration.
+ * arch-utils.c (default_print_float_info): Delete function.
+
+2002-08-16 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/nm-i386v.h (FLOAT_INFO): Remove already commented
+ out define.
+
+ * i387-tdep.c (i387_print_float_info): Add comment about ignoring
+ FRAME.
+
+ * NEWS: Mention that the i[3456]-*-aix target has been made obsolete.
+ * configure.host: Make i[3456]86-*-aix host obsolete.
+ * configure.tgt: Make i[3456]86-*-aix target obsolete.
+ * config/i386/i386aix.mh, config/i386/i386aix.mt,
+ config/i386/nm-i386aix.h, condig/i386/tm-i386aix.h,
+ config/i386/xm-i386aix.h: Make files obsolete.
+ * i386aix-nat.c: Make file obsolete.
+ * Makefile.in (ALLDEPFILES): Remove i386aix-nat.c.
+ (i386aix-nat.o): Make target obsolete.
+
+ * config/i386/nm-gnu.h: Removed.
+ * config/i386/nm-i386gnu.h: New file.
+ (THREAD_STATE_FLAVOR, THREAD_STATE_SIZE,
+ THREAD_STATE_SET_TRACED, THREAD_STATE_CLEAR_STATE, ATTACH_DETACH):
+ Moved here from ...
+ * config/i386/tm-i386gnu.h: ... here. Removed.
+ * config/i386/xm-i386gnu.h: Removed.
+ * config/i386/i386gnu.mh (XM_FILE): Set to xm-i386.h.
+ (NAT_FILE): Set to nm-i386gnu.h.
+ * config/i386/i386gnu.mt (TDEPFILES): Add i386gnu-tdep.o.
+ * i386-tdep.c: New file.
+ * Makefile.in (ALLDEPFILES): Add i386gnu-nat.c and i386gnu-tdep.c.
+ (i386gnu-tdep.o): Specify dependencies.
+
+2002-08-15 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386sco5.h: Include "i386/tm-i386v4.h" instead of
+ "i386/tm-i386.h", "i386/tm-i386v.h" and "config/tm-sysv.h".
+ Adjust a few comments to reflect reality a bit closer.
+ (KERNEL_U_SIZE, TARGET_HAS_HARDWARE_WATCHPOINTS,
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUEABLE_WATCHPOINT,
+ HAVE_STEPPABLE_WATCHPOINT, STOPPED_BY_WATCHPOINT,
+ target_insert_watchpoint, target_remove_watchpoint):
+ Move defines to ...
+ * config/i386/nm-i386sco5.h: ... here.
+ (kernel_u_size): Add prototype. Improve a few comments and add
+ protection against multiple inclusion.
+
+ * config/i386/nm-i386sco.h (FLOAT_INFO): Remove already commented
+ out define.
+
+ * uw-thread.c (SP_ARG0): Define if not already defined.
+ * config/i386/tm-i386.h (SO_ARG0): Remove define.
+
+ * config/i386/tm-i386v4.h (HAVE_I387_REGS): Remove define.
+
+ * config/i386/tm-i386.h: Don't include "regcache.h".
+
+ * i387-tdep.h (i387_print_float_info): New prototype.
+ * i387-tdep.c (print_i387_value, print_i387_ext,
+ print_i387_status_word, print_i387_control_word): Add `struct
+ ui_file *' argument and use it for output.
+ (i387_print_float_info): Renamed from i387_float_info. Add
+ `struct gdbarch *' and `struct ui_file *' arguments and use the
+ latter for output.
+ * i386-tdep.c: Include "i387-tdep.h".
+ (i386_gdbarch_init): Set print_float_info.
+ * config/i386/tm-i386.h (i387_float_info): Remove prototype.
+ (FLOAT_INFO): Remove define.
+
+2002-08-13 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_push_arguments): Rename to
+ mips_eabi_push_arguments, and tune for EABI.
+ (MIPS_REGS_HAVE_HOME_P): Delete.
+ (struct gdbarch_tdep): Remove mips_regs_have_home_p field.
+ (mips_gdbarch_init): Set gdbarch push_arguments for eabi.
+ Delete references to mips_regs_have_home_p.
+
+2002-08-14 Keith Seitz <keiths@redhat.com>
+
+ * Makefile.in (install-gdbtk): Create insight plugin directory.
+ Install plugins.tcl file.
+
+2002-08-14 Keith Seitz <keiths@redhat.com>
+
+ * configure.in: Move SUBDIRS to near top of the file so that
+ --enable options may add things to it.
+ If gdbtk is enabled, add gdbtk directory to SUBDIRS and configdirs.
+ * configure: Regenerate.
+
+2002-08-13 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_o32o64_push_arguments): New function,
+ cloned from mips_push_arguments, tuned for o32/o64 ABI.
+ (mips_gdbarch_init): Set gdbarch_push_arguments to new func.
+
+2002-08-13 Andrew Cagney <ac131313@redhat.com>
+
+ * vax-tdep.c (vax_get_saved_register): Delete function.
+ (vax_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_get_saved_register): Delete function.
+ (ns32k_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_get_saved_register): Delete function.
+ (alpha_gdbarch_init): Update.
+
+2002-08-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (init_regcache_descr): Overallocate the
+ raw_register_valid_p array including space for NUM_PSEUDO_REGS.
+ (registers_changed): Replace NUM_REGS+NUM_PSEUDO_REGS with
+ nr_raw_registers.
+ (set_register_cached): Add range checking assertions. Use
+ current_regcache.
+
+2002-08-13 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_stab_reg_to_regnum): Return correct register
+ numbers for MMX registers.
+
+2002-08-13 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c (i386_gdbarch_init): Use
+ generic_unwind_get_saved_register.
+
+2002-08-13 Kevin Buettner <kevinb@redhat.com>
+
+ * procfs.c (procfs_can_use_hw_breakpoint): New function.
+ (init_procfs_ops): Define ``to_can_use_hw_breakpoint'' for procfs
+ target vector.
+ * config/mips/nm-irix5.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT):
+ Delete. Add comment regarding this now-deleted target method.
+
+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (M68HC12_NUM_PSEUDO_REGS): New define.
+ (M68HC12_HARD_PC_REGNUM): Define specific PC for 68HC12 (pseudo reg).
+ (m68hc11_pseudo_register_read): Compute the 68HC12 PC using the
+ real PC and the page number (if it's within the memory bank window).
+ (m68hc11_pseudo_register_write): Likewise when saving.
+ (m68hc11_register_name): Name the virtual pc 'pc' and the real one ppc.
+ (m68hc11_register_virtual_type): Return uint32 for virtual pc.
+ (m68hc11_register_raw_size): And use 32-bit for it.
+ (m68hc11_gdbarch_init): Use 32-bit address for 68HC12 if the
+ 16K memory bank is used by the prog; also use the virtual pc.
+
+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (m68hc11_elf_make_msymbol_special): New function.
+ (m68hc11_gdbarch_init): Install it in gdbarch.
+ (MSYMBOL_SET_RTC, MSYMBOL_SET_RTI): New to set symbol specific flags.
+ (MSYMBOL_IS_RTC, MSYMBOL_IS_RTI): New to test these flags.
+ (MSYMBOL_SIZE): New for documentation.
+ (insn_return_kind): Enum to specify how a function returns.
+ (frame_extra_info): Cleanup and record the return mode.
+ (gdbarch_tdep, USE_PAGE_REGISTER): New to control the use of page
+ register in address computation.
+ (m68hc11_get_return_insn): New to obtain the return instruction used
+ by the function.
+ (m68hc11_frame_init_saved_regs): Take into account the return
+ instruction used by the function for far and interrupt functions.
+ (m68hc11_init_extra_frame_info): Take into account page register.
+ (m68hc11_frame_args_address): Adjust according to the return mode.
+ (show_regs): Print page register only when it's used.
+
+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register.
+ (M68HC11_LAST_HARD_REG, m68hc11_register_names): Update.
+ (m68hc11_register_virtual_type): Return a 8-bit type for 8-bit
+ registers.
+ (m68hc11_register_raw_size): Likewise.
+
+2002-08-13 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.c (i386_register_name): Handle mmx registers.
+ (mmx_regnum_p): New function.
+ (i386_mmx_names): New array.
+ (mmx_num_regs): New variable.
+ (i386_pseudo_register_read): New function.
+ (i386_pseudo_register_write): New function.
+ (mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser.
+
+ * regcache.c (regcache_raw_read_unsigned): New function.
+ (regcache_raw_read_signed): New function.
+ * regcache.h (regcache_raw_read_unsigned): Declare.
+ (regcache_raw_read_signed): Declare.
+
+2002-08-13 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (regcache_raw_read_as_address): Delete function.
+ (regcache_cooked_read_signed): New function.
+ (regcache_cooked_read_unsigned): New function.
+ * regcache.h (regcache_cooked_read_signed): Declare.
+ (regcache_cooked_read_unsigned): Declare.
+ (regcache_raw_read_as_address): Delete declaration.
+
+ * blockframe.c (generic_read_register_dummy): Use
+ regcache_cooked_read_unsigned.
+ * i386-tdep.c (i386_extract_struct_value_address): Use
+ regcache_cooked_read_unsigned.
+
+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Set int, double and long
+ double sizes according to ELF ABI flags.
+ (gdbarch_tdep): Record elf_flags.
+
+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (M6812_OP_PSHX, M6812_OP_PSHY): New defines.
+ (m6812_prolog): They can appear in 68HC12 function prologue.
+ (m68hc11_frame_chain): Cleanup.
+
+2002-08-12 Andrew Cagney <cagney@redhat.com>
+
+ * i386-tdep.h (i386_register_byte, i386_register_raw_size): Delete
+ declarations.
+ * i386-linux-tdep.c (i386_linux_register_byte): Delete function.
+ (i386_linux_register_raw_size): Delete function.
+ (i386_linux_init_abi): Update.
+ * i386-tdep.c (i386_register_raw_size): Delete function.
+ (i386_register_byte): Delete function.
+ (i386_gdbarch_init): Update.
+ (i386_register_size): Delete array.
+ (i386_register_offset): Delete array.
+
+ * config/i386/tm-symmetry.h (REGISTER_BYTE): Delete macro.
+ (REGISTER_RAW_SIZE): Delete macro.
+ * config/i386/tm-ptx.h (REGISTER_RAW_SIZE): Delete macro.
+ (REGISTER_BYTE): Delete macro.
+
+2002-08-11 Aidan Skinner <aidan@velvet.net>
+
+ * ada-lang.c (ada_lookup_partial_symbol)
+ (to_fixed_variant_branch_type) (find_line_in_linetable): Fix
+ prototype names so that grep ^func works properly.
+
+ * ada-lang.c (ada_array_element_type)
+ (ada_lookup_partial_symbol): Fix typos in parameter list.
+
+ * ada-valprint.c (val_print_packed_array_elements) (ada_val_print_1):
+ Fix prototype names so that grep ^func works properly.
+
+2002-08-10 Andrew Cagney <cagney@redhat.com>
+ Elena Zannoni <ezannoni@redhat.com>
+ Martin M. Hunt <hunt@redhat.com>
+
+ * gdbtypes.c (build_builtin_type_vec128): Set the vector bit.
+ (build_builtin_type_vec128i): Set the vector bit.
+ * gdbtypes.h (builtin_type_vec64, builtin_type_vec64i): Declare.
+ * gdbtypes.c (builtin_type_vec64, builtin_type_vec64i): Define.
+ (build_builtin_type_vec64): New function.
+ (build_builtin_type_vec64i): New function.
+ (build_gdbtypes): Initialize builtin_type_vec64 and
+ builtin_type_vec64i.
+
+2002-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (regcache_dump): Compare the register offset
+ with REGISTER_BYTE.
+ * arch-utils.c (generic_register_byte): New function.
+ * arch-utils.h (generic_register_byte): Declare.
+ * gdbarch.sh (REGISTER_BYTE): Default to generic_register_byte.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c: Include "gdbcmd.h"
+ (_initialize_regcache): Add commands "maintenance print
+ registers", "maintenance print raw-registers" and "maintenance
+ print cooked-registers".
+ (enum regcache_dump_what): Define.
+ (dump_endian_bytes): New function.
+ (regcache_dump): New function.
+ (regcache_print): New function.
+ (maintenance_print_registers): New function.
+ (maintenance_print_raw_registers): New function.
+ (maintenance_print_cooked_registers): New function.
+ * Makefile.in (regcache.o): Update dependencies.
+
+2002-08-09 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (ROUND_DOWN, ROUND_UP): Move to global scope.
+ (mips_push_arguments): Correct some comments. Use paddr_nz
+ for printing addresses in debug output. Replace static
+ allocation using MAX_REGISTER_RAW_SIZE with alloca.
+ (mips_n32n64_push_arguments): New function, cloned from
+ mips_push_arguments and tuned for the n32/n64 ABI.
+ (mips_push_register): Buffer needs dynamic allocation.
+ (mips_print_register): Ditto.
+ (do_gp_register_row): Ditto.
+ (mips_store_return_value): Ditto.
+ (mips_gdbarch_init): Set gdbarch_push_arguments per ABI.
+
+2002-08-09 Don Howard <dhoward@redhat.com>
+
+ * memattr.c (mem_info_command): Print special case of upper bound
+ as max CORE_ADDR + 1.
+
+2002-08-08 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_n32n64_use_struct_convention): N32 only
+ returns structs by ref if they're too big to fit in two registers.
+
+2002-08-09 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_init_extra_frame_info): Initialize SP_REGNUM's
+ saved regs value.
+ (read_next_frame_reg): Call FRAME_INIT_SAVED_REGS instead of
+ mips_find_saved_regs().
+ (mips_pop_frame): Likewise.
+
+2002-08-09 Kevin Buettner <kevinb@redhat.com>
+
+ * blockframe.c (frame_saved_regs_register_unwind): Revise
+ PC_IN_CALL_DUMMY assertion to only apply when generic dummy
+ frames are in use.
+
+2002-08-09 Grace Sainsbury <graces@redhat.com>
+
+ * remote.c: (remote_wait, remote_async_wait): Add check for awatch
+ T-packets; the 'a' is not taken as a register number.
+ (remote_check_watch_resources, remote_stopped_by_watchpoint)
+ (remote_stopped_data_address): New functions; add to target
+ vector.
+ (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Change
+ prototypes to match other implementations of this
+ function. replace integer argument with pointer -- the length
+ field in the Z-packet is the length of what is pointed to or 1 if
+ pointer is null. Add to target vector.
+ (remote_insert_watchpoint, remote_remove_watchpoint): Add to
+ target vector.
+
+ From Mark Salter:
+ * remote.c (remote_wait): Add support to extract optional
+ watchpoint information from T-packet. Ignore unrecognized
+ optional info in T-packet.
+ (remote_async_wait): Ditto.
+
+2002-08-09 Corinna Vinschen <vinschen@redhat.com>
+
+ * cli/cli-dump.c: Change fopen modes to use binary open modes
+ as defined in include/fopen-bin.h throughout.
+
+2002-08-08 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c: Minor whitespace and indentation clean-ups.
+
+2002-08-08 Kevin Buettner <kevinb@redhat.com>
+
+ * doublest.c (store_floating): Avoid floatformat_from_doublest()
+ assertion failure by returning early after a warning.
+
+2002-08-08 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_find_saved_regs): Make static.
+ (mips_frame_init_saved_regs): New function.
+ (mips_gdbarch_init): Setup FRAME_INIT_SAVED_REGS method.
+ * config/mips/tm-mips.h (FRAME_INIT_SAVED_REGS): Delete macro.
+ (mips_find_saved_regs): Delete declaration.
+
+2002-08-08 Grace Sainsbury <graces@redhat.com>
+
+ * remote.c (remote_wait, remote_async_wait): Change
+ thread_num from int to ULONGEST.
+ (unpack_varlen_hex): Change result parameter from
+ int * to ULONGEST *.
+
+2002-08-08 Andrew Cagney <ac131313@redhat.com>
+
+ * configure.tgt: Replace powerpc-*-sysv*, powerpc-*-elf*,
+ powerpcle-*-eabi*, powerpcle-*-sysv* and powerpcle-*-elf* with
+ powerpc*-*-*.
+ * MAINTAINERS: Remove redundant rs6000-ibm-aix4.1 target.
+
+2002-08-08 Andrew Cagney <cagney@redhat.com>
+
+ * gcore.c (override_derive_stack_segment): Delete variable.
+ (preempt_derive_stack_segment): Delete function.
+ (derive_stack_segment): Delete function.
+ (default_derive_stack_segment): Renamed to derive_stack_segment.
+ (override_derive_heap_segment): Delete variable.
+ (preempt_derive_heap_segment): Delete function.
+ (derive_heap_segment): Delete function.
+ (default_derive_heap_segment): Rename to derive_heap_segment.
+
+2002-08-06 Michael Snyder <msnyder@redhat.com>
+
+ * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION.
+ * mips-tdep.c (mips_EABI_use_struct_convention,
+ mips_OABI_use_struct_convention, mips_NABI_use_struct_convention):
+ New functions. (mips_use_struct_convention): Delete.
+ (mips_gdbarch_init): set use_gdbarch_convention.
+
+2002-08-06 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c: gdbarch-ify reg_struct_has_addr.
+ (mips_eabi_reg_struct_has_addr, mips_n32n64_reg_struct_has_addr,
+ mips_o32_reg_struct_has_addr): New functions.
+ (mips_gdbarch_init): Set gdbarch reg_struct_has_addr.
+
+2002-08-07 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (pseudo_register): Delete function.
+ (fetch_register): Delete function.
+ (store_register): Delete function.
+ (regcache_raw_read, legacy_read_register_gen): Use
+ target_fetch_registers instead of fetch_register.
+ (legacy_write_register_gen, regcache_raw_write): Use
+ target_store_register instead of store_register.
+ (write_register_bytes): Ditto.
+
+ * gdbarch.sh (FETCH_PSEUDO_REGISTER): Delete.
+ (STORE_PSEUDO_REGISTER): Delete.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-08-06 Corinna Vinschen <vinschen@redhat.com>
+
+ * cli/cli-dump.c (add_dump_command): Explicitely use "b" flag to
+ write dump file binary.
+
+2002-08-05 Michael Snyder <msnyder@redhat.com>
+
+ * mips-tdep.c (mips_find_saved_regs): Adjust stack according
+ to MIPS_SAVED_REGSIZE, not GDB_TARGET_IS_MIPS64. Enhance comment.
+ (mips_gdbarch_init): Set N32 target to be mips64.
+
+2002-08-06 Kevin Buettner <kevinb@redhat.com>
+
+ * frame.c (find_saved_register): Break out of loop once saved
+ register address is found. Don't mention sparc in loop comment
+ anymore.
+
+2002-08-06 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set
+ mips_default_saved_regsize to 8.
+
+2002-08-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gcore.c: Do not include <sys/procfs.h>.
+ * Makefile.in (gcore.o): Update dependencies.
+
+2002-08-06 Andrew Cagney <cagney@redhat.com>
+
+ * configure.tgt: Make arc-*-* obsolete.
+ * NEWS: Mention that arc-*-* has been identifed as obsolete.
+ * MAINTAINERS: Make arc-elf obsolete.
+ * arc-tdep.c: Make file obsolete.
+ * config/arc/arc.mt: Ditto.
+ * config/arc/tm-arc.h: Ditto.
+
+2002-08-05 Theodore A. Roth <troth@verinet.com>
+
+ * avr-tdep.c (avr_skip_prologue): Fix to return the correct pc.
+
+2002-08-05 Andrew Cagney <ac131313@redhat.com>
+
+ * mcore-tdep.c (mcore_gdbarch_init): Use
+ generic_unwind_get_saved_register instead of
+ generic_get_saved_register.
+ * v850-tdep.c (v850_gdbarch_init): Ditto.
+ * frv-tdep.c (frv_gdbarch_init): Ditto.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+ * s390-tdep.c (s390_gdbarch_init): Ditto.
+ * d10v-tdep.c (d10v_gdbarch_init): Ditto.
+ * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Ditto.
+ * config/h8300/tm-h8300.h (GET_SAVED_REGISTER): Ditto.
+
+2002-08-05 Joel Brobecker <brobecker@gnat.com>
+
+ * objfiles.h: Add missing #include "symfile.h"
+
+ * Makefile.in (objfiles_h): Add dependency on symfile.h and dependents.
+
+2002-08-04 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-08-01 david carlton <carlton@math.stanford.edu>:
+ * hpread.c (hpread_read_struct_type): Deleted superfluous setting
+ of FIELD_BITSIZE.
+
+2002-08-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * NEWS: Cleanup and nitpick.
+
+2002-08-03 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Cleanup. Use *-linux*-gnu*. Only use `*' for headings.
+
+2002-08-03 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdbtk-bp.o): Update dependencies.
+ (gdbtk-register.o): Ditto.
+ (gdbtk-varobj.o): Ditto.
+
+2002-08-03 Andrew Cagney <cagney@redhat.com>
+
+ * m68hc11-tdep.c (m68hc11_pseudo_register_read): Replace
+ m68hc11_fetch_pseudo_register.
+ (m68hc11_pseudo_register_write): Replace
+ m68hc11_store_pseudo_register.
+ (m68hc11_gdbarch_init): Update.
+
+Fri Aug 2 15:53:50 2002 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh: Include "gdb_string.h".
+ * gdbarch.c: Regenerate.
+
+ * regcache.c: Include "gdb_string.h".
+ * ax-general.c: Ditto.
+ * varobj.c: Ditto.
+ * std-regs.c: Ditto.
+ * fbsd-proc.c: Ditto.
+ * thread.c: Ditto.
+
+ * Makefile.in (regcache.o): Update dependencies.
+ (thread.o, gdbarch.o): Ditto.
+ (ax-general.o, gdbarch.o): Ditto.
+ (varobj.o, std-regs.o): Ditto.
+ (fbsd-proc.o): Specify dependencies.
+
+2002-08-02 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (regcache_cooked_read): Rename rawnum parameter to
+ regnum.
+ (regcache_cooked_write): Ditto.
+
+2002-08-02 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (regcache_cooked_read): New function.
+ (regcache_cooked_write): New function.
+ (read_register_gen): Rewrite using regcache_cooked_read.
+ (write_register_gen): Rewrite using regcache_cooked_write.
+
+ * regcache.h (regcache_cooked_read, regcache_cooked_write):
+ Declare.
+
+2002-08-02 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (pseudo_register_read, pseudo_register_write):
+ Replace the architecture methods register_read and register_write.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * regcache.c (init_regcache_descr): Update.
+ (read_register_gen): Update.
+ (write_register_gen): Update.
+ (supply_register): Update comment.
+
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ (sh_pseudo_register_read, sh64_pseudo_register_read): Add
+ `regcache' and `gdbarch' parameters. Make `buffer' a void
+ pointer. Update code.
+ (sh_pseudo_register_write, sh64_pseudo_register_write): Add
+ `regcache' and `gdbarch' parameters. Make `buffer' a constant
+ void pointer. Update code.
+ (sh64_register_write): Delete.
+ (sh4_register_read): Delete.
+ (sh64_register_read): Delete.
+ (sh4_register_write): Delete.
+ (sh_sh4_register_convert_to_raw): Make `from' parameter a constant
+ void pointer, `to' parameter a void pointer.
+ (sh_sh64_register_convert_to_raw): Ditto.
+
+2002-08-01 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_register_virtual_type): Use architecture
+ invariant return values.
+
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * linux-proc.c: Include "gdb_string.h".
+ * Makefile.in (linux-proc.o): Update dependency list.
+
+2002-08-01 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_gdbarch_init): Add comments. Fix typo in
+ comment.
+
+2002-08-01 Grace Sainsbury <graces@redhat.com>
+
+ * target.h: Add to_insert_hw_breakpoint, to_remove_hw_breakpoint,
+ to_insert_watchpoint, to_remove_watchpoint,
+ to_stopped_by_watchpoint, to_stopped_data_address,
+ to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint to
+ target vecctor. Define their corresponding macros so they call
+ them.
+
+ * target.c: Add default and debug versions of for
+ to_insert_hw_breakpoint, to_remove_hw_breakpoint,
+ to_insert_watchpoint, to_remove_watchpoint,
+ to_stopped_by_watchpoint, to_stopped_data_address,
+ to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint.
+
+2002-08-01 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_register_virtual_type): New function.
+ (mips_gdbarch_init): Register mips_register_virtual_type()
+ with gdbarch machinery.
+ * config/mips/tm-irix6.h (mips/tm-bigmips64.h): Include
+ this file instead of tm-bigmips.h.
+ (MIPS_REGSIZE): Delete this macro.
+ (REGISTER_VIRTUAL_TYPE): Delete macro. Undef macro so that
+ multiarch version in mips-tdep.c will be found.
+
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Menion that CHILL has been made obsolete.
+
+ * gdbtypes.c (chill_varying_type): Make chill references obsolete.
+ * stabsread.c (read_range_type): Ditto.
+ * gdbtypes.h: Ditto.
+ * language.c (binop_type_check): Ditto.
+ (binop_result_type): Ditto.
+ (integral_type): Ditto.
+ (character_type): Ditto.
+ (string_type): Ditto.
+ (boolean_type): Ditto.
+ (structured_type): Ditto.
+ (lang_bool_type): Ditto.
+ (binop_type_check): Ditto.
+ * language.h (_LANG_chill): Ditto.
+ * dwarfread.c (set_cu_language): Ditto.
+ * dwarfread.c (CHILL_PRODUCER): Ditto.
+ * dwarfread.c (handle_producer): Ditto.
+ * expression.h (enum exp_opcode): Ditto.
+ * eval.c: Ditto for comments.
+ * typeprint.c (typedef_print) [_LANG_chill]: Ditto.
+ * expprint.c (print_subexp): Ditto.
+ (print_subexp): Ditto.
+ * valops.c (value_cast): Ditto.
+ (search_struct_field): Ditto.
+ * value.h (COERCE_VARYING_ARRAY): Ditto.
+ * symfile.c (init_filename_language_table): Ditto.
+ (add_psymbol_with_dem_name_to_list): Ditto.
+ * valarith.c (value_binop): Ditto.
+ (value_neg): Ditto.
+ * valops.c (value_slice): Ditto.
+ * symtab.h (union language_specific): Ditto.
+ (SYMBOL_INIT_LANGUAGE_SPECIFIC): Ditto.
+ (SYMBOL_DEMANGLED_NAME): Ditto.
+ (SYMBOL_CHILL_DEMANGLED_NAME): Ditto.
+ * defs.h (enum language): Ditto.
+ * symtab.c (got_symtab): Ditto.
+ * utils.c (fprintf_symbol_filtered): Ditto.
+
+ * ch-typeprint.c: Make file obsolete.
+ * ch-valprint.c: Make file obsolete.
+ * ch-lang.h: Make file obsolete.
+ * ch-exp.c: Make file obsolete.
+ * ch-lang.c: Make file obsolete.
+
+ * Makefile.in (FLAGS_TO_PASS): Do not pass CHILL or CHILLFLAGS or
+ CHILL_LIB.
+ (TARGET_FLAGS_TO_PASS): Ditto.
+ (CHILLFLAGS): Obsolete.
+ (CHILL): Obsolete.
+ (CHILL_FOR_TARGET): Obsolete.
+ (CHILL_LIB): Obsolete.
+ (SFILES): Remove ch-exp.c, ch-lang.c, ch-typeprint.c and
+ ch-valprint.c.
+ (HFILES_NO_SRCDIR): Remove ch-lang.h.
+ (COMMON_OBS): Remove ch-valprint.o, ch-typeprint.o, ch-exp.o and
+ ch-lang.o.
+ (ch-exp.o, ch-lang.o, ch-typeprint.o, ch-valprint.o): Delete
+ targets.
+
+2002-07-31 Joel Brobecker <brobecker@gnat.com>
+
+ * dwarf2read.c (set_cu_language): Add handler for LANG_Ada95.
+ This does not change anything at the moment, but will be helpful
+ later when full Ada support is integrated.
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (_initialize_mips_tdep): Add "n64" to "set mips abi"
+ help message.
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_push_arguments): Fetch gdbarch_tdep struct
+ and save it in a local variable. Use variable in later test.
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (mips_find_abi_section): Add N64 ABI recognition
+ test. (Thanks to Daniel Jacobowitz.)
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * mips-tdep.c (enum mips_abi): Add MIPS_ABI_N64.
+ (mips_abi_strings): Add "n64".
+ (mips_gdbarch_init): Add test for n64 abi. Add MIPS_ABI_N64 case.
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * config/mips/tm-irix6.h (MIPS_REGSIZE): Define to be 8.
+ (REGISTER_VIRTUAL_TYPE): Some registers are now 64 bits wide.
+
+2002-07-31 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (host_pointer_to_address, address_to_host_pointer):
+ Use gdb_assert() instead of explicit call to internal_error().
+
+2002-07-30 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in (rs6000-nat.o): Update dependencies.
+
+ From Nicholas Duffek:
+ * Makefile.in (ALLDEPFILES): Add aix-thread.c.
+ (aix-thread.o): New rule.
+ * configure.host (gdb_host): Set to aix432 on AIX 4.3.2+.
+ * config/powerpc/aix432.mh: New file.
+
+2002-07-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * ppc-linux-tdep.c (ELF_NGREG, ELF_NFPREG, ELF_NVRREG)
+ (ELF_FPREGSET_SIZE, ELF_GREGSET_SIZE): New enums.
+ (fetch_core_registers, ppc_linux_supply_gregset)
+ (ppc_linux_supply_fpregset): New functions.
+ (ppc_linux_regset_core_fns): New.
+ (_initialize_ppc_linux_tdep): Call add_core_fns.
+ * ppc-tdep.h: Add prototypes for ppc_linux_supply_fpregset
+ and ppc_linux_supply_gregset.
+ * ppc-linux-nat.c (supply_gregset): Call ppc_linux_supply_gregset.
+ (supply_fpregset): Call ppc_linux_supply_fpregset.
+ * config/powerpc/linux.mh (NATDEPFILES): Remove core-regset.o and
+ corelow.o.
+ * config/powerpc/linux.mt (TDEPFILES): Add corelow.o.
+
+2002-07-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.c (lookup_symbol): Demangle before lowercasing.
+
+2002-07-30 Andrew Cagney <ac131313@redhat.com>
+
+ * symtab.h: Replace #include "gdb_obstack.h" with opaque
+ declaration.
+ * cli/cli-cmds.c, cli/cli-script.c: Include "gdb_string.h".
+ * gnu-v3-abi.c, arc-tdep.c, cli/cli-decode.c: Ditto.
+ * avr-tdep.c, mon960-rom.c, i960-tdep.c: Ditto.
+ * arch-utils.c, cli/cli-setshow.c: Unconditionally include
+ "gdb_string.h".
+ * Makefile.in (cli-script.o, cli-cmds.o): Update dependencies.
+ (gnu-v3-abi.o, cli-setshow.o, i960-tdep.o): Ditto.
+ (cli-decode.o, mi-cmd-var.o, mi-cmd-disas.o): Ditto.
+ (avr-tdep.o, mon960-rom.o): Ditto.
+ (aout_stabs_gnu_h): Define.
+ (symtab_h): Remove $(gdb_obstack_h).
+
+2002-07-30 Jim Blandy <jimb@redhat.com>
+
+ Patch from David Carlton <carlton@math.stanford.edu>:
+ * gdbinit.in: Move the `dir' commands that add GDB's own source
+ directory to the search path to the end, so that the `gdb' source
+ directory will be searched first.
+
+2002-07-29 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb_obstack.h: New file.
+ * symtab.h: Include "gdb_obstack.h" instead of "obstack.h".
+ (obstack_chunk_alloc, obstack_chunk_free): Delete macros.
+ * objfiles.h: Include "gdb_obstack.h".
+ * Makefile.in (gdb_obstack_h): Define.
+ (symtab_h): Add $(gdb_obstack_h).
+ (objfiles_h): Add $(gdb_obstack_h).
+
+ * objfiles.c: Include "gdb_obstack.h" instead of "obstack.h".
+ * macrotab.c, cp-valprint.c, dbxread.c: Ditto.
+ * ch-typeprint.c, ch-valprint.c, dstread.c: Ditto.
+ * macroexp.c, p-typeprint.c, stabsread.c: Ditto.
+ * symtab.c, f-typeprint.c, mdebugread.c: Ditto.
+ * p-valprint.c, symmisc.c, typeprint.c: Ditto.
+ * symfile.c, coffread.c, c-typeprint.c: Ditto.
+ * buildsym.c, bcache.c, ada-typeprint.c: Ditto.
+
+ * Makefile.in (bcache.o): Update dependencies.
+ (buildsym.o, c-typeprint.o, ch-typeprint.o): Ditto.
+ (ch-valprint.o, coffread.o, cp-valprint.o): Ditto.
+ (dbxread.o, dstread.o, f-typeprint.o): Ditto.
+ (objfiles.o, p-typeprint.o, p-valprint.o): Ditto.
+ (stabsread.o, symfile.o, symmisc.o): Ditto.
+ (symtab.o, typeprint.o, macroexp.o): Ditto.
+ (macrotab.o, mdebugread.o): Ditto.
+ (f_lang_h, coff_sym_h, coff_symconst_h): Define.
+ (coff_ecoff_h, aout_aout64_h): Define.
+ (aout_stabs_gnu_h, libaout_h): Define.
+
+2002-07-29 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (struct regcache_descr): Rename nr_registers to
+ nr_cooked_registers. Revise comments describing the structure
+ member fields.
+ (init_regcache_descr): Update.
+ (init_legacy_regcache_descr): Update.
+ (read_register_gen, write_register_gen): When a cooked register in
+ the raw register range, directly access the value from the raw
+ register cache.
+
+2002-07-29 Andrew Cagney <ac131313@redhat.com>
+
+ * z8k-tdep.c: Do not include "obstack.h".
+ * h8300-tdep.c, h8500-tdep.c: Ditto.
+ * m68hc11-tdep.c, sh-tdep.c: Ditto.
+ * valprint.c, v850-tdep.c: Ditto.
+ * d10v-tdep.c, mn10300-tdep.c: Ditto.
+ * mn10200-tdep.c: Ditto.
+
+ * Makefile.in (z8k-tdep.o): Update dependencies.
+ (m68hc11-tdep.o, valprint.o): Ditto.
+ (v850-tdep.o, d10v-tdep.o): Ditto.
+ (mn10300-tdep.o, sparc-tdep.o): Ditto.
+ (sh-tdep.o, h8500-tdep.o, h8300-tdep.o): Ditto.
+ (m32r-tdep.o, mn10200-tdep.o): Specify dependencies.
+ (sh_opc_h, gdb_sim_sh_h): Define.
+ (elf_sh_h, elf_bfd_h): Define.
+ (opcode_m68hc11_h): Define.
+ (OPCODES_SRC, OPCODES_DIR): define.
+ (OPCODES): Use $(OPCODES_DIR).
+ (gdb_sim_d10v_h): Rename sim_d10v_h.
+ (gdb_sim_arm_h): Rename sim_arm_h.
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (host_pointer_to_address, address_to_host_pointer):
+ Change internal_error() message to indicate function responsible
+ for the error.
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * ui-out.c (ui_out_field_core_addr): Remove unnecessary cast in
+ calls to local_hex_string_custom().
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * irix5-nat.c: Move IRIX shared library support from here...
+ * solib-irix.c: ...to here. Revised substantially to work with
+ generic solib framework.
+
+ * osabi.h (gdb_osabi): Add new enum constant GDB_OSABI_IRIX.
+ * osabi.c (gdb_osabi_names): Add corresponding string for Irix.
+ * mips-irix-tdep.c: New file.
+
+ * Makefile.in (ALLDEPFILES): Add mips-irix-tdep.c and solib-irix.c.
+ (mips-irix-tdep.o, solib-irix.o): New rules.
+ * config/mips/irix5.mt (TDEPFILES): Add mips-irix-tdep.o, solib.o,
+ solib-irix.o.
+ * config/mips/irix6.mt (TDEPFILES): Likewise.
+ * config/mips/irix6.mh (NATDEPFILES): Remove solib.o.
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (coff/internal.h, bfd/libcoff.h, pthread.h): Remove
+ disabled (via ``#if 0'') includes.
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (special_register_p, supply_sprs64, supply_sprs32)
+ (fetch_regs_user_thread, fetch_regs_kernel_thread, fill_sprs64)
+ (fill_sprs32, store_regs_user_thread, store_regs_kernel_thread):
+ Add support for the fpscr register.
+ * rs6000-nat.c (regmap, fetch_inferior_registers)
+ (store_inferior_registers, fetch_core_registers): Likewise.
+
+2002-07-26 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-nat.c (language.h): Include.
+ (special_regs): Delete this array.
+ (regmap): New function.
+ (fetch_register, store_register): Use regmap() to map gdb
+ register numbers to ptrace register numbers. Also, use
+ outputs from regmap() to make decisions regarding type of
+ ptrace() call to make. In particular, don't compare against
+ FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM.
+ (fetch_inferior_registers, store_inferior_registers): Where
+ possible, obtain register numbers from tdep struct. Don't
+ refer to FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM.
+ * config/rs6000/tm-rs6000.h (FIRST_UISA_SP_REGNUM)
+ (LAST_UISA_SP_REGNUM): Delete.
+
+2002-07-25 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-nat.c (ppc-tdep.h): Include.
+ (fetch_registers, store_register, fetch_core_registers): Don't
+ access registers[] directly. Instead, use supply_register() or
+ regcache_collect() as appropriate.
+ (find_toc_address): Format hex address with local_hex_string().
+
+2002-07-25 Andrew Cagney <ac131313@redhat.com>
+
+ * config/djgpp/fnchange.lst: Rename bfd/elf32-fr30.c and
+ bfd/elf32-frv.c.
+
+2002-07-24 Tom Tromey <tromey@redhat.com>
+
+ * jv-exp.y: Marked all strings with _().
+ (ClassInstanceCreationExpression, ArrayCreationExpression): Use
+ internal_error.
+ (MethodInvocation, CastExpression, parse_number, yyerror,
+ java_type_from_name, push_expression_name, yylex): Typo fixes.
+
+2002-07-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * ui-file.c (struct tee_file, tee_file_new, tee_file_delete)
+ (tee_file_flush, tee_file_write, tee_file_fputs)
+ (tee_file_isatty): New.
+ * ui-file.h (tee_file_new): Add prototype.
+
+2002-07-24 Aidan Skinner <aidan@velvet.net>
+
+ * ada-lang.c: Change k&r style function definitions to prototyped
+ form.
+ * ada-typeprint.c: Change k&r style function definitions to prototyped
+ form.
+ * ada-valprint.c: Change k&r style function definitions to prototyped
+ form.
+
+2002-07-24 Andrew Cagney <cagney@redhat.com>
+
+ * README: Remove reference to remote-bug.
+ * Makefile.in (ALLDEPFILES): Remove m88k-nat.c, m88k-tdep.c and
+ remote-bug.c.
+ (m88k-nat.o): Delete rule.
+ (m88k-tdep.o): Delete rule.
+ (remote-bug.o): Delete rule.
+ * MAINTAINERS: Mark as obsolete.
+ * elfread.c (elf_symtab_read): Mention that m88k is obsolete.
+ * m88k-tdep.c: Make file obsolete.
+ * config/m88k/m88k.mh: Ditto.
+ * config/m88k/delta88v4.mh: Ditto.
+ * config/m88k/delta88v4.mt: Ditto.
+ * config/m88k/delta88.mt: Ditto.
+ * config/m88k/delta88.mh: Ditto.
+ * remote-bug.c: Ditto.
+ * config/m88k/tm-delta88.h: Ditto.
+ * config/m88k/nm-delta88v4.h: Ditto.
+ * config/m88k/xm-delta88.h: Ditto.
+ * config/m88k/xm-dgux.h: Ditto.
+ * config/m88k/tm-m88k.h: Ditto.
+ * config/m88k/nm-m88k.h: Ditto.
+ * config/m88k/tm-delta88v4.h: Ditto.
+ * m88k-nat.c: Ditto.
+ * cxux-nat.c: Ditto.
+ * configure.host: Make m88*-motorola-sysv4*, m88*-motorola-sysv*
+ and m88*-*-* obsolete.
+ * configure.tgt: Make m88*-motorola-sysv4*, m88*-motorola-* and
+ m88*-*-* obsolete.
+
+2002-07-24 Andrew Cagney <cagney@redhat.com>
+
+ * findvar.c (extract_unsigned_integer): Make `addr' parameter
+ constant. Same for local pointer variables.
+ (extract_signed_integer): Ditto.
+ * defs.h (extract_unsigned_integer): Update.
+ (extract_signed_integer): Update.
+
+2002-07-24 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.c (regcache_raw_write): Change buf parameter to a
+ constant void pointer.
+ (regcache_raw_read): Change buf parameter to a void pointer.
+ (legacy_write_register_gen): Change myaddr parameter a constant
+ void pointer.
+ (supply_register): Change val parameter to a const void pointer.
+ * regcache.h (regcache_raw_write): Update declaration.
+ (regcache_raw_read): Update declaration.
+ (supply_register): Update declaration.
+
+2002-07-24 Tom Tromey <tromey@redhat.com>
+
+ * defs.h (gdb_readline_wrapper): Declare.
+ * utils.c (prompt_for_continue): Use gdb_readline_wrapper.
+ * tracepoint.c (read_actions): Use gdb_readline_wrapper.
+ * top.c (gdb_readline_wrapper): New function.
+ (command_line_input): Use it.
+
+2002-07-24 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.h (regcache_raw_read, regcache_raw_write): Replace
+ regcache_read and regcache_write.
+ (regcache_raw_read_as_address): Replace regcache_read_as_address.
+ * regcache.c: Update.
+ * sh-tdep.c (sh64_push_arguments): Update comment.
+ (sh_pseudo_register_read): Update.
+ (sh_pseudo_register_write): Update.
+ (sh4_register_read): Update.
+ (sh4_register_write): Update.
+ (sh64_pseudo_register_read): Update.
+ (sh64_pseudo_register_write): Update.
+ (sh64_register_read): Update.
+ (sh64_register_write): Update.
+ * i386-tdep.c (i386_extract_return_value): Update.
+ (i386_extract_struct_value_address): Update.
+ (i386_extract_return_value): Update.
+ * blockframe.c (generic_read_register_dummy): Update.
+ (generic_call_dummy_register_unwind): Update
+ * infrun.c (write_inferior_status_register): Update.
+
+2002-07-23 Jim Blandy <jimb@redhat.com>
+
+ * parser-defs.h (expression_context_pc): Make this extern.
+ (Thanks to Michael Snyder.)
+
+2002-07-23 Andrew Cagney <ac131313@redhat.com>
+
+ GDB 5.2.1 released from 5.2 branch.
+ * NEWS: Mention changes in 5.2.1 including addition of AVR target.
+ * README: Update to mention 5.2.1.
+
+2002-07-23 Mark Salter <msalter@redhat.com>
+
+ * remote.c (remote_read_bytes): Fix check for error.
+
+2002-07-22 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (language.h): Include.
+ (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs)
+ (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc):
+ Print newlines at end of debug messages.
+ (pdc_symbol_addrs, pdc_read_regs, pdc_write_regs, pdc_read_data)
+ (pdc_write_data): Use local_hex_string() instead of %llx formats.
+
+2002-07-22 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (ppc-tdep.h): Include.
+ (special_register_p): New function.
+ (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32)
+ (store_regs_user_thread): Use register number information from
+ gdbarch_tdep struct instead of hardcoded offsets relative to
+ FIRST_UISA_SP_REGNUM.
+ (fetch_regs_kernel_thread, store_regs_kernel_thread): Call
+ special_register_p() instead of using FPLAST_REGNUM and
+ LAST_UISA_SP_REGNUM as lower and upper bounds on the special
+ register numbers. Also, don't assume that LAST_UISA_SP_REGNUM
+ will be MQ's register number.
+
+2002-07-22 Michael Snyder <msnyder@redhat.com>
+
+ * aix-thread.c (ops): Rename to aix_thread_ops.
+ (base_ops): Rename to base_target.
+ (ops_attach): Rename to aix_thread_attach.
+ (ops_detach): Rename to aix_thread_detach.
+ (ops_resume): Rename to aix_thread_detach.
+ (ops_wait): Rename to aix_thread_wait.
+ (ops_kill): Rename to aix_thread_kill.
+ (init_ops): Rename to init_aix_thread_ops.
+ (ops_fetch_register): Rename to aix_thread_fetch_register.
+ (ops_store_register): Rename to aix_thread_store_register.
+ (ops_mourn_inferior): Rename to aix_thread_mourn_inferior.
+ (ops_thread_alive): Rename to aix_thread_thread_alive.
+ (ops_extra_thread_info: Rename to aix_thread_extra_thread_info.
+ (ops_pid_to_str): Rename to aix_thread_pid_to_str.
+ (ops_xfer_memory): Rename to aix_thread_xfer_memory.
+ (fetch_regs_lib): Rename to fetch_regs_user_thread.
+ (fetch_regs_kern): Rename to fetch_regs_kernel_thread.
+ (store_regs_lib): Rename to store_regs_user_thread.
+ (store_regs_kern): Rename to store_regs_kernel_thread.
+
+2002-07-22 Michael Snyder <msnyder@redhat.com>
+
+ * aix-thread.c (ops_prepare_to_store): Eliminate.
+ (init_ops): Don't initialize ops.prepare_to_store.
+ (store_regs_kern): Pre-fetch register buffers from child,
+ because some registers may not be in the cache. Copy
+ regs from register cache only if they are cached.
+ (store_regs_lib): Copy regs from register cache only
+ if they are cached.
+ (fill_sprs32, (fill_sprs64, fill_fprs, fill_gprs32,
+ fill_gprs64): Ditto.
+
+2002-07-22 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (gdb_assert.h): Include.
+ (fill_sprs64, fill_sprs32): Add selected asserts to make sure that
+ register sizes (from register cache) match size of buffer holding
+ register data.
+ (fill_sprs32): Change parameter types to match those in the ptrace()
+ buffer.
+ (store_regs_lib): Likewise, but for 32-bit temporary variables.
+ (ops_prepare_to_store): Rename loop variable ``i'' to ``regno''.
+
+2002-07-22 Michael Snyder <msnyder@redhat.com>
+
+ * aix-thread.c (supply_sprs64): Cosmetic change.
+ (supply_sprs32): Cosmetic change.
+ (fill_gprs64, fill_gprs32, fill_fprs, fill_sprs32): New funcs.
+ (fill_sprs64): Use regcache_collect instead of read_register.
+ (store_regs_lib): Use regcache_collect instead of
+ read_register. Use fill_sprs32 instead of fill_sprs64,
+ if debugging a 32-bit architecture.
+ (store_regs_kern): Use fill_gprs64 etc. to pull the values
+ out of the register cache, instead of passing a pointer into
+ the register cache directly to ptrace. Use regcache_collect
+ insteaad of read_register.
+ (ops_prepare_to_store): Use target_read_registers instead
+ of read_register_bytes.
+
+2002-07-20 Aidan Skinner <aidan@velvet.net>
+
+ * MAINTAINERS: Add self under write after approval.
+
+2002-07-20 Aidan Skinner <aidan@velvet.net>
+
+ * ada-tasks.c: Change k&r style function definitions to prototyped
+ form.
+
+2002-07-19 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (x86-64-tdep.o): Add $(objfiles_h).
+ * x86-64-tdep.c: Include "objfiles.h".
+ (x86_64_gdbarch_init): Set in_solib_call_trampoline to
+ in_plt_section. From 2002-07-18 Michal Ludvig <mludvig@suse.cz>.
+
+2002-07-17 Michal Ludvig <michal@suse.cz>
+
+ * dwarf2cfi.c (execute_stack_op): Complain on unknown DW_OP_ value.
+ (update_context): Initialise cfa variable.
+
+2002-07-17 Michael Snyder <msnyder@redhat.com>
+
+ * aix-thread.c: Shorten some long lines.
+ Bring comments into line with code spec.
+
+2002-07-18 Joel Brobecker <brobecker@gnat.com>
+
+ * infrun.c: Re-indent using gdb_indent.sh.
+
+2002-07-18 Joel Brobecker <brobecker@gnat.com>
+
+ * infrun.c (handle_inferior_event): Remove unneeded extra brace.
+ Leave the indentation temporarily untouched, to minimize the diffs.
+
+2002-07-18 Elena Zannoni <ezannoni@redhat.com>
+
+ * stabsread.c: Make os9k sections of the code obsolete,
+ for real this time.
+ * stabsread.h: Make os9k sections of the code obsolete.
+
+2002-07-18 Michal Ludvig <mludvig@suse.cz>
+
+ * linux-low.c (regsets_store_inferior_registers): Add free()
+ at the end of a loop to prevent memory leak.
+ * linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers.
+ (X86_64_NUM_GREGS): Count it from the size of x86_64_regmap.
+ * config/sparc/tm-sp64linux.h: Make the rest of #endif
+ line a comment.
+ * Makefile.in (x86-64-linux-nat.o): Remove dependency on i387-tdep.h
+
+2002-07-17 Jim Blandy <jimb@redhat.com>
+
+ * macrocmd.c (info_macro_command): Remove newline from error
+ message.
+
+2002-07-17 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh-tdep.c (sh_dsp_register_sim_regno): New function.
+ (sh_gdbarch_init): Use it for sh-dsp.
+
+2002-07-16 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (read_initial_length): Handle older, non-standard,
+ 64-bit DWARF2 format.
+
+2002-07-16 Joel Brobecker <brobecker@gnat.com>
+
+ * proc-api.c: use HAVE_SYS_PROC_H macro to avoid including
+ <sys/proc.h> when not available.
+
+2002-07-16 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Mention that the i[34]86-*-os9k has been made obsolete.
+ * stabsread.c: Make os9k sections of the code obsolete.
+ * configure.tgt: Make i[3456]86-*-os9k target obsolete.
+ * config/i386/i386os9k.mt: Make file obsolete.
+ * Makefile.in (ALLDEPFILES): Remove remote-os9k.c.
+ (COMMON_OBS): Remove os9kread.o
+ (SFILES): Remove os9kread.c.
+ (os9kread.o, remote-os9k.o): Make target obsolete.
+ * remote-os9k.c: Make file obsolete.
+ * os9kread.c: Make file obsolete.
+ * Makefile.in
+
+2002-07-16 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Mention that the FR30 has been made obsolete.
+ * fr30-tdep.c: Make file obsolete.
+ * config/fr30/tm-fr30.h: Ditto.
+ * config/fr30/fr30.mt: Ditto.
+ * configure.tgt: Make fr30-*-elf obsolete.
+ * MAINTAINERS: Make fr30-elf obsolete.
+
+2002-07-16 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * blockframe.c (get_pc_function_start): return 0 if the minimal symbol
+ found is not inside a section.
+
+2002-07-15 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (ptrace_check): Use safe_strerror() instead of
+ strerror().
+ (pdc_realloc): Use xrealloc() instead of realloc().
+
+2002-07-15 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (PD_ERROR, CALL_BASE): Delete.
+ (ops_resume, ops_wait, fetch_regs_lib, store_regs_lib)
+ (ops_xfer_memory, ops_kill): Don't use PD_ERROR or CALL_BASE
+ macros.
+
+2002-07-15 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (ptrace_check): Eliminate goto.
+ (sync_threadlists): Eliminate gotos. Also, fix array overrun
+ problem.
+
+2002-07-15 Kevin Buettner <kevinb@redhat.com>
+
+ * aix-thread.c (gdbcmd.h): Include.
+ (DEBUG, DBG, DBG2, dbg): Eliminate.
+ (debug_aix_thread): New static global.
+ (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs)
+ (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc)
+ (fetch_regs_lib, store_regs_lib, store_regs_kern): Rewrite
+ invocations to DBG and DBG2 macros to test against
+ ``debug_aix_thread'' and call fprintf_unfiltered().
+ (_initialize_aix_thread): Add new command "set debug aix-thread".
+
+2002-07-15 Andrew Cagney <ac131313@redhat.com>
+
+ From Gerhard Tonn <TON@de.ibm.com>:
+ * s390-nat.c (fill_fpregset, fill_gregset): Use regcache_collect
+ instead of supply_register.
+
+2002-07-15 Andrew Cagney <ac131313@redhat.com>
+
+ * dwarf2cfi.c: Include "gdb_assert.h".
+ (frame_state_for): Use gdb_assert to check that fde->cie_ptr is
+ non-NULL.
+ (update_context): Do not use __func__. Add missing ``break''.
+ (update_context): Do not use __func__.
+
+2002-07-15 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Remove variable print_insn
+ and its setting. Set gdbarch instruction printing functions
+ directly. For non-rs6000 case use new function
+ gdb_print_insn_powerpc.
+ (gdb_print_insn_powerpc): New function.
+
+2002-07-13 Andrew Cagney <ac131313@redhat.com>
+
+ * NEWS: Mention that the d30v has been marked obsolete.
+ * MAINTAINERS: Note that d30v / d30v-elf has been made obsolete.
+ * configure.tgt: Mark d30v-*-* as obsolete.
+ * d30v-tdep.c: Mark file as obsolete.
+ * config/d30v/d30v.mt: Ditto.
+ * config/d30v/tm-d30v.h: Ditto.
+
+2002-07-13 Aidan Skinner <aidan@velvet.net>
+
+ * ada-tasks.c (add_task_entry): replace calls to
+ malloc() with xmalloc
+ * ada-tasks.c (init_task_list): replace calls to free with xfree()
+
+ * ada-lang.c (replace_operator_with_call, fill_in_ada_prototype,
+ ada_finish_decode_line_1, all_sals_for_line
+ ada_breakpoint_rewrite): replace calls to free() with xfree()
+
+2002-07-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Nicholas Duffek (with minor changes by Martin Hunt,
+ Louis Hamilton, and Kevin Buettner):
+ * aix-thread.c: New file.
+
+2002-07-12 Petr Sorfa <petrs@caldera.com>
+
+ * dwarf2read.c (dwarf2_invalid_attrib_class): New
+ complaint for invalid attribute class or form.
+ (read_func_scope): DW_AT_frame_base
+ better handling of DW_AT_block*.
+ (dwarf2_add_member_fn): DW_AT_vtable_elem_location
+ better handling of DW_AT_block*.
+ (read_common_block): DW_AT_location
+ better handling of DW_AT_block*.
+ (read_partial_die): DW_AT_location better handling
+ of DW_AT_block*.
+ (new_symbol): DW_AT_external better handling of
+ DW_AT_block*. Proper initialization of variable
+ "addr".
+ (attr_form_is_block): New function that returns true
+ if the attribute's form is of DW_FORM_block*.
+
+2002-07-12 Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+
+ * valops.c (find_method_list): Remove comment about
+ removed STATIC_MEMFUNCP argument.
+ (value_find_oload_method_list): Likewise.
+
+2002-07-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Nicholas Duffek:
+ * rs6000-nat.c (vmap_ldinfo, xcoff_relocate_core): Call
+ target_new_objfile_hook.
+
+2002-07-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Nicholas Duffek:
+ * xcoffread.c (scan_xcoff_symtab): Recognize XMC_TD as a data storage
+ csect.
+
+2002-07-12 Andrew Cagney <cagney@redhat.com>
+
+ * MAINTAINERS: Mention --enable-sim-build-warnings.
+ (m68hc11-elf): Disable sim build warnings.
+ (m32r-elf): Mark as broken obsolete candidate.
+ (x86_64-linux-gnu): Mark as buildable with -Werror.
+ (arm-elf): Change -w to ``,'' which enables warnings but not
+ -Werror.
+
+2002-07-12 Andrew Cagney <ac131313@redhat.com>
+
+ * bcache.h: Update copyright.
+ (struct bstring, struct bcache): Move definition to "bcache.c".
+ Replaced by opaque declaration.
+ (bcache_xfree): Replace free_bcache.
+ (bcache_xmalloc, bcache_memory_used): Declare.
+
+ * bcache.c: Update copyright.
+ (struct bstring, struct bcache): Moved to here from "bcache.h".
+ Update comments.
+ (bcache_xmalloc, bcache_memory_used): New functions.
+ (bcache_xfree): Replace function free_bcache.
+
+ * Makefile.in (objfiles.o): Add $(bcache_h).
+ (objfiles_h): Remove $(bcache_h).
+ (symfile.o): Add $(bcache_h).
+
+ * symmisc.c: Update copyright.
+ (print_symbol_bcache_statistics): Pass psymbol_cache by value.
+ (print_objfile_statistics): Use bcache_memory_used.
+
+ * symfile.c: Include "bcache.h".
+ (reread_symbols): Use bcache_xfree.
+ (reread_symbols): Use bcache_xmalloc and bcache_xfree.
+ (add_psymbol_to_list): Pass psymbol_cache by value.
+ (add_psymbol_with_dem_name_to_list): Ditto.
+
+ * objfiles.h: Update copyright.
+ (struct bcache): Declare opaque. Do not include "bcache.h".
+ (struct objfile): Change psymbol_cache and macro_cache to ``struct
+ bcache'' pointers.
+ * dwarf2read.c (macro_start_file): Pass macro_cache by value.
+
+ * objfiles.c: Include "bcache.h". Update copyright.
+ (allocate_objfile): Use bcache_xmalloc to create psymbol_cache and
+ macro_cache.
+ (free_objfile): Use bcache_xfree.
+
+2002-07-11 Grace Sainsbury <graces@redhat.com>
+
+ * monitor.c (monitor_fetch_register): Make name a constant.
+ (monitor_store_register): Same.
+
+2002-07-11 Daniel Jacobowitz <drow@mvista.com>
+
+ Based on patch from Daniel Berlin <dberlin@dberlin.org>.
+ * buildsym.c: Include "demangle.h" for SYMBOL_INIT_DEMANGLED_NAME.
+ (finish_block) For non-function blocks, hash the symbol table. For
+ function blocks, mark the symbol table as unhashed.
+ * minsyms.c (msymbol_hash): Return hash value without taking modulus.
+ (msymbol_hash_iw): Likewise.
+ (add_minsym_to_hash_table): Take modulus of msymbol_hash's return
+ value.
+ (add_minsym_to_demangled_hash_table): Likewise for msymbol_hash_iw.
+ (lookup_minimal_symbol): Likewise for both.
+ * symtab.h (struct block): Add `hashtable' flag. Comment the
+ hashtable.
+ (BLOCK_HASHTABLE, BLOCK_BUCKETS, BLOCK_BUCKET): New macro.
+ (ALL_BLOCK_SYMBOLS): Update.
+ (BLOCK_SHOULD_SORT): Do not sort hashed blocks.
+ (struct symbol): Add `hash_next' pointer.
+ * symtab.c (lookup_block_symbol): Search using the hash table when
+ possible.
+ (find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS.
+ (search_symbols, find_addr_symbol): Likewise.
+
+ * dstread.c (process_dst_block): Clear hashtable bit for new block.
+ (read_dst_symtab): Likewise.
+ * jv-lang.c (get_java_class_symtab): Likewise.
+ * mdebugread.c: Include "gdb_assert.h".
+ (shrink_block): Assert that the block being modified is not hashed.
+ * coffread.c (patch_opaque_types): Use ALL_BLOCK_SYMBOLS.
+ * symmisc.c (free_symtab_block): Walk the hash table when freeing
+ symbols.
+ (dump_symtab): Recognize hashed blocks.
+ * printcmd.c (print_frame_args): Assert that function blocks do not
+ have hashed symbol tables.
+ * ada-lang.c (symtab_for_sym): Use ALL_BLOCK_SYMBOLS.
+ (fill_in_ada_prototype, debug_print_block): Likewise.
+ (ada_add_block_symbols): Use ALL_BLOCK_SYMBOLS. Handle hash tables.
+
+2002-07-11 Corinna Vinschen <vinschen@redhat.com>
+
+ * stack.c (print_frame): Use result of frame_address_in_block()
+ instead of fi->pc when evaluating symbols.
+ (backtrace_command_1): Ditto.
+
+2002-07-11 Andrew Cagney <cagney@redhat.com>
+
+ * cris-tdep.c (cris_saved_pc_after_call): Fix parameter type.
+ Make static.
+
+ * arm-tdep.c (arm_register_name): Make return type constant.
+
+2002-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * win32-nat.c (has_detach_ability): Convert to strict ISO C
+ prototype.
+ * top.c (gdb_rl_operate_and_get_next_completion): Ditto.
+ * s390-tdep.c (s390_fp_regnum): Ditto.
+ (s390_read_fp): Ditto.
+ (s390_pop_frame): Ditto.
+ (_initialize_s390_tdep): Ditto.
+ * remote.c (get_remote_state): Ditto.
+ * procfs.c (mappingflags): Ditto.
+ * memattr.c (_initialize_mem): Ditto.
+ * mcore-tdep.c (mcore_pop_frame): Ditto.
+ * m68klinux-nat.c (_initialize_m68k_linux_nat): Ditto.
+ * m68k-tdep.c (m68k_register_bytes_ok): Ditto.
+ * language.c (set_case_str): Ditto.
+ * gnu-v3-abi.c (vtable_address_point_offset): Ditto.
+ * frv-tdep.c (new_variant): Ditto.
+ (frv_stopped_data_address): Ditto.
+ * dwarf2cfi.c (fde_chunks_need_space): Ditto.
+ (context_alloc): Ditto.
+ (frame_state_alloc): Ditto.
+ (unwind_tmp_obstack_init): Ditto.
+ (unwind_tmp_obstack_free): Ditto.
+ (cfi_read_fp): Ditto.
+ * cris-tdep.c (cris_saved_pc_after_call): Ditto.
+ (cris_pop_frame): Ditto.
+ * c-lang.c (scanning_macro_expansion): Ditto.
+ (finished_macro_expansion): Ditto.
+ (c_preprocess_and_parse): Ditto.
+ * gdbarch.sh: Ditto.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * config/mn10200/tm-mn10200.h: Adjust indentation.
+ * target.c: Adjust indentation.
+ * symtab.h: Adjust indentation.
+ * stabsread.h: Adjust indentation.
+ * remote-es.c: Adjust indentation.
+ * os9kread.c: Adjust indentation.
+
+2002-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * wince.c (_initialize_wince): Rename _initialize_inftarg.
+ * win32-nat.c (_initialize_win32_nat): Rename _initialize_inftarg.
+
+2002-07-10 Grace Sainsbury <graces@redhat.com>
+
+ * NEWS: Mention m68k, mcore multi-arching.
+ * MAINTAINERS: Change status of m68k, mcore to reflect
+ multi-arching.
+
+2002-07-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * valops.c (find_overload_match): Free oload_syms.
+
+2002-07-09 Joel Brobecker <brobecker@gnat.com>
+
+ Define HAVE_SYS_PROC_H if sys/proc.h exists
+ * configure.in: Add check for sys/proc.h
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+2002-07-09 Grace Sainsbury <graces@redhat.com>
+
+ * config/m68k/tm-m68k.h: Remove macros wrapped in
+ #if !GDB_MULTI_ARCH.
+
+2002-07-08 Andrew Cagney <ac131313@redhat.com>
+
+ * config.in, configure: Regenerate.
+
+2002-07-08 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2cfi.c: Include "gcore.h".
+ (execute_stack_op): Fix implementation of the
+ DW_OP_deref and DW_OP_deref_size operators by letting do their
+ lookup in the target.
+
+2002-07-07 Mark Kettenis <kettenis@gnu.org>
+
+ From Peter Schauer <Peter.Schauer@regent.e-technik.tu-muenchen.de>:
+ * i386-sol2-tdep.c (i386_sol2_init_abi): Correct value for
+ tdep->sc_sp_offset.
+
+2002-07-05 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/595, gdb/602
+ * gnu-v3-abi.c (gnuv3_baseclass_offset): Remove unused variables.
+ Don't call value_cast, just read the vtable pointer; update comments
+ to match.
+
+2002-07-05 Grace Sainsbury <graces@redhat.com>
+
+ * config/mcore/tm-mcore.h: Remove file.
+ * config/mcore/mcore.mt: Remove definition of TM_FILE
+ * configure.tgt: Set gdb_multi_arch to yes for the mcore target.
+
+2002-07-05 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-tdep.c: Include "gdb_string.h".
+
+2002-07-04 Grace Sainsbury <graces@redhat.com>
+
+ * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2.
+ (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG,RETVAL_REGNUM): Move to
+ mcore-tdep.
+ (REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER)
+ (TARGET_VIRTUAL_FRAME_POINTER, BELIEVE_PCC_PROMOTION): Remove.
+ * mcore-tdep.c (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG)
+ (RETVAL_REGNUM): Move macros from tm-mcore.h
+ (mcore_reg_struct_has_addr): New function.
+ (mcore_gdbarch_init): Added initializations for the macros removed
+ from tm-mcore.h.
+
+2002-07-04 Mark Kettenis <kettenis@gnu.org>
+
+ * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's
+ traditonal string branding within the ELF header.
+
+2002-07-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.c (remove_params): New function.
+ (make_symbol_overload_list): Use it instead of cplus_demangle.
+ (overload_list_add_symbol): Likewise. Reorder. Fix memory leak.
+
+2002-07-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i386obsd-nat.c (_initialize_i386obsd_nat): Fix typo in prototype.
+
+ * i386bsd-tdep.c (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end):
+ New variables.
+ (i386nbsd_init_abi): Use these to initialize tdep->sigtramp_start
+ and tdep->sigtramp_end.
+ * i386obsd-nat.c: New file.
+ * config/i386/obsd.mh (NATDEPFILES): Add i386obsd-nat.o.
+
+ * dwarf2cfi.c (cfi_pop_frame): Use alloca() for regbuf.
+ Don't call get_current_frame().
+
+2002-07-04 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * i386-nat.c (child_post_startup_inferior): New function
+ calling i386_cleanup_dregs if
+ I386_USE_GENERIC_WATCHPOINTS is defined.
+ * config/i386/nm-i386.h: define CHILD_POST_STARTUP_INFERIOR
+ conditional to acknowledge that i386-nat.c has its
+ own child_post_startup_inferior function.
+
+2002-07-04 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.h (I386_MAX_REGISTER_SIZE): New define.
+ * i386-tdep.c (i386_do_pop_frame): Use I386_MAX_REGISTER_SIZE
+ instead of MAX_REGISTER_RAW_SIZE.
+ (i386_extract_return_value, i386_extract_struct_value_address):
+ Convert to use regcache.
+ (i386_gdbarch_init): Set max_register_raw_size and
+ max_register_virtual_size to I386_MAX_REGISTER_SIZE.
+ Set extract_return_value and extract_struct_value_address instead
+ of their deprecated variants.
+
+ Convert i386 target to generic dummy frames.
+ * i386-tdep.c: Include "symfile.h".
+ (i386_frameless_signal_p): Consider a function to be frameless if
+ the pc points at the first instruction of the function.
+ (i386_frame_chain): Handle (generic) call dummies.
+ (i386_frame_saved_pc): Likewise.
+ (i386_frame_init_saved_regs): Remove code dealing with call
+ dummies on the stack.
+ (i386_push_dummy_frame): Removed.
+ (i386_call_dummy_words): Removed.
+ (i386_fix_call_dummy): Removed.
+ (i386_push_return_address): New function.
+ (i386_do_pop_frame): Renamed from i386_pop_frame. Add FRAME
+ parameter, and don't call get_current_frame.
+ (i386_pop_frame): New function.
+ (i386_gdbarch_init): Set use_generic_dummy_frames to 1, set
+ call_dummy_location to AT_ENTRY_POINT, set call_dummy_address to
+ entry_point_address, set call_dummy_breakpoint_offset to 0, set
+ call_dummy_length to 0, set call_dummy_words to NULL, set
+ sizeof_call_dummy_words to 0, set fix_call_dummy to
+ generic_fix_call_dummy, set pc_in_call_dummy to
+ pc_in_call_dummy_at_entry_point, set push_dummy_frame to
+ generic_push_dummy_frame, set push_return_address to
+ i386_push_return_address and set frame_chain_valid to
+ generic_file_frame_chain_valid.
+
+2002-07-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (struct regcache): Add opaque declaration.
+ (EXTRACT_RETURN_VALUE): New architecture method.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * arch-utils.c (legacy_extract_return_value): New function.
+ * arch-utils.h (legacy_extract_return_value): Declare.
+ * values.c (value_being_returned): Re-enable code handling
+ EXTRACT_STRUCT_VALUE_ADDRESS. Move
+ deprecated_grub_regcache_for_registers call to block handling
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS.
+ (EXTRACT_RETURN_VALUE): Do not define.
+
+2002-07-03 Grace Sainsbury <graces@redhat.com>
+
+ * config/mcore/tm-mcore.h (REGISTER_BYTES, NUM_REGS, PC_REGNUM)
+ (SP_REGNUM, FP_REGNUM, FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK)
+ (BREAKPOINT_FROM_PC, INNER_THAN, SAVED_PC_AFTER_CALL)
+ (INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS, INIT_FRAME_PC)
+ (FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC)
+ (STORE_RETURN_VALUE, DEPRECATED_EXTRACT_RETURN_VALUE)
+ (STORE_STRUCT_RETURN, DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+ (SKIP_PROLOGUE, FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS)
+ (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, POP_FRAME)
+ (PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, PUSH_ARGUMENTS): Remove.
+ * mcore-tdep.c (mcore_init_extra_frame_info): Add fromleaf
+ argument so the function fits the prototype in the architecture
+ vector.
+ (mcore_pop_frame): Remove argument so the function fits the
+ prototype. Use get_current_frame instead of the argument.
+ (mcore_push_arguments): Change type of struct_return so the
+ function can be used in the architecture vector.
+ (mcore_store_struct_return): Add.
+ (mcore_frame_init_saved_regs): Add.
+ (mcore_gdbarch_init): Add function calls to replace the macros
+ removed from tm-mcore.h
+
+2002-07-03 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c (print_return_value): Remove compatibility code calling
+ deprecated_grub_regcache_for_registers.
+
+ * values.c: Include "regcache.h".
+ (value_being_returned): Update. Use
+ deprecated_grub_regcache_for_registers to extract the register
+ buffer address.
+ * value.h (value_being_returned): Change ``retbuf'' parameter to a
+ ``struct regcache''.
+ * Makefile.in (values.o): Add dependency on $(regcache_h).
+
+ * inferior.h (run_stack_dummy): Change type of second parameter to
+ a ``struct regcache''.
+ * valops.c (hand_function_call): Change type of retbuf to ``struct
+ regcache''. Allocate using regcache_xmalloc, clean using
+ make_cleanup_regcache_xfree.
+ * infcmd.c (run_stack_dummy): Update. Use
+ regcache_cpu_no_passthrough instead of memcpy to copy the buffer.
+
+ * regcache.c (do_regcache_xfree): New function.
+ (make_cleanup_regcache_xfree): New function.
+ * regcache.h (make_cleanup_regcache_xfree): Declare.
+
+2002-07-03 Martin M. Hunt <hunt@redhat.com>
+
+ * event-top.c (command_line_handler): Don't read past
+ beginning of buffer.
+
+2002-07-03 Martin M. Hunt <hunt@redhat.com>
+
+ * varobj.c (struct varobj_root): Change frame from CORE_ADDR to
+ struct frame_id.
+ (varobj_create): Store frame_id for root.
+ (varobj_gen_name): Use xasprintf.
+ (varobj_update): Save and restore frame using get_frame_id() and
+ frame_find_by_id().
+ (create_child): Use xasprintf.
+ (new_root_variable): Initialize frame_id.
+ (c_name_of_child): Use xasprintf. Call find_frame_by_id().
+ (c_value_of_variable): Use xasprintf. Move mem_fileopen call
+ to prevent memory leak.
+
+2002-07-03 Andrew Cagney <ac131313@redhat.com>
+
+ * valops.c (hand_function_call): Move declaration of retbuf to
+ start of function, allocate using malloc, add a cleanup but before
+ the inf_status cleanup, cleanup the buffer. Rename local variable
+ old_chain to inf_status_cleanup.
+
+2002-07-03 Martin M. Hunt <hunt@redhat.com>
+
+ * top.c (execute_command): Use cmd_func() and cmd_func_p().
+
+ * cli/cli-decode.c (cmd_func_p): New function.
+ (cmd_func): New function.
+
+ * command.h: Add cmd_func() and cmd_func_p().
+
+2002-07-03 Grace Sainsbury <graces@redhat.com>
+
+ * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0.
+ (REGISTER_SIZE): Remove.
+ (MAX_REGISTER_RAW_SIZE): Remove.
+ (REGISTER_VIRTUAL_TYPE): Remove.
+ (MAX_REGISTER_VIRTUAL_SIZE): Remove.
+ (REGISTER_NAME): Remove.
+ (USE_GENERIC_DUMMY_FRAMES): Remove.
+ (CALL_DUMMY): Remove.
+ (CALL_DUMMY_START_OFFSET): Remove.
+ (CALL_DUMMY_BREAKPOINT_OFFSET): Remove.
+ (CALL_DUMMY_LOCATION): Remove.
+ (FIX_CALL_DUMMY): Remove.
+ (CALL_DUMMY_ADDRESS): Remove.
+ (SIZEOF_CALL_DUMMY_WORDS): Remove.
+ (SAVE_DUMMY_FRAME_TOS): Remove.
+ * mcore-tdep.c (MCORE_REG_SIZE, MCORE_NUM_REGS): Add macros.
+ (mcore_register_virtual_type): New function.
+ (mcore_register_byte): New function.
+ (mcore_register_size): New function.
+ (mcore_register_name): New function.
+ (mcore_gdbarch_init): New function. Add set_gdbarch calls for
+ macros removed from tm-mcore.h.
+ (mcore_dump_tdep): Add.
+ (_initialize_mcore_tdep): Add gdbarch_register call.
+
+2002-07-03 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_frameless_signal_p): Provide an argument in to
+ frameless_look_for_prologue, such that we actually call this
+ function.
+
+2002-07-02 Joel Brobecker <brobecker@gnat.com>
+
+ * frame.h (frame_address_in_block): New function.
+
+ * blockframe.c (frame_address_in_block): New function extracted
+ from get_frame_block().
+ (get_frame_block): Use frame_address_in_block().
+ (block_innermost_frame): Use frame_address_in_block() to match
+ the frame pc address against the block boundaries rather than
+ the frame pc directly. This prevents a failure when a frame pc
+ is actually a return-address pointing immediately after the end
+ of the given block.
+
+2002-07-02 Grace Sainsbury <graces@redhat.com>
+
+ * MAINTAINERS: Add self under write after approval.
+
+2002-07-02 Grace Sainsbury <graces@redhat.com>
+
+ * m68k-tdep.c (m68k_remote_breakpoint_from_pc): Add. Currently not
+ used in architecture vector. The default is
+ m68k_local_breakpoint_from_pc.
+ (m68k_local_breakpoint_from_pc): Add.
+ (enum): Add register numbers from tm-m68k.h.
+ (m68k_gdbarch_init): Add breakpoint_from_pc to architecture
+ vector.
+ * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Set to
+ GDB_MULTI_ARCH_PARTIAL.
+ (BPT_VECTOR, REGISTER_BYTES_FP, REGISTER_BYTES_NOFP)
+ (NUM_FREGS, SIG_PC_FP_OFFSET, SP_ARG0, REMOTE_BPT_VECTOR): Move to
+ m68k-tdep.c.
+ (BREAKPOINT, REMOTE_BREAKPOINT): Remove.
+ (A1_REGNUM, FP0_REGNUM, FPC_REGNUM, FPS_REGNUM, FPI_REGNUM): Move
+ to enum in m68k-tdep.c
+
+2002-07-02 Joel Brobecker <brobecker@gnat.com>
+
+ * solib-osf.c (open_map): Compute the list of shared libraries
+ loaded by the inferior, rather than the list of libraries loaded
+ by GDB itself. Otherwise, GDB ends up reading the symbols from
+ the wrong shared libraries...
+
+2002-07-02 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (i386_linux_sigcontext_addr): Make static.
+ (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONEXT_SP_OFFSET): Remove
+ macros.
+ (i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp):
+ Remove functions.
+ (FRAMELESS_SIGNAL): Remove function.
+ (i386_linux_frame_chain, i386_linux_frame_saved_pc,
+ i386_linux_saved_pc_after_call): Removed.
+ (i386_linux_init_abi): Initialize tdep->sigcontext_addr,
+ tdep->sc_pc_offset and tdep->sc_sp_offset. Don't override
+ frame_chain, frame_saved_pc and saved_pc_after_call any longer.
+
+ * i386-tdep.c (i386_frameless_signal_p): New function.
+ (i386_frame_chain): Deal with frameless signals.
+ (i386_sigtramp_saved_sp): New function.
+ (i386_frame_saved_pc): Deal with frameless signals.
+ (i386_saved_pc_after_call): Make sure the correct value is
+ returned just after entry into a sigtramp.
+ * i386bsd-tdep.c (i386bsd_sc_sp_offset, i386nbsd_sc_sp_offset,
+ i386fbsd4_sc_sp_offset): New variables.
+ (i386bsd_init_abi, i386nbsd_init_abi, i386fbsd4_init_abi): Use
+ these variables to initialize tdep->sc_sp_offset. * i386bsd-nat.c
+ (_initialize_i386bsd_nat): Add sanity check for sc_sp_offset
+ similiar to what we already did for sc_pc_offset.
+ * i386-sol2-tdep.c (i386_sol2_init_abi): Initialize
+ tdep->sc_sp_offset.
+
+ * i386nbsd-tdep.c (fetch_elfcore_registers): Wrap long line.
+
+2002-07-02 Michal Ludvig <mludvig@suse.cz>
+
+ * config/i386/tm-x86-64linux.h: New.
+ * config/i386/x86-64linux.mt: Add GDB_MULTI_ARCH and TM_FILE
+ definitions.
+ * config/i386/nm-x86-64.h: Rename to ...
+ * config/i386/nm-x86-64linux.h: ... this one.
+ * config/i386/x86-64linux.mh: Reflect the above change.
+
+2002-07-01 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.h (struct gdbarch_tdep): Replace sigtramp_saved_pc
+ with sigcontext_addr. Add sc_sp_offset.
+ (i386bsd_sigtramp_saved_pc): Remove prototype.
+ (i386bsd_sicontext_addr): Add prototype.
+ * i386-tdep.c (i386_sigtramp_saved_pc): New function.
+ (i386_frame_saved_pc): Rewrite to call i386_sigtramp_saved_pc.
+ (i386_svr4_sigtramp_saved_pc): Removed.
+ (i386_svr4_sigcontext_addr): New function.
+ (i386_svr4_init_abi): Don't initialize tdep->sigtramp_saved_pc.
+ Initialize tdep->sigcontext_addr instead. Initialize
+ tdep->sc_pc_offset and tdep->sc_sp_offset.
+ (i386_gdbarch_init): Likewise.
+ * i386bsd-tdep.c (i386bsd_sigcontext_addr): Don't make it static
+ any more.
+ (i386bsd_sigtramp_saved_pc): Remove function.
+ (i386bsd_init_abi): Don't initialize tdep->sigtramp_saved_pc.
+ Initialize tdep->sigcontext_addr instead. Initialize
+ tdep->sc_pc_offset.
+ * i386-linux-tdep.c (i386_linux_init_abi): Remove initialization
+ of tdep->sigtramp_saved_pc.
+ * i386-sol2-tdep.c (i386_sol2_init_abi): Don't initialize
+ tdep->sigtramp_saved_pc. Initialize tdep->sigcontext_addr
+ instead.
+
+ * i386-tdep.c (i386_frameless_function_invocation,
+ i386_frame_num_args, i386_frame_init_saved_regs,
+ i386_skip_prologue, i386_push_dummy_frame, i386_fix_call_dummy,
+ i386_pop_frame, i386_push_arguments, i386_store_struct_return,
+ i386_extract_return_value, i386_store_return_value,
+ i386_extract_struct_value_address, i386_register_virtual_type,
+ i386_register_convertible, i386_register_convert_to_virtual,
+ i386_register_convert_to_raw, i386_svr4_sigtramp_saved_pc,
+ i386_go32_init_abi, i386_nw_init_abi, i386_gdbarch_init): Make
+ static.
+
+2002-07-01 Mark Kettenis <kettenis@gnu.org>
+
+ * i386bsd-tdep.c (i386bsd_frame_saved_pc): Removed.
+
+ * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Removed.
+ * i386-sol2-tdep.c (i386_sol2_init_abi): Adjust for the removal of
+ this macro. Include "value.h".
+
+2002-06-30 Aidan Skinner <aidan@velvet.net>
+
+ * ada-exp.tab.c: remove as it's a generated file
+ * ada-lex.c: remove as it's a generated file
+
+2002-06-30 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (struct frame_info, struct
+ frame_saved_regs, struct value, struct type): Remove forward
+ declarations.
+
+ * config/i386/tm-linux.h [HAVE_PTRACE_GETFPXREGS]
+ (FILL_FPXREGSET, HAVE_SSE_REGS): Remove define.
+ * config/i386/nm-linux.h [HAVE_PTRACE_GETFPXREGS]
+ (FILL_FPXREGSET): Define.
+
+ * config/i386/tm-nbsd.h (HAVE_SSE_REGS): Remove define.
+
+ * configure.tgt (i[3456]86-*-openbsd*): Fold into
+ i[3456]86-*-netbsd* case.
+ * config/i386/tm-obsd.h: Removed.
+ * config/i386/obsd.mt: Removed.
+ * config/i386/obsd.mh (NATDEPFILES): Remove corelow.o and
+ core-aout.o.
+ (MH_CFLAGS): Add -DYYDEBUG=0.
+
+ * i386bsd-nat.c (_initialize_i386bsd_nat): Define SC_PC_OFFSET to
+ i386nbsd_sc_pc_offset on OpenBSD too.
+
+ * config/i386/tm-fbsd.h [!SVR4_SHARED_LIBS]
+ (IN_SOLIB_CALL_TRAMPOLINE): Remove define.
+ * config/i386/tm-nbsdaout.h (IN_SOLIB_CALL_TRAMPOLINE): Remove
+ define.
+ * i386bsd-tdep.c: Include "arch-utils.h".
+ (i386bsd_aout_in_solib_call_trampoline): New function.
+ (i386bsd_init_abi): Set in_solib_call_trampoline to
+ i386bsd_aout_in_solib_call_trampoline.
+ (i386nbsdelf_init_abi, i386fbsd_init_abi): Set
+ in_solib_call_trampoline to generic_in_solib_call_trampoline.
+
+2002-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * macrotab.h: Do not include "obstack.h" or "bcache.h".
+ (struct obstack, struct bcache): Add opaque declarations.
+ * Makefile.in (macrotab_h): Update
+
+2002-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * blockframe.c (generic_find_dummy_frame): Change return type to
+ ``struct regcache''.
+ (struct dummy_frame): Replace field ``registers'' with regcache, a
+ struct regcache object.
+ (generic_find_dummy_frame): Update.
+ (generic_push_dummy_frame): Update. Use regcache_xfree,
+ regcache_xmalloc and regcache_cpy.
+ (generic_pop_dummy_frame): Update. Use regcache_cpy and
+ regcache_xfree.
+ (deprecated_generic_find_dummy_frame): Update.
+ (generic_read_register_dummy): Update. Use
+ regcache_read_as_address.
+ (generic_call_dummy_register_unwind): Update. Use regcache_read.
+ (generic_get_saved_register): Update. Use regcache_read.
+
+2002-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (objfiles_h): Add $(bcache_h).
+ * objfiles.h: Include "bcache.h".
+
+ * Makefile.in (symtab_h): Remove $(bcache_h).
+ * symtab.h: Do not include "bcache.h".
+
+2002-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * ppcnbsd-tdep.c (ppcnbsd_init_abi): Set frame_chain_valid to
+ generic_func_frame_chain_valid.
+
+2002-06-28 David O'Brien <obrien@FreeBSD.org>
+
+ * config/i386/nm-fbsd.h: Include <sys/param.h>.
+ * config/i386/tm-fbsd.h: Likewise.
+
+2002-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use
+ generic_unwind_get_saved_register.
+
+2002-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ From 2002-06-27 John David Anglin <dave@hiauly1.hia.nrc.ca>:
+ * regcache.c (supply_register): Add missing argument to
+ register_buffer call.
+
+2002-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (init.c): Drop -e option to grep. Not necessary and
+ Solaris /bin/grep does not not like it. From Peter Schauer.
+
+2002-06-26 Tom Tromey <tromey@redhat.com>
+
+ * command.h (add_setshow_cmd): Declare.
+ (add_setshow_cmd_full): Declare.
+ * cli/cli-decode.c (add_setshow_cmd): No longer static. Now
+ returns void. Use add_setshow_cmd_full.
+ (add_setshow_cmd_full): New function.
+ (add_setshow_auto_boolean_cmd): Use add_setshow_cmd_full.
+ (add_setshow_boolean_cmd): Likewise.
+
+2002-06-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/vax/tm-vax.h: Protect from multiple inclusion.
+ (TARGET_UPAGES, TARGET_NBPG, STACK_END_ADDR)
+ (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Move to...
+ * config/vax/tm-vaxbsd.h: ...here. New file.
+ * config/vax/vax.mt (TM_FILE): Set to tm-vaxbsd.h.
+
+2002-06-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/vax/tm-vax.h (BREAKPOINT): Remove.
+ (BELIEVE_PCC_PROMOTION): Remove.
+ (AP_REGNUM): Move to...
+ * config/vax/nm-vax.h: ...here.
+ * vax-tdep.c: Use VAX_AP_REGNUM instead of AP_REGNUM.
+ (vax_breakpoint_from_pc): New function.
+ (vax_gdbarch_init): Initialize gdbarch_breakpoint_from_pc
+ and gdbarch_believe_pcc_promotion.
+
+2002-06-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (vax_tdep_h): Define.
+ (vax-tdep.o): Use $(vax_tdep_h).
+ * vax-tdep.c (vax_gdbarch_init): Use generic OS ABI framework.
+ (vax_dump_tdep): New function.
+ (_initialize_vax_tdep): Register vax_dump_tdep.
+ * vax-tdep.h: Include osabi.h.
+ (struct gdbarch_tdep): New.
+
+2002-06-26 Andrew Cagney <cagney@redhat.com>
+
+ * frame.h (deprecated_generic_find_dummy_frame): Rename
+ generic_find_dummy_frame.
+ * blockframe.c (generic_find_dummy_frame): Make static.
+ (deprecated_generic_find_dummy_frame): New function.
+ * sh-tdep.c (sh_nofp_frame_init_saved_regs): Replace
+ generic_find_dummy_frame with deprecated_find_dummy_frame.
+ (sh64_nofp_frame_init_saved_regs): Ditto.
+ (sh_fp_frame_init_saved_regs): Ditto.
+ * s390-tdep.c (s390_frame_saved_pc_nofix): Ditto.
+ (s390_frame_chain): Ditto.
+ * cris-tdep.c (cris_frame_init_saved_regs): Ditto.
+
+2002-06-26 Grace Sainsbury <graces@redhat.com>
+
+ * config/m68k/tm-m68k.h: Rearrange code so macros not in the
+ gdbarch vector are at the top.
+ (NUM_REGS): Remove.
+ (FP_REGNUM, SP_REGNUM, PS_REGNUM, PC_REGNUM, FP0_REGNUM): Remove.
+ (FRAME_ARGS_ADDRESS): Remove.
+ (FRAME_LOCALS_ADDRESS): Remove.
+ (FRAME_NUM_ARGS): Remove.
+ (FRAME_ARGS_SKIP): Remove.
+ * m68k-tdep.c (enum): Add eumeration of special register numbers.
+ (m68k_gdbarch_init): Add gdbarch initializations for macros
+ undefined in tm-m68k.h
+
+2002-06-26 Grace Sainsbury <graces@redhat.com>
+
+ * monitor.h: Add the function regname to monitor_ops
+ structure. This way NUM_REGS does not have to be a constant.
+ * monitor.c (monitor_fetch_register): Added support for regname
+ function. The function is called if the array regnames is NULL.
+ (monitor_store_register): Same.
+ * cpu32bug-rom.c (cpu32bug_regname): Add function. Replaces
+ regnames array.
+ (init_cpu32bug_cmds): set cpu32bug_cmds.regnames to NULL,
+ cpu32bug_cmds.regname to point to new function.
+ * abug-rom.c (abug_regname): Same as above.
+ (init_abug_cmds): Same.
+ * dbug-rom.c (dbug_regname): Same as above.
+ (init_dbug_cmds): Same.
+ * remote-est.c (est_regname): Same.
+ (init_est_cmds): Same.
+ * rom68k-rom.c (rom68k_regname): Same.
+ (init_rom68k_cmds): Same.
+
+2002-06-25 Tom Tromey <tromey@redhat.com>
+
+ * breakpoint.c (delete_command): Don't repeat `delete' commands.
+
+2002-06-25 Andrew Cagney <cagney@redhat.com>
+
+ * infrun.c (stop_registers): Change variable's type to ``struct
+ regcache'''.
+ (xmalloc_inferior_status): Delete function.
+ (free_inferior_status): Delete function.
+ (normal_stop): Use regcache_cpy.
+ (struct inferior_status): Change type of fields ``stop_registers''
+ and ``registers'' to ``struct regcache''.
+ (write_inferior_status_register): Use regcache_write.
+ (save_inferior_status): Instead of calling
+ xmalloc_inferior_status, allocate the inf_status buffer directly.
+ Use regcache_dup_no_passthrough and regcache_dup to save the
+ buffers.
+ (restore_inferior_status): Use regcache_xfree and regcache_cpy.
+ Replace the stop_registers regcache instead of overriding it. Use
+ regcache_xfree. Instead of calling free_inferior_status, xfree
+ the buffer directly.
+ (discard_inferior_status): Use regcache_xfree. Instead of calling
+ free_inferior_status, xfree the buffer directly.
+ (build_infrun): Use regcache_xmalloc.
+ (_initialize_infrun): Delete redundant call to build_infrun.
+
+ * Makefile.in (infcmd.o): Add $(regcache_h).
+
+ * infcmd.c: Include "regcache.h".
+ (run_stack_dummy): Use deprecated_grub_regcache_for_registers to
+ obtain the address of `stop_registers' register buffer.
+ (print_return_value): Ditto.
+
+ * inferior.h (struct regcache): Add opaque declaration.
+ (stop_registers): Change variable's declared type to ``struct
+ regcache''.
+
+2002-06-24 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-decode.c (add_show_from_set): Fixed typo in comment.
+ * target.c (initialize_targets): Fixed typo in
+ trust-readonly-sections `show' documentation.
+
+ * main.c: Marked all strings with _().
+
+2002-06-24 Don Howard <dhoward@redhat.com>
+
+ * memattr.c (create_mem_region): Treat hi == 0 as a special case
+ that means max CORE_ADDR+1.
+ (lookup_mem_region): Ditto.
+ (mem_info_command): Ditto.
+
+2002-06-24 Grace Sainsbury <graces@redhat.com>
+
+ * config/m68k/tm-m68k.h (DECR_PC_AFTER_BREAK): Remove.
+ (REGISTER_BYTES_OK): Remove.
+ (REGISTER_BYTES): Remove.
+ (STORE_STRUCT_RETURN): Remove.
+ (DEPRECATED_EXTRACT_RETURN_VALUE): Remove.
+ (STORE_RETURN_VALUE): Remove.
+ (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
+ (FRAME_CHAIN): Remove.
+ (FRAMELESS_FUNCTION_INVOCATION): Remove.
+ (FRAME_SAVED_PC): Remove.
+ * m68k-tdep.c (m68k_register_bytes_ok):Add.
+ (m68k_store_struct_return): Add.
+ (m68k_deprecated_extract_return_value): Add.
+ (m68k_deprecated_extract_struct_value_address): Add.
+ (m68k_store_return_value): Add.
+ (m68k_frame_chain): Add.
+ (m68k_frameless_function_invocation): Add.
+ (m68k_frame_saved_pc): Add.
+ (m68k_gdbarch_init): added set_gdbarch calls for new
+ functions and deleted macros.
+
+2002-06-23 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in (HFILES_NO_SRCDIR): Remove old files.
+ (ALLDEPFILES): Likewise.
+ (udiheaders): Removed.
+ (udip2soc.o): Likewise.
+ (udi2go32.o): Likewise.
+ (udr.o): Likewise.
+ (HFILES_WITH_SRCDIR): Don't mention udiheaders.
+
+2002-06-22 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c (_initialize_infrun): Delete unnecessary call to
+ build_infrun.
+
+ * regcache.h: Update comments describing the regcache_cpy family
+ of functions.
+ (regcache_save, regcache_restore): Delete declaration.
+ (regcache_save_no_passthrough): Delete declaration.
+ (regcache_restore_no_passthrough): Delete declaration.
+ * regcache.c (regcache_save): Delete function.
+ (regcache_save_no_passthrough): Delete function.
+ (regcache_restore): Delete function.
+ (regcache_restore_no_passthrough): Delete function.
+
+2002-06-21 Andrew Cagney <ac131313@redhat.com>
+
+ * config/m68k/tm-m68k.h: Fix typo.
+ (FRAME_INIT_SAVED_REGS): Define when non-multi-arch.
+ (m68k_frame_init_saved_regs): Declare.
+
+2002-06-21 Jim Blandy <jimb@redhat.com>
+
+ Remove some vestiges of Harris 88k support.
+ * dwarf2read.c (decode_locdesc): Remove `#if' block for Harris 88k
+ register numbering quirk.
+ * elfread.c (elf_symtab_read): Remove `#if' block for skipping
+ odd symbols occurring in Harris 88k ELF targets.
+
+2002-06-21 Tom Tromey <tromey@redhat.com>
+
+ * gdb_locale.h: New file.
+ * Makefile.in (GDB_CFLAGS): Define LOCALEDIR.
+ (defs_h): Added gdb_locale.h.
+ * configure, config.in: Rebuilt.
+ * configure.in (PACKAGE): Define.
+ * defs.h: Include gdb_locale.h.
+ * main.c (captured_main): Call setlocale, bindtextdomain,
+ textdomain.
+
+2002-06-21 Dave Brolley <brolley@redhat.com>
+
+ From Stan Shebs, Jim Blandy, Mark Salter, Kevin Buettner:
+ * config/frv/frv.mt: New file.
+ * config/frv/tm-frv.h: New file.
+ * configure.tgt: Support frv-*-*.
+ * Makefile.in (frv-tdep.o): New target.
+ * frv-tdep.c: New file.
+ * NEWS: Mention frv.
+
+2002-06-21 Dave Brolley <brolley@redhat.com>
+
+ * MAINTAINERS: Add self to "Write After Approval" list.
+
+2002-06-21 Grace Sainsbury <graces@redhat.com>
+
+ * config/m68k/tm-m68k.h (REGISTER_BYTE, REGISTER_RAW_SIZE)
+ (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE)
+ (REGISTER_VIRTUAL_TYPE, REGISTER_NAMES, TARGET_LONG_DOUBLE_FORMAT)
+ (FUNCTION_START_OFFSET, SKIP_PROLOGUE, SAVED_PC_AFTER_CALL)
+ (INNER_THAN, STACK_ALIGN, REGISTER_SIZE): Remove macros.
+
+ * m68k-tdep.c: Include arch-utils.h
+ (m68k_register_raw_size): Add.
+ (m68k_register_virtual_size): Add.
+ (m68k_register_virtual_type): Add.
+ (m68k_register_name): Add.
+ (m68k_stack_align): Add.
+ (m68k_register_byte): Add.
+ (m68k_gdbarch_init): Add set_gdbarch calls for macros removed in
+ tm-m68k.h.
+
+2002-06-21 Grace Sainsbury <graces@redhat.com>
+
+ * m68k-tdep.c (m68k_frame_init_saved_regs): Replace
+ m68k_find_saved_regs.
+ (m68k_pop_frame): Removed saved_regs structure, and replaced
+ references to it with frame->saved_regs.
+ (m68k_gdbarch_init): Added function calls to initialize the
+ gdbarch structure.
+ (m68k_fix_call_dummy): Add.
+ * config/m68k/tm-m68k.h: (FRAME_FIND_SAVED_REGS): Remove.
+ (CALL_DUMMY): Remove.
+ (CALL_DUMMY_LENGTH): Remove.
+ (CALL_DUMMY_START_OFFSET): Remove.
+ (CALL_DUMMY_BREAKPOINT_OFFSET): Remove.
+ (FIX_CALL_DUMMY): Remove.
+ (PUSH_DUMMY_FRAME): Remove.
+ (POP_FRAME): Remove.
+
+2002-06-19 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * parse.c (parse_fprintf): New function used to avoid calls to
+ fprintf in bison parser generated debug code.
+ * parser-defs.h: Declaration of new parse_fprintf function.
+ * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y:
+ Set YYDEBUG to 1 by default.
+ Set YYFPRINTF as parse_fprintf.
+
+2002-06-21 Michal Ludvig <mludvig@suse.cz>
+
+ * dwarf2cfi.c (read_encoded_pointer): Don't handle pointer
+ encoding anymore.
+ (pointer_encoding, enum ptr_encoding): New.
+ (execute_cfa_program): Take care about pointer encoding.
+ (dwarf2_build_frame_info): Only call parse_frame_info for
+ .debug_frame and .eh_frame.
+ (parse_frame_info): New, derived from former dwarf2_build_frame_info.
+ fixed augmentation handling, added relative addressing,
+ ignore duplicate FDEs. Added comments.
+ * dwarf2cfi.c: Reindented.
+
+2002-06-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * event-top.c (command_handler): Don't use space_at_cmd_start
+ unless there is sbrk() on the host. Assign time and space data
+ to union fields of the appropriate length.
+
+2002-06-20 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_register_nr2name): Rename to
+ x86_64_register_name. Return type changed to 'const char *'.
+ (x86_64_register_name2nr): Rename to x86_64_register_number.
+ (x86_64_gdbarch_init): Update to reflect the change.
+ * x86-64-tdep.h: Ditto.
+ * x86-64-linux-nat.c (x86_64_fxsave_offset)
+ (supply_fpregset): Ditto.
+
+2002-06-19 Andrew Cagney <cagney@redhat.com>
+
+ * regcache.h: Update copyright.
+ (struct regcache, struct gdbarch): Add opaque declarations.
+ (current_regcache): Declare global variable.
+ (regcache_read, regcache_write): Add gdbarch parameter.
+ (regcache_save, regcache_save_no_passthrough)
+ (regcache_restore, regcache_restore_no_passthrough)
+ (regcache_dup, regcache_dup_no_passthrough)
+ (regcache_cpy, regcache_cpy_no_passthrough)
+ (deprecated_grub_regcache_for_registers)
+ (deprecated_grub_regcache_for_register_valid)
+ (regcache_valid_p): Add function declarations.
+
+ * regcache.c: Update copyright.
+ (regcache_descr_handle): New global variable.
+ (struct regcache_descr): Define.
+ (init_legacy_regcache_descr, init_regcache_descr): New functions.
+ (regcache_descr, xfree_regcache_descr): New functions.
+ (struct regcache): Define.
+ (regcache_xmalloc, regcache_xfree): New functions.
+ (regcache_cpy, regcache_cpy_no_passthrough): New functions.
+ (regcache_dup, regcache_dup_no_passthrough): New functions.
+ (regcache_valid_p, regcache_read_as_address): New functions.
+ (deprecated_grub_regcache_for_registers): New function.
+ (deprecated_grub_regcache_for_register_valid): New function.
+ (current_regcache): New global variable.
+ (register_buffer): Add regcache parameter. Update calls.
+ (regcache_read, regcache_write): Add regcache parameter. Rewrite.
+ (read_register_gen, write_register_gen): Update register_buffer
+ call. Test for legacy_p instead of gdbarch_register_read_p or
+ gdbarch_register_write_p.
+ (regcache_collect): Update register_buffer call.
+ (build_regcache): Rewrite. Use deprecated grub functions.
+ (regcache_save, regcache_save_no_passthrough): New functions.
+ (regcache_restore, regcache_restore_no_passthrough): New
+ functions.
+ (_initialize_regcache): Create the regcache_data_handle. Swap
+ current_regcache global variable.
+
+ * sh-tdep.c (sh_pseudo_register_read): Add current_regcache
+ parameter to regcache_read and regcache_write calls.
+ (sh4_register_read): Ditto.
+ (sh64_pseudo_register_read): Ditto.
+ (sh64_register_read): Ditto.
+ (sh_pseudo_register_write): Ditto.
+ (sh4_register_write): Ditto.
+ (sh64_pseudo_register_write): Ditto.
+ (sh64_register_write): Ditto.
+
+ * defs.h (XCALLOC): Define.
+
+2002-06-19 Grace Sainsbury <graces@redhat.com>
+
+ * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Added (set to 0).
+ * m68k-tdep.c (m68k_gdbarch_init): Added.
+ (m68k_dump_tdep): Added.
+
+2002-06-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * ada-lang.c (fill_in_ada_prototype): Update comment.
+
+2002-06-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (enum mips_abi): Explicitly start at 0. Add
+ MIPS_ABI_LAST.
+ (mips_abi_string, mips_abi_strings): New.
+ (struct gdbarch_tdep): Remove mips_abi_string, add found_abi.
+ (mips_gdbarch_init): Set tdep->found_abi. Don't set
+ tdep->mips_abi_string. Honor mips_abi_string. Default to
+ O32 if no ABI is found.
+ (mips_dump_tdep): Use mips_abi_strings.
+ (mips_abi_update): New function.
+ (_initialize_mips_tdep): Initialize mips_abi_string. Add
+ ``set mips abi'' and ``show mips abi''. Check the size of
+ mips_abi_strings.
+
+2002-06-19 Andrew Cagney <cagney@redhat.com>
+
+ * i386-linux-tdep.c (i386_linux_register_name): Make return type
+ constant.
+
+2002-06-18 Joel Brobecker <brobecker@gnat.com>
+
+ * alpha-tdep.c (heuristic_proc_desc): Compute the size of the
+ current frame using only the first stack size adjustment. All
+ subsequent size adjustments are not considered to be part of
+ the "static" part of the current frame.
+ Compute the address of the saved registers relative to the
+ Frame Pointer ($fp) instead of the Stack Pointer if $fp is
+ in use in this frame.
+
+2002-06-18 Don Howard <dhoward@redhat.com>
+
+ * valops.c (value_ind): Use value_at_lazy() when dereferencing
+ type int expressions. Thanks to Jim Blandy <jimb@redhat.com> for
+ suggesting this solution.
+
+2002-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * config/romp/xm-rtbsd.h: Delete file.
+ * config/romp/rtbsd.mh: Delete file.
+
+2002-06-18 Keith Seitz <keiths@redhat.com>
+
+ * breakpoint.c (condition_command): Post breakpoint_modify
+ when a condition is added to an existing breakpoint.
+ (commands_command): Likewise for commands.
+ (set_ignore_count): Likewise for ignore counts.
+ If no tty, do not simply return, still need to send event
+ notification.
+ (ignore_command): Only print a newline if the command came
+ from a tty.
+ Don't call breakpoints_changed, since this is now properly
+ handled by set_ignore_count.
+
+2002-06-18 Andrew Cagney <cagney@redhat.com>
+
+ * MAINTAINERS: Note that cris-elf target can be compiled with
+ -Werror.
+ * cris-tdep.c (cris_register_name): Make return type constant.
+ (cris_breakpoint_from_pc): Ditto.
+
+2002-06-18 Michal Ludvig <mludvig@suse.cz>
+
+ * frame.h (struct frame_info): Change type of context to
+ 'struct context'.
+
+2002-06-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (REGISTER_NAME): Change return type a constant string
+ pointer.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * config/mips/tm-mips.h (mips_register_name): Update.
+ * i386-tdep.h (i386_register_name): Update.
+ * mips-tdep.c (mips_register_name): Update
+ * alpha-tdep.c (alpha_register_name): Update.
+ * arch-utils.c (legacy_register_name): Update.
+ * arch-utils.h (legacy_register_name): Update.
+ * avr-tdep.c (avr_register_name): Update.
+ * ia64-tdep.c (ia64_register_name): Update.
+ * i386-tdep.c (i386_register_name): Update.
+ * sparc-tdep.c (sparc32_register_name): Update.
+ (sparc64_register_name): Update.
+ (sparclite_register_name): Update.
+ (sparclet_register_name): Update.
+ * sh-tdep.c (sh_generic_register_name): Update.
+ (sh_sh_register_name): Update.
+ (sh_sh3_register_name): Update.
+ (sh_sh3e_register_name): Update.
+ (sh_sh_dsp_register_name): Update.
+ (sh_sh3_dsp_register_name): Update.
+ (sh_sh4_register_name): Update.
+ (sh_sh64_register_name): Update.
+ * s390-tdep.c (s390_register_name): Update.
+ * rs6000-tdep.c (rs6000_register_name): Update.
+ * ns32k-tdep.c (ns32k_register_name_32082): Update.
+ (ns32k_register_name_32382): Update.
+ * d10v-tdep.c (d10v_ts2_register_name): Update.
+ (d10v_ts3_register_name): Update.
+ * xstormy16-tdep.c (xstormy16_register_name): Update.
+ * vax-tdep.c (vax_register_name): Update.
+ * v850-tdep.c (v850_register_name): Update.
+ * m68hc11-tdep.c (m68hc11_register_name): Update.
+ * mn10300-tdep.c (mn10300_generic_register_name): Update.
+ (am33_register_name): Update.
+
+2002-06-17 Grace Sainsbury <graces@redhat.com>
+
+ * m68k-tdep.c: Reindented.
+
+2002-06-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb_indent.sh: Add prgregset_t, fpregset_t, and gregset_t to the
+ list of predefined types.
+
+2002-06-16 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE,
+ REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL,
+ REGISTER_CONVERT_TO_RAW): Remove defines.
+ (i386_register_virtual_type, i386_register_convertible,
+ i386_register_convert_to_virtual, i386_register_convert_to_raw):
+ Remove prototypes.
+ * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the
+ macros mentioned above.
+
+ * config/i386/tm-i386lynx.h (SAVED_PC_AFTER_CALL): Remove define.
+ (i386lynx_saved_pc_after_call): Remove prototype.
+ * i386ly-tdep.c: Include "i386-tdep.h".
+ (i386lynx_saved_pc_after_call): Make static. Use
+ read_memory_nobpt instead of read_memory. Use
+ read_memory_unsigned_integer instead of read_memory_integer.
+ (i386lynx_init_abi): New function.
+ (i386lynx_coff_osabi_sniffer): New function.
+ (_initialize_i386bsd_tdep): New function.
+
+ * config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY,
+ CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET,
+ CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Remove defines.
+ (i386_fix_call_dummy): Remove prototype.
+ * i386-tdep.c (i386_call_dummy_words): New variable.
+ (i386_gdbarch_init): Adjust for removal of the
+ macros mentioned above.
+
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * command.h (add_setshow_auto_boolean_cmd): Replace
+ add_set_auto_boolean_cmd.
+ * cli/cli-decode.c (add_setshow_auto_boolean_cmd): Replace
+ add_set_auto_boolean_cmd.
+ * cli/cli-decode.h (add_set_auto_boolean_cmd): Delete declaration.
+ * mips-tdep.c (_initialize_mips_tdep): Update ``set mips
+ mask-address'' command.
+ (show_mask_address): Add cmd parameter.
+ * remote.c (add_packet_config_cmd): Update. Change type of
+ set_func and show_func to cmd_sfunc_ftype.
+ (_initialize_remote): Update `set remote Z-packet'
+ (show_remote_protocol_qSymbol_packet_cmd): Add cmd parameter.
+ (show_remote_protocol_e_packet_cmd): Ditto.
+ (show_remote_protocol_E_packet_cmd): Ditto.
+ (show_remote_protocol_P_packet_cmd): Ditto.
+ (show_remote_protocol_Z_software_bp_packet_cmd): Ditto.
+ (show_remote_protocol_Z_hardware_bp_packet_cmd): Ditto.
+ (show_remote_protocol_Z_write_wp_packet_cmd): Ditto.
+ (show_remote_protocol_Z_read_wp_packet_cmd): Ditto.
+ (show_remote_protocol_Z_access_wp_packet_cmd): Ditto.
+ (show_remote_protocol_Z_packet_cmd): Ditto.
+ (show_remote_protocol_binary_download_cmd): Ditto.
+ (show_remote_cmd): Pass NULL to all of above.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (PUSH_ARGUMENTS, STORE_STRUCT_RETURN,
+ DEPRECATED_EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE,
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS, PUSH_DUMMY_FRAME,
+ POP_FRAME): Remove defines.
+ (i386_push_arguments, i386_store_struct_return,
+ i386_extract_return_value, i386_store_return_value,
+ i386_extract_struct_value_address, i386_push_dummy_frame,
+ i386_pop_frame): Renove prototypes.
+ * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the
+ macros mentioned above.
+
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c (add_setshow_boolean_cmd): Replace
+ add_set_boolean_cmd.
+ (add_setshow_cmd): New function.
+ * command.h (add_setshow_boolean_cmd): Replace
+ add_set_boolean_cmd.
+ * remote-rdi.c (_initialize_remote_rdi): Update ``set rdiheartbeat''
+ and ``set rdiromatzero''.
+ * maint.c (_initialize_maint_cmds): Update commented out code.
+ * cli/cli-decode.h (add_set_boolean_cmd): Delete declaration.
+ * target.c (initialize_targets): Update `set
+ trust-readonly-sections'.
+ * remote.c (_initialize_remote): Update `set remotebreak'.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (FUNCTION_START_OFFSET, INNER_THAN,
+ BREAKPOINT, DECR_PC_AFTER_BREAK): Removed.
+ * i386-tdep.c (i386_skip_prologue): Adjust function signature to
+ fit into multi-arch framework.
+ (i386_breakpoint_from_pc): New function.
+ (i386_gdbarch_init): Adjust for removal of the macros mentioned
+ above.
+
+ * config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION,
+ FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS,
+ FRAME_ARGS_SKIP, FRAME_INIT_SAVED_REGS): Remove defines.
+ (i386_frameless_function_invocation, i386_frame_num_args,
+ i386_frame_init_saved_regs): Remove prototypes.
+ * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the
+ macros mentioned above.
+
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c (set_cmd_cfunc): Update.
+ (set_cmd_sfunc): Update.
+ * command.h (cmd_cfunc_ftype, cmd_sfunc_ftype): Declare.
+ (set_cmd_sfunc, set_cmd_cfunc): Update.
+ * cli/cli-decode.h: Update.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function.
+ (_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer.
+
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (auto_boolean): Declare enum.
+ * command.h (cmd_auto_boolean): Delete enum.
+ * mips-tdep.c (mask_address_var): Update.
+ (mips_mask_address_p): Update.
+ (show_mask_address): Update.
+ * remote.c (struct packet_config): Update.
+ (update_packet_config): Update.
+ (show_packet_config_cmd): Update.
+ (packet_ok): Update.
+ (add_packet_config_cmd): Update.
+ (_initialize_remote):
+ * command.h: Update.
+ * cli/cli-setshow.c (parse_auto_binary_operation): Update.
+ (do_setshow_command): Update.
+ * cli/cli-decode.c (add_set_auto_boolean_cmd): Update.
+ * cli/cli-decode.h: Update.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-cygwin.h, config/i386/tm-fbsd.h,
+ config/i386/tm-go32.h, config/i386/tm-i386gnu.h,
+ config/i386/tm-i386sol2.h, config/i386/tm-i386v4.h,
+ config/i386/tm-linux.h, config/i386/tm-nbsd.h,
+ config/i386/tm-obsd.h (HAVE_I387_REGS): Remove define.
+ * config/i386/tm-i386.h: Unconditionally define FLOAT_INFO.
+
+ * i386-tdep.c (i386_coff_osabi_sniffer): Add "coff-go32" to the
+ list of DJGPP COFF targets.
+
+ * config/i386/tm-i386.h (REGISTER_SIZE): Remove define.
+ (NUM_GREGS, NUM_FREGS, NUM_SSE_REGS): Remove defines.
+ (FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove defines.
+ (FP0_REGNUM): Remove define.
+ (MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE,
+ MAX_REGISTER_VIRTUAL_SIZE): Remove define.
+ (i386_register_virtual_size): Remove protoype.
+ * i386-tdep.c (i386_register_virtual_size): Removed.
+ (i386_extract_return_value, i386_store_return_value): Use
+ FP0_REGNUM instead of NUM_FREGS to determine whether the
+ floating-point registers are available.
+ (i386_gdbarch_init): Tweak FIXME about FPU registers.
+ Adjust for removal of macros mentioned above.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * i386v4-nat.c: Include "i386-tdep.h". Reformat and tweak various
+ comments.
+ (fill_gregset, supply_gregset, supply_fpregset, fill_fpregset):
+ Remove prototypes.
+ (supply_gregset, fill_gregset): Remove use of register keyword and
+ remove declaration for regmap. Use I386_NUM_GREGS instead of
+ NUM_REGS and NUM_FREGS.
+ (FPREGSET_FSAVE_OFFSET): Remove.
+ (supply_fpregset, fill_fpregset): Use FPO_REGNUM instead of
+ NUM_FREGS to determine whether the floating-point registers are
+ available.
+
+ * i386gnu-nat.c (supply_gregset, gnu_fetch_registers,
+ gnu_store_registers): Replace usage of NUM_GREGS with
+ I386_NUM_GREGS.
+
+ * i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER,
+ OLD_CANNOT_STORE_REGISTER, supply_gregset, fill_gregset): Replace
+ usage of NUM_GREGS with I386_NUM_GREGS.
+
+ * i386-linux-nat.c (fill_gregset): Remove redundant parentheses.
+
+ * i386bsd-nat.c: Include "i386-tdep.h".
+ (supply_gregset, fill_gregset): Replace usage of NUM_GREGS with
+ I386_NUM_GREGS.
+
+ * i386v-nat.c: Remove copnditional inclusion of <asm/debugreg.h>,
+ and associated comment. They no longer make any sense, since we
+ don't use this file anymore on Linux.
+
+ * config/i386/tm-i386.h (MAX_NUM_REGS): Removed.
+ * i386-tdep.c (i386_register_offset, i386_register_size): Use
+ I386_SSE_NUM_REGS instead of MAX_NUM_REGS for the number of
+ elements in these arrays.
+ (_initialize_i386_tdep): Use I386_SSE_NUM_REGS instead of
+ MAX_NUM_REGS.
+
+2002-06-15 Mark Kettenis <kettenis@gnu.org>
+
+ * osabi.h (gdb_osabi): Add GDB_OSABI_LYNXOS.
+ * osabi.c (gdb_osabi_names): Add entry for "LynxOS".
+
+2002-06-14 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_EXTRACT_RETURN_VALUE): Rename
+ EXTRACT_RETURN_VALUE.
+ (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Rename
+ EXTRACT_STRUCT_VALUE_ADDRESS.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * values.c (value_being_returned): Handle
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS.
+ (EXTRACT_RETURN_VALUE): Define as DEPRECATED_EXTRACT_RETURN_VALUE.
+
+ * arm-linux-tdep.c (arm_linux_init_abi): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * avr-tdep.c (avr_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * d10v-tdep.c (d10v_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+ * x86-64-tdep.c (x86_64_gdbarch_init): Update.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+
+ * config/arc/tm-arc.h: Update.
+ * config/d30v/tm-d30v.h: Update.
+ * config/fr30/tm-fr30.h: Update.
+ * config/h8300/tm-h8300.h: Update.
+ * config/h8500/tm-h8500.h: Update.
+ * config/i386/tm-i386.h: Update.
+ * config/i386/tm-ptx.h: Update.
+ * config/i386/tm-symmetry.h: Update.
+ * config/i960/tm-i960.h: Update.
+ * config/m32r/tm-m32r.h: Update.
+ * config/m68k/tm-delta68.h: Update.
+ * config/m68k/tm-linux.h: Update.
+ * config/m68k/tm-m68k.h: Update.
+ * config/m88k/tm-m88k.h: Update.
+ * config/mcore/tm-mcore.h: Update.
+ * config/mips/tm-mips.h: Update.
+ * config/mn10200/tm-mn10200.h: Update.
+ * config/pa/tm-hppa.h: Update.
+ * config/pa/tm-hppa64.h: Update.
+ * config/sparc/tm-sp64.h: Update.
+ * config/sparc/tm-sparc.h: Update.
+ * config/sparc/tm-sparclet.h: Update.
+ * config/z8k/tm-z8k.h: Update.
+
+2002-06-14 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (i386_linux_tdep_h): Define.
+ (i386_tdep_h, i387_tdep_h): Define.
+ (i386-linux-nat.o): Add $(i386_linux_tdep_h),
+ $(i386_tdep_h) and $(i387_tdep_h).
+ * i386-linux-nat.c: Include "i386-linux-tdep.h".
+
+2002-06-14 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/tm-i386.h (START_INFERIOR_TRAPS_EXPECTED): Removed.
+ Already covered by the default.
+
+ * config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT,
+ TARGET_LONG_DOUBLE_BIT): Remove. * i386-tdep.c
+ (i386_gdbarch_init): Initialize long_double_format and long_double
+ bit.
+
+ * config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and
+ i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o.
+ Move these to ...
+ * config/i386/i386sol2.mh: ... here.
+ * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define.
+ (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef.
+ (SIGCONTEXT_PC_OFFSET): Remove define.
+ (IN_SIGTRAMP): Remove define.
+ * i386-sol2-tdep.c: New file.
+
+ * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h.
+ * config/i386/tm-i386nw.h: Removed.
+
+ * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM,
+ USE_STRUCT_CONVENTION): Remove defines.
+ (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
+ (get_longjmp_target): Remove prototype.
+ (IN_SIGTRAMP): Remove define.
+ (i386bsd_in_sigtramp): Remove prototype.
+ (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a
+ function. Update comment accordingly
+ (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly.
+ (FRAME_SAVED_PC): Remove define.
+ (i386bsd_frame_saved_pc): Remove prototype.
+ * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC,
+ GET_LONGJMP_TARGET): Remove defines.
+ (get_longjmp_target): Remove prototype.
+ (IN_SIGTRAMP): Remove define.
+ (i386bsd_in_sigtramp): Remove prototype.
+ (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a
+ function. Update comment accordingly
+ (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly.
+ (FRAME_SAVED_PC): Remove define.
+ (i386bsd_frame_saved_pc): Remove prototype.
+ * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention):
+ Remove prototype.
+ (USE_STRUCT_CONVENTION): Remove prototype.
+ * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove
+ declaration.
+ (_initialize_i386bsd_nat): Revise logic to determine some
+ constants at compile time when compiling a native GDB. Warn if
+ things don't match up with what we expect.
+ * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end):
+ Remove variables.
+ (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite
+ to use date stored in `struct gdbarch_tdep'.
+ (i386bsd_sigcontext_offset): Remove varaible.
+ (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data
+ stored in `struct gdbarch_tdep'.
+ (i386bsd_frame_saved_pc): Make static.
+ (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions.
+ (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset,
+ i386fbsd_sigtramp_start, i386fbsd_sigtramp_end,
+ i386fbsd4_sc_pc_offset): New variables.
+ (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi,
+ i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New
+ functions.
+ (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New
+ functions.
+ * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment.
+ Modify the value of i386fbsd_sigtramp_start and
+ i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and
+ i386fbsd_sigtramp_end.
+ * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove
+ function.
+
+ * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move
+ define to i386-linux-tdep.h.
+ (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME,
+ REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove
+ defines.
+ (i386_linux_register_name, i386_linux_register_byte,
+ i386_linux_register_raw_size): Remove prototypes.
+ (i386_linux_svr4_fetch_link_map_offsets): Remove prototype.
+ (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define.
+ (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL,
+ TARGET_WRITE_PC): Remove defines.
+ (i386_linux_in_sigtramp, i386_linux_frame_chain,
+ i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call,
+ i386_linux_write_pc): Remove prototypes.
+ (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
+ (get_longjmp_target): Remove prototype.
+ * i386-linux-tdep.h: New file.
+ * i386-linux-nat.c: Include "i386-linux-tdep.h".
+ * i386-linux-tdep.c: Include "i386-tdep.h" and
+ "i386-linux-tdep.h".
+ (i386_linux_register_name, i386_linux_register_byte,
+ i386_linux_register_raw_size, i386_linux_in_sigtramp,
+ i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets):
+ Make static.
+ (i386_linux_init_abi): New function.
+ (_initialize_i386_linux_tdep): New function.
+
+ * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define.
+ (i386_saved_pc_after_call): Remove prototype.
+ (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register".
+ (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM,
+ DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines.
+ (i386_register_name, i386_stab_reg_to_regnum,
+ i386_dwarf_reg_to_regnum): Remove prototypes.
+ (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS,
+ SIZEOF_SSE_REGS): Remove defines.
+ (REGISTER_BYTES): Remove define.
+ (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines.
+ (i386_register_byte, i386_register_raw_size): Remove prototypes.
+ (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines.
+ (i386_frame_chain, i386_frame_saved_pc): Remove prototypes.
+ * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define.
+ (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP,
+ JB_EDX, GET_LONGJMP_TARGET): Remove defines.
+ (get_longjmp_target): Remove prototype.
+ (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines.
+ (sigtramp_saved_pc): Remove define.
+ (i386v4_sigtramp_saved_pc): Remove prototype.
+ * config/i386/tm-go32.h (FRAME_CHAIN,
+ FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines.
+ (i386go32_frame_saved_pc): Remove prototype.
+ (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
+ (get_longjmp_target): Remove prototype.
+ * i386-tdep.h: Include "osabi.h".
+ (enum i386_abi): Removed.
+ (enum struct_return): New enum.
+ (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset,
+ struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and
+ sc_pc_offset members.
+ (i386_gdbarch_register_os_abi): Remove prototype.
+ (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS,
+ I386_SSE_NUM_REGS): New defines.
+ (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS,
+ I386_SSE_SIZEOF_REGS): New defines.
+ (i386_register_name, i386_register_byte, i386_register_raw_size):
+ New prototypes.
+ (i386_elf_init_abi, i386_svr4_init_abi): New prototypes.
+ (i386bsd_sigtramp_saved_pc): New prototype.
+ * i386-tdep.c: Don't include "elf-bfd.h".
+ (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum,
+ i386_frame_chain, i386_saved_pc_after_call): Make static.
+ (i386_frame_saved_pc): Rewrite to call architecture dependent
+ function to deal with signal handlers. Make static.
+ (i386go32_frame_saved_pc): Removed.
+ [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target):
+ Removed.
+ (i386_get_longjmp_target): New function.
+ (default_struct_convention, pcc_struct_convention,
+ reg_struct_convention, valid_conventions, struct_convention): New
+ variables.
+ (i386_use_struct_convention): New function.
+ (i386v4_sigtramp_saved_pc): Renamed to
+ i386_svr4_sigtramp_saved_pc. Made static. Moved.
+ (i386_pc_in_sigtramp): New function.
+ (i386_abi_names): Removed.
+ (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD,
+ ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD):
+ Removed.
+ (process_note_sections, i386_elf_abi_from_note, i386_elf_abi,
+ i386_gdbarch_register_os_abi): Removed.
+ (struct i386_abi_handler): Removed.
+ (i386_abi_handler_list): Removed.
+ (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New
+ functions.
+ (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi,
+ i386_nw_init_abi): New functions.
+ (i386_gdbarch_init): Rewritten to use generic OS ABI framework.
+ Use set_gdbarch_xxx() calls instead of relying on macros for a
+ number of calls.
+ (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions.
+ (_initialize_i386_tdep): Add new 'struct-convcention' command.
+ Register the various architecture variants defined in this file.
+
+2002-06-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment.
+ (struct main_type): Remove arg_types member. Update comments for
+ struct field.
+ (TYPE_ARG_TYPES): Remove.
+ (TYPE_FN_FIELD_ARGS): Update.
+ (smash_to_method_type): Update prototype.
+
+ * c-typeprint.c (cp_type_print_method_args): Take method type
+ instead of argument list. Use new argument layout. Simplify.
+ (c_type_print_args): Use new argument layout. Simplify.
+ (c_type_print_base): Update call to cp_type_print_method_args.
+ * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type
+ argument; use die->type instead. Update call to
+ smash_to_method_type.
+ (read_structure_scope): Update call to dwarf2_add_member_fn.
+ * gdbtypes.c (allocate_stub_method): Update comment.
+ (smash_to_method_type): Take new NARGS and VARARGS arguments.
+ Use new argument layout.
+ (check_stub_method): Use new argument layout. Don't count
+ void as an argument.
+ (print_arg_types): Update comments. Use new argument layout.
+ (recursive_dump_type): Don't print arg_types member.
+ * hpread.c (hpread_read_struct_type): Use new argument layout.
+ (fixup_class_method_type): Likewise.
+ (hpread_type_lookup): Likewise.
+ * stabsread.c (read_type): Update calls to read_args and
+ smash_to_method_type.
+ (read_args): Use new argument layout. Simplify.
+ * valops.c (typecmp): Use new argument layout. Update parameters
+ and comments. Simplify.
+ (hand_function_call): Use new argument layout.
+ (search_struct_method): Update call to typecmp.
+ (find_overload_match): Use new argument layout.
+
+2002-06-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * NEWS: Mention multithreaded debug support for gdbserver.
+
+2002-06-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * MAINTAINERS: Mention NEWS.
+
+2002-06-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (PROC_SYMBOL): Add warning comment.
+ (struct mips_objfile_private, compare_pdr_entries): New.
+ (non_heuristic_proc_desc): Read the ".pdr" section if it
+ is present.
+
+2002-06-12 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c (arm_push_arguments): Rewrite using a two-pass loop.
+ (arm_debug): New static variable.
+ (_initialize_arm_tdep): Add ``set debug arm'' command.
+
+2002-06-12 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (sim_arm_h): Define.
+ (arm-tdep.o): Add $(sim_arm_h) and $(gdb_assert_h).
+ * arm-tdep.c: Include "gdb/sim-arm.h" and "gdb_assert.h".
+ (arm_register_sim_regno): New function, map an internal REGNUM
+ onto a simulator register number.
+ (arm_gdbarch_init): Set register_sim_regno.
+
+2002-06-09 Aldy Hernandez <aldyh@redhat.com>
+
+ * MAINTAINERS: Add self.
+
+2002-06-11 Jim Blandy <jimb@redhat.com>
+
+ * source.c (source_info): Mention whether the symtab has
+ information about preprocessor macros.
+
+ Call the command `info macro', not `show macro'.
+ * macrocmd.c (info_macro_command): Renamed from `show_macro_command'.
+ Fix error message.
+ (_initialize_macrocmd): Register `info_macro_command' in
+ `infolist', not `showlist'.
+
+2002-06-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (MIPS_FPU_TYPE, FP_REGISTER_DOUBLE, MIPS_EABI)
+ (MIPS_LAST_FP_ARG_REGNUM, MIPS_LAST_ARG_REGNUM)
+ (MIPS_DEFAULT_SAVED_REGSIZE, MIPS_REGS_HAVE_HOME_P)
+ (MIPS_DEFAULT_STACK_ARGSIZE, GDB_TARGET_IS_MIPS64)
+ (MIPS_DEFAULT_MASK_ADDRESS_P): Remove obsolete definitions. Define
+ unconditionally.
+ (set_mipsfpu_single_command, set_mipsfpu_double_command)
+ (set_mipsfpu_none_command): Remove if (GDB_MULTI_ARCH).
+ (_initialize_mips_tdep): Remove dead code.
+ * config/mips/tm-irix5.h (MIPS_LAST_ARG_REGNUM)
+ (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove.
+ * config/mips/tm-irix6.h (MIPS_LAST_ARG_REGNUM)
+ (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove.
+ * config/mips/tm-mips.h (MIPS_EABI, MIPS_LAST_ARG_REGNUM,
+ MIPS_LAST_FP_ARG_REGNUM): Remove.
+
+2002-06-11 Michal Ludvig <mludvig@suse.cz>
+
+ * dwarf2cfi.c (unwind_tmp_obstack_init): New.
+ (unwind_tmp_obstack_free, parse_frame_info)
+ (update_context, cfi_read_fp, cfi_write_fp)
+ (cfi_frame_chain, cfi_init_extra_frame_info)
+ (cfi_virtual_frame_pointer): Use the above function.
+ * dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c').
+
+2002-06-11 Corinna Vinschen <vinschen@redhat.com>
+
+ * v850-tdep.c (v850_type_is_scalar): New function.
+ (v850_use_struct_convention): Match current gcc implementation
+ as close as possible.
+ (v850_push_arguments): Fix stack_offset handling. Don't write
+ struct_addr into register. This is done by v850_store_struct_return.
+ (v850_extract_return_value): Care for structs.
+ (v850_store_return_value): Ditto.
+ (v850_store_struct_return): Actually write address.
+
+2002-06-11 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_skip_prologue): Fix to work on functions
+ without debug information too.
+
+2002-06-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (PRINT_FLOAT_INFO): Add frame and ui_file parameters.
+ Make multi-arch pure.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * arm-tdep.c (arm_print_float_info): Update.
+ * arch-utils.h (default_print_float_info): Update.
+ * arch-utils.c (default_print_float_info): Update.
+ * infcmd.c (float_info): Update call.
+
+2002-06-10 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (init.c): Move the call to _initialize_gdbtypes to
+ the front of the initialize list.
+
+2002-06-10 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c (struct inferior_status): Replace fields
+ selected_frame_address and selected_level with field
+ selected_frame_id.
+ (save_inferior_status): Update. Use get_frame_id.
+ (struct restore_selected_frame_args): Delete.
+ (restore_selected_frame): Update. Use frame_find_by_id.
+ (restore_inferior_status): Update.
+
+ * breakpoint.h (struct breakpoint): Change type of
+ watchpoint_frame to frame_id.
+ * breakpoint.c (insert_breakpoints): Use frame_find_by_id. Remove
+ call to get_current_frame.
+ (do_enable_breakpoint): Use frame_find_by_id. Remove call to
+ get_current_frame.
+ (watchpoint_check): Use frame_find_by_id.
+
+ * frame.h (record_selected_frame): Delete declaration.
+ * stack.c (record_selected_frame): Delete function.
+
+ * frame.h (struct frame_id): Define.
+ (get_frame_id): Declare.
+ (frame_find_by_id): Declare.
+ * frame.c (frame_find_by_id): New function.
+ (get_frame_id): New function.
+
+2002-06-10 Andrey Volkov <avolkov@transas.com>
+
+ * ser-e7kpc.c: Fix duplicated define and call of
+ _initialize_ser_e7000pc
+
+2002-06-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals/signals.c (target_signal_from_host): Fix #ifdef
+ SIGRTMIN case.
+ (do_target_signal_to_host): Likewise.
+
+2002-06-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * mips-tdep.c (mips_find_abi_section): New function.
+ (mips_gdbarch_init): Call it.
+
+2002-06-09 Mark Kettenis <kettenis@gnu.org>
+
+ * solib-svr4.c (init_fetch_link_map_offsets): Simply return
+ legacy_fetch_link_map_offsets. Adjust comment to reflect reality
+ after Andrew's 2002-06-08 gdbarch change.
+
+2002-06-09 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (suppy_gregset): Don't supply
+ I386_LINUX_ORIG_EAX_REGNUM if there isn't room for it in GDB's
+ register cache.
+ (fill_gregset): Don't fetch it under the same circumstances.
+
+2002-06-09 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (callback_h): Define.
+ (remote_sim_h): Update path to remote-sim.h.
+ (remote-rdp.o): Add $(callback_h).
+ (remote-sim.o): Use $(callback_h).
+ * remote-sim.c: Include "gdb/callback.h" and "gdb/remote-sim.h".
+ * remote-rdp.c: Include "gdb/callback.h".
+
+2002-06-09 Mark Kettenis <kettenis@gnu.org>
+
+ * osabi.h (gdb_osabi): Add GDB_OSABI_GO32 and GDB_OSABI_NETWARE.
+ * osabi.c (gdb_osabi_names): Add "DJGPP" and "NetWare".
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__.
+ * rdi-share/serpardr.c: Ditto.
+ * rdi-share/unixcomm.c: Ditto.
+ * rdi-share/serdrv.c: Ditto.
+ * rdi-share/hostchan.h: Ditto.
+ * rdi-share/hostchan.c: Ditto.
+ * rdi-share/host.h: Ditto.
+ * rdi-share/devsw.c: Ditto.
+
+ * objfiles.h: Change type of obj_private to void pointer.
+ * pa64solib.c: Update copyright. Don't include "assert.h", use
+ strcmp instead of STREQ, use LONGEST, do not use PTR
+ * somsolib.c: Ditto.
+
+ * config/djgpp/fnchange.lst: Fix problems with bfd/elf32-i386.c,
+ bfd/elf32-i386qnx.c, bfd/elf32-sh.c, bfd/elf32-sh64-nbsd.c,
+ bfd/elf64-sh64-nbsd.c bfd/elf64-sh64.c.
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (GET_SAVED_REGISTER): Delete macro definition.
+ (default_get_saved_register): Delete function.
+ * gdbarch.sh (GET_SAVED_REGISTER): Set default to
+ generic_unwind_get_saved_register.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (FRAME_CHAIN_VALID): Set default to
+ generic_func_frame_chain_valid.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * blockframe.c (generic_func_frame_chain_valid): Only check
+ PC_IN_CALL_DUMMY when generic dummy frames. Don't worry about
+ passing FP to PC_IN_CALL_DUMMY.
+ Fix PR gdb/360.
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (struct gdbarch_data): Add field init_p.
+ (register_gdbarch_data): Initialize init_p.
+ (gdbarch_data): Initialize data pointer using the init function.
+ (init_gdbarch_data): Delete function.
+ (gdbarch_update_p): Update.
+ (initialize_non_multiarch): Update.
+ (struct gdbarch): Add field initialized_p.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-06-07 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (x86_64_fxsave_offset): New.
+ (supply_fpregset, fill_fpregset): Don't call i387_*_fxsave,
+ better do the things actually here.
+ * x86-64-tdep.c (x86_64_register_name2nr): New.
+ (x86_64_register_name): Renamed to x86_64_register_nr2name.
+ (x86_64_gdbarch_init): Respect the above change.
+ * x86-64-tdep.h (x86_64_register_name2nr)
+ (x86_64_register_nr2name): Add prototypes.
+ * config/i386/x86-64linux.mt (TDEPFILES): Remove i387-tdep.o.
+
+2002-06-06 Michael Snyder <msnyder@redhat.com>
+
+ * d10v-tdep.c (d10v_push_arguments): Handle struct_return.
+ Delete extra braces and re-indent.
+ (d10v_store_return_value): Char return values
+ must be shifted over by one byte in R0.
+ (d10v_extract_return_value): Delete extra braces, re-indent.
+
+2002-06-06 Elena Zannoni <ezannoni@redhat.com>
+
+ * d10v-tdep.c (d10v_read_sp, d10v_read_fp): Add prototype.
+ (d10v_register_virtual_type): Make $fp and $sp be pointer to data.
+ (d10v_integer_to_address): Rewrite.
+ (d10v_frame_init_saved_regs): When reading fp and sp registers use
+ the d10v specific functions which take care of converting to the
+ correct space.
+
+2002-06-06 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/djgpp/fnchange.lst: Add testsuite files altivec-abi.c,
+ altivec-abi.exp, altivec-regs.c, altivec-regs.exp.
+
+2002-06-02 Andrew Cagney <ac131313@redhat.com>
+
+ * config/alpha/nm-linux.h: Add "config/" prefix to tm, nm and xm
+ includes.
+ * config/tm-linux.h: Ditto.
+ * config/alpha/tm-alphalinux.h: Ditto.
+ * config/arm/nm-linux.h, config/arm/tm-linux.h: Ditto.
+ * config/arm/xm-nbsd.h, config/i386/nm-gnu.h: Ditto.
+ * config/i386/nm-i386lynx.h, config/i386/nm-i386sol2.h: Ditto.
+ * config/i386/nm-i386v4.h, config/i386/nm-i386v42mp.h: Ditto.
+ * config/i386/nm-linux.h, config/i386/nm-m3.h: Ditto.
+ * config/i386/nm-ptx4.h, config/i386/nm-x86-64.h: Ditto.
+ * config/i386/tm-i386gnu.h, config/i386/tm-i386lynx.h: Ditto.
+ * config/i386/tm-i386m3.h, config/i386/tm-i386sco5.h: Ditto.
+ * config/i386/tm-i386v4.h, config/i386/tm-linux.h: Ditto.
+ * config/i386/tm-ptx4.h, config/i386/tm-vxworks.h: Ditto.
+ * config/i386/xm-i386v4.h, config/i386/xm-nbsd.h: Ditto.
+ * config/i386/xm-ptx.h, config/i386/xm-ptx4.h: Ditto.
+ * config/i960/tm-vx960.h, config/ia64/nm-aix.h: Ditto.
+ * config/ia64/nm-linux.h, config/ia64/tm-aix.h: Ditto.
+ * config/ia64/tm-linux.h, config/ia64/xm-aix.h: Ditto.
+ * config/m68k/nm-linux.h, config/m68k/nm-m68klynx.h: Ditto.
+ * config/m68k/nm-sysv4.h, config/m68k/tm-linux.h: Ditto.
+ * config/m68k/tm-m68klynx.h, config/m68k/tm-m68kv4.h: Ditto.
+ * config/m68k/tm-sun2os4.h, config/m68k/tm-sun3os4.h: Ditto.
+ * config/m68k/tm-vx68.h, config/m68k/xm-m68kv4.h: Ditto.
+ * config/m68k/xm-nbsd.h, config/m88k/nm-delta88v4.h: Ditto.
+ * config/m88k/tm-delta88v4.h, config/m88k/xm-delta88v4.h: Ditto.
+ * config/mips/nm-irix5.h, config/mips/nm-linux.h: Ditto.
+ * config/mips/tm-linux.h, config/mips/tm-mips64.h: Ditto.
+ * config/mips/tm-mipsm3.h, config/mips/tm-mipsv4.h: Ditto.
+ * config/mips/tm-vxmips.h, config/mips/xm-irix5.h: Ditto.
+ * config/mips/xm-mipsv4.h, config/ns32k/xm-nbsd.h: Ditto.
+ * config/pa/nm-hppao.h, config/powerpc/nm-linux.h: Ditto.
+ * config/powerpc/tm-linux.h, config/powerpc/tm-vxworks.h: Ditto.
+ * config/powerpc/xm-aix.h, config/rs6000/nm-rs6000ly.h: Ditto.
+ * config/rs6000/tm-rs6000ly.h, config/rs6000/xm-aix4.h: Ditto.
+ * config/sh/tm-linux.h, config/sparc/nm-linux.h: Ditto.
+ * config/sparc/nm-sparclynx.h, config/sparc/nm-sun4sol2.h: Ditto.
+ * config/sparc/tm-linux.h, config/sparc/tm-sp64linux.h: Ditto.
+ * config/sparc/tm-sp64sim.h, config/sparc/tm-sparclynx.h: Ditto.
+ * config/sparc/tm-sun4os4.h, config/sparc/tm-sun4sol2.h: Ditto.
+ * config/sparc/tm-vxsparc.h, config/sparc/xm-sun4sol2.h: Ditto.
+
+2002-05-04 Aidan Skinner <aidan@velvet.net>
+
+ * ada-exp.tab.c: New file
+ * ada-exp.y: New file
+ * ada-lang.c: New file
+ * ada-lang.h: New file
+ * ada-lex.c: New file
+ * ada-lex.l: New file
+ * ada-tasks.c: New file
+ * ada-typeprint.c: New file
+ * ada-valprint.c: New file
+
+2002-06-02 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * ppcnbsd-tdep.c (ppcnbsd_init_abi): Don't set
+ use_struct_convention to ppc_sysv_abi_broken_use_struct_convention.
+
+2002-06-02 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/rs6000/aix4.mt (TDEPFILES): Use ppc-sysv-tdep.o
+ insetead of ppc-linux-tdep.o.
+ * config/rs6000/rs6000.mt (TDEPFILES): Likewise.
+ * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise.
+
+2002-06-02 Andrew Cagney <ac131313@redhat.com>
+
+ 2002-05-07 Christian Groessler <chris@groessler.org>
+ * z8k-tdep.c (z8k_print_register_hook): Fix display of 32 and 64
+ bit register contents for little endian hosts.
+
+2002-06-01 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Mention that any `HP/UX reader' can be changed by
+ any maintainer.
+
+2002-06-01 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.h: Regenerate.
+
+2002-06-01 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Add everyone to write-after-approval list.
+
+2002-06-01 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (frame_info): Use frame_register_unwind instead of
+ saved_regs. Mention when the SP is on the stack or in a register.
+
+ * frame.h (frame_register_unwind_ftype): Define. Document.
+ (struct frame_info): Add field register_unwind and
+ register_unwind_cache.
+ (frame_register_unwind): Declare.
+ (generic_unwind_get_saved_register): Declare.
+
+ * frame.c (frame_register_unwind): New function.
+ (generic_unwind_get_saved_register): New function.
+
+ * blockframe.c (generic_call_dummy_register_unwind): New function.
+ (frame_saved_regs_register_unwind): New function.
+ (set_unwind_by_pc): New function.
+ (create_new_frame): New function.
+ (get_prev_frame): New function.
+
+2002-05-30 Andrew Cagney <ac131313@redhat.com>
+
+ * a29k-share/: Delete directory.
+ * remote-vx29k.c: Delete file.
+
+2002-05-30 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/djgpp/fnchange.lst: Add ns32knbsd-nat.c, ns32knbsd-tdep.c,
+ ppcnbsd-nat.c, ppcnbsd-tdep.c, sparcnbsd-nat.c, and sparcnbsd-tdep.c.
+
+2002-05-30 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ALLDEPFILES): Add sparc64nbsd-nat.c,
+ sparcnbsd-nat.c, and sparcnbsd-tdep.c.
+ (sparc64nbsd-nat.o)
+ (sparcnbsd-nat.o)
+ (sparcnbsd-tdep.o): New dependency lists.
+ * NEWS: Note new UltraSPARC NetBSD native configuration.
+ * configure.host (sparc64-*-netbsd*): New host.
+ * configure.tgt (sparc-*-netbsdelf*)
+ (sparc-*-netbsd*): Set gdb_target to nbsd.
+ (sparc64-*-netbsd*): New target.
+ * sparc64nbsd-nat.c: New file.
+ * sparcnbsd-nat.c: New file.
+ * sparcnbsd-tdep.c: New file.
+ * sparcnbsd-tdep.h: New file.
+ * config/sparc/nbsd.mt: New file.
+ * config/sparc/nbsd64.mh: New file.
+ * config/sparc/nbsd64.mt: New file.
+ * config/sparc/nbsdaout.mh (NATDEPFILES): Remove corelow.o,
+ sparc-nat.o, and solib.o. Add sparcnbsd-nat.o.
+ (HOST_IPC): Remove.
+ * config/sparc/nbsdaout.mt: Remove.
+ * config/sparc/nbsdelf.mh (NATDEPFILES): Remove corelow.o,
+ sparc-nat.o, and solib.o. Add sparcnbsd-nat.o.
+ (HOST_IPC): Remove.
+ * config/sparc/nbsdelf.mt: Remove.
+ * config/sparc/nm-nbsd.h: Update copyright years. Remove all
+ sparc-nat.c compatiblity defines.
+ * config/sparc/tm-nbsd.h: Update copyright years. Include solib.h.
+ (GDB_MULTI_ARCH): Set to GDB_MULTI_ARCH_PARTIAL.
+ * config/sparc/tm-nbsd64.h: New file.
+ * config/sparc/tm-nbsdaout.h: Remove.
+ * config/sparc/xm-nbsd.h: Remove.
+
+2002-05-30 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (sparc-tdep.o): Add osabi.h to dependency list.
+ * sparc-tdep.c: Include osabi.h.
+ (gdbarch_tdep): Add osabi member.
+ (_initialize_sparc_tdep): Use gdbarch_register.
+ (sparc_gdbarch_init): Use generic OS ABI framework.
+ (sparc_dump_tdep): New function.
+
+2002-05-30 Kevin Buettner <kevinb@redhat.com>
+
+ * corefile.c (do_captured_read_memory_integer): Return non-zero
+ result.
+ (safe_read_memory_integer): Copy result of memory read when
+ status is non-zero. Also, add comments.
+
+2002-05-20 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ppc_tdep_h): Define.
+ (ppc-linux-nat.o)
+ (ppc-linux-tdep.o)
+ (rs6000-tdep.o): Use $(ppc_tdep_h).
+ (ppc-sysv-tdep.o)
+ (ppcnbsd-nat.o)
+ (ppcnbsd-tdep.o): New dependency lists.
+ * ppc-tdep.h: Use generic OS ABI framework.
+ * ppc-linux-tdep.c (_initialize_ppc_linux_tdep)
+ (ppc_linux_init_abi): New functions.
+ (ppc_sysv_abi_broken_use_struct_convention)
+ (ppc_sysv_abi_use_struct_convention)
+ (ppc_sysv_abi_push_arguments): Move to...
+ * ppc-sysv-tdep.c: ...here.
+ * ppcnbsd-nat.c: Don't include gdbcore.h and regcache.h.
+ * rs6000-tdep.c (process_note_abi_tag_sections)
+ (get_elfosabi): Remove.
+ (rs6000_gdbarch_init): Use generic OS ABI framework.
+ (rs6000_dump_tdep): New function.
+ (_initialize_rs6000_tdep): Use gdbarch_register.
+ * config/powerpc/linux.mt (TDEPFILES): Add ppc-sysv-tdep.o.
+ * config/powerpc/nbsd.mh (NATDEPFILES): Remove solib-legacy.o.
+ * config/powerpc/aix.mt (TDEPFILES): Use ppc-sysv-tdep.o instead
+ of ppc-linux-tdep.o.
+ * config/powerpc/nbsd.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise.
+ * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise.
+ * config/powerpc/vxworks.mt (TDEPFILES): Likewise.
+
+2002-05-29 Jim Blandy <jimb@redhat.com>
+
+ * macroscope.c (default_macro_scope): Put `void' in empty argument
+ list.
+
+2002-05-29 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (arch-utils.o): Add $(sim_regno_h).
+ * arch-utils.c: Include "sim-regno.h".
+ * gdbarch.sh: Don't include "sim-regno.h".
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * sim-regno.h (legacy_register_sim_regno): Move declaration from
+ here.
+ * arch-utils.h (legacy_register_sim_regno): To here.
+ * remote-sim.c (legacy_register_sim_regno): Move function from
+ here.
+ * arch-utils.c (legacy_register_sim_regno): To here.
+
+2002-05-28 Andrew Cagney <ac131313@redhat.com>
+
+ * sim-regno.h: New file.
+ * Makefile.in (sim_regno_h): Define.
+ (d10v-tdep.o, remote-sim.o): Add dependency on $(sim_regno_h).
+ * remote-sim.c: Include "sim-regno.h" and "gdb_assert.h".
+ (legacy_register_sim_regno): New function.
+ (one2one_register_sim_regno): New function.
+ (gdbsim_fetch_register): Rewrite.
+ (gdbsim_store_register): Only store a register when
+ REGISTER_SIM_REGNO is valid.
+ * d10v-tdep.c: Include "sim-regno.h".
+ (d10v_ts2_register_sim_regno): Add legacy_regiter_sim_regno check.
+ (d10v_ts3_register_sim_regno): Ditto.
+ * gdbarch.sh: Include "sim-regno.h".
+ (REGISTER_SIM_REGNO): Set default to legacy_register_sim_regno.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * arch-utils.h (default_register_sim_regno): Delete declaration.
+ * arch-utils.c (default_register_sim_regno): Delete function.
2002-05-28 Jason Thorpe <thorpej@wasabisystems.com>
@@ -620,12 +4775,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke <joern.rennecke@superh.com>
* hpread.c (hpread_read_struct_type): Remove assignments to args.
(fixup_class_method_type): Likewise.
-2002-05-15 Daniel Jacobowitz <drow@mvista.com>
-
- From Martin Pool <mbp@samba.org>:
- * gdbserver/server.c (gdbserver_usage): New function.
- (main): Call it.
-
2002-05-15 Jim Blandy <jimb@redhat.com>
Add macro structures to GDB's symbol tables. Nobody puts anything
@@ -664,11 +4813,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke <joern.rennecke@superh.com>
* arm-linux-tdep.c (ARM_LINUX_JB_PC): Renamed from JB_PC.
(ARM_LINUX_JB_ELEMENT_SIZE): Likewise.
-2002-05-14 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/mem-break.c (reinsert_breakpoint_by_bp): Correct typo
- stop_at -> stop_pc.
-
2002-05-14 Andrew Cagney <ac131313@redhat.com>
* regcache.c (register_valid): Revise comments refering to "Not
@@ -1523,7 +5667,6 @@ Fri May 17 14:26:19 2002 J"orn Rennecke <joern.rennecke@superh.com>
* remote-eb.c: Delete.
* remote-adapt.c: Delete.
* Makefile.in: Remove obsolete code.
- * gdbserver/Makefile.in: Ditto.
* config/s390/s390x.mt: Ditto.
* config/s390/s390.mt: Ditto.
* config/sparc/sparclynx.mh: Ditto.
@@ -1706,7 +5849,7 @@ Fri May 17 14:26:19 2002 J"orn Rennecke <joern.rennecke@superh.com>
2002-04-24 Pierre Muller <ics.u-strasbg.fr>
* hpread.c (hpread_psymtab_to_symtab_1,
- hpread_psymtab_to_symtab): Replace fprintf (stderr,...)
+ hpread_psymtab_to_symtab): Replace fprintf tab_to_s...)
with fprintf_unfiltered (gdb_stderr,...).
2002-04-24 Pierre Muller <ics.u-strasbg.fr>
@@ -2038,13 +6181,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
* i386-linux-tdep.c: Update comments.
* breakpoint.c (bpstat_what): Update comment.
-2002-04-24 Michal Ludvig <mludvig@suse.cz>
-
- * gdbserver/linux-low.c (regsets_fetch_inferior_registers),
- (regsets_store_inferior_registers): Removed cast to int from
- ptrace() calls.
- * gdbserver/regcache.h: Added declaration of struct inferior_info.
-
2002-04-24 David S. Miller <davem@redhat.com>
* i960-tdep.c (register_in_window_p): New function.
@@ -2391,55 +6527,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
sorted in most most-recent-used order. Document.
* gdbarch.h, gdbarch.c: Regenerate.
-2002-04-20 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/inferiors.c (struct inferior_info): Add regcache_data.
- (add_inferior): Call create_register_cache.
- (clear_inferiors): Call free_register_cache.
- (inferior_regcache_data, set_inferior_regcache_data): New functions.
- * gdbserver/regcache.c (struct inferior_regcache_data): New.
- (registers): Remove.
- (get_regcache): New function.
- (create_register_cache, free_register_cache): New functions.
- (set_register_cache): Don't initialize the register cache here.
- (registers_to_string, registers_from_string, register_data): Call
- get_regcache.
- * gdbserver/regcache.h: Add prototypes.
- * gdbserver/server.h: Likewise.
-
-2002-04-20 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/mem-break.c: New file.
- * gdbserver/mem-break.h: New file.
- * gdbserver/Makefile.in: Add mem-break.o rule; update server.h
- dependencies.
- * gdbserver/inferiors.c (struct inferior_info): Add target_data
- member.
- (clear_inferiors): Free target_data member if set.
- (inferior_target_data, set_inferior_target_data): New functions.
- * gdbserver/linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
- (i386_stop_pc, i386_set_pc): New. Add to the_low_target.
- * gdbserver/linux-low.c (linux_bp_reinsert): New variable.
- (struct inferior_linux_data): New.
- (linux_create_inferior): Use set_inferior_target_data.
- (linux_attach): Likewise. Call add_inferior.
- (linux_wait_for_one_inferior): New function.
- (linux_wait): Call it.
- (linux_write_memory): Add const.
- (initialize_low): Call set_breakpoint_data.
- * gdbserver/linux-low.h (struct linux_target_ops): Add breakpoint
- handling members.
- * gdbserver/server.c (attach_inferior): Remove extra add_inferior
- call.
- * gdbserver/server.h: Include mem-break.h. Update inferior.c
- prototypes.
- * gdbserver/target.c (read_inferior_memory)
- (write_inferior_memory): New functions.
- * gdbserver/target.h (read_inferior_memory)
- (write_inferior_memory): Change macros to prototypes.
- (struct target_ops): Update comments. Add const to write_memory
- definition.
-
2002-04-19 Andrew Cagney <ac131313@redhat.com>
* sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame
@@ -2641,11 +6728,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
2002-04-11 Daniel Jacobowitz <drow@mvista.com>
- * gdbserver/linux-low.c (usr_store_inferior_registers): Support
- registers which are allowed to fail to store.
- * gdbserver/linux-low.h (linux_target_ops): Likewise.
- * gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR.
- (ppc_cannot_store_register): FPSCR may not be storable.
* regformats/reg-ppc.dat: Support FPSCR.
2002-04-11 Kevin Buettner <kevinb@redhat.com>
@@ -2721,88 +6803,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
* server.h (look_up_one_symbol): Add prototype.
* target.h (struct target_ops): Add look_up_symbols hook.
-2002-04-09 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/server.h: Include <string.h> if HAVE_STRING_H.
- * ChangeLog: Correct paths in last ChangeLog entry.
-
-2002-04-09 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/linux-low.h: Remove obsolete prototypes.
- (struct linux_target_ops): New.
- (extern the_low_target): New.
- * gdbserver/linux-low.c (num_regs, regmap): Remove declarations.
- (register_addr): Use the_low_target explicitly.
- (fetch_register): Likewise.
- (usr_fetch_inferior_registers): Likewise.
- (usr_store_inferior_registers): Likewise.
- * gdbserver/linux-arm-low.c (num_regs): Remove.
- (arm_num_regs): Define.
- (arm_regmap): Renamed from regmap, made static.
- (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (arm_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-i386-low.c (num_regs): Remove.
- (i386_num_regs): Define.
- (i386_regmap): Renamed from regmap, made static.
- (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (i386_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-ia64-low.c (num_regs): Remove.
- (ia64_num_regs): Define.
- (ia64_regmap): Renamed from regmap, made static.
- (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (ia64_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-m68k-low.c (num_regs): Remove.
- (m68k_num_regs): Define.
- (m68k_regmap): Renamed from regmap, made static.
- (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (m68k_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-mips-low.c (num_regs): Remove.
- (mips_num_regs): Define.
- (mips_regmap): Renamed from regmap, made static.
- (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (mips_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-ppc-low.c (num_regs): Remove.
- (ppc_num_regs): Define.
- (ppc_regmap): Renamed from regmap, made static.
- (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (ppc_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-s390-low.c (num_regs): Remove.
- (s390_num_regs): Define.
- (s390_regmap): Renamed from regmap, made static.
- (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (s390_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-sh-low.c (num_regs): Remove.
- (sh_num_regs): Define.
- (sh_regmap): Renamed from regmap, made static.
- (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
- made static.
- (sh_cannot_store_register): Renamed from cannot_store_register,
- made static.
- (the_low_target): New.
- * gdbserver/linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
- (the_low_target): New.
-
2002-04-09 Andrew Cagney <ac131313@redhat.com>
* frame.c (read_relative_register_raw_bytes_for_frame): Do not
@@ -2816,71 +6816,6 @@ Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
- * gdbserver/Makefile.in: Add stamp-h target.
- * gdbserver/configure.in: Create stamp-h.
- * gdbserver/configure: Regenerated.
-
-2002-04-09 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/inferiors.c: New file.
- * gdbserver/target.c: New file.
- * gdbserver/target.h: New file.
- * gdbserver/Makefile.in: Add target.o and inferiors.o. Update
- dependencies.
- * gdbserver/linux-low.c (inferior_pid): New static variable,
- moved from server.c.
- (linux_create_inferior): Renamed from create_inferior.
- Call add_inferior. Return 0 on success instead of a PID.
- (linux_attach): Renamed from myattach.
- (linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
- (linux_thread_alive): Renamed from mythread_alive.
- (linux_wait): Renamed from mywait. Call clear_inferiors () if the
- child dies.
- (linux_resume): Renamed from myresume. Add missing ``return 0''.
- (regsets_store_inferior_registers): Correct error message.
- Add missing ``return 0''.
- (linux_fetch_registers): Renamed from fetch_inferior_registers.
- (linux_store_registers): Renamed from store_inferior_registers.
- (linux_read_memory): Renamed from read_inferior_memory.
- (linux_write_memory): Renamed from write_inferior_memory.
- (linux_target_ops): New structure.
- (initialize_low): Call set_target_ops ().
- * gdbserver/remote-utils.c (unhexify): New function.
- (hexify): New function.
- (input_interrupt): Send signals to ``signal_pid''.
- * gdbserver/server.c (inferior_pid): Remove.
- (start_inferior): Update create_inferior call.
- (attach_inferior): Call add_inferior.
- (handle_query): New function.
- (main): Call handle_query for `q' packets.
- * gdbserver/server.h: Include "target.h". Remove obsolete prototypes.
- Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
-
-2002-04-09 Daniel Jacobowitz <drow@mvista.com>
-
- * gdbserver/Makefile.in: Add WARN_CFLAGS. Update configury
- dependencies.
- * gdbserver/configure.in: Check for <string.h>
- * gdbserver/configure: Regenerate.
- * gdbserver/config.in: Regenerate.
- * gdbserver/gdbreplay.c: Include needed system headers.
- (remote_open): Remove strchr prototype.
- * gdbserver/linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
- * gdbserver/regcache.c (supply_register): Change buf argument to const void *.
- (supply_register_by_name): Likewise.
- (collect_register): Change buf argument to void *.
- (collect_register_by_name): Likewise.
- * gdbserver/regcache.h: Add missing prototypes.
- * gdbserver/remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
- * gdbserver/server.c (handle_query): New function.
- (attached): New static variable, moved out of main.
- (main): Quiet longjmp clobber warnings.
- * gdbserver/server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
- * gdbserver/utils.c (error): Remove NORETURN.
- (fatal): Likewise.
-
-2002-04-09 Daniel Jacobowitz <drow@mvista.com>
-
* symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer
after the last symbol in a block.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 8b80d417c6e..212007e5b70 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -47,7 +47,7 @@ fix, since such a change without discussion will result in
instantaneous and loud complaints.
-Target/Architecture:
+Target Instruction Set Architectures:
Generic ISA (Instruction Set Architecture) issues, API variants, CPU
variants. *-tdep.c. The Target/Architecture maintainer works with the
@@ -56,14 +56,12 @@ maintainer works with the native maintainer when resolving API issues.
a29k Deleted.
- alpha --target=alpha-dec-osf4.0a -Werror
+ alpha --target=alpha-elf -Werror
Maintenance only
- arc --target=arc-elf ,-Werror
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ arc (--target=arc-elf OBSOLETE)
- arm --target=arm-elf -w
+ arm --target=arm-elf ,
Fernando Nasser fnasser@redhat.com
Scott Bambrough scottb@netwinder.org
Richard Earnshaw rearnsha@arm.com
@@ -72,22 +70,15 @@ maintainer works with the native maintainer when resolving API issues.
avr --target=avr ,-Werror
Theodore A. Roth troth@verinet.com
- cris --target=cris-elf -w
+ cris --target=cris-elf ,-Werror
Orjan Friberg orjanf@axis.com
d10v --target=d10v-elf ,-Werror
Maintenance only
- d30v --target=d30v-elf ,-Werror
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ d30v (--target=d30v-elf OBSOLETE)
- djgpp --target=i586-pc-msdosdjgpp ,-Werror
- (See native and host)
-
- fr30 --target=fr30-elf -Werror
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ fr30 (--target=fr30-elf OBSOLETE)
h8300 --target=h8300hms -Werror
Maintenance only
@@ -97,37 +88,31 @@ maintainer works with the native maintainer when resolving API issues.
Maintenance only
Not multi-arch, work in progress
- i386 --target=i386-elf,i386-aout ,-Werror
+ i386 --target=i386-elf ,-Werror
Mark Kettenis kettenis@gnu.org
- i960 --target=i960-coff ,-Werror
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ i960 (--target=i960-coff OBSOLETE)
- ia64 --target=ia64-linux ,-Werror
+ ia64 --target=ia64-linux-gnu ,-Werror
+ (--target=ia64-elf broken)
Kevin Buettner kevinb@redhat.com
- m32r --target=m32r-elf -Werror
+ m32r (--target=m32r-elf broken)
Michael Snyder msnyder@redhat.com
- Not multi-arch
+ OBSOLETE candidate, not multi-arch
- m68hc11 --target=m68hc11-elf ,-Werror
+ m68hc11 --target=m68hc11-elf ,-Werror ,
Stephane Carrez stcarrez@nerim.fr
m68k --target=m68k-elf ,-Werror
Maintenance only
- OBSOLETE candidate, not multi-arch
- m88k --target=m88k ,-Werror
- Known problem in 5.1
- Maintenance only
- OBSOLETE candidate, not multi-arch
+ m88k (--target=m88k OBSOLETE)
- mcore --target=mcore-elf,mcore-pe ,-Werror
+ mcore --target=mcore-elf ,-Werror
Maintenance only
- OBSOLETE candidate, not multi-arch
- mips --target=mips-elf,mips64-elf ,-Werror
+ mips --target=mips-elf ,-Werror
Andrew Cagney cagney@redhat.com
mn10200 --target=mn10200-elf ,-Werror
@@ -140,23 +125,20 @@ maintainer works with the native maintainer when resolving API issues.
ns32k --target=ns32k-netbsd ,-Werror
Maintenance only
- pa (--target=hppa1.1-hp-proelf broken)
+ pa (--target=hppa-elf broken)
Maintenance only
OBSOLETE candidate, not multi-arch
powerpc --target=powerpc-eabi ,-Werror
Kevin Buettner kevinb@redhat.com
- rs6000 --target=rs6000-ibm-aix4.1 ,-Werror
- (see rs6000 native and ppc target)
-
- s390 --target=s390-linux ,-Werror
+ s390 --target=s390-linux-gnu ,-Werror
(contact DJ Barrow djbarrow@de.ibm.com)
sh --target=sh-elf ,-Werror
Elena Zannoni ezannoni@redhat.com
- sparc --target=sparc-elf,sparc64-elf ,-Werror
+ sparc --target=sparc-elf ,-Werror
Maintenance only
tic80 Deleted.
@@ -164,12 +146,12 @@ maintainer works with the native maintainer when resolving API issues.
v850 --target=v850-elf ,-Werror
Maintenance only
- vax --target=vax-dec-vms5.5 ,-Werror
+ vax --target=vax-netbsd ,-Werror
Maintenance only
w65 Deleted.
- x86-64 (--target=x86_64-linux-gnu broken)
+ x86-64 --target=x86_64-linux-gnu ,-Werror
Maintenance only
xstormy16 --target=xstormy16-elf ,-Werror
@@ -210,11 +192,15 @@ b loop
p
'
-can be used to generate a complete list of --target=
---enable-gdb-build-warnings= pairs of the form:
+can be used to generate a list of buildable targets. The list
+containing values for the configure options --target=,
+--enable-gdb-build-warnings= and optionally
+--enable-sim-build-warnings vis:
arc-elf ,-Werror
...
+ m68hc11-elf ,-Werror ,
+ ...
hppa1.1-hp-proelf broken
...
@@ -282,6 +268,8 @@ generic symtabs Jim Blandy jimb@redhat.com
linespec Jim Blandy jimb@redhat.com
Elena Zannoni ezannoni@redhat.com
Fernando Nasser fnasser@redhat.com
+ HP/UX readers Any [past] maintainer can modify this.
+ Please send tricky ones to the symtabs maintainers.
tracing bytecode stuff Jim Blandy jimb@redhat.com
tracing Michael Snyder msnyder@redhat.com
@@ -348,6 +336,8 @@ Makefile.in, configure* ALL
mmalloc/ ALL Host maintainers
+NEWS ALL
+
sim/ See sim/MAINTAINERS
readline/ Master version: ftp://ftp.cwru.edu/pub/bash/
@@ -364,16 +354,34 @@ To get recommended for the Write After Approval list you need a valid
FSF assignment and have submitted one good patch.
David Anderson davea@sgi.com
+Scott Bambrough scottb@netwinder.org
+Jim Blandy jimb@redhat.com
Philip Blundell philb@gnu.org
+Per Bothner per@bothner.com
Joel Brobecker brobecker@act-europe.fr
+Dave Brolley brolley@redhat.com
+Kevin Buettner kevinb@redhat.com
+Andrew Cagney ac131313@redhat.com
+David Carlton carlton@math.stanford.edu
+Stephane Carrez stcarrez@nerim.fr
+Michael Chastain mec@shout.net
+Eric Christopher echristo@redhat.com
Nick Clifton nickc@redhat.com
+Philippe De Muyter phdm@macqel.be
Chris G. Demetriou cgd@broadcom.com
Klee Dienes kdienes@apple.com
+DJ Delorie dj@redhat.com
Richard Earnshaw rearnsha@arm.com
+Frank Ch. Eigler fche@redhat.com
+Ben Elliston bje@redhat.com
+Anthony Green green@redhat.com
Matthew Green mrg@eterna.com.au
+Chris Faylor cgf@redhat.com
+Fred Fish fnf@ninemoons.com
Orjan Friberg orjanf@axis.com
Ben Harris bjh21@netbsd.org
Richard Henderson rth@redhat.com
+Aldy Hernandez aldyh@redhat.com
Paul Hilfinger hilfinger@gnat.com
Matt Hiller hiller@redhat.com
Kazu Hirata kazu@hxi.com
@@ -384,33 +392,45 @@ Jim Ingham jingham@apple.com
Daniel Jacobowitz dan@debian.org
Andreas Jaeger aj@suse.de
Geoff Keating geoffk@redhat.com
+Mark Kettenis kettenis@gnu.org
Jim Kingdon jkingdon@engr.sgi.com ++
+Jeff Law law@redhat.com
Jonathan Larmour jlarmour@redhat.co.uk
+Robert Lipe rjl@sco.com
H.J. Lu hjl@lucon.org
+Michal Ludvig mludvig@suse.cz
Glen McCready gkm@redhat.com
Greg McGary greg@mcgary.org
Jason Merrill jason@redhat.com
+David S. Miller davem@redhat.com
Jason Molenda jmolenda@apple.com
Pierre Muller muller@sources.redhat.com
+Fernando Nasser fnasser@redhat.com
+David O'Brien obrien@freebsd.org
Alexandre Oliva aoliva@redhat.com
Tom Rix trix@redhat.com
Theodore A. Roth troth@verinet.com
+Ian Roxborough irox@redhat.com
+Grace Sainsbury graces@redhat.com
Mark Salter msalter@redhat.com
+Peter Schauer Peter.Schauer@regent
Andreas Schwab schwab@suse.de
Keith Seitz keiths@redhat.com
+Aidan Skinner aidan@velvet.net
Jiri Smid smid@suse.cz
David Smith dsmith@redhat.com
Stephen P. Smith ischis2@home.com
Jackie Smith Cashion jsmith@redhat.com
+Stan Shebs shebs@apple.com
+Michael Snyder msnyder@redhat.com
Petr Sorfa petrs@caldera.com
Gary Thomas gthomas@redhat.com
Jason Thorpe thorpej@wasabisystems.com
Tom Tromey tromey@redhat.com
Corinna Vinschen vinschen@redhat.com
Keith Walker keith.walker@arm.com
-Michal Ludvig mludvig@suse.cz
-David S. Miller davem@redhat.com
-Eric Christopher echristo@redhat.com
+Elena Zannoni ezannoni@redhat.com
+Eli Zaretskii eliz@gnu.org
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 64b76f01623..756ffdf4074 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -79,6 +79,11 @@ VPATH = @srcdir@
YACC=@YACC@
+# This is used to rebuild ada-lex.c from ada-lex.l. If the program is
+# not defined, but ada-lex.c is present, compilation will continue,
+# possibly with a warning.
+FLEX = flex
+
YLWRAP = $(srcdir)/../ylwrap
# where to find makeinfo, preferably one designed for texinfo-2
@@ -137,11 +142,11 @@ INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC)
# CLI sub directory definitons
#
SUBDIR_CLI_OBS = \
- cli-dump.o cli-decode.o \
- cli-interp.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o
+ cli-dump.o \
+ cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o
SUBDIR_CLI_SRCS = \
- cli/cli-dump.c cli/cli-decode.c \
- cli/cli-interp.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
+ cli/cli-dump.c \
+ cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
cli/cli-utils.c
SUBDIR_CLI_DEPS =
SUBDIR_CLI_INITS = \
@@ -159,13 +164,13 @@ 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-cmd-disas.o mi-events.o mi-interp.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-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
- mi/mi-cmd-disas.c mi/mi-events.c mi/mi-interp.c \
+ mi/mi-cmd-disas.c \
mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
SUBDIR_MI_DEPS =
SUBDIR_MI_INITS = \
@@ -211,7 +216,9 @@ SUBDIR_TUI_UNINSTALL=
# in INCLUDE_DIR.
# Where is the "-lopcodes" library, with (some of) the opcode tables and
# disassemblers?
-OPCODES = ../opcodes/libopcodes.a
+OPCODES_DIR = ../opcodes
+OPCODES_SRC = $(srcdir)/$(OPCODES_DIR)
+OPCODES = $(OPCODES_DIR)/libopcodes.a
# Where are the other opcode tables which only have header file
# versions?
OP_INCLUDE = $(INCLUDE_DIR)/opcode
@@ -312,7 +319,7 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
# your system doesn't have fcntl.h in /usr/include (which is where it
# should be according to Posix).
DEFS = @DEFS@
-GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config $(DEFS)
+GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(prefix)/share/locale\"" $(DEFS)
# M{H,T}_CFLAGS, if defined, have host- and target-dependent CFLAGS
# from the config directory.
@@ -339,6 +346,7 @@ INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
+LDFLAGS = @LDFLAGS@
# Profiling options need to go here to work.
# I think it's perfectly reasonable for a user to set -pg in CFLAGS
@@ -423,9 +431,6 @@ FLAGS_TO_PASS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
- "CHILLFLAGS=$(CHILLFLAGS)" \
- "CHILL=$(CHILL)" \
- "CHILL_LIB=$(CHILL_LIB)" \
"CXX=$(CXX)" \
"CXXFLAGS=$(CXXFLAGS)" \
"DLLTOOL=$(DLLTOOL)" \
@@ -475,25 +480,25 @@ CXX_FOR_TARGET = ` \
fi; \
fi`
-CHILLFLAGS = $(CFLAGS)
-CHILL = gcc
-CHILL_FOR_TARGET = ` \
- if [ -f $${rootme}/../gcc/Makefile ] ; then \
- echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../gcc/ch/runtime/; \
- else \
- if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
- echo $(CC); \
- else \
- t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
- fi; \
- fi`
-CHILL_LIB = ` \
- if [ -f $${rootme}/../gcc/ch/runtime/libchill.a ] ; then \
- echo $${rootme}/../gcc/ch/runtime/chillrt0.o \
- $${rootme}/../gcc/ch/runtime/libchill.a; \
- else \
- echo -lchill; \
- fi`
+# OBSOLETE CHILLFLAGS = $(CFLAGS)
+# OBSOLETE CHILL = gcc
+# OBSOLETE CHILL_FOR_TARGET = ` \
+# OBSOLETE if [ -f $${rootme}/../gcc/Makefile ] ; then \
+# OBSOLETE echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../gcc/ch/runtime/; \
+# OBSOLETE else \
+# OBSOLETE if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+# OBSOLETE echo $(CC); \
+# OBSOLETE else \
+# OBSOLETE t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
+# OBSOLETE fi; \
+# OBSOLETE fi`
+# OBSOLETE CHILL_LIB = ` \
+# OBSOLETE if [ -f $${rootme}/../gcc/ch/runtime/libchill.a ] ; then \
+# OBSOLETE echo $${rootme}/../gcc/ch/runtime/chillrt0.o \
+# OBSOLETE $${rootme}/../gcc/ch/runtime/libchill.a; \
+# OBSOLETE else \
+# OBSOLETE echo -lchill; \
+# OBSOLETE fi`
# The use of $$(x_FOR_TARGET) reduces the command line length by not
# duplicating the lengthy definition.
@@ -504,10 +509,6 @@ TARGET_FLAGS_TO_PASS = \
'CC=$$(CC_FOR_TARGET)' \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
- "CHILLFLAGS=$(CHILLFLAGS)" \
- 'CHILL=$$(CHILL_FOR_TARGET)' \
- "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
- "CHILL_LIB=$(CHILL_LIB)" \
'CXX=$$(CXX_FOR_TARGET)' \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
"CXXFLAGS=$(CXXFLAGS)" \
@@ -523,9 +524,10 @@ TARGET_FLAGS_TO_PASS = \
# Links made at configuration time should not be specified here, since
# SFILES is used in building the distribution archive.
-SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
+SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
+ ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \
- ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \
+ coffread.c \
complaints.c completer.c corefile.c cp-valprint.c dbxread.c \
demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \
event-loop.c event-top.c \
@@ -533,18 +535,18 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
findvar.c regcache.c gdbarch.c arch-utils.c gdbtypes.c osabi.c \
inf-loop.c infcmd.c inflow.c infrun.c language.c \
kod.c kod-cisco.c \
- ui-out.c cli-out.c interps.c \
+ ui-out.c cli-out.c \
varobj.c wrapper.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \
macrotab.c macroexp.c macrocmd.c macroscope.c \
- printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \
+ printcmd.c remote.c scm-exp.c scm-lang.c \
scm-valprint.c source.c stabsread.c stack.c symfile.c \
symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \
typeprint.c utils.c valarith.c valops.c valprint.c values.c \
- serial.c ser-unix.c mdebugread.c os9kread.c \
+ serial.c ser-unix.c mdebugread.c \
tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \
tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \
tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \
@@ -565,14 +567,27 @@ LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
# (Why would we not want to depend on them? If one of these changes in a
# non-binary-compatible way, it is a real pain to remake the right stuff
# without these dependencies -kingdon, 13 Mar 1994)
+aout_aout64_h = $(INCLUDE_DIR)/aout/aout64.h
+aout_stabs_gnu_h = $(INCLUDE_DIR)/aout/stabs_gnu.h
getopt_h = $(INCLUDE_DIR)/getopt.h
floatformat_h = $(INCLUDE_DIR)/floatformat.h
bfd_h = $(BFD_DIR)/bfd.h
+callback_h = $(INCLUDE_DIR)/gdb/callback.h
+coff_sym_h = $(INCLUDE_DIR)/coff/sym.h
+coff_symconst_h = $(INCLUDE_DIR)/coff/symconst.h
+coff_ecoff_h = $(INCLUDE_DIR)/coff/ecoff.h
dis_asm_h = $(INCLUDE_DIR)/dis-asm.h
-remote_sim_h = $(INCLUDE_DIR)/remote-sim.h
+elf_sh_h = $(INCLUDE_DIR)/elf/sh.h
+elf_bfd_h = $(BFD_SRC)/elf-bfd.h
+libaout_h = $(BFD_SRC)/libaout.h
+remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h
demangle_h = $(INCLUDE_DIR)/demangle.h
obstack_h = $(INCLUDE_DIR)/obstack.h
-sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h
+opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.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
+gdb_sim_sh_h = $(INCLUDE_DIR)/gdb/sim-sh.h
splay_tree_h = $(INCLUDE_DIR)/splay-tree.h
readline_headers = \
@@ -581,95 +596,175 @@ readline_headers = \
$(READLINE_SRC)/keymaps.h \
$(READLINE_SRC)/readline.h
-udiheaders = \
- $(srcdir)/29k-share/udi/udiproc.h \
- $(srcdir)/29k-share/udi/udiphcfg.h \
- $(srcdir)/29k-share/udi/udiphunix.h \
- $(srcdir)/29k-share/udi/udiptcfg.h \
- $(srcdir)/29k-share/udi/udipt29k.h \
- $(srcdir)/29k-share/udi/udisoc.h
-
xm_h = @xm_h@
tm_h = @tm_h@
nm_h = @nm_h@
-alpha_tdep_h = alpha-tdep.h osabi.h
-annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
-arch_utils_h = arch-utils.h
-arm_tdep_h = arm-tdep.h osabi.h
-ax_h = ax.h $(doublest_h)
-bcache_h = bcache.h
+#
+# gdb/ header files
+#
+
+acconfig_h = acconfig.h
+ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h)
+alpha_tdep_h = alpha-tdep.h $(osabi_h)
+alphabsd_tdep_h = alphabsd-tdep.h
+annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
+arch_utils_h = arch-utils.h
+arm_tdep_h = arm-tdep.h $(osabi_h)
+ax_gdb_h = ax-gdb.h
+ax_h = ax.h $(doublest_h)
+bcache_h = bcache.h
+breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h)
+buildsym_h = buildsym.h
builtin_regs_h = builtin-regs.h
-breakpoint_h = breakpoint.h $(frame_h) $(value_h)
-buildsym_h = buildsym.h
-c_lang_h = c-lang.h $(value_h) $(macroexp_h)
-call_cmds_h = call-cmds.h
-cli_cmds_h = $(srcdir)/cli/cli-cmds.h
-cli_decode_h = $(srcdir)/cli/cli-decode.h $(command_h)
-cli_dump_h = $(srcdir)/cli/cli-dump.h
-cli_out_h = cli-out.h
-cli_script_h = $(srcdir)/cli/cli-script.h
-cli_setshow_h = $(srcdir)/cli/cli-setshow.h
-cli_utils_h = $(srcdir)/cli/cli-utils.h
-command_h = command.h
-complaints_h = complaints.h
-completer_h = completer.h
-cp_abi_h = cp-abi.h
-dcache_h = dcache.h
-defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h \
- gdbarch.h ui-file.h $(INCLUDE_DIR)/gdb/signals.h
-doublest_h = doublest.h $(floatformat_h)
-dwarf2cfi_h = dwarf2cfi.h
-event_loop_h = event-loop.h
-event_top_h = event-top.h
-expression_h = expression.h $(doublest_h) $(symtab_h)
-frame_h = frame.h
-gdb_h = gdb.h
-gdb_assert_h = gdb_assert.h
-gdb_events_h = gdb-events.h
-gdb_stabs_h = gdb-stabs.h
-gdb_string_h = gdb_string.h
-gdb_wait_h = gdb_wait.h
-gdb_regex_h = gdb_regex.h
-gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h)
-gdbcore_h = gdbcore.h $(bfd_h)
-gdbthread_h = gdbthread.h $(breakpoint_h)
-gdbtypes_h = gdbtypes.h
-inf_loop_h = inf-loop.h
-inferior_h = inferior.h $(breakpoint_h)
-interps_h = interps.h
-language_h = language.h
-linespec_h = linespec.h
-macroexp_h = macroexp.h
-macrotab_h = macrotab.h $(obstack_h) $(bcache_h)
-macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
-memattr_h = memattr.h
-monitor_h = monitor.h
-objfiles_h = objfiles.h
-parser_defs_h = parser-defs.h $(doublest_h)
-regcache_h = regcache.h
-remote_h = remote.h
-remote_utils_h = remote-utils.h $(target_h)
-ser_unix_h = ser-unix.h
-serial_h = serial.h
-sh_tdep_h = sh-tdep.h osabi.h
-solist_h = solist.h
-source_h = source.h
-stabsread_h = stabsread.h
-symfile_h = symfile.h
-symtab_h = symtab.h $(bcache_h)
-target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
-terminal_h = terminal.h
-top_h = top.h
-tracepoint_h = tracepoint.h
-typeprint_h = typeprint.h
-ui_out_h = ui-out.h
-valprint_h = valprint.h
-value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) $(doublest_h)
-varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
-version_h = version.h
-wrapper_h = wrapper.h
-xcoffsolib_h = xcoffsolib.h
+c_lang_h = c-lang.h $(value_h) $(macroexp_h)
+call_cmds_h = call-cmds.h
+ch_lang_h = ch-lang.h
+cli_out_h = cli-out.h
+coff_solib_h = coff-solib.h
+command_h = command.h
+complaints_h = complaints.h
+completer_h = completer.h
+cp_abi_h = cp-abi.h
+dcache_h = dcache.h
+defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \
+ $(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \
+ $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h) $(arch_utils_h)
+doublest_h = doublest.h $(floatformat_h)
+dst_h = dst.h
+dwarf2cfi_h = dwarf2cfi.h
+environ_h = environ.h
+event_loop_h = event-loop.h
+event_top_h = event-top.h
+expression_h = expression.h $(symtab_h) $(doublest_h)
+f_lang_h = f-lang.h
+frame_h = frame.h
+gdb_events_h = gdb-events.h
+gdb_stabs_h = gdb-stabs.h
+gdb_h = gdb.h
+gdb_assert_h = gdb_assert.h
+gdb_dirent_h = gdb_dirent.h
+gdb_locale_h = gdb_locale.h
+gdb_obstack_h = gdb_obstack.h $(obstack_h)
+gdb_proc_service_h = gdb_proc_service.h $(gregset_h)
+gdb_regex_h = gdb_regex.h $(xregex_h)
+gdb_stat_h = gdb_stat.h
+gdb_string_h = gdb_string.h
+gdb_thread_db_h = gdb_thread_db.h
+gdb_vfork_h = gdb_vfork.h
+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)
+gdbtypes_h = gdbtypes.h
+gnu_nat_h = gnu-nat.h
+gregset_h = gregset.h
+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)
+jv_lang_h = jv-lang.h
+kod_h = kod.h
+language_h = language.h
+linespec_h = linespec.h
+m2_lang_h = m2-lang.h
+macroexp_h = macroexp.h
+macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
+macrotab_h = macrotab.h
+memattr_h = memattr.h
+minimon_h = minimon.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)
+objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h)
+ocd_h = ocd.h
+osabi_h = osabi.h
+p_lang_h = p-lang.h
+pa64solib_h = pa64solib.h
+parser_defs_h = parser-defs.h $(doublest_h)
+ppc_tdep_h = ppc-tdep.h $(osabi_h)
+ppcnbsd_tdep_h = ppcnbsd-tdep.h
+proc_utils_h = proc-utils.h
+regcache_h = regcache.h
+remote_utils_h = remote-utils.h $(target_h)
+remote_h = remote.h
+scm_lang_h = scm-lang.h $(scm_tags_h)
+scm_tags_h = scm-tags.h
+ser_unix_h = ser-unix.h
+serial_h = serial.h
+sh_tdep_h = sh-tdep.h $(osabi_h)
+shnbsd_tdep_h = shnbsd-tdep.h
+sim_regno_h = sim-regno.h
+solib_svr4_h = solib-svr4.h
+solib_h = solib.h
+solist_h = solist.h
+somsolib_h = somsolib.h
+source_h = source.h
+sparcnbsd_tdep_h = sparcnbsd-tdep.h
+srec_h = srec.h
+stabsread_h = stabsread.h
+symfile_h = symfile.h
+symtab_h = symtab.h
+target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
+terminal_h = terminal.h
+top_h = top.h
+tracepoint_h = tracepoint.h
+typeprint_h = typeprint.h
+ui_file_h = ui-file.h
+ui_out_h = ui-out.h
+valprint_h = valprint.h
+value_h = value.h $(doublest_h) $(symtab_h) $(gdbtypes_h) $(expression_h)
+varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
+vax_tdep_h = vax-tdep.h $(osabi_h)
+version_h = version.h
+wince_stub_h = wince-stub.h
+wrapper_h = wrapper.h $(gdb_h)
+x86_64_tdep_h = x86-64-tdep.h $(i386_tdep_h)
+xcoffsolib_h = xcoffsolib.h
+xmodem_h = xmodem.h
+
+#
+# gdb/cli/ headers
+#
+
+cli_cmds_h = $(srcdir)/cli/cli-cmds.h
+cli_decode_h = $(srcdir)/cli/cli-decode.h $(gdb_regex_h) $(command_h)
+cli_dump_h = $(srcdir)/cli/cli-dump.h
+cli_script_h = $(srcdir)/cli/cli-script.h
+cli_setshow_h = $(srcdir)/cli/cli-setshow.h
+cli_utils_h = $(srcdir)/cli/cli-utils.h
+
+#
+# gdb/mi/ headers
+#
+
+mi_cmds_h = $(srcdir)/mi/mi-cmds.h
+mi_console_h = $(srcdir)/mi/mi-console.h
+mi_getopt_h = $(srcdir)/mi/mi-getopt.h
+mi_out_h = $(srcdir)/mi/mi-out.h
+mi_parse_h = $(srcdir)/mi/mi-parse.h
+
+#
+# gdb/tui/ headers
+#
+
+tui_file_h = $(srcdir)/tui/tui-file.h
+tui_h = $(srcdir)/tui/tui.h $(ansidecl_h)
+tuiCommand_h = $(srcdir)/tui/tuiCommand.h
+tuiData_h = $(srcdir)/tui/tuiData.h
+tuiDataWin_h = $(srcdir)/tui/tuiDataWin.h
+tuiDisassem_h = $(srcdir)/tui/tuiDisassem.h
+tuiGeneralWin_h = $(srcdir)/tui/tuiGeneralWin.h
+tuiIO_h = $(srcdir)/tui/tuiIO.h
+tuiLayout_h = $(srcdir)/tui/tuiLayout.h
+tuiRegs_h = $(srcdir)/tui/tuiRegs.h
+tuiSource_h = $(srcdir)/tui/tuiSource.h $(defs_h)
+tuiSourceWin_h = $(srcdir)/tui/tuiSourceWin.h
+tuiStack_h = $(srcdir)/tui/tuiStack.h
+tuiWin_h = $(srcdir)/tui/tuiWin.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -678,16 +773,16 @@ xcoffsolib_h = xcoffsolib.h
# right, it is probably easiest just to list .h files here directly.
HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
- dst.h environ.h $(gdbcmd_h) gdb.h gdbcore.h \
+ environ.h $(gdbcmd_h) gdb.h gdbcore.h \
gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \
objfiles.h parser-defs.h serial.h solib.h \
symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
macrotab.h macroexp.h macroscope.h \
- c-lang.h ch-lang.h f-lang.h \
+ c-lang.h f-lang.h \
jv-lang.h \
m2-lang.h p-lang.h \
complaints.h valprint.h \
- 29k-share/udi/udiids.h 29k-share/udi_soc nindy-share/b.out.h \
+ nindy-share/b.out.h \
nindy-share/block_io.h nindy-share/coff.h \
nindy-share/env.h nindy-share/stop.h \
vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \
@@ -697,7 +792,7 @@ HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \
# Header files that already have srcdir in them, or which are in objdir.
-HFILES_WITH_SRCDIR = $(udiheaders) ../bfd/bfd.h
+HFILES_WITH_SRCDIR = ../bfd/bfd.h
# GDB "info" files, which should be included in their entirety
@@ -736,15 +831,15 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
- c-lang.o ch-exp.o ch-lang.o f-lang.o \
- ui-out.o cli-out.o interps.o \
+ c-lang.o f-lang.o \
+ ui-out.o cli-out.o \
varobj.o wrapper.o \
jv-lang.o jv-valprint.o jv-typeprint.o \
m2-lang.o p-lang.o p-typeprint.o p-valprint.o \
scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \
- c-typeprint.o ch-typeprint.o f-typeprint.o m2-typeprint.o \
- c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \
- nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \
+ c-typeprint.o f-typeprint.o m2-typeprint.o \
+ c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
+ nlmread.o serial.o mdebugread.o top.o utils.o \
ui-file.o \
frame.o doublest.o \
gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o
@@ -757,6 +852,7 @@ SUBDIRS = @SUBDIRS@
# For now, shortcut the "configure GDB for fewer languages" stuff.
YYFILES = c-exp.tab.c \
+ ada-exp.tab.c \
jv-exp.tab.c \
f-exp.tab.c m2-exp.tab.c p-exp.tab.c
YYOBJ = c-exp.tab.o \
@@ -827,6 +923,22 @@ uninstall: force $(CONFIG_UNINSTALL)
rm -rf $(GDBTK_LIBRARY)
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+install-gdbtk:
+ $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \
+ $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs \
+ $(GDBTK_LIBRARY)/images \
+ $(GDBTK_LIBRARY)/images2 ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
+ $(GDBTK_LIBRARY)/help/images \
+ $(GDBTK_LIBRARY)/help/trace ; \
+ cd $(srcdir)/gdbtk/library ; \
+ for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \
+ do \
+ $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
+ done ;
+
# We do this by grepping through sources. If that turns out to be too slow,
# maybe we could just require every .o file to have an initialization routine
# of a given name (top.o -> _initialize_top, etc.).
@@ -842,7 +954,16 @@ uninstall: force $(CONFIG_UNINSTALL)
# list includes a file twice (because of some mistake somewhere else)
# the _initialize_* function will be included twice in init.c. Second,
# init.c may force unnecessary files to be linked in.
-#
+
+# FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that
+# the first call is to _initialize_gdbtypes. This is a hack to ensure
+# that all the architecture dependant global builtin_type_* variables
+# are initialized before anything else (per-architecture code is
+# called in the same order that it is registered). The ``correct
+# fix'' is to have all the builtin types made part of the architecture
+# and initialize them on-demand (using gdbarch_data) just like
+# everything else. The catch is that other modules still take the
+# address of these builtin types forcing them to be variables, sigh!
INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_OBS) $(CONFIG_INITS)
init.c: $(INIT_FILES)
@@ -867,7 +988,8 @@ init.c: $(INIT_FILES)
-e 's,signals\.c,signals/signals\.c,' \
-e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \
while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \
- sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' > init.l-tmp
+ sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' | \
+ ( echo _initialize_gdbtypes ; grep -v '^_initialize_gdbtypes$$' ) > init.l-tmp
@echo '/* Do not modify this file. */' >>init.c-tmp
@echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
@echo '#include "defs.h"' >>init.c-tmp
@@ -1008,6 +1130,7 @@ local-maintainer-clean:
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f c-exp.tab.c \
+ ada-lex.c ada-exp.tab.c \
jv-exp.tab \
f-exp.tab.c m2-exp.tab.c p-exp.tab.c
rm -f TAGS $(INFOFILES)
@@ -1143,6 +1266,33 @@ m2-exp.tab.c: m2-exp.y
-rm m2-exp.tmp
mv m2-exp.new ./m2-exp.tab.c
+# ada-exp.tab.c is generated in objdir from ada-exp.y if it doesn't exist
+# in srcdir, then compiled in objdir to ada-exp.tab.o.
+# Remove bogus decls for malloc/realloc/free which conflict with everything
+# else.
+ada-exp.tab.c: ada-exp.y
+ $(YACC) $(YFLAGS) $(srcdir)/ada-exp.y
+ -sed -e '/extern.*malloc/d' \
+ -e '/extern.*realloc/d' \
+ -e '/extern.*free/d' \
+ -e '/include.*malloc.h/d' \
+ -e 's/malloc/xmalloc/g' \
+ -e 's/realloc/xrealloc/g' \
+ < y.tab.c > ada-exp.new
+ -rm y.tab.c
+ mv ada-exp.new ./ada-exp.tab.c
+
+ada-lex.c: ada-lex.l
+ @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
+ echo $(FLEX) -Isit $(srcdir)/ada-lex.l ">" ada-lex.c; \
+ $(FLEX) -Isit $(srcdir)/ada-lex.l > ada-lex.c; \
+ elif [ ! -f ada-lex.c -a ! -f $(srcdir)/ada-lex.c ]; then \
+ echo "ada-lex.c missing and flex not available."; \
+ false; \
+ elif [ ! -f ada-lex.c ]; then \
+ echo "Warning: ada-lex.c older than ada-lex.l and flex not available."; \
+ fi
+
# p-exp.tab.c is generated in objdir from p-exp.y if it doesn't exist
# in srcdir, then compiled in objdir to p-exp.tab.o.
# Remove bogus decls for malloc/realloc/free which conflict with everything
@@ -1163,7 +1313,7 @@ p-exp.tab.c: p-exp.y
# These files are updated atomically, so make never has to remove them
.PRECIOUS: m2-exp.tab.c f-exp.tab.c c-exp.tab.c
-.PRECIOUS: jv-exp.tab.c p-exp.tab.c
+.PRECIOUS: jv-exp.tab.c p-exp.tab.c ada-exp.tab.c
lint: $(LINTFILES)
$(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
@@ -1188,11 +1338,10 @@ MAKEOVERRIDES=
## This is ugly, but I don't want GNU make to put these variables in
## the environment. Older makes will see this as a set of targets
## with no dependencies and no actions.
-unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
+# OBSOLETE unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
-ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
- 29k-share/udi/udi2go32.c \
- a29k-tdep.c a68v-nat.c \
+ALLDEPFILES = a68v-nat.c \
+ aix-thread.c \
alpha-nat.c alphabsd-nat.c \
alpha-tdep.c alpha-linux-tdep.c alphabsd-tdep.c alphanbsd-tdep.c \
alpha-osf1-tdep.c alphafbsd-tdep.c \
@@ -1201,24 +1350,24 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
avr-tdep.c \
coff-solib.c \
core-sol2.c core-regset.c core-aout.c corelow.c \
- dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.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 \
- i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c i386-linux-nat.c \
- i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.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 \
i387-tdep.c \
i386-linux-tdep.c i386-nat.c \
- i960-tdep.c \
+ i386gnu-nat.c i386gnu-tdep.c \
ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \
infptrace.c inftarg.c irix4-nat.c irix5-nat.c \
lynx-nat.c m3-nat.c \
m68hc11-tdep.c \
m68k-tdep.c \
- m88k-nat.c m88k-tdep.c mac-nat.c \
mcore-tdep.c \
mips-linux-nat.c mips-linux-tdep.c \
mips-nat.c \
+ mips-irix-tdep.c \
mips-tdep.c mipsm3-nat.c mipsv4-nat.c \
mipsnbsd-nat.c mipsnbsd-tdep.c \
nbsd-tdep.c \
@@ -1226,19 +1375,21 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
nindy-share/ttyflush.c nindy-tdep.c \
ns32k-tdep.c solib-osf.c \
somread.c somsolib.c $(HPREAD_SOURCE) \
- ppc-linux-nat.c ppc-linux-tdep.c \
+ ppc-sysv-tdep.o ppc-linux-nat.c ppc-linux-tdep.c \
+ ppcnbsd-nat.o ppcnbsd-tdep.o \
procfs.c \
- remote-adapt.c remote-array.c remote-bug.c remote-e7000.c remote-eb.c \
+ remote-array.c remote-e7000.c \
remote-es.c remote-hms.c remote-mips.c \
- remote-mm.c remote-nindy.c remote-os9k.c remote-rdp.c remote-sim.c \
+ remote-rdp.c remote-sim.c \
remote-st.c remote-utils.c dcache.c \
- remote-udi.c remote-vx.c remote-vx29k.c \
+ remote-vx.c \
rs6000-nat.c rs6000-tdep.c \
s390-tdep.c s390-nat.c \
ser-go32.c ser-pipe.c ser-tcp.c \
sh-tdep.c shnbsd-tdep.c shnbsd-nat.c \
- solib.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \
+ solib.c solib-irix.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \
sparc-nat.c \
+ sparc64nbsd-nat.c sparcnbsd-nat.c sparcnbsd-tdep.c \
sparc-tdep.c sparcl-tdep.c sun3-nat.c \
symm-tdep.c symm-nat.c \
vax-tdep.c \
@@ -1248,18 +1399,60 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
xstormy16-tdep.c \
z8k-tdep.c
-udip2soc.o: $(srcdir)/29k-share/udi/udip2soc.c $(udiheaders)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udip2soc.c
+# Some files need explict build rules (due to -Werror problems) or due
+# to sub-directory fun 'n' games.
-udi2go32.o: $(srcdir)/29k-share/udi/udi2go32.c $(udiheaders)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udi2go32.c
+# Provide explicit rule/dependency - works for more makes.
+copying.o: $(srcdir)/copying.c
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c
-udr.o: $(srcdir)/29k-share/udi/udr.c $(udiheaders)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udr.c
+hpux-thread.o: $(srcdir)/hpux-thread.c
+ $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \
+ -I$(srcdir)/osf-share/HP800 -I/usr/include/dce \
+ $(srcdir)/hpux-thread.c
+
+# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
+# match output format strings.
+procfs.o: $(srcdir)/procfs.c
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c
+
+v850ice.o: $(srcdir)/v850ice.c
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
+ $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
+ $(GDBTK_CFLAGS) \
+ $(srcdir)/v850ice.c
+
+# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
+# declared -Wimplicit fails. It should be using the GDBARCH framework.
+# cagney 1999-09-02.
+z8k-tdep.o: $(srcdir)/z8k-tdep.c
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
+ $(srcdir)/z8k-tdep.c
+
+# The dependencies. In aphabetic order.
a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
$(regcache_h)
+aix-thread.o: aix-thread.c $(defs_h) $(gdbcore_h) $(gdbthread_h) \
+ $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) $(gdb_assert_h) \
+ $(ppc_tdep_h) $(language_h)
+
+ada-lang.o: ada-lang.c ada-lang.h c-lang.h $(defs_h) $(expression_h) \
+ $(gdbtypes_h) $(inferior_h) language.h parser-defs.h $(symtab_h) \
+ $(gdbcmd_h) $(ui_out_h) symfile.h objfiles.h $(gdbcore_h)
+
+ada-tasks.o: ada-tasks.c ada-lang.h $(defs_h) language.h $(value_h) \
+ $(command_h) $(value_h) $(gdbcore_h)
+
+ada-typeprint.o: ada-typeprint.c ada-lang.h $(defs_h) $(expression_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) \
+ target.h typeprint.h $(value_h) ada-lang.h
+
+ada-valprint.o: ada-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
+ language.h $(symtab_h) valprint.h $(value_h) c-lang.h ada-lang.h \
+ annotate.h
+
alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
$(regcache_h) $(alpha_tdep_h)
@@ -1293,7 +1486,7 @@ arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) $(doublest_h) \
$(value_h) $(arch_utils_h) $(solib_svr4_h) $(arm_tdep_h) \
$(BFD_SRC)/elf-bfd.h $(INCLUDE_DIR)/coff/internal.h \
- $(INCLUDE_DIR)/elf/arm.h
+ $(INCLUDE_DIR)/elf/arm.h $(sim_arm_h) $(gdb_assert_h)
armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \
$(regcache_h) $(gdbcore_h)
@@ -1302,9 +1495,9 @@ armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(arm_tdep_h) solib-svr4.h \
nbsd-tdep.h
avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
- $(symfile_h) $(regcache_h) $(arch_utils_h)
+ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h)
-bcache.o: bcache.c $(bcache_h) $(defs_h)
+bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h)
blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
$(objfiles_h) $(symfile_h) $(target_h) $(regcache_h)
@@ -1314,11 +1507,10 @@ breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(gdb_string_h) $(gdb_events_h) $(linespec_h) $(ui_out_h) \
$(completer_h) $(gdb_h)
-buildsym.o: buildsym.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
- $(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h) \
- $(obstack_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
- $(language_h) $(bcache_h) $(filenames_h) $(stabsread_h) \
- $(macrotab_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)
builtin-regs.o: builtin-regs.c $(defs.h) $(builtin_regs_h) $(gdbtypes_h) \
$(gdb_string_h) $(value_h) $(frame_h)
@@ -1327,9 +1519,10 @@ c-lang.o: c-lang.c $(c_lang_h) $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h) $(macroscope_h) \
gdb_assert.h
-c-typeprint.o: c-typeprint.c $(c_lang_h) $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
- $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h) $(cp_abi_h)
+c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
+ $(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \
+ $(gdb_string_h)
c-valprint.o: c-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(symtab_h) $(valprint_h) $(value_h) $(cp_abi_h)
@@ -1340,38 +1533,39 @@ doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) $(gdbtypes_h) \
f-lang.o: f-lang.c f-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h)
-f-typeprint.o: f-typeprint.c f-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
- $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h)
+f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
+ $(f_lang_h) $(gdb_string_h)
f-valprint.o: f-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h)
-ch-exp.o: ch-exp.c ch-lang.h $(defs_h) $(language_h) $(parser_defs_h) \
- $(bfd_h) $(symfile_h) $(objfiles_h) $(value_h)
+# OBSOLETE ch-exp.o: ch-exp.c ch-lang.h $(defs_h) $(language_h) $(parser_defs_h) \
+# OBSOLETE $(bfd_h) $(symfile_h) $(objfiles_h) $(value_h)
-ch-lang.o: ch-lang.c ch-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
- $(language_h) $(parser_defs_h) $(symtab_h)
+# OBSOLETE ch-lang.o: ch-lang.c ch-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
+# OBSOLETE $(language_h) $(parser_defs_h) $(symtab_h)
-ch-typeprint.o: ch-typeprint.c ch-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
- $(target_h) $(value_h) $(typeprint_h) $(gdb_string_h)
+# OBSOLETE ch-typeprint.o: ch-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \
+# OBSOLETE $(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \
+# OBSOLETE $(target_h) $(language_h) $(ch_lang_h) $(typeprint_h) $(gdb_string_h)
-ch-valprint.o: ch-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
- $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(c_lang_h)
+# OBSOLETE ch-valprint.o: ch-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
+# OBSOLETE $(gdbtypes_h) $(valprint_h) $(expression_h) $(value_h) $(language_h) \
+# OBSOLETE $(demangle_h) $(c_lang_h) $(typeprint_h) $(ch_lang_h) $(annotate_h)
coff-solib.o: coff-solib.c $(defs_h)
-coffread.o: coffread.c $(bfd_h) $(breakpoint_h) $(buildsym_h) \
- $(complaints_h) $(defs_h) $(expression_h) $(gdbtypes_h) $(objfiles_h) \
- $(symfile_h) $(symtab_h) $(gdb_stabs_h) $(stabsread_h) $(target_h) \
- $(gdb_string_h)
+coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \
+ $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \
+ $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \
+ $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \
+ $(target_h) $(gdb_assert_h)
complaints.o: complaints.c $(complaints_h) $(defs_h) $(gdbcmd_h)
# Provide explicit rule/dependency - works for more makes.
copying.o: $(srcdir)/copying.c $(defs_h) $(gdbcmd_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c
core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(inferior_h) \
$(regcache_h)
@@ -1389,30 +1583,33 @@ corefile.o: corefile.c $(dis_asm_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
$(target_h) $(gdbthread_h) $(gdb_string_h) $(regcache_h)
-gcore.o: gcore.c $(defs_h) $(command_h) $(inferior_h) $(gdbcore_h) \
- $(BFD_SRC)/elf-bfd.h $(symfile_h) $(objfiles_h)
+gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
+ $(elf_bfd_h) $(symfile_h) $(objfiles_h)
-linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(gregset_h) \
- $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(BFD_SRC)/elf-bfd.h
+linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) $(gregset_h) \
+ $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) $(cli_decode_h) \
+ $(gdb_string_h)
cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h)
-cp-valprint.o: cp-valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbtypes_h) $(symtab_h) $(value_h) $(gdb_string_h) $(cp_abi_h)
+cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \
+ $(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \
+ $(cp_abi_h)
dcache.o: dcache.c $(dcache_h) $(defs_h) $(gdbcmd_h) $(gdb_string_h) \
$(gdbcore_h) $(target_h)
-d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(obstack_h) $(symtab_h) \
- $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \
- $(inferior_h) $(dis-asm_h) $(symfile_h) $(objfiles_h) $(language_h) \
- $(arch_utils_h) $(regcache_h) $(floatformat_h) $(sim_d10v_h)
+d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \
+ $(dis_asm_h) $(symfile_h) $(objfiles_h) $(language_h) $(arch_utils_h) \
+ $(regcache_h) $(floatformat_h) $(sim_d10v_h) $(sim_regno_h)
-dbxread.o: dbxread.c $(breakpoint_h) $(buildsym_h) $(command_h) \
- $(complaints_h) $(defs_h) $(expression_h) $(gdb_stabs_h) $(gdbcore_h) \
- $(gdbtypes_h) $(language_h) $(objfiles_h) \
- $(stabsread_h) $(symfile_h) $(symtab_h) $(target_h) $(gdb_string_h) \
- $(cp_abi_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) \
+ $(gdb_stabs_h) $(demangle_h) $(language_h) $(complaints_h) \
+ $(cp_abi_h) $(aout_aout64_h) $(aout_stab_gnu_h)
delta68-nat.o: delta68-nat.c $(defs_h)
@@ -1424,7 +1621,9 @@ dink32-rom.o: dink32-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
-dstread.o: dstread.c $(gdb_string_h)
+# OBSOLETE dstread.o: dstread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(breakpoint_h) \
+# OBSOLETE $(bfd_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(gdb_obstack_h) \
+# OBSOLETE $(gdb_string_h) $(dst_h)
dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(symtab_h) $(symfile_h) $(objfiles_h) \
$(target_h) $(inferior_h) $(regcache_h) $(dwarf2cfi_h)
@@ -1451,7 +1650,7 @@ event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h) $(event_top_h)
event-top.o: event-top.c $(top_h) $(readline_headers) \
$(defs_h) $(inferior_h) $(event_loop_h) $(event_top_h) $(terminal_h) \
- $(gdbcmd_h) $(target_h) $(cli_decode_h) $(interps_h)
+ $(gdbcmd_h) $(target_h) $(cli_decode_h)
inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(inf_loop_h) $(event_loop_h) \
$(event_top_h)
@@ -1462,130 +1661,48 @@ exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h) $(value_h)
+fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) $(gdb_string_h) \
+ $(elf_bfd_h) $(gregset_h)
+
findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
$(gdb_string_h) $(regcache_h) $(builtin_regs_h)
frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
$(regcache_h)
-regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
+frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
+ $(arch_utils_h) $(regcache_h)
+
+regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \
+ $(gdbcmd_h) $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gdbcmd_h)
fork-child.o: fork-child.c $(gdb_wait_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
-install-gdbtk:
- $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
- $(SHELL) $(srcdir)/../mkinstalldirs \
- $(GDBTK_LIBRARY)/images \
- $(GDBTK_LIBRARY)/images2 ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \
- $(GDBTK_LIBRARY)/help/images \
- $(GDBTK_LIBRARY)/help/trace ; \
- cd $(srcdir)/gdbtk/library ; \
- for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \
- do \
- $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \
- done ;
-
-gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
- $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
-
-gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
- $(symtab_h) $(inferior_h) $(command_h) \
- $(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) \
- $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
- $(srcdir)/gdbtk/generic/gdbtk.c \
- -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" -DSRC_DIR=\"$(GDBTK_SRC_DIR)\"
-
-gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
- $(defs_h) $(breakpoint_h) $(tracepoint_h) $(symfile_h) $(symtab_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
- $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
- $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
- -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
-
-gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
- $(defs_h) $(symtab_h) $(inferior_h) \
- $(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) \
- $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
- -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
-
-gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
- $(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) \
- $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
- $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
-
-gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
- $(defs_h) $(frame_h) $(value_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
- $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
- $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \
- -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
-
-gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
- $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
- $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
- $(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) \
- $(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)
- $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
- $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
- $(srcdir)/gdbtk/generic/gdbtk-varobj.c
-
-gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \
- $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
- $(defs_h) $(frame_h) $(value_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\
- $(srcdir)/gdbtk/generic/gdbtk-wrapper.c
-
v850ice.o: v850ice.c $(defs_h) $(symtab_h) $(inferior_h) $(command_h) \
$(frame_h) $(breakpoint_h) $(gdbcore_h) $(value_h) $(symfile_h) \
$(gdb_string_h) $(target_h) $(objfiles_h) $(regcache_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \
- $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
- $(srcdir)/v850ice.c
-v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(obstack_h) \
- $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \
- $(symfile_h) $(arch_utils_h) $(regcache_h)
+v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+ $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \
+ $(arch_utils_h) $(regcache_h) $(symtab_h)
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \
$(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) \
$(language_h) $(gdb_string_h) $(readline_headers) $(remote_h) \
$(linespec_h) $(regcache_h) $(completer_h)
-gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h) $(gdb_string_h) \
- $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) $(gdb_wait_h) \
- $(gdbcore_h) $(target_h) $(gdbthread_h) $(annotate_h) $(symfile_h) \
- $(value_h) $(symcat_h) $(floatformat_h) $(gdb_assert_h) \
- $(gdb_events_h)
+gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
+ $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
+ $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \
+ $(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \
+ $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h)
arch-utils.o: arch-utils.c $(defs_h) $(bfd_h) $(gdbcmd_h) \
$(arch_utils_h) $(gdb_assert_h) $(inferior_h) \
$(gdb_string_h) $(symtab.h) $(frame_h) $(breakpoint_h) $(gdb_wait_h) \
$(gdbcore_h) $(target_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \
- $(version_h) $(floatformat_h)
+ $(version_h) $(floatformat_h) $(sim_regno_h)
gdbtypes.o: gdbtypes.c $(bfd_h) $(complaints_h) $(defs_h) $(expression_h) \
$(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \
@@ -1602,13 +1719,15 @@ gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \
$(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h)
-gnu-v3-abi.o: gnu-v2-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h)
+gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \
+ $(gdb_assert_h) $(gdb_string_h)
-h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(regcache_h)
+h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \
+ $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \
+ $(regcache_h)
-h8500-tdep.o: h8500-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h) \
- $(expression_h) $(frame_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) \
- $(value_h) $(regcache_h)
+h8500-tdep.o: h8500-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \
+ $(gdbcmd_h) $(value_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h)
hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
@@ -1625,6 +1744,8 @@ hppab-nat.o: hppab-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
hppah-nat.o: hppah-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
$(regcache_h)
+i386gnu-tdep.o: $(defs_h) $(i386_tdep_h)
+
i386gnu-nat.o: gnu-nat.h
i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) \
@@ -1634,8 +1755,8 @@ i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) \
i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h)
-i386aix-nat.o: i386aix-nat.c $(defs_h) $(frame_h) $(inferior_h) \
- $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h)
+# OBSOLETE i386aix-nat.o: i386aix-nat.c $(defs_h) $(frame_h) $(inferior_h) \
+# OBSOLETE $(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h)
i386b-nat.o: i386b-nat.c $(defs_h) $(regcache_h)
@@ -1651,17 +1772,18 @@ i386ly-nat.o: i386ly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h)
i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
$(regcache_h)
-i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) $(target_h) \
- $(regcache_h)
+# OBSOLETE i386m3-nat.o: i386m3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) $(target_h) \
+# OBSOLETE $(regcache_h)
-i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- $(regcache_h)
+# OBSOLETE i386mach-nat.o: i386mach-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+# OBSOLETE $(regcache_h)
i386v-nat.o: i386v-nat.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) $(language_h) $(target_h)
i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
- $(symtab_h) $(symfile_h) $(objfiles_h) $(regcache_h)
+ $(symtab_h) $(symfile_h) $(objfiles_h) $(regcache_h) \
+ $(i386_linux_tdep_h) $(i386_tdep_h) $(i387_tdep_h)
i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
$(value_h) $(regcache_h)
@@ -1671,9 +1793,8 @@ i386v4-nat.o: i386v4-nat.c $(defs_h) $(regcache_h)
i387-tdep.o: i387-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) $(language_h) $(regcache_h) $(doublest_h) i386-tdep.h
-i960-tdep.o: i960-tdep.c $(floatformat_h) $(defs_h) $(expression_h) \
- $(frame_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(gdbcore_h) \
- $(regcache_h)
+# OBSOLETE i960-tdep.o: i960-tdep.c $(defs_h) $(symtab_h) $(value_h) $(frame_h) \
+# OBSOLETE $(floatformat_h) $(target_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(regcache_h)
@@ -1686,7 +1807,7 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(language_h) $(symfile_h) $(gdb_string_h) \
- $(ui_out_h) $(completer_h)
+ $(ui_out_h) $(completer_h) $(regcache_h)
inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \
$(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
@@ -1745,18 +1866,26 @@ m2-valprint.o: m2-valprint.c $(defs_h) $(gdbtypes_h) $(symtab_h) \
m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(value_h) $(language_h) \
$(target_h) $(gdb_wait_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h)
+m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+ $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \
+ $(regcache_h)
+
p-lang.o: p-lang.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h) $(gdb_string_h)
-p-typeprint.o: p-typeprint.c p-lang.h $(defs_h) $(expression_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) \
- $(target_h) $(typeprint_h) $(value_h) $(gdb_string_h)
+p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
+ $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h)
-p-valprint.o: p-valprint.c p-lang.h $(defs_h) $(expression_h) $(gdbtypes_h) \
- $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h)
+p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \
+ $(gdbcore_h) $(demangle_h) $(valprint_h) $(typeprint_h) $(language_h) \
+ $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h)
-m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
- $(gdbcore_h) $(gdb_string_h)
+m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \
+ $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \
+ $(dis_asm_h) $(symfile_h) $(objfiles_h) $(arch_utils_h) $(regcache_h) \
+ $(target_h) $(opcode_m68hc11_h)
m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
$(gdbcore_h) $(gdb_string_h) $(regcache_h)
@@ -1766,10 +1895,6 @@ m68kly-nat.o: m68kly-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h)
m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \
$(language_h) $(gdbcore_h) $(floatformat_h) $(target_h) $(regcache_h)
-m88k-nat.o: m88k-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-
-m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-
mac-nat.o: mac-nat.c $(defs_h) $(gdb_string_h) $(regcache_h)
main.o: main.c $(top_h) $(defs_h) $(gdb_string_h) $(event_loop_h) \
@@ -1785,21 +1910,23 @@ mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) \
mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(gdb_string_h) $(regcache_h) $(serial_h)
-mdebugread.o: mdebugread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
- $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
- $(language_h) $(objfiles_h) $(stabsread_h) \
- $(symfile_h) $(symtab_h) $(gdb_string_h)
+mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
+ $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \
+ $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \
+ $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \
+ $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \
+ $(aout_stab_gnu_h) $(expression_h) $(language_h)
mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h)
-# os9kread assumes that sizeof(char*) <= sizeof(int). This looses on
-# 64 bit targets where often, sizeof(int)=4 but sizeof(char*)=9.
-os9kread.o: os9kread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
- $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
- $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \
- $(symtab_h) $(target_h) $(gdb_string_h)
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
- $(srcdir)/os9kread.c
+# OBSOLETE # os9kread assumes that sizeof(char*) <= sizeof(int). This looses on
+# OBSOLETE # 64 bit targets where often, sizeof(int)=4 but sizeof(char*)=9.
+# OBSOLETE os9kread.o: os9kread.c $(buildsym_h) $(complaints_h) $(bfd_h) $(defs_h) \
+# OBSOLETE $(expression_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
+# OBSOLETE $(language_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \
+# OBSOLETE $(symtab_h) $(target_h) $(gdb_string_h)
+# OBSOLETE $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
+# OBSOLETE $(srcdir)/os9kread.c
mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \
$(target_h)
@@ -1817,6 +1944,8 @@ mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \
mips-nat.o: mips-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
+mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) osabi.h $(BFD_SRC)/elf-bfd.h
+
mips-tdep.o: mips-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(arch_utils_h) $(regcache_h) \
$(inferior_h) $(language_h) $(objfiles_h) $(symfile_h) \
@@ -1836,9 +1965,13 @@ mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
mipsnbsd-tdep.o: mipsnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
$(target_h) $(value_h) osabi.h solib-svr4.h mipsnbsd-tdep.h
-mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
- $(obstack_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \
- $(gdbcore_h) $(symfile_h) $(regcache_h) $(arch-utils.h)
+mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+ $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \
+ $(regcache_h)
+
+mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
+ $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \
+ $(regcache_h) $(arch_utils_h)
monitor.o: monitor.c $(monitor_h) $(bfd_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(gdb_string_h) \
@@ -1846,27 +1979,17 @@ monitor.o: monitor.c $(monitor_h) $(bfd_h) $(defs_h) $(gdbcmd_h) \
nbsd-tdep.o: nbsd-tdep.c $(defs_h) solib-svr4.h
-Onindy.o: nindy-share/Onindy.c $(gdb_wait_h) nindy-share/block_io.h \
- nindy-share/env.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c
-
-nindy.o: nindy-share/nindy.c $(gdb_wait_h) nindy-share/block_io.h \
- nindy-share/env.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c
-
nlmread.o: nlmread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
$(gdb_stabs_h) $(objfiles_h) $(symfile_h) $(symtab_h) $(stabsread_h) \
$(gdb_string_h)
-ttyflush.o: nindy-share/ttyflush.c
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c
-
nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h)
ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h)
-objfiles.o: objfiles.c $(bfd_h) $(defs_h) $(objfiles_h) $(symfile_h) \
- $(symtab_h) $(gdb_string_h) $(breakpoint_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)
solib-osf.o: solib-osf.c $(defs_h) $(inferior_h) $(symtab_h) $(objfiles_h) \
$(symfile_h) $(target_h) $(gdb_string_h) $(solist_h)
@@ -1876,15 +1999,13 @@ somread.o: somread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
somsolib.o: somsolib.c $(defs_h) $(regcache_h)
-std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) \
- $(gdbtypes_h) $(value_h)
+std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \
+ $(value_h) $(gdb_string_h)
pa64solib.o: pa64solib.c $(defs_h) $(regcache_h)
hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) inferior.h \
$(regcache_h)
- $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \
- -I$(srcdir)/osf-share/HP800 -I/usr/include/dce $(srcdir)/hpux-thread.c
hpread.o: hpread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
$(demangle_h) $(gdb_stabs_h) $(gdbtypes_h) $(objfiles_h) \
@@ -1900,10 +2021,20 @@ ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \
$(objfiles_h) $(gdb_stabs_h) $(serial_h) ocd.h $(regcache_h)
ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdbcore_h) $(frame_h) \
- $(inferior_h) $(target_h) $(regcache_h) ppc-tdep.h
+ $(inferior_h) $(target_h) $(regcache_h) $(ppc_tdep_h)
ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- $(target_h) ppc-tdep.h $(regcache_h) $(value_h)
+ $(target_h) $(ppc_tdep_h) $(regcache_h) $(value_h)
+
+ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+ $(value_h) $(regcache_h) $(ppc_tdep_h)
+
+ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \
+ ppcnbsd-tdep.h
+
+ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+ $(target_h) $(breakpoint_h) $(value_h) $(ppc_tdep_t) ppcnbsd-tdep.h \
+ nbsd-tdep.h
ppcbug-rom.o: ppcbug-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
$(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
@@ -1918,7 +2049,6 @@ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \
# match output format strings.
procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
$(target_h) $(gdb_string_h) $(gdbthread_h) proc-utils.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c
proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) proc-utils.h $(completer_h)
@@ -1950,22 +2080,8 @@ remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \
remote-rdi.o: remote-rdi.c $(defs_h) $(gdbcore_h) \
$(inferior_h) $(gdb_string_h) $(completer_h) $(arm_tdep_h)
-rdi-share/libangsd.a: force
- @dir=rdi-share; \
- if [ -f ./$${dir}/Makefile ] ; then \
- r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
- (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
- else \
- true; \
- fi
-
remote-rdp.o: remote-rdp.c $(defs_h) $(gdbcore_h) \
- $(inferior_h) $(gdb_string_h) $(arm_tdep_h)
-
-remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) $(serial_h) \
- $(inferior_h) $(target_h) $(terminal_h) $(remote_utils_h) \
- $(gdb_string_h) $(regcache_h)
+ $(inferior_h) $(gdb_string_h) $(arm_tdep_h) $(callback_h)
remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \
$(serial_h) $(gdb_string_h) $(regcache_h)
@@ -1984,22 +2100,23 @@ remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \
$(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \
$(regcache_h)
-remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
- $(defs_h) $(gdbcore_h) $(inferior_h) \
- nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
- $(symfile_h) $(regcache_h)
+# OBSOLETE remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
+# OBSOLETE $(defs_h) $(gdbcore_h) $(inferior_h) \
+# OBSOLETE nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
+# OBSOLETE $(symfile_h) $(regcache_h)
-remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \
- $(command_h) $(monitor_h) $(remote_utils_h) $(symtab_h) $(symfile_h) \
- $(objfiles_h) $(gdb_stabs_h) $(gdb_string_h) $(regcache_h)
+# OBSOLETE remote-os9k.o: remote-os9k.c $(defs_h) $(gdbcore_h) \
+# OBSOLETE $(command_h) $(monitor_h) $(remote_utils_h) $(symtab_h) $(symfile_h) \
+# OBSOLETE $(objfiles_h) $(gdb_stabs_h) $(gdb_string_h) $(regcache_h)
remote-sds.o: remote-sds.c $(bfd_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h) \
$(gdb_string_h) $(regcache_h)
remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) $(gdb_string_h) \
- $(terminal_h) $(target_h) $(gdbcore_h) $(INCLUDE_DIR)/callback.h \
- $(remote_sim_h) $(remote_utils_h) $(command_h) $(regcache_h)
+ $(terminal_h) $(target_h) $(gdbcore_h) $(callback_h) \
+ $(remote_sim_h) $(remote_utils_h) $(command_h) $(regcache_h) \
+ $(sim_regno_h)
remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(serial_h) \
$(target_h) $(gdb_string_h) $(regcache_h)
@@ -2027,8 +2144,8 @@ remote.o: remote.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
$(gdb_string_h) $(event_loop_h) $(event_top_h) $(remote_h) \
$(inf_loop_h) $(value_h)
-remote-nrom.o: remote-nrom.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
- $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h)
+# OBSOLETE remote-nrom.o: remote-nrom.c $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
+# OBSOLETE $(inferior_h) $(remote_utils_h) $(symfile_h) $(terminal_h)
rom68k-rom.o: rom68k-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
$(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h) \
@@ -2036,10 +2153,11 @@ rom68k-rom.o: rom68k-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
$(gdbcore_h) $(xcoffsolib_h) $(symfile_h) $(objfiles_h) \
- $(gdb_stabs_h) $(regcache_h) $(arch_utils_h)
+ $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \
+ $(ppc_tdep_h)
rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- $(target_h) ppc-tdep.h $(regcache_h) $(value_h) $(parser_defs_h)
+ $(target_h) $(ppc_tdep_h) $(regcache_h) $(value_h) $(parser_defs_h)
s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
@@ -2066,10 +2184,11 @@ ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h)
serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h)
-sh-tdep.o: sh-tdep.c $(bfd_h) $(dis_asm_h) \
- $(srcdir)/../opcodes/sh-opc.h $(defs_h) $(expression_h) $(frame_h) \
- $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(value_h) $(arch_utils_h) \
- $(regcache_h) $(doublest_h) $(sh_tdep_h)
+sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
+ $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) \
+ $(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \
+ $(regcache_h) $(doublest_h) $(sh_tdep_h) $(elf_bfd_h) $(solib_svr4_h) \
+ $(elf_sh_h) $(gdb_sim_sh_h)
shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
$(value_h) $(sh_tdep_h) solib-svr4.h shnbsd-tdep.h nbsd-tdep.h
@@ -2080,16 +2199,17 @@ sh3-rom.o: sh3-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(arch_utils_h) \
$(regcache_h) $(sh_tdep_h)
-signals.o: signals/signals.c $(defs_h) $(target_h)
- $(CC) -c $(INTERNAL_CFLAGS) $<
-
-mon960-rom.o: mon960-rom.c $(monitor_h) $(bfd_h) $(gdb_wait_h) $(defs_h) \
- $(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h)
+mon960-rom.o: mon960-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
+ $(serial_h) $(srec_h) $(xmodem_h) $(symtab_h) $(symfile_h) \
+ $(inferior_h)
solib.o: solib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
$(objfiles_h) $(gdb_regex_h) $(symfile_h) $(target_h) $(gdb_string_h) \
$(solist_h) $(completer_h)
+solib-irix.o: solib-irix.c $(defs_h) $(gdbcore_h) $(inferior_h) $(objfiles_h) \
+ $(symfile_h) $(target_h) $(solist_h) solib-svr4.h
+
solib-sunos.o: solib-sunos.c $(defs_h) $(symfile_h) $(objfiles_h) \
$(gdbcore_h) $(inferior_h) $(solist_h)
@@ -2108,21 +2228,32 @@ sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h)
sparc-nat.o: sparc-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(gdbcore_h) \
$(target_h) $(regcache_h)
-sparc-tdep.o: sparc-tdep.c $(floatformat_h) $(defs_h) $(gdbcore_h) \
- $(inferior_h) $(objfiles_h) $(symfile_h) $(target_h) $(gdb_string_h) \
- $(arch_utils_h) $(regcache_h)
+sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
+ $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(regcache_h) \
+ $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h)
sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(target_h) $(regcache_h)
+sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ sparcnbsd-tdep.h
+
+sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ sparcnbsd-tdep.h
+
+sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+ $(target_h) $(value_h) osabi.h sparcnbsd-tdep.h nbsd-tdep.h \
+ solib-svr4.h
+
xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \
$(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h)
dsrec.o: dsrec.c $(defs_h) srec.h
-stabsread.o: stabsread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
- $(INCLUDE_DIR)/aout/stab_gnu.h $(buildsym_h) $(complaints_h) \
- $(defs_h) $(gdbtypes_h) $(objfiles_h) $(stabsread_h) $(symfile_h) \
- $(symtab_h) $(gdb_string_h) $(doublest_h)
+stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \
+ $(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \
+ $(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \
+ $(buildsym_h) $(complaints_h) $(demangle_h) $(language_h) \
+ $(doublest_h) $(stabsread_h)
stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
$(language_h) $(target_h) $(gdb_string_h) $(ui_out_h)
@@ -2130,40 +2261,45 @@ stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
ui-file.o: ui-file.c $(defs_h) ui-file.h
tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(srcdir)/tui/tui-file.h \
$(srcdir)/tui/tuiIO.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
-ax-general.o: ax-general.c $(ax_h) $(defs_h) $(value_h)
+ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h)
+
ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \
$(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h
sun3-nat.o: sun3-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-symfile.o: symfile.c $(breakpoint_h) $(complaints_h) $(defs_h) \
- $(expression_h) $(gdb_stabs_h) $(gdbcmd_h) $(gdbcore_h) \
- $(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \
- $(target_h) $(gdb_string_h) $(completer_h)
+symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
+ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_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)
symm-tdep.o: symm-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
symm-nat.o: symm-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h)
-symmisc.o: symmisc.c $(bfd_h) $(breakpoint_h) $(command_h) $(defs_h) \
- $(expression_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
- $(symfile_h) $(symtab_h) $(gdb_string_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) $(gdb_string_h)
-symtab.o: symtab.c $(call_cmds_h) $(defs_h) $(expression_h) $(frame_h) \
- $(gdbcmd_h) $(gdbcore_h) $(gdbtypes_h) $(language_h) $(objfiles_h) \
- $(gdb_regex_h) $(symfile_h) $(symtab_h) $(target_h) $(value_h) \
- $(gdb_string_h) $(linespec_h) $(cp_abi_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) \
+ $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \
+ $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \
+ $(cp_abi_h)
linespec.o: linespec.c $(linespec_h) $(defs_h) $(frame_h) $(value_h) \
$(objfiles_h) $(symfile_h) $(completer_h) $(symtab_h) \
$(demangle_h) $(command_h) $(cp_abi_h)
-macroexp.o: macroexp.c $(defs_h) $(macrotab_h)
+macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \
+ $(macroexp_h) $(gdb_assert_h)
-macrotab.o: macrotab.c $(defs_h) $(obstack_h) $(objfiles_h) $(symtab_h) \
- $(macrotab_h) $(splay_tree_h) gdb_assert.h $(bcache_h)
+macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) $(symtab_h) \
+ $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) $(bcache_h) \
+ $(complaints_h)
macroscope.o: macroscope.c $(defs_h) $(macroscope_h)
@@ -2173,8 +2309,9 @@ macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) \
target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \
$(objfiles_h) $(symfile_h) $(target_h) $(gdb_string_h) $(regcache_h)
-thread.o: thread.c $(defs_h) $(gdbthread_h) $(gdbcmd_h) $(target_h) \
- $(regcache_h) $(ui_out_h) $(gdb_h)
+thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \
+ $(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \
+ $(gdbcmd_h) $(regcache_h) $(gdb_h) $(ui_out_h)
completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \
$(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) \
@@ -2185,11 +2322,11 @@ top.o: top.c $(top_h) $(bfd_h) $(getopt_h) $(readline_headers) $(call_cmds_h) \
$(defs_h) $(gdbcmd_h) $(inferior_h) $(language_h) \
$(remote_utils_h) $(gdb_string_h) $(event_loop_h) $(event_top_h) \
$(completer_h) $(version_h) $(ui_out_h) $(doublest_h) \
- $(serial_h) $(interps_h)
+ $(serial_h)
-typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) \
- $(value_h) $(gdb_string_h) $(cp_abi_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)
utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \
$(language_h) $(target_h) $(terminal_h) $(readline_headers) \
@@ -2202,43 +2339,32 @@ valarith.o: valarith.c $(bfd_h) $(defs_h) $(expression_h) \
valops.o: valops.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
$(gdb_string_h) $(regcache_h) $(cp_abi_h) $(gdb_assert_h)
-valprint.o: valprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
- $(gdbcore_h) $(gdbtypes_h) $(language_h) $(symtab_h) $(target_h) \
- $(value_h) $(gdb_string_h) $(valprint_h) $(doublest_h)
+valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
+ $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(obstack_h) \
+ $(language_h) $(annotate_h) $(valprint_h) $(floatformat_h) \
+ $(doublest_h)
values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbtypes_h) $(symtab_h) $(target_h) $(value_h) \
- $(gdb_string_h) scm-lang.h $(doublest_h)
+ $(gdb_string_h) scm-lang.h $(doublest_h) $(regcache_h)
vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) \
- $(arch_utils_h) $(inferior_h) vax-tdep.h
+ $(arch_utils_h) $(inferior_h) $(vax_tdep_h)
x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
$(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h)
-x86-64-tdep.o : x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) $(gdbcmd_h) \
- $(arch_utils_h) $(regcache_h) $(symfile_h) x86-64-tdep.h i386-tdep.h \
- $(dwarf2cfi_h) $(gdb_assert_h)
+x86-64-tdep.o : x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) x86-64-tdep.h \
+ i386-tdep.h $(dwarf2cfi_h) $(gdb_assert_h) $(objfiles_h)
x86-64-linux-nat.o : x86-64-linux-nat.c $(defs_h) $(inferior_h) \
- $(gdbcore_h) $(regcache_h) i387-tdep.h $(gdb_assert_h) x86-64-tdep.h \
+ $(gdbcore_h) $(regcache_h) $(gdb_assert_h) x86-64-tdep.h \
i386-tdep.h
win32-nat.o: win32-nat.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
$(gdb_string_h) $(regcache_h) $(completer_h)
-xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_ld.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c
-
-xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_ptrace.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c
-
-xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/xdr_rdb.h
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_rdb.c
-
xcoffread.o: xcoffread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
$(INCLUDE_DIR)/aout/stab_gnu.h $(INCLUDE_DIR)/coff/internal.h \
$(INCLUDE_DIR)/coff/rs6000.h $(BFD_SRC)/libcoff.h $(buildsym_h) \
@@ -2251,11 +2377,8 @@ xcoffsolib.o: xcoffsolib.c $(bfd_h) $(defs_h) $(xcoffsolib_h) $(inferior_h) \
# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
# declared -Wimplicit fails. It should be using the GDBARCH framework.
# cagney 1999-09-02.
-z8k-tdep.o: z8k-tdep.c $(bfd_h) $(dis_asm_h) $(defs_h) $(frame_h) \
- $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) $(gdbcore_h) $(value_h) \
- $(regcache_h)
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \
- $(srcdir)/z8k-tdep.c
+z8k-tdep.o: z8k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcmd_h) \
+ $(gdbtypes_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h)
c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \
$(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \
@@ -2277,103 +2400,213 @@ p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \
$(bfd_h) $(objfiles_h) $(symfile_h)
+ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \
+ $(defs_h) $(expression_h) \
+ $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \
+ $(bfd_h) objfiles.h symfile.h
+
gdb-events.o: gdb-events.c $(gdb_events_h) $(defs_h) $(gdbcmd_h)
ui-out.o: ui-out.c $(defs_h) $(ui_out_h) $(expression_h) $(language_h)
-cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(interps_h)
-inters.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
- $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h)
-varobj.o: varobj.c $(defs_h) $(frame_h) $(value_h) \
- $(language_h) $(valprint_h) $(varobj_h) $(wrapper_h)
+cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h)
+
+varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
+ $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) $(wrapper_h)
#
-# CLI dependencies
+# gdb/cli/ dependencies
#
# Need to explicitly specify the compile rule as make will do nothing
-# or try to compile the object file into the cli directory.
+# or try to compile the object file into the mi directory.
-cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(cli_cmds_h) $(cli_decode_h) \
- $(cli_script_h) $(cli_setshow_h) $(top_h) $(completer_h) \
- $(defs_h) $(target_h) $(gdb_wait_h) $(gdb_regex_h) $(ui_out_h)
+cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \
+ $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \
+ $(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \
+ $(cli_setshow_h) $(cli_cmds_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
-
-cli-decode.o: $(srcdir)/cli/cli-decode.c $(cli_decode_h) \
- $(cli_cmds_h) $(defs_h) $(ui_out_h) \
- $(symtab_h) $(gdb_regex_h)
+cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
+ $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \
+ $(cli_decode_h) $(gdb_assert_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c
-
-cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) $(command_h) \
- $(value_h) $(gdbcmd_h) $(completer_h) $(cli_dump_h)
+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)
$(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) \
+ $(cli_script_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c
+cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(value_h) \
+ $(gdb_string_h) $(ui_out_h) $(cli_decode_h) $(cli_cmds_h) \
+ $(cli_setshow_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c
+cli-utils.o: $(srcdir)/cli/cli-utils.c $(defs_h) $(cli_utils_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c
-cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(interps_h) \
- $(wrapper_h) $(event_top_h) $(ui_out_h) $(cli_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c
+#
+# GDBTK sub-directory
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
-cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(cli_setshow_h) \
- $(cli_decode_h) $(cli_cmds_h) $(defs_h) \
- $(value_h) $(ui_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c
+gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
+ $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
-cli-script.o: $(srcdir)/cli/cli-script.c $(cli_script_h) \
- $(cli_cmds_h) $(cli_decode_h) $(top_h) \
- $(defs_h) $(value_h) $(language_h) $(ui_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c
+gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
+ $(symtab_h) $(inferior_h) $(command_h) \
+ $(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) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" -DSRC_DIR=\"$(GDBTK_SRC_DIR)\"
-cli-utils.o: $(srcdir)/cli/cli-utils.c $(cli_utils_h) $(defs_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c
+gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h \
+ $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(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) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(defs_h) $(symtab_h) $(inferior_h) \
+ $(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) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \
+ $(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) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h \
+ $(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) \
+ $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \
+ -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\"
+
+gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
+ $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
+ $(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) \
+ $(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) \
+ $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-varobj.c
+
+gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
+ $(defs_h) $(frame_h) $(value_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.c
#
-# MI dependencies
+# gdb/mi/ dependencies
#
# Need to explicitly specify the compile rule as make will do nothing
# or try to compile the object file into the mi directory.
-mi_h = $(srcdir)/mi/mi.h
-mi_cmds_h = $(srcdir)/mi/mi-cmds.h
-mi_out_h = $(srcdir)/mi/mi-out.h
-mi_parse_h = $(srcdir)/mi/mi-parse.h
-mi_getopt_h = $(srcdir)/mi/mi-getopt.h
-mi_console_h = $(srcdir)/mi/mi-console.h
-
-mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c
-mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(top_h) $(mi_cmds_h) \
- $(ui_out_h) $(varobj_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c
-mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(top_h) $(mi_cmds_h) \
- $(ui_out_h) $(frame_h) $(value_h) $(target_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
- $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \
- $(gdb_events_h) $(mi_getopt_h) $(gdb_h)
+ $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \
+ $(mi_getopt_h) $(gdb_events_h) $(gdb_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
-mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(mi_cmds_h) \
- $(ui_out_h) $(value_h) $(target_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)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
-mi-events.o: $(srcdir)/mi/mi-events.c $(defs_h) $(ui_out_h) $(interps_h) \
- $(gdb_h) $(breakpoint_h) $(mi_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-events.c
-mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(interps_h) \
- $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) \
- $(top_h) $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c
-mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(top_h) $(mi_cmds_h) $(ui_out_h) \
- $(mi_console_h) $(mi_getopt_h) $(event_loop_h) $(event_top_h) \
- $(mi_getopt_h) $(regcache_h) $(gdb_h) $(target_h) \
- $(inferior_h) $(gdb_string_h) $(gdbthread_h) $(mi_out_h) \
- $(gdbcore_h) $(value_h)
+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)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
+mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \
+ $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c
+mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) \
+ $(gdb_string_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c
+mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \
+ $(gdb_string_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c
+mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(defs_h) $(mi_getopt_h) \
+ $(gdb_string_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c
+mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \
+ $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \
+ $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \
+ $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \
+ $(gdb_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
-mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(mi_out_h) $(ui_out_h)
+mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
-mi-console.o: $(srcdir)/mi/mi-console.c $(mi_out_h) $(defs_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c
-mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_parse_h) $(mi_cmds_h)
+mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \
+ $(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c
-mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c
+
+#
+# nindy-share sub-directory
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
+
+Onindy.o: nindy-share/Onindy.c $(gdb_wait_h) nindy-share/block_io.h \
+ nindy-share/env.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c
+
+nindy.o: nindy-share/nindy.c $(gdb_wait_h) nindy-share/block_io.h \
+ nindy-share/env.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c
+
+ttyflush.o: nindy-share/ttyflush.c $(srcdir)/nindy-share/ttyflush.c
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c
+
+#
+# rdi-share sub-directory
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
+
+rdi-share/libangsd.a: force
+ @dir=rdi-share; \
+ if [ -f ./$${dir}/Makefile ] ; then \
+ r=`pwd`; export r; \
+ srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
+ else \
+ true; \
+ fi
+
+#
+# Signals sub-directory
+#
+# Need to explicitly specify the compile rule as make will do nothing
+# or try to compile the object file into the mi directory.
+
+signals.o: $(srcdir)/signals/signals.c $(defs_h) $(target_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/signals/signals.c
#
# TUI dependencies
@@ -2381,69 +2614,89 @@ mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(mi_getopt_h) $(defs_h)
# Need to explicitly specify the compile rule as make will do nothing
# or try to compile the object file into the mi directory.
-tui.o: $(srcdir)/tui/tui.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiIO.h \
- $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui.c
-tui-out.o: $(srcdir)/tui/tui-out.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-out.c
-tui-hooks.o: $(srcdir)/tui/tui-hooks.c \
- $(srcdir)/tui/tui.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tui-hooks.c
-tuiCommand.o: $(srcdir)/tui/tuiCommand.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiWin.h $(srcdir)/tui/tuiIO.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiCommand.c
-tuiData.o: $(srcdir)/tui/tuiData.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiData.c
-tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiRegs.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDataWin.c
-tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiSourceWin.h \
- $(srcdir)/tui/tuiStack.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiDisassem.c
-tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiGeneralWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c
-tuiIO.o: $(srcdir)/tui/tuiIO.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiIO.h $(srcdir)/tui/tuiCommand.h \
- $(srcdir)/tui/tuiWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiIO.c
-tuiLayout.o: $(srcdir)/tui/tuiLayout.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \
- $(srcdir)/tui/tuiRegs.h $(srcdir)/tui/tuiDisassem.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiLayout.c
-tuiRegs.o: $(srcdir)/tui/tuiRegs.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiLayout.h $(srcdir)/tui/tuiWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiRegs.c
-tuiSource.o: $(srcdir)/tui/tuiSource.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \
- $(srcdir)/tui/tuiSource.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSource.c
-tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h \
- $(srcdir)/tui/tuiSource.h $(srcdir)/tui/tuiDisassem.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiSourceWin.c
-tuiStack.o: $(srcdir)/tui/tuiStack.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiStack.h $(srcdir)/tui/tuiSourceWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiStack.c
-tuiWin.o: $(srcdir)/tui/tuiWin.c \
- $(srcdir)/tui/tui.h $(srcdir)/tui/tuiData.h \
- $(srcdir)/tui/tuiGeneralWin.h $(srcdir)/tui/tuiStack.h \
- $(srcdir)/tui/tuiSourceWin.h $(srcdir)/tui/tuiDataWin.h
- $(CC) -c $(INTERNAL_WARN_CFLAGS) $(srcdir)/tui/tuiWin.c
+tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \
+ $(tui_tuiIO_h) $(tui_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c
+tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(config_h) $(defs_h) $(symtab_h) \
+ $(inferior_h) $(command_h) $(bfd_h) $(symfile_h) $(objfiles_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)
+ $(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)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-out.c
+tui.o: $(srcdir)/tui/tui.c $(config_h) $(defs_h) $(gdbcmd_h) $(tui_h) \
+ $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) $(tuiRegs_h) $(tuiStack_h) \
+ $(tuiWin_h) $(tuiSourceWin_h) $(readline_h) $(target_h) $(frame_h) \
+ $(breakpoint_h) $(inferior_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui.c
+tuiCommand.o: $(srcdir)/tui/tuiCommand.c $(config_h) $(defs_h) $(tui_h) \
+ $(tuiData_h) $(tuiWin_h) $(tuiIO_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiCommand.c
+tuiData.o: $(srcdir)/tui/tuiData.c $(config_h) $(defs_h) $(tui_h) \
+ $(tuiData_h) $(tuiGeneralWin_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiData.c
+tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c $(config_h) $(defs_h) $(tui_h) \
+ $(tuiData_h) $(tuiGeneralWin_h) $(tuiRegs_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDataWin.c
+tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c $(config_h) $(defs_h) $(symtab_h) \
+ $(breakpoint_h) $(frame_h) $(value_h) $(tui_h) $(tuiData_h) \
+ $(tuiWin_h) $(tuiLayout_h) $(tuiSourceWin_h) $(tuiStack_h) \
+ $(tui_file_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDisassem.c
+tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c $(config_h) $(defs_h) \
+ $(tui_h) $(tuiData_h) $(tuiGeneralWin_h) $(tuiWin_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c
+tuiIO.o: $(srcdir)/tui/tuiIO.c $(config_h) $(defs_h) $(terminal_h) \
+ $(target_h) $(event_loop_h) $(command_h) $(top_h) $(readline_h) \
+ $(tui_h) $(tuiData_h) $(tuiIO_h) $(tuiCommand_h) $(tuiWin_h) \
+ $(tuiGeneralWin_h) $(tui_file_h) $(ui_out_h) $(cli_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiIO.c
+tuiLayout.o: $(srcdir)/tui/tuiLayout.c $(config_h) $(defs_h) $(command_h) \
+ $(symtab_h) $(frame_h) $(tui_h) $(tuiData_h) $(tuiDataWin_h) \
+ $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) $(tuiWin_h) \
+ $(tuiSourceWin_h) $(tuiDisassem_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiLayout.c
+tuiRegs.o: $(srcdir)/tui/tuiRegs.c $(config_h) $(defs_h) $(tui_h) \
+ $(tuiData_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) \
+ $(inferior_h) $(target_h) $(tuiLayout_h) $(tuiWin_h) $(tuiDataWin_h) \
+ $(tuiGeneralWin_h) $(tui_file_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiRegs.c
+tuiSource.o: $(srcdir)/tui/tuiSource.c $(config_h) $(defs_h) $(symtab_h) \
+ $(frame_h) $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) \
+ $(tuiData_h) $(tuiStack_h) $(tuiSourceWin_h) $(tuiSource_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSource.c
+tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c $(config_h) $(defs_h) \
+ $(symtab_h) $(frame_h) $(breakpoint_h) $(value_h) $(tui_h) \
+ $(tuiData_h) $(tuiStack_h) $(tuiWin_h) $(tuiGeneralWin_h) \
+ $(tuiSourceWin_h) $(tuiSource_h) $(tuiDisassem_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSourceWin.c
+tuiStack.o: $(srcdir)/tui/tuiStack.c $(config_h) $(defs_h) $(symtab_h) \
+ $(breakpoint_h) $(frame_h) $(command_h) $(tui_h) $(tuiData_h) \
+ $(tuiStack_h) $(tuiGeneralWin_h) $(tuiSource_h) $(tuiSourceWin_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiStack.c
+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)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiWin.c
+
+#
+# vx-share sub-directory
+#
+
+xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \
+ vx-share/vxWorks.h vx-share/xdr_ld.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c
+
+xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \
+ vx-share/vxWorks.h vx-share/xdr_ptrace.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c
+
+xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \
+ vx-share/vxWorks.h vx-share/xdr_rdb.h
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_rdb.c
### end of the gdb Makefile.in.
diff --git a/gdb/NEWS b/gdb/NEWS
index a61b435c687..8b09cf60b7f 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,44 +3,50 @@
*** Changes since GDB 5.2:
+* ``gdbserver'' now supports multi-threaded applications on some targets
+
+Support for debugging multi-threaded applications which use
+the GNU/Linux LinuxThreads package has been added for
+arm*-*-linux*-gnu*, i[3456]86-*-linux*-gnu*, mips*-*-linux*-gnu*,
+powerpc*-*-linux*-gnu*, and sh*-*-linux*-gnu*.
+
* GDB now supports C/C++ preprocessor macros.
GDB now expands preprocessor macro invocations in C/C++ expressions,
and provides various commands for showing macro definitions and how
they expand.
+The new command `macro expand EXPRESSION' expands any macro
+invocations in expression, and shows the result.
+
+The new command `show macro MACRO-NAME' shows the definition of the
+macro named MACRO-NAME, and where it was defined.
+
Most compilers don't include information about macros in the debugging
information by default. In GCC 3.1, for example, you need to compile
your program with the options `-gdwarf-2 -g3'. If the macro
information is present in the executable, GDB will read it.
-Here are the new commands for working with macros:
-
-** macro expand EXPRESSION
-
-Expand any macro invocations in expression, and show the result.
-
-** show macro MACRO-NAME
-
-Show the definition of the macro named MACRO-NAME, and where it was
-defined.
-
* Multi-arched targets.
DEC Alpha (partial) alpha*-*-*
DEC VAX (partial) vax-*-*
NEC V850 v850-*-*
National Semiconductor NS32000 (partial) ns32k-*-*
+Motorola 68000 (partial) m68k-*-*
+Motorola MCORE mcore-*-*
* New targets.
-Atmel AVR avr*-*-*
+Fujitsu FRV architecture added by Red Hat frv*-*-*
+
* New native configurations
Alpha NetBSD alpha*-*-netbsd*
SH NetBSD sh*-*-netbsdelf*
MIPS NetBSD mips*-*-netbsd*
+UltraSPARC NetBSD sparc64-*-netbsd*
* OBSOLETE configurations and files
@@ -49,6 +55,24 @@ been commented out. Unless there is activity to revive these
configurations, the next release of GDB will have their sources
permanently REMOVED.
+Mitsubishi D30V d30v-*-*
+OS/9000 i[34]86-*-os9k
+IBM AIX PS/2 i[3456]86-*-aix
+Fujitsu FR30 fr30-*-elf*
+Motorola Delta 88000 running Sys V m88k-motorola-sysv or delta88
+Argonaut Risc Chip (ARC) arc-*-*
+i386 running Mach 3.0 i[3456]86-*-mach3*
+i386 running Mach i[3456]86-*-mach*
+i386 running OSF/1 i[3456]86-*osf1mk*
+HP/Apollo 68k Family m68*-apollo*-sysv*,
+ m68*-apollo*-bsd*,
+ m68*-hp-bsd*, m68*-hp-hpux*
+I960 with MON960 i960-*-coff
+
+* OBSOLETE languages
+
+CHILL, a Pascal like language used by telecommunications companies.
+
* REMOVED configurations and files
AMD 29k family via UDI a29k-amd-udi, udi29k
@@ -74,6 +98,36 @@ These commands allow data to be copied from target memory
to a bfd-format or binary file (dump and append), and back
from a file into memory (restore).
+* Improved "next/step" support on multi-processor Alpha Tru64.
+
+The previous single-step mechanism could cause unpredictable problems,
+including the random appearance of SIGSEGV or SIGTRAP signals. The use
+of a software single-step mechanism prevents this.
+
+*** Changes in GDB 5.2.1:
+
+* New targets.
+
+Atmel AVR avr*-*-*
+
+* Bug fixes
+
+gdb/182: gdb/323: gdb/237: On alpha, gdb was reporting:
+mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
+Fix, by Joel Brobecker imported from mainline.
+
+gdb/439: gdb/291: On some ELF object files, gdb was reporting:
+dwarf2read.c:1072: gdb-internal-error: sect_index_text not initialize
+Fix, by Fred Fish, imported from mainline.
+
+Dwarf2 .debug_frame & .eh_frame handler improved in many ways.
+Surprisingly enough, it works now.
+By Michal Ludvig, imported from mainline.
+
+i386 hardware watchpoint support:
+avoid misses on second run for some targets.
+By Pierre Muller, imported from mainline.
+
*** Changes in GDB 5.2:
* New command "set trust-readonly-sections on[off]".
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index 49d27967daa..9ffea60be61 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -1,9 +1,26 @@
- Known problems in GDB 5.2
+ Known problems in GDB 5.3
See also: http://www.gnu.org/software/gdb/bugs/
+*-*-freebsd*
+---------------
+
+Due to a kernel bug (kern/35175), detaching from an attached process
+will very likely cause the process to be stop or die with a Trace/BPT
+trap.
+
+
+i386-*-freebsd[34]*
+-------------------
+
+There is a bug (bin/41671) in FreeBSD's gcc that causes it to emit bad
+debug information when using the stabs format (which is the default).
+In earlier versions of GDB the effects were rather limited, but
+starting with GDB 5.3 the influence is much more prominent.
+
+
hppa2.0-hp-hpux10.20
--------------------
diff --git a/gdb/README b/gdb/README
index 8af440fbd68..64526ae2dfb 100644
--- a/gdb/README
+++ b/gdb/README
@@ -1,5 +1,5 @@
- README for gdb-5.2 release
- Updated 17 April, 2002 by Andrew Cagney
+ README for gdb-5.2.1 release
+ Updated 19 July, 2002 by Andrew Cagney
This is GDB, the GNU source-level debugger.
@@ -20,7 +20,7 @@ Unpacking and Installation -- quick overview
In this release, the GDB debugger sources, the generic GNU include
files, the BFD ("binary file description") library, the readline
library, and other libraries all have directories of their own
-underneath the gdb-5.2 directory. The idea is that a variety of GNU
+underneath the gdb-5.2.1 directory. The idea is that a variety of GNU
tools can share a common copy of these things. Be aware of variation
over time--for example don't try to build gdb with a copy of bfd from
a release other than the gdb release (such as a binutils release),
@@ -29,8 +29,8 @@ Configuration scripts and makefiles exist to cruise up and down this
directory tree and automatically build all the pieces in the right
order.
- When you unpack the gdb-5.2.tar.gz file, you'll find a directory
-called `gdb-5.2', which contains:
+ When you unpack the gdb-5.2.1.tar.gz file, you'll find a directory
+called `gdb-5.2.1', which contains:
COPYING config.sub intl missing opcodes
COPYING.LIB configure libiberty mkinstalldirs readline
@@ -44,7 +44,7 @@ called `gdb-5.2', which contains:
You can build GDB right in the source directory:
- cd gdb-5.2
+ cd gdb-5.2.1
./configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
@@ -58,12 +58,12 @@ You can build GDB in any empty build directory:
mkdir build
cd build
- <full path to your sources>/gdb-5.2/configure
+ <full path to your sources>/gdb-5.2.1/configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly
-different; see the file gdb-5.2/gdb/config/djgpp/README for details.)
+different; see the file gdb-5.2.1/gdb/config/djgpp/README for details.)
This will configure and build all the libraries as well as GDB. If
`configure' can't determine your system type, specify one as its
@@ -94,7 +94,7 @@ documentation and TeX (or `texi2roff') to typeset the printed version.
GDB includes an already formatted copy of the on-line Info version
of this manual in the `gdb/doc' subdirectory. The main Info file is
-`gdb-5.2/gdb/doc/gdb.info', and it refers to subordinate files
+`gdb-5.2.1/gdb/doc/gdb.info', and it refers to subordinate files
matching `gdb.info*' in the same directory. If necessary, you can
print out these files, or read them with any editor; but they are
easier to read using the `info' subsystem in GNU Emacs or the
@@ -106,7 +106,7 @@ Info formatting programs, such as `texinfo-format-buffer' or
`makeinfo'.
If you have `makeinfo' installed, and are in the top level GDB
-source directory (`gdb-5.2', in the case of version 5.2), you can make
+source directory (`gdb-5.2.1', in the case of version 5.2.1), you can make
the Info file by typing:
cd gdb/doc
@@ -115,7 +115,7 @@ the Info file by typing:
If you want to typeset and print copies of this manual, you need
TeX, a program to print its DVI output files, and `texinfo.tex', the
Texinfo definitions file. This file is included in the GDB
-distribution, in the directory `gdb-5.2/texinfo'.
+distribution, in the directory `gdb-5.2.1/texinfo'.
TeX is a typesetting program; it does not print files directly, but
produces output files called DVI files. To print a typeset document,
@@ -129,11 +129,11 @@ without any extension or a `.dvi' extension.
This file tells TeX how to typeset a document written in Texinfo
format. On its own, TeX cannot read, much less typeset a Texinfo file.
`texinfo.tex' is distributed with GDB and is located in the
-`gdb-5.2/texinfo' directory.
+`gdb-5.2.1/texinfo' directory.
If you have TeX and a DVI printer program installed, you can typeset
and print this manual. First switch to the the `gdb' subdirectory of
-the main source directory (for example, to `gdb-5.2/gdb') and then type:
+the main source directory (for example, to `gdb-5.2.1/gdb') and then type:
make doc/gdb.dvi
@@ -156,55 +156,55 @@ preparing GDB for installation; you can then use `make' to build the
a single directory, whose name is usually composed by appending the
version number to `gdb'.
- For example, the GDB version 5.2 distribution is in the `gdb-5.2'
+ For example, the GDB version 5.2.1 distribution is in the `gdb-5.2.1'
directory. That directory contains:
-`gdb-5.2/{COPYING,COPYING.LIB}'
+`gdb-5.2.1/{COPYING,COPYING.LIB}'
Standard GNU license files. Please read them.
-`gdb-5.2/bfd'
+`gdb-5.2.1/bfd'
source for the Binary File Descriptor library
-`gdb-5.2/config*'
+`gdb-5.2.1/config*'
script for configuring GDB, along with other support files
-`gdb-5.2/gdb'
+`gdb-5.2.1/gdb'
the source specific to GDB itself
-`gdb-5.2/include'
+`gdb-5.2.1/include'
GNU include files
-`gdb-5.2/libiberty'
+`gdb-5.2.1/libiberty'
source for the `-liberty' free software library
-`gdb-5.2/mmalloc'
+`gdb-5.2.1/mmalloc'
source for the GNU memory-mapped malloc package
-`gdb-5.2/opcodes'
+`gdb-5.2.1/opcodes'
source for the library of opcode tables and disassemblers
-`gdb-5.2/readline'
+`gdb-5.2.1/readline'
source for the GNU command-line interface
NOTE: The readline library is compiled for use by GDB, but will
not be installed on your system when "make install" is issued.
-`gdb-5.2/sim'
+`gdb-5.2.1/sim'
source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)
-`gdb-5.2/intl'
+`gdb-5.2.1/intl'
source for the GNU gettext library, for internationalization.
This is slightly modified from the standalone gettext
distribution you can get from GNU.
-`gdb-5.2/texinfo'
+`gdb-5.2.1/texinfo'
The `texinfo.tex' file, which you need in order to make a printed
manual using TeX.
-`gdb-5.2/etc'
+`gdb-5.2.1/etc'
Coding standards, useful files for editing GDB, and other
miscellanea.
-`gdb-5.2/utils'
+`gdb-5.2.1/utils'
A grab bag of random utilities.
Note: the following instructions are for building GDB on Unix or
@@ -213,14 +213,14 @@ MS-DOS/MS-Windows are in the file gdb/config/djgpp/README.
The simplest way to configure and build GDB is to run `configure'
from the `gdb-VERSION-NUMBER' source directory, which in this example
-is the `gdb-5.2' directory.
+is the `gdb-5.2.1' directory.
First switch to the `gdb-VERSION-NUMBER' source directory if you are
not already in it; then run `configure'.
For example:
- cd gdb-5.2
+ cd gdb-5.2.1
./configure
make
@@ -236,8 +236,8 @@ you may need to run `sh' on it explicitly:
sh configure
If you run `configure' from a directory that contains source
-directories for multiple libraries or programs, such as the `gdb-5.2'
-source directory for version 5.2, `configure' creates configuration
+directories for multiple libraries or programs, such as the `gdb-5.2.1'
+source directory for version 5.2.1, `configure' creates configuration
files for every directory level underneath (unless you tell it not to,
with the `--norecursion' option).
@@ -245,10 +245,10 @@ with the `--norecursion' option).
directories in the GDB distribution, if you only want to configure that
subdirectory; but be sure to specify a path to it.
- For example, with version 5.2, type the following to configure only
+ For example, with version 5.2.1, type the following to configure only
the `bfd' subdirectory:
- cd gdb-5.2/bfd
+ cd gdb-5.2.1/bfd
../configure
You can install `gdb' anywhere; it has no hardwired paths. However,
@@ -277,13 +277,13 @@ directory. If the path to `configure' would be the same as the
argument to `--srcdir', you can leave out the `--srcdir' option; it
will be assumed.)
- For example, with version 5.2, you can build GDB in a separate
+ For example, with version 5.2.1, you can build GDB in a separate
directory for a Sun 4 like this:
- cd gdb-5.2
+ cd gdb-5.2.1
mkdir ../gdb-sun4
cd ../gdb-sun4
- ../gdb-5.2/configure
+ ../gdb-5.2.1/configure
make
When `configure' builds a configuration using a remote source
@@ -304,8 +304,8 @@ called `configure' (or one of its subdirectories).
The `Makefile' that `configure' generates in each source directory
also runs recursively. If you type `make' in a source directory such
-as `gdb-5.2' (or in a separate configured directory configured with
-`--srcdir=PATH/gdb-5.2'), you will build all the required libraries,
+as `gdb-5.2.1' (or in a separate configured directory configured with
+`--srcdir=PATH/gdb-5.2.1'), you will build all the required libraries,
and then build GDB.
When you have multiple hosts or targets configured in separate
@@ -348,7 +348,7 @@ you can use it to test your guesses on abbreviations--for example:
Invalid configuration `i786v': machine `i786v' not recognized
`config.sub' is also distributed in the GDB source directory
-(`gdb-5.2', for version 5.2).
+(`gdb-5.2.1', for version 5.2.1).
`configure' options
@@ -451,7 +451,6 @@ monitors and other hardware:
remote-adapt.c AMD 29000 "Adapt"
remote-array.c Array Tech RAID controller
- remote-bug.c Motorola BUG monitor
remote-e7000.c Hitachi E7000 ICE
remote-eb.c AMD 29000 "EBMON"
remote-es.c Ericsson 1800 monitor
@@ -496,7 +495,7 @@ As an alternative, the bug report can be submitted, via e-mail, to the
address "bug-gdb@gnu.org".
When submitting a bug, please include the GDB version number (e.g.,
-gdb-5.2), and how you configured it (e.g., "sun4" or "mach386 host,
+gdb-5.2.1), and how you configured it (e.g., "sun4" or "mach386 host,
i586-intel-synopsys target"). Since GDB now supports so many
different configurations, it is important that you be precise about
this. If at all possible, you should include the actual banner that
@@ -551,17 +550,17 @@ ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot.
Once DejaGNU is installed, you can run the tests in one of the
following ways:
- (1) cd gdb-5.2
+ (1) cd gdb-5.2.1
make check-gdb
or
- (2) cd gdb-5.2/gdb
+ (2) cd gdb-5.2.1/gdb
make check
or
- (3) cd gdb-5.2/gdb/testsuite
+ (3) cd gdb-5.2.1/gdb/testsuite
make site.exp (builds the site specific file)
runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate)
diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c
index b4c44a94b54..8a9e8ff47c7 100644
--- a/gdb/abug-rom.c
+++ b/gdb/abug-rom.c
@@ -76,12 +76,22 @@ abug_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes an "A7".
*/
-static char *abug_regnames[NUM_REGS] =
+static const char *
+abug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "PC",
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "PC",
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -141,7 +151,8 @@ init_abug_cmds (void)
abug_cmds.cmd_end = NULL; /* optional command terminator */
abug_cmds.target = &abug_ops; /* target operations */
abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- abug_cmds.regnames = abug_regnames; /* registers names */
+ abug_cmds.regnames = NULL; /* registers names */
+ abug_cmds.regname = abug_regname;
abug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
};
diff --git a/gdb/ada-exp.tab.c b/gdb/ada-exp.tab.c
deleted file mode 100644
index bb6d29bf276..00000000000
--- a/gdb/ada-exp.tab.c
+++ /dev/null
@@ -1,2389 +0,0 @@
-/* A Bison parser, made from ./ada-exp.y
- by GNU bison 1.35. */
-
-#define YYBISON 1 /* Identify Bison output. */
-
-# define INT 257
-# define NULL_PTR 258
-# define CHARLIT 259
-# define FLOAT 260
-# define TYPENAME 261
-# define BLOCKNAME 262
-# define STRING 263
-# define NAME 264
-# define DOT_ID 265
-# define OBJECT_RENAMING 266
-# define DOT_ALL 267
-# define LAST 268
-# define REGNAME 269
-# define INTERNAL_VARIABLE 270
-# define ASSIGN 271
-# define _AND_ 272
-# define OR 273
-# define XOR 274
-# define THEN 275
-# define ELSE 276
-# define NOTEQUAL 277
-# define LEQ 278
-# define GEQ 279
-# define IN 280
-# define DOTDOT 281
-# define UNARY 282
-# define MOD 283
-# define REM 284
-# define STARSTAR 285
-# define ABS 286
-# define NOT 287
-# define TICK_ACCESS 288
-# define TICK_ADDRESS 289
-# define TICK_FIRST 290
-# define TICK_LAST 291
-# define TICK_LENGTH 292
-# define TICK_MAX 293
-# define TICK_MIN 294
-# define TICK_MODULUS 295
-# define TICK_POS 296
-# define TICK_RANGE 297
-# define TICK_SIZE 298
-# define TICK_TAG 299
-# define TICK_VAL 300
-# define ARROW 301
-# define NEW 302
-
-#line 38 "./ada-exp.y"
-
-
-#include "defs.h"
-#include <string.h>
-#include <ctype.h>
-#include "expression.h"
-#include "value.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "ada-lang.h"
-#include "bfd.h" /* Required by objfiles.h. */
-#include "symfile.h" /* Required by objfiles.h. */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
-#include "frame.h"
-
-/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
- as well as gratuitiously global symbol names, so we can have multiple
- yacc generated parsers in gdb. These are only the variables
- produced by yacc. If other parser generators (bison, byacc, etc) produce
- additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
-
-/* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix
- options. I presume we are maintaining it to accommodate systems
- without BISON? (PNH) */
-
-#define yymaxdepth ada_maxdepth
-#define yyparse _ada_parse /* ada_parse calls this after initialization */
-#define yylex ada_lex
-#define yyerror ada_error
-#define yylval ada_lval
-#define yychar ada_char
-#define yydebug ada_debug
-#define yypact ada_pact
-#define yyr1 ada_r1
-#define yyr2 ada_r2
-#define yydef ada_def
-#define yychk ada_chk
-#define yypgo ada_pgo
-#define yyact ada_act
-#define yyexca ada_exca
-#define yyerrflag ada_errflag
-#define yynerrs ada_nerrs
-#define yyps ada_ps
-#define yypv ada_pv
-#define yys ada_s
-#define yy_yys ada_yys
-#define yystate ada_state
-#define yytmp ada_tmp
-#define yyv ada_v
-#define yy_yyv ada_yyv
-#define yyval ada_val
-#define yylloc ada_lloc
-#define yyreds ada_reds /* With YYDEBUG defined */
-#define yytoks ada_toks /* With YYDEBUG defined */
-
-#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
-#endif
-
-struct name_info {
- struct symbol* sym;
- struct minimal_symbol* msym;
- struct block* block;
- struct stoken stoken;
-};
-
-/* If expression is in the context of TYPE'(...), then TYPE, else
- * NULL. */
-static struct type* type_qualifier;
-
-int yyparse (void);
-
-static int yylex (void);
-
-void yyerror (char *);
-
-static struct stoken string_to_operator (struct stoken);
-
-static void write_attribute_call0 (enum ada_attribute);
-
-static void write_attribute_call1 (enum ada_attribute, LONGEST);
-
-static void write_attribute_calln (enum ada_attribute, int);
-
-static void write_object_renaming (struct block*, struct symbol*);
-
-static void write_var_from_name (struct block*, struct name_info);
-
-static LONGEST
-convert_char_literal (struct type*, LONGEST);
-
-#line 131 "./ada-exp.y"
-#ifndef YYSTYPE
-typedef union
- {
- LONGEST lval;
- struct {
- LONGEST val;
- struct type *type;
- } typed_val;
- struct {
- DOUBLEST dval;
- struct type *type;
- } typed_val_float;
- struct type *tval;
- struct stoken sval;
- struct name_info ssym;
- int voidval;
- struct block *bval;
- struct internalvar *ivar;
-
- } yystype;
-# define YYSTYPE yystype
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-
-
-#define YYFINAL 184
-#define YYFLAG -32768
-#define YYNTBASE 68
-
-/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
-#define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 82)
-
-/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
-static const char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 34, 63,
- 57, 62, 36, 32, 64, 33, 56, 37, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 61,
- 25, 23, 26, 2, 31, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 58, 2, 67, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 65, 2, 66, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 24, 27, 28,
- 29, 30, 35, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 59, 60
-};
-
-#if YYDEBUG
-static const short yyprhs[] =
-{
- 0, 0, 2, 4, 6, 10, 13, 16, 21, 26,
- 27, 35, 36, 43, 47, 49, 51, 53, 55, 57,
- 61, 64, 67, 70, 73, 74, 76, 80, 84, 90,
- 95, 99, 103, 107, 111, 115, 119, 123, 127, 131,
- 135, 139, 143, 149, 155, 159, 166, 173, 178, 182,
- 186, 190, 194, 199, 203, 208, 212, 215, 218, 222,
- 226, 230, 233, 236, 244, 252, 258, 262, 266, 270,
- 276, 279, 280, 284, 286, 288, 289, 291, 293, 295,
- 297, 299, 302, 304, 307, 309, 312, 314, 316, 318,
- 320, 323, 325, 328, 331, 335, 338, 341
-};
-static const short yyrhs[] =
-{
- 69, 0, 81, 0, 73, 0, 69, 61, 73, 0,
- 70, 13, 0, 70, 11, 0, 70, 57, 74, 62,
- 0, 81, 57, 73, 62, 0, 0, 81, 63, 72,
- 71, 57, 73, 62, 0, 0, 70, 57, 73, 30,
- 73, 62, 0, 57, 69, 62, 0, 78, 0, 15,
- 0, 16, 0, 70, 0, 14, 0, 73, 17, 73,
- 0, 33, 73, 0, 32, 73, 0, 42, 73, 0,
- 41, 73, 0, 0, 73, 0, 79, 59, 73, 0,
- 74, 64, 73, 0, 74, 64, 79, 59, 73, 0,
- 65, 81, 66, 73, 0, 73, 40, 73, 0, 73,
- 36, 73, 0, 73, 37, 73, 0, 73, 39, 73,
- 0, 73, 38, 73, 0, 73, 31, 73, 0, 73,
- 32, 73, 0, 73, 34, 73, 0, 73, 33, 73,
- 0, 73, 23, 73, 0, 73, 24, 73, 0, 73,
- 27, 73, 0, 73, 29, 73, 30, 73, 0, 73,
- 29, 73, 52, 75, 0, 73, 29, 7, 0, 73,
- 42, 29, 73, 30, 73, 0, 73, 42, 29, 73,
- 52, 75, 0, 73, 42, 29, 7, 0, 73, 28,
- 73, 0, 73, 25, 73, 0, 73, 26, 73, 0,
- 73, 18, 73, 0, 73, 18, 21, 73, 0, 73,
- 19, 73, 0, 73, 19, 22, 73, 0, 73, 20,
- 73, 0, 70, 43, 0, 70, 44, 0, 70, 45,
- 75, 0, 70, 46, 75, 0, 70, 47, 75, 0,
- 70, 53, 0, 70, 54, 0, 77, 49, 57, 73,
- 64, 73, 62, 0, 77, 48, 57, 73, 64, 73,
- 62, 0, 77, 51, 57, 73, 62, 0, 76, 45,
- 75, 0, 76, 46, 75, 0, 76, 47, 75, 0,
- 76, 55, 57, 73, 62, 0, 76, 50, 0, 0,
- 57, 3, 62, 0, 7, 0, 76, 0, 0, 3,
- 0, 5, 0, 6, 0, 4, 0, 9, 0, 60,
- 7, 0, 10, 0, 80, 10, 0, 12, 0, 80,
- 12, 0, 10, 0, 7, 0, 12, 0, 8, 0,
- 80, 8, 0, 7, 0, 80, 7, 0, 7, 43,
- 0, 80, 7, 43, 0, 36, 73, 0, 34, 73,
- 0, 73, 58, 73, 67, 0
-};
-
-#endif
-
-#if YYDEBUG
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const short yyrline[] =
-{
- 0, 203, 204, 210, 211, 216, 220, 227, 235, 243,
- 243, 254, 256, 261, 264, 267, 274, 282, 285, 292,
- 296, 300, 304, 308, 312, 315, 317, 319, 321, 325,
- 335, 339, 343, 347, 351, 355, 359, 363, 367, 371,
- 375, 379, 383, 387, 393, 400, 405, 413, 423, 427,
- 431, 435, 439, 443, 447, 451, 455, 457, 463, 465,
- 467, 469, 471, 473, 475, 477, 479, 481, 483, 485,
- 487, 491, 493, 497, 504, 506, 513, 521, 533, 541,
- 548, 575, 579, 580, 582, 583, 587, 588, 589, 592,
- 594, 599, 600, 601, 603, 610, 612, 614
-};
-#endif
-
-
-#if (YYDEBUG) || defined YYERROR_VERBOSE
-
-/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
-static const char *const yytname[] =
-{
- "$", "error", "$undefined.", "INT", "NULL_PTR", "CHARLIT", "FLOAT",
- "TYPENAME", "BLOCKNAME", "STRING", "NAME", "DOT_ID", "OBJECT_RENAMING",
- "DOT_ALL", "LAST", "REGNAME", "INTERNAL_VARIABLE", "ASSIGN", "_AND_",
- "OR", "XOR", "THEN", "ELSE", "'='", "NOTEQUAL", "'<'", "'>'", "LEQ",
- "GEQ", "IN", "DOTDOT", "'@'", "'+'", "'-'", "'&'", "UNARY", "'*'",
- "'/'", "MOD", "REM", "STARSTAR", "ABS", "NOT", "TICK_ACCESS",
- "TICK_ADDRESS", "TICK_FIRST", "TICK_LAST", "TICK_LENGTH", "TICK_MAX",
- "TICK_MIN", "TICK_MODULUS", "TICK_POS", "TICK_RANGE", "TICK_SIZE",
- "TICK_TAG", "TICK_VAL", "'.'", "'('", "'['", "ARROW", "NEW", "';'",
- "')'", "'\\''", "','", "'{'", "'}'", "']'", "start", "exp1",
- "simple_exp", "@1", "save_qualifier", "exp", "arglist", "tick_arglist",
- "type_prefix", "opt_type_prefix", "variable", "any_name", "block",
- "type", 0
-};
-#endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const short yyr1[] =
-{
- 0, 68, 68, 69, 69, 70, 70, 70, 70, 71,
- 70, 72, 70, 70, 70, 70, 70, 73, 70, 73,
- 73, 73, 73, 73, 74, 74, 74, 74, 74, 73,
- 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
- 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
- 73, 73, 73, 73, 73, 73, 70, 70, 70, 70,
- 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
- 70, 75, 75, 76, 77, 77, 73, 73, 73, 73,
- 73, 73, 78, 78, 78, 78, 79, 79, 79, 80,
- 80, 81, 81, 81, 81, 73, 73, 73
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const short yyr2[] =
-{
- 0, 1, 1, 1, 3, 2, 2, 4, 4, 0,
- 7, 0, 6, 3, 1, 1, 1, 1, 1, 3,
- 2, 2, 2, 2, 0, 1, 3, 3, 5, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 5, 5, 3, 6, 6, 4, 3, 3,
- 3, 3, 4, 3, 4, 3, 2, 2, 3, 3,
- 3, 2, 2, 7, 7, 5, 3, 3, 3, 5,
- 2, 0, 3, 1, 1, 0, 1, 1, 1, 1,
- 1, 2, 1, 2, 1, 2, 1, 1, 1, 1,
- 2, 1, 2, 2, 3, 2, 2, 4
-};
-
-/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
- doesn't specify something else to do. Zero means the default is an
- error. */
-static const short yydefact[] =
-{
- 75, 76, 79, 77, 78, 73, 89, 80, 82, 84,
- 18, 15, 16, 75, 75, 75, 75, 75, 75, 75,
- 0, 0, 1, 17, 3, 74, 0, 14, 0, 2,
- 93, 21, 0, 20, 96, 95, 23, 22, 0, 81,
- 91, 0, 0, 75, 6, 5, 56, 57, 71, 71,
- 71, 61, 62, 75, 75, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 0, 75, 71, 71, 71, 70,
- 0, 0, 0, 0, 92, 90, 83, 85, 75, 11,
- 13, 75, 4, 0, 58, 59, 60, 73, 82, 84,
- 25, 0, 0, 19, 75, 51, 75, 53, 55, 39,
- 40, 49, 50, 41, 48, 44, 0, 35, 36, 38,
- 37, 31, 32, 34, 33, 30, 75, 0, 66, 67,
- 68, 75, 75, 75, 75, 94, 0, 9, 29, 0,
- 75, 7, 75, 75, 52, 54, 75, 71, 47, 0,
- 97, 0, 0, 0, 0, 8, 0, 72, 0, 27,
- 0, 26, 42, 43, 75, 71, 69, 75, 75, 65,
- 75, 12, 75, 45, 46, 0, 0, 0, 28, 64,
- 63, 10, 0, 0, 0
-};
-
-static const short yydefgoto[] =
-{
- 182, 22, 23, 156, 137, 24, 101, 94, 25, 26,
- 27, 102, 28, 32
-};
-
-static const short yypact[] =
-{
- 251,-32768,-32768,-32768,-32768, 20,-32768,-32768,-32768,-32768,
- -32768,-32768,-32768, 251, 251, 251, 251, 251, 251, 251,
- 2, 79, -47, 53, 958, -23, 54,-32768, 104, -32,
- -32768, 31, -32, 31, -22, -22, 31, 31, 33,-32768,
- -5, 101, -27, 251,-32768,-32768,-32768,-32768, 4, 4,
- 4,-32768,-32768, 131, 251, 171, 211, 251, 251, 251,
- 251, 251, 251, 251, 291, 251, 251, 251, 251, 251,
- 251, 251, 251, 251, 47, 251, 4, 4, 4,-32768,
- 23, 25, 27, 35, 45,-32768,-32768,-32768, 251,-32768,
- -32768, 251, 958, 98,-32768,-32768,-32768, 22, 56, 58,
- 930, -36, 64, 986, 251, 1009, 251, 1009, 1009, -21,
- -21, -21, -21, -21, -21, 534, 858, 387, 31, 31,
- 31, 32, 32, 32, 32, 32, 331, 415,-32768,-32768,
- -32768, 251, 251, 251, 251,-32768, 536,-32768, -22, 62,
- 251,-32768, 371, 251, 1009, 1009, 251, 4, 534, 894,
- -32768, 582, 452, 494, 628,-32768, 68,-32768, 674, 958,
- 67, 958, -21,-32768, 251, 4,-32768, 251, 251,-32768,
- 251,-32768, 251, -21,-32768, 720, 766, 812, 958,-32768,
- -32768,-32768, 128, 132,-32768
-};
-
-static const short yypgoto[] =
-{
- -32768, 112,-32768,-32768,-32768, -13,-32768, -43,-32768,-32768,
- -32768, 0, 123, 8
-};
-
-
-#define YYLAST 1067
-
-
-static const short yytable[] =
-{
- 31, 33, 34, 35, 36, 37, 95, 96, 29, 39,
- 65, 66, 67, 68, 43, 69, 70, 71, 72, 73,
- -91, 74, 76, 77, 78, 88, 141, 79, 142, 42,
- 92, 89, 80, 128, 129, 130, 75, 75, 30, 91,
- 100, 103, 105, 107, 108, 109, 110, 111, 112, 113,
- 114, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 125, 93, 127, 30, 44, 30, 45, 69, 70, 71,
- 72, 73, 73, 74, 74, 136, 126, -91, 138, -91,
- 131, -87, 132, -91, 133, -91, 40, 6, 135, 75,
- 75, 144, 134, 145, 43, 90, 46, 47, 48, 49,
- 50, 139, 81, 82, 163, 83, 51, 52, 84, 85,
- 53, 84, 85, 149, 86, -86, 87, -88, 151, 152,
- 153, 154, 174, 143, 157, 170, 172, 158, 183, 159,
- 161, 38, 184, 162, 1, 2, 3, 4, 97, 6,
- 7, 98, 160, 99, 41, 10, 11, 12, 0, 0,
- 0, 173, 0, 0, 175, 176, 0, 177, 0, 178,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 5, 6,
- 7, 8, 0, 9, 0, 10, 11, 12, 19, 0,
- 0, 20, 104, -24, 0, -24, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 5, 6,
- 7, 8, 0, 9, 0, 10, 11, 12, 19, 0,
- 0, 20, 0, 106, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 5, 6,
- 7, 8, 0, 9, 0, 10, 11, 12, 19, 0,
- 0, 20, 0, 0, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 115, 6,
- 7, 8, 0, 9, 0, 10, 11, 12, 19, 0,
- 0, 20, 0, 0, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 148, 6,
- 7, 8, 0, 9, 0, 10, 11, 12, 19, 0,
- 0, 20, 0, 0, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 1, 2, 3, 4, 97, 6,
- 7, 98, 0, 99, 0, 10, 11, 12, 19, 0,
- 0, 20, 0, 0, 0, 0, 21, 0, 0, 0,
- 0, 0, 0, 13, 14, 15, 0, 16, 0, 0,
- 0, 0, 17, 18, 0, 0, 0, 0, 0, 66,
- 67, 68, 0, 69, 70, 71, 72, 73, 19, 74,
- 0, 20, 54, 55, 56, 57, 21, 0, 58, 59,
- 60, 61, 62, 63, 64, 75, 65, 66, 67, 68,
- 0, 69, 70, 71, 72, 73, 0, 74, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
- 55, 56, 57, 75, 0, 58, 59, 60, 61, 62,
- 63, 64, 150, 65, 66, 67, 68, 0, 69, 70,
- 71, 72, 73, 0, 74, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 54, 55, 56, 57, 0, 167, 58, 59, 60,
- 61, 62, 63, 64, 0, 65, 66, 67, 68, 0,
- 69, 70, 71, 72, 73, 0, 74, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 75, 54, 55, 56, 57, 0, 168, 58,
- 59, 60, 61, 62, 63, 64, 0, 65, 66, 67,
- 68, 0, 69, 70, 71, 72, 73, 30, 74, -73,
- -73, -73, -73, -73, -73, -73, 0, 0, 0, -73,
- 0, -91, 0, 0, 75, 0, 0, -91, 155, 54,
- 55, 56, 57, 0, 0, 58, 59, 60, 61, 62,
- 63, 64, 0, 65, 66, 67, 68, 0, 69, 70,
- 71, 72, 73, 0, 74, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 0, 0, 0, 166, 54, 55, 56, 57, 0,
- 0, 58, 59, 60, 61, 62, 63, 64, 0, 65,
- 66, 67, 68, 0, 69, 70, 71, 72, 73, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 75, 0, 0, 0,
- 169, 54, 55, 56, 57, 0, 0, 58, 59, 60,
- 61, 62, 63, 64, 0, 65, 66, 67, 68, 0,
- 69, 70, 71, 72, 73, 0, 74, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 75, 0, 0, 0, 171, 54, 55, 56,
- 57, 0, 0, 58, 59, 60, 61, 62, 63, 64,
- 0, 65, 66, 67, 68, 0, 69, 70, 71, 72,
- 73, 0, 74, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 75, 0,
- 0, 0, 179, 54, 55, 56, 57, 0, 0, 58,
- 59, 60, 61, 62, 63, 64, 0, 65, 66, 67,
- 68, 0, 69, 70, 71, 72, 73, 0, 74, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 0, 0, 0, 180, 54,
- 55, 56, 57, 0, 0, 58, 59, 60, 61, 62,
- 63, 64, 0, 65, 66, 67, 68, 0, 69, 70,
- 71, 72, 73, 0, 74, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 0, 0, 0, 181, 54, 55, 56, 57, 0,
- 0, 58, 59, 60, 61, 62, 63, 64, 146, 65,
- 66, 67, 68, 0, 69, 70, 71, 72, 73, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 147, 54, 55, 56, 57, 0, 75, 58, 59, 60,
- 61, 62, 63, 64, 164, 65, 66, 67, 68, 0,
- 69, 70, 71, 72, 73, 0, 74, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 165, 54, 55, 56,
- 57, 0, 75, 58, 59, 60, 61, 62, 63, 64,
- 140, 65, 66, 67, 68, 0, 69, 70, 71, 72,
- 73, 0, 74, 0, 0, 54, 55, 56, 57, 0,
- 0, 58, 59, 60, 61, 62, 63, 64, 75, 65,
- 66, 67, 68, 0, 69, 70, 71, 72, 73, 0,
- 74, 0, 0,-32768, 55, 56, 57, 0, 0, 58,
- 59, 60, 61, 62, 63, 64, 75, 65, 66, 67,
- 68, 0, 69, 70, 71, 72, 73, 0, 74, 0,
- 0, 0, 58, 59, 60, 61, 62, 63, 64, 0,
- 65, 66, 67, 68, 75, 69, 70, 71, 72, 73,
- 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 75
-};
-
-static const short yycheck[] =
-{
- 13, 14, 15, 16, 17, 18, 49, 50, 0, 7,
- 31, 32, 33, 34, 61, 36, 37, 38, 39, 40,
- 0, 42, 45, 46, 47, 57, 62, 50, 64, 21,
- 43, 63, 55, 76, 77, 78, 58, 58, 43, 66,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 57, 75, 43, 11, 43, 13, 36, 37, 38,
- 39, 40, 40, 42, 42, 88, 29, 57, 91, 57,
- 57, 59, 57, 63, 57, 63, 7, 8, 43, 58,
- 58, 104, 57, 106, 61, 62, 43, 44, 45, 46,
- 47, 3, 48, 49, 147, 51, 53, 54, 7, 8,
- 57, 7, 8, 126, 10, 59, 12, 59, 131, 132,
- 133, 134, 165, 59, 62, 57, 59, 140, 0, 142,
- 143, 19, 0, 146, 3, 4, 5, 6, 7, 8,
- 9, 10, 142, 12, 21, 14, 15, 16, -1, -1,
- -1, 164, -1, -1, 167, 168, -1, 170, -1, 172,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, 21, 62, -1, 64, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, -1, 22, -1, -1, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, -1, -1, -1, -1, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, -1, -1, -1, -1, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, -1, -1, -1, -1, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, 3, 4, 5, 6, 7, 8,
- 9, 10, -1, 12, -1, 14, 15, 16, 57, -1,
- -1, 60, -1, -1, -1, -1, 65, -1, -1, -1,
- -1, -1, -1, 32, 33, 34, -1, 36, -1, -1,
- -1, -1, 41, 42, -1, -1, -1, -1, -1, 32,
- 33, 34, -1, 36, 37, 38, 39, 40, 57, 42,
- -1, 60, 17, 18, 19, 20, 65, -1, 23, 24,
- 25, 26, 27, 28, 29, 58, 31, 32, 33, 34,
- -1, 36, 37, 38, 39, 40, -1, 42, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 17,
- 18, 19, 20, 58, -1, 23, 24, 25, 26, 27,
- 28, 29, 67, 31, 32, 33, 34, -1, 36, 37,
- 38, 39, 40, -1, 42, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 58, 17, 18, 19, 20, -1, 64, 23, 24, 25,
- 26, 27, 28, 29, -1, 31, 32, 33, 34, -1,
- 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 58, 17, 18, 19, 20, -1, 64, 23,
- 24, 25, 26, 27, 28, 29, -1, 31, 32, 33,
- 34, -1, 36, 37, 38, 39, 40, 43, 42, 45,
- 46, 47, 48, 49, 50, 51, -1, -1, -1, 55,
- -1, 57, -1, -1, 58, -1, -1, 63, 62, 17,
- 18, 19, 20, -1, -1, 23, 24, 25, 26, 27,
- 28, 29, -1, 31, 32, 33, 34, -1, 36, 37,
- 38, 39, 40, -1, 42, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 58, -1, -1, -1, 62, 17, 18, 19, 20, -1,
- -1, 23, 24, 25, 26, 27, 28, 29, -1, 31,
- 32, 33, 34, -1, 36, 37, 38, 39, 40, -1,
- 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 58, -1, -1, -1,
- 62, 17, 18, 19, 20, -1, -1, 23, 24, 25,
- 26, 27, 28, 29, -1, 31, 32, 33, 34, -1,
- 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 58, -1, -1, -1, 62, 17, 18, 19,
- 20, -1, -1, 23, 24, 25, 26, 27, 28, 29,
- -1, 31, 32, 33, 34, -1, 36, 37, 38, 39,
- 40, -1, 42, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 58, -1,
- -1, -1, 62, 17, 18, 19, 20, -1, -1, 23,
- 24, 25, 26, 27, 28, 29, -1, 31, 32, 33,
- 34, -1, 36, 37, 38, 39, 40, -1, 42, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 58, -1, -1, -1, 62, 17,
- 18, 19, 20, -1, -1, 23, 24, 25, 26, 27,
- 28, 29, -1, 31, 32, 33, 34, -1, 36, 37,
- 38, 39, 40, -1, 42, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 58, -1, -1, -1, 62, 17, 18, 19, 20, -1,
- -1, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, -1, 36, 37, 38, 39, 40, -1,
- 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 52, 17, 18, 19, 20, -1, 58, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, -1,
- 36, 37, 38, 39, 40, -1, 42, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 52, 17, 18, 19,
- 20, -1, 58, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, -1, 36, 37, 38, 39,
- 40, -1, 42, -1, -1, 17, 18, 19, 20, -1,
- -1, 23, 24, 25, 26, 27, 28, 29, 58, 31,
- 32, 33, 34, -1, 36, 37, 38, 39, 40, -1,
- 42, -1, -1, 17, 18, 19, 20, -1, -1, 23,
- 24, 25, 26, 27, 28, 29, 58, 31, 32, 33,
- 34, -1, 36, 37, 38, 39, 40, -1, 42, -1,
- -1, -1, 23, 24, 25, 26, 27, 28, 29, -1,
- 31, 32, 33, 34, 58, 36, 37, 38, 39, 40,
- -1, 42, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 58
-};
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/local/share/bison/bison.simple"
-
-/* Skeleton output parser for bison,
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* This is the parser code that is written into each bison parser when
- the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
-
-#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
-
-/* The parser invokes alloca or xmalloc; define the necessary symbols. */
-
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-# define YYSTACK_ALLOC xmalloc
-# define YYSTACK_FREE free
-# endif
-#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short yyss;
- YYSTYPE yyvs;
-# if YYLSP_NEEDED
- YYLTYPE yyls;
-# endif
-};
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# if YYLSP_NEEDED
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
- + 2 * YYSTACK_GAP_MAX)
-# else
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAX)
-# endif
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- register YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-
-
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
-#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
-#define YYFAIL goto yyerrlab
-#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yychar1 = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror ("syntax error: cannot back up"); \
- YYERROR; \
- } \
-while (0)
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run).
-
- When YYLLOC_DEFAULT is run, CURRENT is set the location of the
- first token. By default, to implement support for ranges, extend
- its range to the last symbol. */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#if YYPURE
-# if YYLSP_NEEDED
-# ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-# else
-# define YYLEX yylex (&yylval, &yylloc)
-# endif
-# else /* !YYLSP_NEEDED */
-# ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
-# else
-# define YYLEX yylex (&yylval)
-# endif
-# endif /* !YYLSP_NEEDED */
-#else /* !YYPURE */
-# define YYLEX yylex ()
-#endif /* !YYPURE */
-
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-#endif /* !YYDEBUG */
-
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
-
- Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
-
-#if YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-#ifdef YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
-{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- register char *yyd = yydest;
- register const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-#endif
-
-#line 315 "/usr/local/share/bison/bison.simple"
-
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
-
-#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-# define YYPARSE_PARAM_DECL
-# else
-# define YYPARSE_PARAM_ARG YYPARSE_PARAM
-# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-# endif
-#else /* !YYPARSE_PARAM */
-# define YYPARSE_PARAM_ARG
-# define YYPARSE_PARAM_DECL
-#endif /* !YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-# ifdef YYPARSE_PARAM
-int yyparse (void *);
-# else
-int yyparse (void);
-# endif
-#endif
-
-/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
- variables are global, or local to YYPARSE. */
-
-#define YY_DECL_NON_LSP_VARIABLES \
-/* The lookahead symbol. */ \
-int yychar; \
- \
-/* The semantic value of the lookahead symbol. */ \
-YYSTYPE yylval; \
- \
-/* Number of parse errors so far. */ \
-int yynerrs;
-
-#if YYLSP_NEEDED
-# define YY_DECL_VARIABLES \
-YY_DECL_NON_LSP_VARIABLES \
- \
-/* Location data for the lookahead symbol. */ \
-YYLTYPE yylloc;
-#else
-# define YY_DECL_VARIABLES \
-YY_DECL_NON_LSP_VARIABLES
-#endif
-
-
-/* If nonreentrant, generate the variables here. */
-
-#if !YYPURE
-YY_DECL_VARIABLES
-#endif /* !YYPURE */
-
-int
-yyparse (YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
-{
- /* If reentrant, generate the variables here. */
-#if YYPURE
- YY_DECL_VARIABLES
-#endif /* !YYPURE */
-
- register int yystate;
- register int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
- int yychar1 = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to xreallocate them elsewhere. */
-
- /* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
-
-#if YYLSP_NEEDED
- /* The location stack. */
- YYLTYPE yylsa[YYINITDEPTH];
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-#endif
-
-#if YYLSP_NEEDED
-# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
-#else
-# define YYPOPSTACK (yyvsp--, yyssp--)
-#endif
-
- YYSIZE_T yystacksize = YYINITDEPTH;
-
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-#if YYLSP_NEEDED
- YYLTYPE yyloc;
-#endif
-
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
-
- YYDPRINTF ((stderr, "Starting parse\n"));
-
- yystate = 0;
- yyerrstatus = 0;
- yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-#if YYLSP_NEEDED
- yylsp = yyls;
-#endif
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
-
- yysetstate:
- *yyssp = yystate;
-
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
- {
- /* Give user a chance to xreallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. */
-# if YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yyls1, yysize * sizeof (*yylsp),
- &yystacksize);
- yyls = yyls1;
-# else
- yyoverflow ("parser stack overflow",
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-# endif
- yyss = yyss1;
- yyvs = yyvs1;
- }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
-# else
- /* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- goto yyoverflowlab;
- yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
- yystacksize = YYMAXDEPTH;
-
- {
- short *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyoverflowlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-# if YYLSP_NEEDED
- YYSTACK_RELOCATE (yyls);
-# endif
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
-#endif /* no yyoverflow */
-
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-#if YYLSP_NEEDED
- yylsp = yyls + yysize - 1;
-#endif
-
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
-
- if (yyssp >= yyss + yystacksize - 1)
- YYABORT;
- }
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
- goto yybackup;
-
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
-
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
-
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yydefault;
-
- /* Not known => get a lookahead token if don't already have one. */
-
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
- if (yychar == YYEMPTY)
- {
- YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
- }
-
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
- {
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
- YYDPRINTF ((stderr, "Now at end of input.\n"));
- }
- else
- {
- yychar1 = YYTRANSLATE (yychar);
-
-#if YYDEBUG
- /* We have to keep this `#if YYDEBUG', since we use variables
- which are defined only if `YYDEBUG' is set. */
- if (yydebug)
- {
- YYFPRINTF (stderr, "Next token is %d (%s",
- yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise
- meaning of a token, for further debugging info. */
-# ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
-# endif
- YYFPRINTF (stderr, ")\n");
- }
-#endif
- }
-
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
- goto yydefault;
-
- yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrlab;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrlab;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %d (%s), ",
- yychar, yytname[yychar1]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-#if YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
-yydefault:
- yyn = yydefact[yystate];
- if (yyn == 0)
- goto yyerrlab;
- goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
-yyreduce:
- /* yyn is the number of a rule to reduce with. */
- yylen = yyr2[yyn];
-
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
-
- Otherwise, the following line sets YYVAL to the semantic value of
- the lookahead token. This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
-
-#if YYLSP_NEEDED
- /* Similarly for the default location. Let the user run additional
- commands if for instance locations are ranges. */
- yyloc = yylsp[1-yylen];
- YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
-#endif
-
-#if YYDEBUG
- /* We have to keep this `#if YYDEBUG', since we use variables which
- are defined only if `YYDEBUG' is set. */
- if (yydebug)
- {
- int yyi;
-
- YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
-
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
- YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
-
- switch (yyn) {
-
-case 2:
-#line 204 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_TYPE);
- write_exp_elt_type (yyvsp[0].tval);
- write_exp_elt_opcode (OP_TYPE); }
- break;
-case 4:
-#line 212 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_COMMA); }
- break;
-case 5:
-#line 217 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_IND); }
- break;
-case 6:
-#line 221 "./ada-exp.y"
-{ write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string (yyvsp[0].ssym.stoken);
- write_exp_elt_opcode (STRUCTOP_STRUCT);
- }
- break;
-case 7:
-#line 228 "./ada-exp.y"
-{
- write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst (yyvsp[-1].lval);
- write_exp_elt_opcode (OP_FUNCALL);
- }
- break;
-case 8:
-#line 236 "./ada-exp.y"
-{
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (yyvsp[-3].tval);
- write_exp_elt_opcode (UNOP_CAST);
- }
- break;
-case 9:
-#line 243 "./ada-exp.y"
-{ type_qualifier = yyvsp[-2].tval; }
- break;
-case 10:
-#line 244 "./ada-exp.y"
-{
- /* write_exp_elt_opcode (UNOP_QUAL); */
- /* FIXME: UNOP_QUAL should be defined in expression.h */
- write_exp_elt_type (yyvsp[-6].tval);
- /* write_exp_elt_opcode (UNOP_QUAL); */
- /* FIXME: UNOP_QUAL should be defined in expression.h */
- type_qualifier = yyvsp[-4].tval;
- }
- break;
-case 11:
-#line 254 "./ada-exp.y"
-{ yyval.tval = type_qualifier; }
- break;
-case 12:
-#line 258 "./ada-exp.y"
-{ write_exp_elt_opcode (TERNOP_SLICE); }
- break;
-case 13:
-#line 261 "./ada-exp.y"
-{ }
- break;
-case 15:
-#line 268 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_REGISTER);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_REGISTER);
- }
- break;
-case 16:
-#line 275 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_INTERNALVAR);
- write_exp_elt_intern (yyvsp[0].ivar);
- write_exp_elt_opcode (OP_INTERNALVAR);
- }
- break;
-case 18:
-#line 286 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_LAST);
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- write_exp_elt_opcode (OP_LAST);
- }
- break;
-case 19:
-#line 293 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_ASSIGN); }
- break;
-case 20:
-#line 297 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_NEG); }
- break;
-case 21:
-#line 301 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_PLUS); }
- break;
-case 22:
-#line 305 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
- break;
-case 23:
-#line 309 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_ABS); }
- break;
-case 24:
-#line 312 "./ada-exp.y"
-{ yyval.lval = 0; }
- break;
-case 25:
-#line 316 "./ada-exp.y"
-{ yyval.lval = 1; }
- break;
-case 26:
-#line 318 "./ada-exp.y"
-{ yyval.lval = 1; }
- break;
-case 27:
-#line 320 "./ada-exp.y"
-{ yyval.lval = yyvsp[-2].lval + 1; }
- break;
-case 28:
-#line 322 "./ada-exp.y"
-{ yyval.lval = yyvsp[-4].lval + 1; }
- break;
-case 29:
-#line 327 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_MEMVAL);
- write_exp_elt_type (yyvsp[-2].tval);
- write_exp_elt_opcode (UNOP_MEMVAL);
- }
- break;
-case 30:
-#line 336 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_EXP); }
- break;
-case 31:
-#line 340 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_MUL); }
- break;
-case 32:
-#line 344 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_DIV); }
- break;
-case 33:
-#line 348 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_REM); }
- break;
-case 34:
-#line 352 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_MOD); }
- break;
-case 35:
-#line 356 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_REPEAT); }
- break;
-case 36:
-#line 360 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_ADD); }
- break;
-case 37:
-#line 364 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_CONCAT); }
- break;
-case 38:
-#line 368 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_SUB); }
- break;
-case 39:
-#line 372 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_EQUAL); }
- break;
-case 40:
-#line 376 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_NOTEQUAL); }
- break;
-case 41:
-#line 380 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_LEQ); }
- break;
-case 42:
-#line 384 "./ada-exp.y"
-{ /*write_exp_elt_opcode (TERNOP_MBR); */ }
- break;
-case 43:
-#line 388 "./ada-exp.y"
-{ /*write_exp_elt_opcode (BINOP_MBR); */
- /* FIXME: BINOP_MBR should be defined in expression.h */
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- /*write_exp_elt_opcode (BINOP_MBR); */
- }
- break;
-case 44:
-#line 394 "./ada-exp.y"
-{ /*write_exp_elt_opcode (UNOP_MBR); */
- /* FIXME: UNOP_QUAL should be defined in expression.h */
- write_exp_elt_type (yyvsp[0].tval);
- /* write_exp_elt_opcode (UNOP_MBR); */
- /* FIXME: UNOP_MBR should be defined in expression.h */
- }
- break;
-case 45:
-#line 401 "./ada-exp.y"
-{ /*write_exp_elt_opcode (TERNOP_MBR); */
- /* FIXME: TERNOP_MBR should be defined in expression.h */
- write_exp_elt_opcode (UNOP_LOGICAL_NOT);
- }
- break;
-case 46:
-#line 406 "./ada-exp.y"
-{ /* write_exp_elt_opcode (BINOP_MBR); */
- /* FIXME: BINOP_MBR should be defined in expression.h */
- write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
- /*write_exp_elt_opcode (BINOP_MBR);*/
- /* FIXME: BINOP_MBR should be defined in expression.h */
- write_exp_elt_opcode (UNOP_LOGICAL_NOT);
- }
- break;
-case 47:
-#line 414 "./ada-exp.y"
-{ /*write_exp_elt_opcode (UNOP_MBR);*/
- /* FIXME: UNOP_MBR should be defined in expression.h */
- write_exp_elt_type (yyvsp[0].tval);
- /* write_exp_elt_opcode (UNOP_MBR);*/
- /* FIXME: UNOP_MBR should be defined in expression.h */
- write_exp_elt_opcode (UNOP_LOGICAL_NOT);
- }
- break;
-case 48:
-#line 424 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_GEQ); }
- break;
-case 49:
-#line 428 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_LESS); }
- break;
-case 50:
-#line 432 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_GTR); }
- break;
-case 51:
-#line 436 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_BITWISE_AND); }
- break;
-case 52:
-#line 440 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_LOGICAL_AND); }
- break;
-case 53:
-#line 444 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_BITWISE_IOR); }
- break;
-case 54:
-#line 448 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_LOGICAL_OR); }
- break;
-case 55:
-#line 452 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_BITWISE_XOR); }
- break;
-case 56:
-#line 456 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_ADDR); }
- break;
-case 57:
-#line 458 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_ADDR);
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (builtin_type_ada_system_address);
- write_exp_elt_opcode (UNOP_CAST);
- }
- break;
-case 58:
-#line 464 "./ada-exp.y"
-{ write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
- break;
-case 59:
-#line 466 "./ada-exp.y"
-{ write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
- break;
-case 60:
-#line 468 "./ada-exp.y"
-{ write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
- break;
-case 61:
-#line 470 "./ada-exp.y"
-{ write_attribute_call0 (ATR_SIZE); }
- break;
-case 62:
-#line 472 "./ada-exp.y"
-{ write_attribute_call0 (ATR_TAG); }
- break;
-case 63:
-#line 474 "./ada-exp.y"
-{ write_attribute_calln (ATR_MIN, 2); }
- break;
-case 64:
-#line 476 "./ada-exp.y"
-{ write_attribute_calln (ATR_MAX, 2); }
- break;
-case 65:
-#line 478 "./ada-exp.y"
-{ write_attribute_calln (ATR_POS, 1); }
- break;
-case 66:
-#line 480 "./ada-exp.y"
-{ write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
- break;
-case 67:
-#line 482 "./ada-exp.y"
-{ write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
- break;
-case 68:
-#line 484 "./ada-exp.y"
-{ write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
- break;
-case 69:
-#line 486 "./ada-exp.y"
-{ write_attribute_calln (ATR_VAL, 1); }
- break;
-case 70:
-#line 488 "./ada-exp.y"
-{ write_attribute_call0 (ATR_MODULUS); }
- break;
-case 71:
-#line 492 "./ada-exp.y"
-{ yyval.lval = 1; }
- break;
-case 72:
-#line 494 "./ada-exp.y"
-{ yyval.lval = yyvsp[-1].typed_val.val; }
- break;
-case 73:
-#line 499 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_TYPE);
- write_exp_elt_type (yyvsp[0].tval);
- write_exp_elt_opcode (OP_TYPE); }
- break;
-case 75:
-#line 507 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_TYPE);
- write_exp_elt_type (builtin_type_void);
- write_exp_elt_opcode (OP_TYPE); }
- break;
-case 76:
-#line 514 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (yyvsp[0].typed_val.type);
- write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val.val));
- write_exp_elt_opcode (OP_LONG);
- }
- break;
-case 77:
-#line 522 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_LONG);
- if (type_qualifier == NULL)
- write_exp_elt_type (yyvsp[0].typed_val.type);
- else
- write_exp_elt_type (type_qualifier);
- write_exp_elt_longcst
- (convert_char_literal (type_qualifier, yyvsp[0].typed_val.val));
- write_exp_elt_opcode (OP_LONG);
- }
- break;
-case 78:
-#line 534 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (yyvsp[0].typed_val_float.type);
- write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
- write_exp_elt_opcode (OP_DOUBLE);
- }
- break;
-case 79:
-#line 542 "./ada-exp.y"
-{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst ((LONGEST)(0));
- write_exp_elt_opcode (OP_LONG);
- }
- break;
-case 80:
-#line 549 "./ada-exp.y"
-{ /* Ada strings are converted into array constants
- a lower bound of 1. Thus, the array upper bound
- is the string length. */
- char *sp = yyvsp[0].sval.ptr; int count;
- if (yyvsp[0].sval.length == 0)
- { /* One dummy character for the type */
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_ada_char);
- write_exp_elt_longcst ((LONGEST)(0));
- write_exp_elt_opcode (OP_LONG);
- }
- for (count = yyvsp[0].sval.length; count > 0; count -= 1)
- {
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_ada_char);
- write_exp_elt_longcst ((LONGEST)(*sp));
- sp += 1;
- write_exp_elt_opcode (OP_LONG);
- }
- write_exp_elt_opcode (OP_ARRAY);
- write_exp_elt_longcst ((LONGEST) 1);
- write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
- write_exp_elt_opcode (OP_ARRAY);
- }
- break;
-case 81:
-#line 576 "./ada-exp.y"
-{ error ("NEW not implemented."); }
- break;
-case 82:
-#line 579 "./ada-exp.y"
-{ write_var_from_name (NULL, yyvsp[0].ssym); }
- break;
-case 83:
-#line 581 "./ada-exp.y"
-{ write_var_from_name (yyvsp[-1].bval, yyvsp[0].ssym); }
- break;
-case 84:
-#line 582 "./ada-exp.y"
-{ write_object_renaming (NULL, yyvsp[0].ssym.sym); }
- break;
-case 85:
-#line 584 "./ada-exp.y"
-{ write_object_renaming (yyvsp[-1].bval, yyvsp[0].ssym.sym); }
- break;
-case 86:
-#line 587 "./ada-exp.y"
-{ }
- break;
-case 87:
-#line 588 "./ada-exp.y"
-{ }
- break;
-case 88:
-#line 589 "./ada-exp.y"
-{ }
- break;
-case 89:
-#line 593 "./ada-exp.y"
-{ yyval.bval = yyvsp[0].bval; }
- break;
-case 90:
-#line 595 "./ada-exp.y"
-{ yyval.bval = yyvsp[0].bval; }
- break;
-case 91:
-#line 599 "./ada-exp.y"
-{ yyval.tval = yyvsp[0].tval; }
- break;
-case 92:
-#line 600 "./ada-exp.y"
-{ yyval.tval = yyvsp[0].tval; }
- break;
-case 93:
-#line 602 "./ada-exp.y"
-{ yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
- break;
-case 94:
-#line 604 "./ada-exp.y"
-{ yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
- break;
-case 95:
-#line 611 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_IND); }
- break;
-case 96:
-#line 613 "./ada-exp.y"
-{ write_exp_elt_opcode (UNOP_ADDR); }
- break;
-case 97:
-#line 615 "./ada-exp.y"
-{ write_exp_elt_opcode (BINOP_SUBSCRIPT); }
- break;
-}
-
-#line 705 "/usr/local/share/bison/bison.simple"
-
-
- yyvsp -= yylen;
- yyssp -= yylen;
-#if YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-
-#if YYDEBUG
- if (yydebug)
- {
- short *yyssp1 = yyss - 1;
- YYFPRINTF (stderr, "state stack now");
- while (yyssp1 != yyssp)
- YYFPRINTF (stderr, " %d", *++yyssp1);
- YYFPRINTF (stderr, "\n");
- }
-#endif
-
- *++yyvsp = yyval;
-#if YYLSP_NEEDED
- *++yylsp = yyloc;
-#endif
-
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
-
- goto yynewstate;
-
-
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- char *yymsg;
- int yyx, yycount;
-
- yycount = 0;
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
- if (yycheck[yyx + yyn] == yyx)
- yysize += yystrlen (yytname[yyx]) + 15, yycount++;
- yysize += yystrlen ("parse error, unexpected ") + 1;
- yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
- yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
-
- if (yycount < 5)
- {
- yycount = 0;
- for (yyx = yyn < 0 ? -yyn : 0;
- yyx < (int) (sizeof (yytname) / sizeof (char *));
- yyx++)
- if (yycheck[yyx + yyn] == yyx)
- {
- const char *yyq = ! yycount ? ", expecting " : " or ";
- yyp = yystpcpy (yyp, yyq);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yycount++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("parse error; also virtual memory exhausted");
- }
- else
-#endif /* defined (YYERROR_VERBOSE) */
- yyerror ("parse error");
- }
- goto yyerrlab1;
-
-
-/*--------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action |
-`--------------------------------------------------*/
-yyerrlab1:
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
-
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
- YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
- yychar, yytname[yychar1]));
- yychar = YYEMPTY;
- }
-
- /* Else will try to reuse lookahead token after shifting the error
- token. */
-
- yyerrstatus = 3; /* Each real token shifted decrements this */
-
- goto yyerrhandle;
-
-
-/*-------------------------------------------------------------------.
-| yyerrdefault -- current state does not do anything special for the |
-| error token. |
-`-------------------------------------------------------------------*/
-yyerrdefault:
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
-
- /* If its default is to accept any token, ok. Otherwise pop it. */
- yyn = yydefact[yystate];
- if (yyn)
- goto yydefault;
-#endif
-
-
-/*---------------------------------------------------------------.
-| yyerrpop -- pop the current state because it cannot handle the |
-| error token |
-`---------------------------------------------------------------*/
-yyerrpop:
- if (yyssp == yyss)
- YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#if YYLSP_NEEDED
- yylsp--;
-#endif
-
-#if YYDEBUG
- if (yydebug)
- {
- short *yyssp1 = yyss - 1;
- YYFPRINTF (stderr, "Error: state stack now");
- while (yyssp1 != yyssp)
- YYFPRINTF (stderr, " %d", *++yyssp1);
- YYFPRINTF (stderr, "\n");
- }
-#endif
-
-/*--------------.
-| yyerrhandle. |
-`--------------*/
-yyerrhandle:
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
-
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
-
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
-
- if (yyn == YYFINAL)
- YYACCEPT;
-
- YYDPRINTF ((stderr, "Shifting error token, "));
-
- *++yyvsp = yylval;
-#if YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
-
- yystate = yyn;
- goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-/*---------------------------------------------.
-| yyoverflowab -- parser overflow comes here. |
-`---------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
-
-yyreturn:
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
-#endif
- return yyresult;
-}
-#line 618 "./ada-exp.y"
-
-
-/* yylex defined in ada-lex.c: Reads one token, getting characters */
-/* through lexptr. */
-
-/* Remap normal flex interface names (yylex) as well as gratuitiously */
-/* global symbol names, so we can have multiple flex-generated parsers */
-/* in gdb. */
-
-/* (See note above on previous definitions for YACC.) */
-
-#define yy_create_buffer ada_yy_create_buffer
-#define yy_delete_buffer ada_yy_delete_buffer
-#define yy_init_buffer ada_yy_init_buffer
-#define yy_load_buffer_state ada_yy_load_buffer_state
-#define yy_switch_to_buffer ada_yy_switch_to_buffer
-#define yyrestart ada_yyrestart
-#define yytext ada_yytext
-#define yywrap ada_yywrap
-
-/* The following kludge was found necessary to prevent conflicts between */
-/* defs.h and non-standard stdlib.h files. */
-#define qsort __qsort__dummy
-#include "ada-lex.c"
-
-int
-ada_parse ()
-{
- lexer_init (yyin); /* (Re-)initialize lexer. */
- left_block_context = NULL;
- type_qualifier = NULL;
-
- return _ada_parse ();
-}
-
-void
-yyerror (msg)
- char *msg;
-{
- error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
-}
-
-/* The operator name corresponding to operator symbol STRING (adds
- quotes and maps to lower-case). Destroys the previous contents of
- the array pointed to by STRING.ptr. Error if STRING does not match
- a valid Ada operator. Assumes that STRING.ptr points to a
- null-terminated string and that, if STRING is a valid operator
- symbol, the array pointed to by STRING.ptr contains at least
- STRING.length+3 characters. */
-
-static struct stoken
-string_to_operator (string)
- struct stoken string;
-{
- int i;
-
- for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
- {
- if (string.length == strlen (ada_opname_table[i].demangled)-2
- && strncasecmp (string.ptr, ada_opname_table[i].demangled+1,
- string.length) == 0)
- {
- strncpy (string.ptr, ada_opname_table[i].demangled,
- string.length+2);
- string.length += 2;
- return string;
- }
- }
- error ("Invalid operator symbol `%s'", string.ptr);
-}
-
-/* Emit expression to access an instance of SYM, in block BLOCK (if
- * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
-static void
-write_var_from_sym (orig_left_context, block, sym)
- struct block* orig_left_context;
- struct block* block;
- struct symbol* sym;
-{
- if (orig_left_context == NULL && symbol_read_needs_frame (sym))
- {
- if (innermost_block == 0 ||
- contained_in (block, innermost_block))
- innermost_block = block;
- }
-
- write_exp_elt_opcode (OP_VAR_VALUE);
- /* We want to use the selected frame, not another more inner frame
- which happens to be in the same block */
- write_exp_elt_block (NULL);
- write_exp_elt_sym (sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
-}
-
-/* Emit expression to access an instance of NAME. */
-static void
-write_var_from_name (orig_left_context, name)
- struct block* orig_left_context;
- struct name_info name;
-{
- if (name.msym != NULL)
- {
- write_exp_msymbol (name.msym,
- lookup_function_type (builtin_type_int),
- builtin_type_int);
- }
- else if (name.sym == NULL)
- {
- /* Multiple matches: record name and starting block for later
- resolution by ada_resolve. */
- /* write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
- /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
- write_exp_elt_block (name.block);
- /* write_exp_elt_name (name.stoken.ptr); */
- /* FIXME: write_exp_elt_name should be defined in defs.h, located in parse.c */
- /* write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
- /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
- }
- else
- write_var_from_sym (orig_left_context, name.block, name.sym);
-}
-
-/* Write a call on parameterless attribute ATR. */
-
-static void
-write_attribute_call0 (atr)
- enum ada_attribute atr;
-{
- /* write_exp_elt_opcode (OP_ATTRIBUTE); */
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
- write_exp_elt_longcst ((LONGEST) 0);
- write_exp_elt_longcst ((LONGEST) atr);
- /* write_exp_elt_opcode (OP_ATTRIBUTE); */
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
-}
-
-/* Write a call on an attribute ATR with one constant integer
- * parameter. */
-
-static void
-write_attribute_call1 (atr, arg)
- enum ada_attribute atr;
- LONGEST arg;
-{
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_longcst (arg);
- write_exp_elt_opcode (OP_LONG);
- /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
- write_exp_elt_longcst ((LONGEST) 1);
- write_exp_elt_longcst ((LONGEST) atr);
- /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
-}
-
-/* Write a call on an attribute ATR with N parameters, whose code must have
- * been generated previously. */
-
-static void
-write_attribute_calln (atr, n)
- enum ada_attribute atr;
- int n;
-{
- /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
- write_exp_elt_longcst ((LONGEST) n);
- write_exp_elt_longcst ((LONGEST) atr);
- /* write_exp_elt_opcode (OP_ATTRIBUTE);*/
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
-}
-
-/* Emit expression corresponding to the renamed object designated by
- * the type RENAMING, which must be the referent of an object renaming
- * type, in the context of ORIG_LEFT_CONTEXT (?). */
-static void
-write_object_renaming (orig_left_context, renaming)
- struct block* orig_left_context;
- struct symbol* renaming;
-{
- const char* qualification = SYMBOL_NAME (renaming);
- const char* simple_tail;
- const char* expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
- const char* suffix;
- char* name;
- struct symbol* sym;
- enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
-
- /* if orig_left_context is null, then use the currently selected
- block, otherwise we might fail our symbol lookup below */
- if (orig_left_context == NULL)
- orig_left_context = get_selected_block (NULL);
-
- for (simple_tail = qualification + strlen (qualification);
- simple_tail != qualification; simple_tail -= 1)
- {
- if (*simple_tail == '.')
- {
- simple_tail += 1;
- break;
- }
- else if (STREQN (simple_tail, "__", 2))
- {
- simple_tail += 2;
- break;
- }
- }
-
- suffix = strstr (expr, "___XE");
- if (suffix == NULL)
- goto BadEncoding;
-
- name = (char*) xmalloc (suffix - expr + 1);
- /* add_name_string_cleanup (name); */
- /* FIXME: add_name_string_cleanup should be defined in
- parser-defs.h, implemented in parse.c */
- strncpy (name, expr, suffix-expr);
- name[suffix-expr] = '\000';
- sym = lookup_symbol (name, orig_left_context, VAR_NAMESPACE, 0, NULL);
- /* if (sym == NULL)
- error ("Could not find renamed variable: %s", ada_demangle (name));
- */
- /* FIXME: ada_demangle should be defined in defs.h, implemented in ada-lang.c */
- write_var_from_sym (orig_left_context, block_found, sym);
-
- suffix += 5;
- slice_state = SIMPLE_INDEX;
- while (*suffix == 'X')
- {
- suffix += 1;
-
- switch (*suffix) {
- case 'L':
- slice_state = LOWER_BOUND;
- case 'S':
- suffix += 1;
- if (isdigit (*suffix))
- {
- char* next;
- long val = strtol (suffix, &next, 10);
- if (next == suffix)
- goto BadEncoding;
- suffix = next;
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_ada_int);
- write_exp_elt_longcst ((LONGEST) val);
- write_exp_elt_opcode (OP_LONG);
- }
- else
- {
- const char* end;
- char* index_name;
- int index_len;
- struct symbol* index_sym;
-
- end = strchr (suffix, 'X');
- if (end == NULL)
- end = suffix + strlen (suffix);
-
- index_len = simple_tail - qualification + 2 + (suffix - end) + 1;
- index_name = (char*) xmalloc (index_len);
- memset (index_name, '\000', index_len);
- /* add_name_string_cleanup (index_name);*/
- /* FIXME: add_name_string_cleanup should be defined in
- parser-defs.h, implemented in parse.c */
- strncpy (index_name, qualification, simple_tail - qualification);
- index_name[simple_tail - qualification] = '\000';
- strncat (index_name, suffix, suffix-end);
- suffix = end;
-
- index_sym =
- lookup_symbol (index_name, NULL, VAR_NAMESPACE, 0, NULL);
- if (index_sym == NULL)
- error ("Could not find %s", index_name);
- write_var_from_sym (NULL, block_found, sym);
- }
- if (slice_state == SIMPLE_INDEX)
- {
- write_exp_elt_opcode (OP_FUNCALL);
- write_exp_elt_longcst ((LONGEST) 1);
- write_exp_elt_opcode (OP_FUNCALL);
- }
- else if (slice_state == LOWER_BOUND)
- slice_state = UPPER_BOUND;
- else if (slice_state == UPPER_BOUND)
- {
- write_exp_elt_opcode (TERNOP_SLICE);
- slice_state = SIMPLE_INDEX;
- }
- break;
-
- case 'R':
- {
- struct stoken field_name;
- const char* end;
- suffix += 1;
-
- if (slice_state != SIMPLE_INDEX)
- goto BadEncoding;
- end = strchr (suffix, 'X');
- if (end == NULL)
- end = suffix + strlen (suffix);
- field_name.length = end - suffix;
- field_name.ptr = (char*) xmalloc (end - suffix + 1);
- strncpy (field_name.ptr, suffix, end - suffix);
- field_name.ptr[end - suffix] = '\000';
- suffix = end;
- write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string (field_name);
- write_exp_elt_opcode (STRUCTOP_STRUCT);
- break;
- }
-
- default:
- goto BadEncoding;
- }
- }
- if (slice_state == SIMPLE_INDEX)
- return;
-
- BadEncoding:
- error ("Internal error in encoding of renaming declaration: %s",
- SYMBOL_NAME (renaming));
-}
-
-/* Convert the character literal whose ASCII value would be VAL to the
- appropriate value of type TYPE, if there is a translation.
- Otherwise return VAL. Hence, in an enumeration type ('A', 'B'),
- the literal 'A' (VAL == 65), returns 0. */
-static LONGEST
-convert_char_literal (struct type* type, LONGEST val)
-{
- char name[7];
- int f;
-
- if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM)
- return val;
- sprintf (name, "QU%02x", (int) val);
- for (f = 0; f < TYPE_NFIELDS (type); f += 1)
- {
- if (STREQ (name, TYPE_FIELD_NAME (type, f)))
- return TYPE_FIELD_BITPOS (type, f);
- }
- return val;
-}
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 7d46dd2cf8b..67185a3e497 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -92,9 +92,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define yytoks ada_toks /* With YYDEBUG defined */
#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
struct name_info {
struct symbol* sym;
struct minimal_symbol* msym;
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index db1d7d4f185..c58d46338ea 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
-#include <string.h>
+#include "gdb_string.h"
#include <ctype.h>
#include <stdarg.h>
#include "demangle.h"
@@ -40,153 +40,165 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "ui-out.h"
#endif
-struct cleanup* unresolved_names;
+struct cleanup *unresolved_names;
void extract_string (CORE_ADDR addr, char *buf);
-static struct type * ada_create_fundamental_type (struct objfile *, int);
+static struct type *ada_create_fundamental_type (struct objfile *, int);
static void modify_general_field (char *, LONGEST, int, int);
-static struct type* desc_base_type (struct type*);
+static struct type *desc_base_type (struct type *);
-static struct type* desc_bounds_type (struct type*);
+static struct type *desc_bounds_type (struct type *);
-static struct value* desc_bounds (struct value*);
+static struct value *desc_bounds (struct value *);
-static int fat_pntr_bounds_bitpos (struct type*);
+static int fat_pntr_bounds_bitpos (struct type *);
-static int fat_pntr_bounds_bitsize (struct type*);
+static int fat_pntr_bounds_bitsize (struct type *);
-static struct type* desc_data_type (struct type*);
+static struct type *desc_data_type (struct type *);
-static struct value* desc_data (struct value*);
+static struct value *desc_data (struct value *);
-static int fat_pntr_data_bitpos (struct type*);
+static int fat_pntr_data_bitpos (struct type *);
-static int fat_pntr_data_bitsize (struct type*);
+static int fat_pntr_data_bitsize (struct type *);
-static struct value* desc_one_bound (struct value*, int, int);
+static struct value *desc_one_bound (struct value *, int, int);
-static int desc_bound_bitpos (struct type*, int, int);
+static int desc_bound_bitpos (struct type *, int, int);
-static int desc_bound_bitsize (struct type*, int, int);
+static int desc_bound_bitsize (struct type *, int, int);
-static struct type* desc_index_type (struct type*, int);
+static struct type *desc_index_type (struct type *, int);
-static int desc_arity (struct type*);
+static int desc_arity (struct type *);
-static int ada_type_match (struct type*, struct type*, int);
+static int ada_type_match (struct type *, struct type *, int);
-static int ada_args_match (struct symbol*, struct value**, int);
+static int ada_args_match (struct symbol *, struct value **, int);
-static struct value* place_on_stack (struct value*, CORE_ADDR*);
+static struct value *place_on_stack (struct value *, CORE_ADDR *);
-static struct value* convert_actual (struct value*, struct type*, CORE_ADDR*);
+static struct value *convert_actual (struct value *, struct type *,
+ CORE_ADDR *);
-static struct value* make_array_descriptor (struct type*, struct value*, CORE_ADDR*);
+static struct value *make_array_descriptor (struct type *, struct value *,
+ CORE_ADDR *);
-static void ada_add_block_symbols (struct block*, const char*,
- namespace_enum, struct objfile*, int);
+static void ada_add_block_symbols (struct block *, const char *,
+ namespace_enum, struct objfile *, int);
-static void fill_in_ada_prototype (struct symbol*);
+static void fill_in_ada_prototype (struct symbol *);
-static int is_nonfunction (struct symbol**, int);
+static int is_nonfunction (struct symbol **, int);
-static void add_defn_to_vec (struct symbol*, struct block*);
+static void add_defn_to_vec (struct symbol *, struct block *);
-static struct partial_symbol*
-ada_lookup_partial_symbol (struct partial_symtab*, const char*,
- int, namespace_enum, int);
+static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab
+ *, const char *, int,
+ namespace_enum, int);
-static struct symtab* symtab_for_sym (struct symbol*);
+static struct symtab *symtab_for_sym (struct symbol *);
-static struct value* ada_resolve_subexp (struct expression**, int*, int, struct type*);
+static struct value *ada_resolve_subexp (struct expression **, int *, int,
+ struct type *);
-static void replace_operator_with_call (struct expression**, int, int, int,
- struct symbol*, struct block*);
+static void replace_operator_with_call (struct expression **, int, int, int,
+ struct symbol *, struct block *);
-static int possible_user_operator_p (enum exp_opcode, struct value**);
+static int possible_user_operator_p (enum exp_opcode, struct value **);
-static const char* ada_op_name (enum exp_opcode);
+static const char *ada_op_name (enum exp_opcode);
-static int numeric_type_p (struct type*);
+static int numeric_type_p (struct type *);
-static int integer_type_p (struct type*);
+static int integer_type_p (struct type *);
-static int scalar_type_p (struct type*);
+static int scalar_type_p (struct type *);
-static int discrete_type_p (struct type*);
+static int discrete_type_p (struct type *);
-static char* extended_canonical_line_spec (struct symtab_and_line, const char*);
+static char *extended_canonical_line_spec (struct symtab_and_line,
+ const char *);
-static struct value* evaluate_subexp (struct type*, struct expression*, int*, enum noside);
+static struct value *evaluate_subexp (struct type *, struct expression *,
+ int *, enum noside);
-static struct value* evaluate_subexp_type (struct expression*, int*);
+static struct value *evaluate_subexp_type (struct expression *, int *);
-static struct type * ada_create_fundamental_type (struct objfile*, int);
+static struct type *ada_create_fundamental_type (struct objfile *, int);
-static int is_dynamic_field (struct type *, int);
+static int is_dynamic_field (struct type *, int);
-static struct type*
-to_fixed_variant_branch_type (struct type*, char*, CORE_ADDR, struct value*);
+static struct type *to_fixed_variant_branch_type (struct type *, char *,
+ CORE_ADDR, struct value *);
-static struct type* to_fixed_range_type (char*, struct value*, struct objfile*);
+static struct type *to_fixed_range_type (char *, struct value *,
+ struct objfile *);
-static struct type* to_static_fixed_type (struct type*);
+static struct type *to_static_fixed_type (struct type *);
-static struct value* unwrap_value (struct value*);
+static struct value *unwrap_value (struct value *);
-static struct type* packed_array_type (struct type*, long*);
+static struct type *packed_array_type (struct type *, long *);
-static struct type* decode_packed_array_type (struct type*);
+static struct type *decode_packed_array_type (struct type *);
-static struct value* decode_packed_array (struct value*);
+static struct value *decode_packed_array (struct value *);
-static struct value* value_subscript_packed (struct value*, int, struct value**);
+static struct value *value_subscript_packed (struct value *, int,
+ struct value **);
-static struct value* coerce_unspec_val_to_type (struct value*, long, struct type*);
+static struct value *coerce_unspec_val_to_type (struct value *, long,
+ struct type *);
-static struct value* get_var_value (char*, char*);
+static struct value *get_var_value (char *, char *);
-static int lesseq_defined_than (struct symbol*, struct symbol*);
+static int lesseq_defined_than (struct symbol *, struct symbol *);
-static int equiv_types (struct type*, struct type*);
+static int equiv_types (struct type *, struct type *);
-static int is_name_suffix (const char*);
+static int is_name_suffix (const char *);
-static int wild_match (const char*, int, const char*);
+static int wild_match (const char *, int, const char *);
-static struct symtabs_and_lines find_sal_from_funcs_and_line (const char*, int, struct symbol**, int);
+static struct symtabs_and_lines find_sal_from_funcs_and_line (const char *,
+ int,
+ struct symbol
+ **, int);
-static int
-find_line_in_linetable (struct linetable*, int, struct symbol**, int, int*);
+static int find_line_in_linetable (struct linetable *, int, struct symbol **,
+ int, int *);
-static int find_next_line_in_linetable (struct linetable*, int, int, int);
+static int find_next_line_in_linetable (struct linetable *, int, int, int);
-static struct symtabs_and_lines all_sals_for_line (const char*, int, char***);
+static struct symtabs_and_lines all_sals_for_line (const char *, int,
+ char ***);
-static void read_all_symtabs (const char*);
+static void read_all_symtabs (const char *);
-static int is_plausible_func_for_line (struct symbol*, int);
+static int is_plausible_func_for_line (struct symbol *, int);
-static struct value* ada_coerce_ref (struct value*);
+static struct value *ada_coerce_ref (struct value *);
-static struct value* value_pos_atr (struct value*);
+static struct value *value_pos_atr (struct value *);
-static struct value* value_val_atr (struct type*, struct value*);
+static struct value *value_val_atr (struct type *, struct value *);
-static struct symbol* standard_lookup (const char*, namespace_enum);
+static struct symbol *standard_lookup (const char *, namespace_enum);
extern void markTimeStart (int index);
extern void markTimeStop (int index);
-
+
/* Maximum-sized dynamic type. */
static unsigned int varsize_limit;
-static const char* ada_completer_word_break_characters =
+static const char *ada_completer_word_break_characters =
" \t\n!@#$%^&*()+=|~`}{[]\";:?/,-";
/* The name of the symbol to use to get the name of the main subprogram */
@@ -202,18 +214,17 @@ static const char* ada_completer_word_break_characters =
void
extract_string (CORE_ADDR addr, char *buf)
{
- int char_index = 0;
+ int char_index = 0;
- /* Loop, reading one byte at a time, until we reach the '\000'
- end-of-string marker */
- do
- {
- target_read_memory (addr + char_index * sizeof (char),
- buf + char_index * sizeof (char),
- sizeof (char));
- char_index++;
- }
- while (buf[char_index - 1] != '\000');
+ /* Loop, reading one byte at a time, until we reach the '\000'
+ end-of-string marker */
+ do
+ {
+ target_read_memory (addr + char_index * sizeof (char),
+ buf + char_index * sizeof (char), sizeof (char));
+ char_index++;
+ }
+ while (buf[char_index - 1] != '\000');
}
/* Assuming *OLD_VECT points to an array of *SIZE objects of size
@@ -221,48 +232,42 @@ extract_string (CORE_ADDR addr, char *buf)
updating *OLD_VECT and *SIZE as necessary. */
void
-grow_vect (old_vect, size, min_size, element_size)
- void** old_vect;
- size_t* size;
- size_t min_size;
- int element_size;
-{
- if (*size < min_size) {
- *size *= 2;
- if (*size < min_size)
- *size = min_size;
- *old_vect = xrealloc (*old_vect, *size * element_size);
- }
+grow_vect (void **old_vect, size_t * size, size_t min_size, int element_size)
+{
+ if (*size < min_size)
+ {
+ *size *= 2;
+ if (*size < min_size)
+ *size = min_size;
+ *old_vect = xrealloc (*old_vect, *size * element_size);
+ }
}
/* True (non-zero) iff TARGET matches FIELD_NAME up to any trailing
suffix of FIELD_NAME beginning "___" */
static int
-field_name_match (field_name, target)
- const char *field_name;
- const char *target;
+field_name_match (const char *field_name, const char *target)
{
int len = strlen (target);
- return
- STREQN (field_name, target, len)
- && (field_name[len] == '\0'
+ return
+ STREQN (field_name, target, len)
+ && (field_name[len] == '\0'
|| (STREQN (field_name + len, "___", 3)
- && ! STREQ (field_name + strlen (field_name) - 6, "___XVN")));
+ && !STREQ (field_name + strlen (field_name) - 6, "___XVN")));
}
/* The length of the prefix of NAME prior to any "___" suffix. */
int
-ada_name_prefix_len (name)
- const char* name;
+ada_name_prefix_len (const char *name)
{
if (name == NULL)
return 0;
- else
+ else
{
- const char* p = strstr (name, "___");
+ const char *p = strstr (name, "___");
if (p == NULL)
return strlen (name);
else
@@ -272,7 +277,7 @@ ada_name_prefix_len (name)
/* SUFFIX is a suffix of STR. False if STR is null. */
static int
-is_suffix (const char* str, const char* suffix)
+is_suffix (const char *str, const char *suffix)
{
int len1, len2;
if (str == NULL)
@@ -285,14 +290,12 @@ is_suffix (const char* str, const char* suffix)
/* Create a value of type TYPE whose contents come from VALADDR, if it
* is non-null, and whose memory address (in the inferior) is
* ADDRESS. */
-struct value*
-value_from_contents_and_address (type, valaddr, address)
- struct type* type;
- char* valaddr;
- CORE_ADDR address;
-{
- struct value* v = allocate_value (type);
- if (valaddr == NULL)
+struct value *
+value_from_contents_and_address (struct type *type, char *valaddr,
+ CORE_ADDR address)
+{
+ struct value *v = allocate_value (type);
+ if (valaddr == NULL)
VALUE_LAZY (v) = 1;
else
memcpy (VALUE_CONTENTS_RAW (v), valaddr, TYPE_LENGTH (type));
@@ -305,27 +308,25 @@ value_from_contents_and_address (type, valaddr, address)
/* The contents of value VAL, beginning at offset OFFSET, treated as a
value of type TYPE. The result is an lval in memory if VAL is. */
-static struct value*
-coerce_unspec_val_to_type (val, offset, type)
- struct value* val;
- long offset;
- struct type *type;
+static struct value *
+coerce_unspec_val_to_type (struct value *val, long offset, struct type *type)
{
CHECK_TYPEDEF (type);
if (VALUE_LVAL (val) == lval_memory)
return value_at_lazy (type,
- VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset, NULL);
- else
+ VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset,
+ NULL);
+ else
{
- struct value* result = allocate_value (type);
+ struct value *result = allocate_value (type);
VALUE_LVAL (result) = not_lval;
- if (VALUE_ADDRESS (val) == 0)
+ if (VALUE_ADDRESS (val) == 0)
memcpy (VALUE_CONTENTS_RAW (result), VALUE_CONTENTS (val) + offset,
- TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val))
+ TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val))
? TYPE_LENGTH (VALUE_TYPE (val)) : TYPE_LENGTH (type));
- else
+ else
{
- VALUE_ADDRESS (result) =
+ VALUE_ADDRESS (result) =
VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset;
VALUE_LAZY (result) = 1;
}
@@ -333,10 +334,8 @@ coerce_unspec_val_to_type (val, offset, type)
}
}
-static char*
-cond_offset_host (valaddr, offset)
- char* valaddr;
- long offset;
+static char *
+cond_offset_host (char *valaddr, long offset)
{
if (valaddr == NULL)
return NULL;
@@ -345,35 +344,33 @@ cond_offset_host (valaddr, offset)
}
static CORE_ADDR
-cond_offset_target (address, offset)
- CORE_ADDR address;
- long offset;
+cond_offset_target (CORE_ADDR address, long offset)
{
if (address == 0)
return 0;
- else
+ else
return address + offset;
}
/* Perform execute_command on the result of concatenating all
arguments up to NULL. */
static void
-do_command (const char* arg, ...)
+do_command (const char *arg, ...)
{
int len;
- char* cmd;
- const char* s;
+ char *cmd;
+ const char *s;
va_list ap;
va_start (ap, arg);
len = 0;
s = arg;
cmd = "";
- for (; s != NULL; s = va_arg (ap, const char*))
+ for (; s != NULL; s = va_arg (ap, const char *))
{
- char* cmd1;
+ char *cmd1;
len += strlen (s);
- cmd1 = alloca (len+1);
+ cmd1 = alloca (len + 1);
strcpy (cmd1, cmd);
strcat (cmd1, s);
cmd = cmd1;
@@ -381,65 +378,62 @@ do_command (const char* arg, ...)
va_end (ap);
execute_command (cmd, 0);
}
-
+
/* Language Selection */
/* If the main program is in Ada, return language_ada, otherwise return LANG
(the main program is in Ada iif the adainit symbol is found).
MAIN_PST is not used. */
-
+
enum language
-ada_update_initial_language (lang, main_pst)
- enum language lang;
- struct partial_symtab* main_pst;
+ada_update_initial_language (enum language lang,
+ struct partial_symtab *main_pst)
{
- if (lookup_minimal_symbol ("adainit", (const char*) NULL,
- (struct objfile*) NULL) != NULL)
+ if (lookup_minimal_symbol ("adainit", (const char *) NULL,
+ (struct objfile *) NULL) != NULL)
/* return language_ada; */
/* FIXME: language_ada should be defined in defs.h */
return language_unknown;
return lang;
}
-
+
/* Symbols */
/* Table of Ada operators and their GNAT-mangled names. Last entry is pair
of NULLs. */
-const struct ada_opname_map ada_opname_table[] =
-{
- { "Oadd", "\"+\"", BINOP_ADD },
- { "Osubtract", "\"-\"", BINOP_SUB },
- { "Omultiply", "\"*\"", BINOP_MUL },
- { "Odivide", "\"/\"", BINOP_DIV },
- { "Omod", "\"mod\"", BINOP_MOD },
- { "Orem", "\"rem\"", BINOP_REM },
- { "Oexpon", "\"**\"", BINOP_EXP },
- { "Olt", "\"<\"", BINOP_LESS },
- { "Ole", "\"<=\"", BINOP_LEQ },
- { "Ogt", "\">\"", BINOP_GTR },
- { "Oge", "\">=\"", BINOP_GEQ },
- { "Oeq", "\"=\"", BINOP_EQUAL },
- { "One", "\"/=\"", BINOP_NOTEQUAL },
- { "Oand", "\"and\"", BINOP_BITWISE_AND },
- { "Oor", "\"or\"", BINOP_BITWISE_IOR },
- { "Oxor", "\"xor\"", BINOP_BITWISE_XOR },
- { "Oconcat", "\"&\"", BINOP_CONCAT },
- { "Oabs", "\"abs\"", UNOP_ABS },
- { "Onot", "\"not\"", UNOP_LOGICAL_NOT },
- { "Oadd", "\"+\"", UNOP_PLUS },
- { "Osubtract", "\"-\"", UNOP_NEG },
- { NULL, NULL }
+const struct ada_opname_map ada_opname_table[] = {
+ {"Oadd", "\"+\"", BINOP_ADD},
+ {"Osubtract", "\"-\"", BINOP_SUB},
+ {"Omultiply", "\"*\"", BINOP_MUL},
+ {"Odivide", "\"/\"", BINOP_DIV},
+ {"Omod", "\"mod\"", BINOP_MOD},
+ {"Orem", "\"rem\"", BINOP_REM},
+ {"Oexpon", "\"**\"", BINOP_EXP},
+ {"Olt", "\"<\"", BINOP_LESS},
+ {"Ole", "\"<=\"", BINOP_LEQ},
+ {"Ogt", "\">\"", BINOP_GTR},
+ {"Oge", "\">=\"", BINOP_GEQ},
+ {"Oeq", "\"=\"", BINOP_EQUAL},
+ {"One", "\"/=\"", BINOP_NOTEQUAL},
+ {"Oand", "\"and\"", BINOP_BITWISE_AND},
+ {"Oor", "\"or\"", BINOP_BITWISE_IOR},
+ {"Oxor", "\"xor\"", BINOP_BITWISE_XOR},
+ {"Oconcat", "\"&\"", BINOP_CONCAT},
+ {"Oabs", "\"abs\"", UNOP_ABS},
+ {"Onot", "\"not\"", UNOP_LOGICAL_NOT},
+ {"Oadd", "\"+\"", UNOP_PLUS},
+ {"Osubtract", "\"-\"", UNOP_NEG},
+ {NULL, NULL}
};
/* True if STR should be suppressed in info listings. */
static int
-is_suppressed_name (str)
- const char* str;
+is_suppressed_name (const char *str)
{
if (STREQN (str, "_ada_", 5))
str += 5;
@@ -447,13 +441,13 @@ is_suppressed_name (str)
return 1;
else
{
- const char* p;
- const char* suffix = strstr (str, "___");
+ const char *p;
+ const char *suffix = strstr (str, "___");
if (suffix != NULL && suffix[3] != 'X')
return 1;
if (suffix == NULL)
suffix = str + strlen (str);
- for (p = suffix-1; p != str; p -= 1)
+ for (p = suffix - 1; p != str; p -= 1)
if (isupper (*p))
{
int i;
@@ -462,11 +456,11 @@ is_suppressed_name (str)
if (*p != 'O')
return 1;
for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
- if (STREQN (ada_opname_table[i].mangled, p,
+ if (STREQN (ada_opname_table[i].mangled, p,
strlen (ada_opname_table[i].mangled)))
goto OK;
return 1;
- OK: ;
+ OK:;
}
return 0;
}
@@ -475,43 +469,43 @@ is_suppressed_name (str)
/* The "mangled" form of DEMANGLED, according to GNAT conventions.
* The result is valid until the next call to ada_mangle. */
char *
-ada_mangle (demangled)
- const char* demangled;
+ada_mangle (const char *demangled)
{
- static char* mangling_buffer = NULL;
+ static char *mangling_buffer = NULL;
static size_t mangling_buffer_size = 0;
- const char* p;
+ const char *p;
int k;
-
+
if (demangled == NULL)
return NULL;
- GROW_VECT (mangling_buffer, mangling_buffer_size, 2*strlen (demangled) + 10);
+ GROW_VECT (mangling_buffer, mangling_buffer_size,
+ 2 * strlen (demangled) + 10);
k = 0;
for (p = demangled; *p != '\0'; p += 1)
{
- if (*p == '.')
+ if (*p == '.')
{
- mangling_buffer[k] = mangling_buffer[k+1] = '_';
+ mangling_buffer[k] = mangling_buffer[k + 1] = '_';
k += 2;
}
else if (*p == '"')
{
- const struct ada_opname_map* mapping;
+ const struct ada_opname_map *mapping;
for (mapping = ada_opname_table;
- mapping->mangled != NULL &&
- ! STREQN (mapping->demangled, p, strlen (mapping->demangled));
+ mapping->mangled != NULL &&
+ !STREQN (mapping->demangled, p, strlen (mapping->demangled));
p += 1)
;
if (mapping->mangled == NULL)
error ("invalid Ada operator name: %s", p);
- strcpy (mangling_buffer+k, mapping->mangled);
+ strcpy (mangling_buffer + k, mapping->mangled);
k += strlen (mapping->mangled);
break;
}
- else
+ else
{
mangling_buffer[k] = *p;
k += 1;
@@ -525,19 +519,19 @@ ada_mangle (demangled)
/* Return NAME folded to lower case, or, if surrounded by single
* quotes, unfolded, but with the quotes stripped away. Result good
* to next call. */
-char*
-ada_fold_name (const char* name)
+char *
+ada_fold_name (const char *name)
{
- static char* fold_buffer = NULL;
+ static char *fold_buffer = NULL;
static size_t fold_buffer_size = 0;
int len = strlen (name);
- GROW_VECT (fold_buffer, fold_buffer_size, len+1);
+ GROW_VECT (fold_buffer, fold_buffer_size, len + 1);
if (name[0] == '\'')
{
- strncpy (fold_buffer, name+1, len-2);
- fold_buffer[len-2] = '\000';
+ strncpy (fold_buffer, name + 1, len - 2);
+ fold_buffer[len - 2] = '\000';
}
else
{
@@ -563,17 +557,16 @@ ada_fold_name (const char* name)
*/
char *
-ada_demangle (mangled)
- const char* mangled;
+ada_demangle (const char *mangled)
{
int i, j;
int len0;
- const char* p;
- char* demangled;
+ const char *p;
+ char *demangled;
int at_start_name;
- static char* demangling_buffer = NULL;
+ static char *demangling_buffer = NULL;
static size_t demangling_buffer_size = 0;
-
+
if (STREQN (mangled, "_ada_", 5))
mangled += 5;
@@ -583,7 +576,7 @@ ada_demangle (mangled)
p = strstr (mangled, "___");
if (p == NULL)
len0 = strlen (mangled);
- else
+ else
{
if (p[3] == 'X')
len0 = p - mangled;
@@ -596,19 +589,20 @@ ada_demangle (mangled)
len0 -= 1;
/* Make demangled big enough for possible expansion by operator name. */
- GROW_VECT (demangling_buffer, demangling_buffer_size, 2*len0+1);
+ GROW_VECT (demangling_buffer, demangling_buffer_size, 2 * len0 + 1);
demangled = demangling_buffer;
- if (isdigit (mangled[len0 - 1])) {
- for (i = len0-2; i >= 0 && isdigit (mangled[i]); i -= 1)
- ;
- if (i > 1 && mangled[i] == '_' && mangled[i-1] == '_')
- len0 = i - 1;
- else if (mangled[i] == '$')
- len0 = i;
- }
+ if (isdigit (mangled[len0 - 1]))
+ {
+ for (i = len0 - 2; i >= 0 && isdigit (mangled[i]); i -= 1)
+ ;
+ if (i > 1 && mangled[i] == '_' && mangled[i - 1] == '_')
+ len0 = i - 1;
+ else if (mangled[i] == '$')
+ len0 = i;
+ }
- for (i = 0, j = 0; i < len0 && ! isalpha (mangled[i]); i += 1, j += 1)
+ for (i = 0, j = 0; i < len0 && !isalpha (mangled[i]); i += 1, j += 1)
demangled[j] = mangled[i];
at_start_name = 1;
@@ -619,9 +613,10 @@ ada_demangle (mangled)
int k;
for (k = 0; ada_opname_table[k].mangled != NULL; k += 1)
{
- int op_len = strlen (ada_opname_table[k].mangled);
- if (STREQN (ada_opname_table[k].mangled+1, mangled+i+1, op_len-1)
- && ! isalnum (mangled[i + op_len]))
+ int op_len = strlen (ada_opname_table[k].mangled);
+ if (STREQN
+ (ada_opname_table[k].mangled + 1, mangled + i + 1,
+ op_len - 1) && !isalnum (mangled[i + op_len]))
{
strcpy (demangled + j, ada_opname_table[k].demangled);
at_start_name = 0;
@@ -635,9 +630,9 @@ ada_demangle (mangled)
}
at_start_name = 0;
- if (i < len0-4 && STREQN (mangled+i, "TK__", 4))
+ if (i < len0 - 4 && STREQN (mangled + i, "TK__", 4))
i += 2;
- if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i-1]))
+ if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i - 1]))
{
do
i += 1;
@@ -645,16 +640,18 @@ ada_demangle (mangled)
if (i < len0)
goto Suppress;
}
- else if (i < len0-2 && mangled[i] == '_' && mangled[i+1] == '_')
+ else if (i < len0 - 2 && mangled[i] == '_' && mangled[i + 1] == '_')
{
demangled[j] = '.';
at_start_name = 1;
- i += 2; j += 1;
+ i += 2;
+ j += 1;
}
else
{
demangled[j] = mangled[i];
- i += 1; j += 1;
+ i += 1;
+ j += 1;
}
}
demangled[j] = '\000';
@@ -666,8 +663,7 @@ ada_demangle (mangled)
return demangled;
Suppress:
- GROW_VECT (demangling_buffer, demangling_buffer_size,
- strlen (mangled) + 3);
+ GROW_VECT (demangling_buffer, demangling_buffer_size, strlen (mangled) + 3);
demangled = demangling_buffer;
if (mangled[0] == '<')
strcpy (demangled, mangled);
@@ -685,46 +681,43 @@ Suppress:
* either argument is NULL. */
int
-ada_match_name (sym_name, name, wild)
- const char* sym_name;
- const char* name;
- int wild;
+ada_match_name (const char *sym_name, const char *name, int wild)
{
if (sym_name == NULL || name == NULL)
return 0;
else if (wild)
return wild_match (name, strlen (name), sym_name);
- else {
- int len_name = strlen (name);
- return (STREQN (sym_name, name, len_name)
- && is_name_suffix (sym_name+len_name))
- || (STREQN (sym_name, "_ada_", 5)
- && STREQN (sym_name+5, name, len_name)
- && is_name_suffix (sym_name+len_name+5));
- }
+ else
+ {
+ int len_name = strlen (name);
+ return (STREQN (sym_name, name, len_name)
+ && is_name_suffix (sym_name + len_name))
+ || (STREQN (sym_name, "_ada_", 5)
+ && STREQN (sym_name + 5, name, len_name)
+ && is_name_suffix (sym_name + len_name + 5));
+ }
}
/* True (non-zero) iff in Ada mode, the symbol SYM should be
suppressed in info listings. */
int
-ada_suppress_symbol_printing (sym)
- struct symbol *sym;
+ada_suppress_symbol_printing (struct symbol *sym)
{
if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE)
return 1;
- else
+ else
return is_suppressed_name (SYMBOL_NAME (sym));
}
-
+
/* Arrays */
/* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of
array descriptors. */
-static char* bound_name[] = {
- "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3",
+static char *bound_name[] = {
+ "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3",
"LB4", "UB4", "LB5", "UB5", "LB6", "UB6", "LB7", "UB7"
};
@@ -735,14 +728,10 @@ static char* bound_name[] = {
/* Like modify_field, but allows bitpos > wordlength. */
static void
-modify_general_field (addr, fieldval, bitpos, bitsize)
- char *addr;
- LONGEST fieldval;
- int bitpos, bitsize;
+modify_general_field (char *addr, LONGEST fieldval, int bitpos, int bitsize)
{
- modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)),
- fieldval, bitpos % (8 * sizeof (LONGEST)),
- bitsize);
+ modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)),
+ fieldval, bitpos % (8 * sizeof (LONGEST)), bitsize);
}
@@ -751,9 +740,8 @@ modify_general_field (addr, fieldval, bitpos, bitsize)
/* The descriptor or array type, if any, indicated by TYPE; removes
level of indirection, if needed. */
-static struct type*
-desc_base_type (type)
- struct type* type;
+static struct type *
+desc_base_type (struct type *type)
{
if (type == NULL)
return NULL;
@@ -766,26 +754,25 @@ desc_base_type (type)
/* True iff TYPE indicates a "thin" array pointer type. */
static int
-is_thin_pntr (struct type* type)
+is_thin_pntr (struct type *type)
{
- return
+ return
is_suffix (ada_type_name (desc_base_type (type)), "___XUT")
|| is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE");
}
/* The descriptor type for thin pointer type TYPE. */
-static struct type*
-thin_descriptor_type (struct type* type)
+static struct type *
+thin_descriptor_type (struct type *type)
{
- struct type* base_type = desc_base_type (type);
+ struct type *base_type = desc_base_type (type);
if (base_type == NULL)
return NULL;
if (is_suffix (ada_type_name (base_type), "___XVE"))
return base_type;
- else
+ else
{
- struct type* alt_type =
- ada_find_parallel_type (base_type, "___XVE");
+ struct type *alt_type = ada_find_parallel_type (base_type, "___XVE");
if (alt_type == NULL)
return base_type;
else
@@ -794,21 +781,21 @@ thin_descriptor_type (struct type* type)
}
/* A pointer to the array data for thin-pointer value VAL. */
-static struct value*
-thin_data_pntr (struct value* val)
+static struct value *
+thin_data_pntr (struct value *val)
{
- struct type* type = VALUE_TYPE (val);
+ struct type *type = VALUE_TYPE (val);
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- return value_cast (desc_data_type (thin_descriptor_type (type)),
+ return value_cast (desc_data_type (thin_descriptor_type (type)),
value_copy (val));
- else
+ else
return value_from_longest (desc_data_type (thin_descriptor_type (type)),
VALUE_ADDRESS (val) + VALUE_OFFSET (val));
}
/* True iff TYPE indicates a "thick" array pointer type. */
static int
-is_thick_pntr (struct type* type)
+is_thick_pntr (struct type *type)
{
type = desc_base_type (type);
return (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT
@@ -817,11 +804,10 @@ is_thick_pntr (struct type* type)
/* If TYPE is the type of an array descriptor (fat or thin pointer) or a
pointer to one, the type of its bounds data; otherwise, NULL. */
-static struct type*
-desc_bounds_type (type)
- struct type* type;
+static struct type *
+desc_bounds_type (struct type *type)
{
- struct type* r;
+ struct type *r;
type = desc_base_type (type);
@@ -847,34 +833,34 @@ desc_bounds_type (type)
/* If ARR is an array descriptor (fat or thin pointer), or pointer to
one, a pointer to its bounds data. Otherwise NULL. */
-static struct value*
-desc_bounds (arr)
- struct value* arr;
+static struct value *
+desc_bounds (struct value *arr)
{
- struct type* type = check_typedef (VALUE_TYPE (arr));
- if (is_thin_pntr (type))
+ struct type *type = check_typedef (VALUE_TYPE (arr));
+ if (is_thin_pntr (type))
{
- struct type* bounds_type = desc_bounds_type (thin_descriptor_type (type));
+ struct type *bounds_type =
+ desc_bounds_type (thin_descriptor_type (type));
LONGEST addr;
if (desc_bounds_type == NULL)
error ("Bad GNAT array descriptor");
/* NOTE: The following calculation is not really kosher, but
- since desc_type is an XVE-encoded type (and shouldn't be),
- the correct calculation is a real pain. FIXME (and fix GCC). */
+ since desc_type is an XVE-encoded type (and shouldn't be),
+ the correct calculation is a real pain. FIXME (and fix GCC). */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
addr = value_as_long (arr);
- else
+ else
addr = VALUE_ADDRESS (arr) + VALUE_OFFSET (arr);
- return
- value_from_longest (lookup_pointer_type (bounds_type),
- addr - TYPE_LENGTH (bounds_type));
+ return
+ value_from_longest (lookup_pointer_type (bounds_type),
+ addr - TYPE_LENGTH (bounds_type));
}
else if (is_thick_pntr (type))
- return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL,
+ return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL,
"Bad GNAT array descriptor");
else
return NULL;
@@ -883,8 +869,7 @@ desc_bounds (arr)
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
position of the field containing the address of the bounds data. */
static int
-fat_pntr_bounds_bitpos (type)
- struct type* type;
+fat_pntr_bounds_bitpos (struct type *type)
{
return TYPE_FIELD_BITPOS (desc_base_type (type), 1);
}
@@ -892,12 +877,11 @@ fat_pntr_bounds_bitpos (type)
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
size of the field containing the address of the bounds data. */
static int
-fat_pntr_bounds_bitsize (type)
- struct type* type;
+fat_pntr_bounds_bitsize (struct type *type)
{
type = desc_base_type (type);
- if (TYPE_FIELD_BITSIZE (type, 1) > 0)
+ if (TYPE_FIELD_BITSIZE (type, 1) > 0)
return TYPE_FIELD_BITSIZE (type, 1);
else
return 8 * TYPE_LENGTH (check_typedef (TYPE_FIELD_TYPE (type, 1)));
@@ -907,16 +891,15 @@ fat_pntr_bounds_bitsize (type)
pointer to one, the type of its array data (a
pointer-to-array-with-no-bounds type); otherwise, NULL. Use
ada_type_of_array to get an array type with bounds data. */
-static struct type*
-desc_data_type (type)
- struct type* type;
+static struct type *
+desc_data_type (struct type *type)
{
type = desc_base_type (type);
/* NOTE: The following is bogus; see comment in desc_bounds. */
if (is_thin_pntr (type))
- return lookup_pointer_type
- (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type),1)));
+ return lookup_pointer_type
+ (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type), 1)));
else if (is_thick_pntr (type))
return lookup_struct_elt_type (type, "P_ARRAY", 1);
else
@@ -925,15 +908,14 @@ desc_data_type (type)
/* If ARR is an array descriptor (fat or thin pointer), a pointer to
its array data. */
-static struct value*
-desc_data (arr)
- struct value* arr;
+static struct value *
+desc_data (struct value *arr)
{
- struct type* type = VALUE_TYPE (arr);
+ struct type *type = VALUE_TYPE (arr);
if (is_thin_pntr (type))
return thin_data_pntr (arr);
else if (is_thick_pntr (type))
- return value_struct_elt (&arr, NULL, "P_ARRAY", NULL,
+ return value_struct_elt (&arr, NULL, "P_ARRAY", NULL,
"Bad GNAT array descriptor");
else
return NULL;
@@ -943,8 +925,7 @@ desc_data (arr)
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
position of the field containing the address of the data. */
static int
-fat_pntr_data_bitpos (type)
- struct type* type;
+fat_pntr_data_bitpos (struct type *type)
{
return TYPE_FIELD_BITPOS (desc_base_type (type), 0);
}
@@ -952,27 +933,23 @@ fat_pntr_data_bitpos (type)
/* If TYPE is the type of an array-descriptor (fat pointer), the bit
size of the field containing the address of the data. */
static int
-fat_pntr_data_bitsize (type)
- struct type* type;
+fat_pntr_data_bitsize (struct type *type)
{
type = desc_base_type (type);
if (TYPE_FIELD_BITSIZE (type, 0) > 0)
return TYPE_FIELD_BITSIZE (type, 0);
- else
+ else
return TARGET_CHAR_BIT * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0));
}
/* If BOUNDS is an array-bounds structure (or pointer to one), return
the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
bound, if WHICH is 1. The first bound is I=1. */
-static struct value*
-desc_one_bound (bounds, i, which)
- struct value* bounds;
- int i;
- int which;
+static struct value *
+desc_one_bound (struct value *bounds, int i, int which)
{
- return value_struct_elt (&bounds, NULL, bound_name[2*i+which-2], NULL,
+ return value_struct_elt (&bounds, NULL, bound_name[2 * i + which - 2], NULL,
"Bad GNAT array descriptor bounds");
}
@@ -980,51 +957,42 @@ desc_one_bound (bounds, i, which)
of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
bound, if WHICH is 1. The first bound is I=1. */
static int
-desc_bound_bitpos (type, i, which)
- struct type* type;
- int i;
- int which;
+desc_bound_bitpos (struct type *type, int i, int which)
{
- return TYPE_FIELD_BITPOS (desc_base_type (type), 2*i+which-2);
+ return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2);
}
/* If BOUNDS is an array-bounds structure type, return the bit field size
of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
bound, if WHICH is 1. The first bound is I=1. */
static int
-desc_bound_bitsize (type, i, which)
- struct type* type;
- int i;
- int which;
+desc_bound_bitsize (struct type *type, int i, int which)
{
type = desc_base_type (type);
- if (TYPE_FIELD_BITSIZE (type, 2*i+which-2) > 0)
- return TYPE_FIELD_BITSIZE (type, 2*i+which-2);
- else
- return 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 2*i+which-2));
+ if (TYPE_FIELD_BITSIZE (type, 2 * i + which - 2) > 0)
+ return TYPE_FIELD_BITSIZE (type, 2 * i + which - 2);
+ else
+ return 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 2 * i + which - 2));
}
/* If TYPE is the type of an array-bounds structure, the type of its
- Ith bound (numbering from 1). Otherwise, NULL. */
-static struct type*
-desc_index_type (type, i)
- struct type* type;
- int i;
+ Ith bound (numbering from 1). Otherwise, NULL. */
+static struct type *
+desc_index_type (struct type *type, int i)
{
type = desc_base_type (type);
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
- return lookup_struct_elt_type (type, bound_name[2*i-2], 1);
- else
+ return lookup_struct_elt_type (type, bound_name[2 * i - 2], 1);
+ else
return NULL;
}
/* The number of index positions in the array-bounds type TYPE. 0
if TYPE is NULL. */
static int
-desc_arity (type)
- struct type* type;
+desc_arity (struct type *type)
{
type = desc_base_type (type);
@@ -1036,8 +1004,7 @@ desc_arity (type)
/* Non-zero iff type is a simple array type (or pointer to one). */
int
-ada_is_simple_array (type)
- struct type* type;
+ada_is_simple_array (struct type *type)
{
if (type == NULL)
return 0;
@@ -1049,20 +1016,19 @@ ada_is_simple_array (type)
/* Non-zero iff type belongs to a GNAT array descriptor. */
int
-ada_is_array_descriptor (type)
- struct type* type;
+ada_is_array_descriptor (struct type *type)
{
- struct type* data_type = desc_data_type (type);
+ struct type *data_type = desc_data_type (type);
if (type == NULL)
return 0;
CHECK_TYPEDEF (type);
- return
+ return
data_type != NULL
&& ((TYPE_CODE (data_type) == TYPE_CODE_PTR
&& TYPE_TARGET_TYPE (data_type) != NULL
&& TYPE_CODE (TYPE_TARGET_TYPE (data_type)) == TYPE_CODE_ARRAY)
- ||
+ ||
TYPE_CODE (data_type) == TYPE_CODE_ARRAY)
&& desc_arity (desc_bounds_type (type)) > 0;
}
@@ -1072,15 +1038,14 @@ ada_is_array_descriptor (type)
debugging output from GNAT. Re-examine periodically to see if it
is still needed. */
int
-ada_is_bogus_array_descriptor (type)
- struct type *type;
+ada_is_bogus_array_descriptor (struct type *type)
{
- return
+ return
type != NULL
&& TYPE_CODE (type) == TYPE_CODE_STRUCT
&& (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL
|| lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL)
- && ! ada_is_array_descriptor (type);
+ && !ada_is_array_descriptor (type);
}
@@ -1091,47 +1056,47 @@ ada_is_bogus_array_descriptor (type)
the ARR denotes a null array descriptor and BOUNDS is non-zero,
returns NULL. The result is simply the type of ARR if ARR is not
a descriptor. */
-struct type*
-ada_type_of_array (arr, bounds)
- struct value* arr;
- int bounds;
+struct type *
+ada_type_of_array (struct value *arr, int bounds)
{
if (ada_is_packed_array_type (VALUE_TYPE (arr)))
return decode_packed_array_type (VALUE_TYPE (arr));
- if (! ada_is_array_descriptor (VALUE_TYPE (arr)))
+ if (!ada_is_array_descriptor (VALUE_TYPE (arr)))
return VALUE_TYPE (arr);
-
- if (! bounds)
- return check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr))));
+
+ if (!bounds)
+ return
+ check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr))));
else
{
- struct type* elt_type;
+ struct type *elt_type;
int arity;
- struct value* descriptor;
+ struct value *descriptor;
struct objfile *objf = TYPE_OBJFILE (VALUE_TYPE (arr));
elt_type = ada_array_element_type (VALUE_TYPE (arr), -1);
arity = ada_array_arity (VALUE_TYPE (arr));
- if (elt_type == NULL || arity == 0)
+ if (elt_type == NULL || arity == 0)
return check_typedef (VALUE_TYPE (arr));
descriptor = desc_bounds (arr);
- if (value_as_long (descriptor) == 0)
+ if (value_as_long (descriptor) == 0)
return NULL;
- while (arity > 0) {
- struct type* range_type = alloc_type (objf);
- struct type* array_type = alloc_type (objf);
- struct value* low = desc_one_bound (descriptor, arity, 0);
- struct value* high = desc_one_bound (descriptor, arity, 1);
- arity -= 1;
-
- create_range_type (range_type, VALUE_TYPE (low),
- (int) value_as_long (low),
- (int) value_as_long (high));
- elt_type = create_array_type (array_type, elt_type, range_type);
- }
+ while (arity > 0)
+ {
+ struct type *range_type = alloc_type (objf);
+ struct type *array_type = alloc_type (objf);
+ struct value *low = desc_one_bound (descriptor, arity, 0);
+ struct value *high = desc_one_bound (descriptor, arity, 1);
+ arity -= 1;
+
+ create_range_type (range_type, VALUE_TYPE (low),
+ (int) value_as_long (low),
+ (int) value_as_long (high));
+ elt_type = create_array_type (array_type, elt_type, range_type);
+ }
return lookup_pointer_type (elt_type);
}
@@ -1141,13 +1106,12 @@ ada_type_of_array (arr, bounds)
Otherwise, returns either a standard GDB array with bounds set
appropriately or, if ARR is a non-null fat pointer, a pointer to a standard
GDB array. Returns NULL if ARR is a null fat pointer. */
-struct value*
-ada_coerce_to_simple_array_ptr (arr)
- struct value* arr;
+struct value *
+ada_coerce_to_simple_array_ptr (struct value *arr)
{
if (ada_is_array_descriptor (VALUE_TYPE (arr)))
{
- struct type* arrType = ada_type_of_array (arr, 1);
+ struct type *arrType = ada_type_of_array (arr, 1);
if (arrType == NULL)
return NULL;
return value_cast (arrType, value_copy (desc_data (arr)));
@@ -1161,33 +1125,31 @@ ada_coerce_to_simple_array_ptr (arr)
/* If ARR does not represent an array, returns ARR unchanged.
Otherwise, returns a standard GDB array describing ARR (which may
be ARR itself if it already is in the proper form). */
-struct value*
-ada_coerce_to_simple_array (arr)
- struct value* arr;
+struct value *
+ada_coerce_to_simple_array (struct value *arr)
{
if (ada_is_array_descriptor (VALUE_TYPE (arr)))
{
- struct value* arrVal = ada_coerce_to_simple_array_ptr (arr);
+ struct value *arrVal = ada_coerce_to_simple_array_ptr (arr);
if (arrVal == NULL)
error ("Bounds unavailable for null array pointer.");
return value_ind (arrVal);
}
else if (ada_is_packed_array_type (VALUE_TYPE (arr)))
return decode_packed_array (arr);
- else
+ else
return arr;
}
/* If TYPE represents a GNAT array type, return it translated to an
ordinary GDB array type (possibly with BITSIZE fields indicating
packing). For other types, is the identity. */
-struct type*
-ada_coerce_to_simple_array_type (type)
- struct type* type;
+struct type *
+ada_coerce_to_simple_array_type (struct type *type)
{
- struct value* mark = value_mark ();
- struct value* dummy = value_from_longest (builtin_type_long, 0);
- struct type* result;
+ struct value *mark = value_mark ();
+ struct value *dummy = value_from_longest (builtin_type_long, 0);
+ struct type *result;
VALUE_TYPE (dummy) = type;
result = ada_type_of_array (dummy, 0);
value_free_to_mark (dummy);
@@ -1196,13 +1158,12 @@ ada_coerce_to_simple_array_type (type)
/* Non-zero iff TYPE represents a standard GNAT packed-array type. */
int
-ada_is_packed_array_type (type)
- struct type* type;
+ada_is_packed_array_type (struct type *type)
{
if (type == NULL)
return 0;
CHECK_TYPEDEF (type);
- return
+ return
ada_type_name (type) != NULL
&& strstr (ada_type_name (type), "___XP") != NULL;
}
@@ -1215,13 +1176,11 @@ ada_is_packed_array_type (type)
constituent arrays) recorded in the BITSIZE components of its
TYPE_FIELD_BITSIZE values, and with *ELT_BITS set to its total size
in bits. */
-static struct type*
-packed_array_type (type, elt_bits)
- struct type* type;
- long* elt_bits;
+static struct type *
+packed_array_type (struct type *type, long *elt_bits)
{
- struct type* new_elt_type;
- struct type* new_type;
+ struct type *new_elt_type;
+ struct type *new_type;
LONGEST low_bound, high_bound;
CHECK_TYPEDEF (type);
@@ -1235,15 +1194,15 @@ packed_array_type (type, elt_bits)
TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
TYPE_NAME (new_type) = ada_type_name (type);
- if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0),
+ if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0),
&low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
if (high_bound < low_bound)
*elt_bits = TYPE_LENGTH (new_type) = 0;
- else
+ else
{
*elt_bits *= (high_bound - low_bound + 1);
- TYPE_LENGTH (new_type) =
+ TYPE_LENGTH (new_type) =
(*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
}
@@ -1254,16 +1213,15 @@ packed_array_type (type, elt_bits)
/* The array type encoded by TYPE, where ada_is_packed_array_type (TYPE).
*/
-static struct type*
-decode_packed_array_type (type)
- struct type* type;
-{
- struct symbol** syms;
- struct block** blocks;
- const char* raw_name = ada_type_name (check_typedef (type));
- char* name = (char*) alloca (strlen (raw_name) + 1);
- char* tail = strstr (raw_name, "___XP");
- struct type* shadow_type;
+static struct type *
+decode_packed_array_type (struct type *type)
+{
+ struct symbol **syms;
+ struct block **blocks;
+ const char *raw_name = ada_type_name (check_typedef (type));
+ char *name = (char *) alloca (strlen (raw_name) + 1);
+ char *tail = strstr (raw_name, "___XP");
+ struct type *shadow_type;
long bits;
int i, n;
@@ -1272,7 +1230,7 @@ decode_packed_array_type (type)
/* NOTE: Use ada_lookup_symbol_list because of bug in some versions
* of gcc (Solaris, e.g.). FIXME when compiler is fixed. */
- n = ada_lookup_symbol_list (name, get_selected_block (NULL),
+ n = ada_lookup_symbol_list (name, get_selected_block (NULL),
VAR_NAMESPACE, &syms, &blocks);
for (i = 0; i < n; i += 1)
if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF
@@ -1290,13 +1248,13 @@ decode_packed_array_type (type)
warning ("could not understand bounds information on packed array");
return NULL;
}
-
+
if (sscanf (tail + sizeof ("___XP") - 1, "%ld", &bits) != 1)
{
warning ("could not understand bit size information on packed array");
return NULL;
}
-
+
return packed_array_type (shadow_type, &bits);
}
@@ -1306,11 +1264,10 @@ decode_packed_array_type (type)
target types are set to the number of bits in each element, and the
type length is set appropriately. */
-static struct value*
-decode_packed_array (arr)
- struct value* arr;
+static struct value *
+decode_packed_array (struct value *arr)
{
- struct type* type = decode_packed_array_type (VALUE_TYPE (arr));
+ struct type *type = decode_packed_array_type (VALUE_TYPE (arr));
if (type == NULL)
{
@@ -1325,39 +1282,36 @@ decode_packed_array (arr)
/* The value of the element of packed array ARR at the ARITY indices
given in IND. ARR must be a simple array. */
-static struct value*
-value_subscript_packed (arr, arity, ind)
- struct value* arr;
- int arity;
- struct value** ind;
+static struct value *
+value_subscript_packed (struct value *arr, int arity, struct value **ind)
{
int i;
int bits, elt_off, bit_off;
long elt_total_bit_offset;
- struct type* elt_type;
- struct value* v;
+ struct type *elt_type;
+ struct value *v;
bits = 0;
elt_total_bit_offset = 0;
elt_type = check_typedef (VALUE_TYPE (arr));
- for (i = 0; i < arity; i += 1)
+ for (i = 0; i < arity; i += 1)
{
- if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY
+ if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY
|| TYPE_FIELD_BITSIZE (elt_type, 0) == 0)
- error ("attempt to do packed indexing of something other than a packed array");
+ error
+ ("attempt to do packed indexing of something other than a packed array");
else
{
struct type *range_type = TYPE_INDEX_TYPE (elt_type);
LONGEST lowerbound, upperbound;
LONGEST idx;
- if (get_discrete_bounds (range_type, &lowerbound,
- &upperbound) < 0)
+ if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
{
warning ("don't know bounds of array");
lowerbound = upperbound = 0;
}
-
+
idx = value_as_long (value_pos_atr (ind[i]));
if (idx < lowerbound || idx > upperbound)
warning ("packed array index %ld out of bounds", (long) idx);
@@ -1368,8 +1322,8 @@ value_subscript_packed (arr, arity, ind)
}
elt_off = elt_total_bit_offset / HOST_CHAR_BIT;
bit_off = elt_total_bit_offset % HOST_CHAR_BIT;
-
- v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off,
+
+ v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off,
bits, elt_type);
if (VALUE_LVAL (arr) == lval_internalvar)
VALUE_LVAL (v) = lval_internalvar_component;
@@ -1381,19 +1335,19 @@ value_subscript_packed (arr, arity, ind)
/* Non-zero iff TYPE includes negative integer values. */
static int
-has_negatives (type)
- struct type* type;
+has_negatives (struct type *type)
{
- switch (TYPE_CODE (type)) {
- default:
- return 0;
- case TYPE_CODE_INT:
- return ! TYPE_UNSIGNED (type);
- case TYPE_CODE_RANGE:
- return TYPE_LOW_BOUND (type) < 0;
- }
+ switch (TYPE_CODE (type))
+ {
+ default:
+ return 0;
+ case TYPE_CODE_INT:
+ return !TYPE_UNSIGNED (type);
+ case TYPE_CODE_RANGE:
+ return TYPE_LOW_BOUND (type) < 0;
+ }
}
-
+
/* Create a new value of type TYPE from the contents of OBJ starting
at byte OFFSET, and bit offset BIT_OFFSET within that byte,
@@ -1404,32 +1358,26 @@ has_negatives (type)
in this case is never an lval.
Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */
-struct value*
-ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
- bit_size, type)
- struct value* obj;
- char* valaddr;
- long offset;
- int bit_offset;
- int bit_size;
- struct type* type;
-{
- struct value* v;
+struct value *
+ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset,
+ int bit_offset, int bit_size,
+ struct type *type)
+{
+ struct value *v;
int src, /* Index into the source area. */
targ, /* Index into the target area. */
- i,
- srcBitsLeft, /* Number of source bits left to move. */
+ i, srcBitsLeft, /* Number of source bits left to move. */
nsrc, ntarg, /* Number of source and target bytes. */
unusedLS, /* Number of bits in next significant
* byte of source that are unused. */
accumSize; /* Number of meaningful bits in accum */
- unsigned char* bytes; /* First byte containing data to unpack. */
- unsigned char* unpacked;
+ unsigned char *bytes; /* First byte containing data to unpack. */
+ unsigned char *unpacked;
unsigned long accum; /* Staging area for bits being transferred */
unsigned char sign;
int len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
/* Transmit bytes from least to most significant; delta is the
- * direction the indices move. */
+ * direction the indices move. */
int delta = BITS_BIG_ENDIAN ? -1 : 1;
CHECK_TYPEDEF (type);
@@ -1437,22 +1385,22 @@ ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
if (obj == NULL)
{
v = allocate_value (type);
- bytes = (unsigned char*) (valaddr + offset);
+ bytes = (unsigned char *) (valaddr + offset);
}
else if (VALUE_LAZY (obj))
{
v = value_at (type,
VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL);
- bytes = (unsigned char*) alloca (len);
+ bytes = (unsigned char *) alloca (len);
read_memory (VALUE_ADDRESS (v), bytes, len);
}
- else
+ else
{
v = allocate_value (type);
- bytes = (unsigned char*) VALUE_CONTENTS (obj) + offset;
+ bytes = (unsigned char *) VALUE_CONTENTS (obj) + offset;
}
-
- if (obj != NULL)
+
+ if (obj != NULL)
{
VALUE_LVAL (v) = VALUE_LVAL (obj);
if (VALUE_LVAL (obj) == lval_internalvar)
@@ -1461,14 +1409,14 @@ ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
VALUE_BITPOS (v) = bit_offset + VALUE_BITPOS (obj);
VALUE_BITSIZE (v) = bit_size;
if (VALUE_BITPOS (v) >= HOST_CHAR_BIT)
- {
- VALUE_ADDRESS (v) += 1;
- VALUE_BITPOS (v) -= HOST_CHAR_BIT;
- }
+ {
+ VALUE_ADDRESS (v) += 1;
+ VALUE_BITPOS (v) -= HOST_CHAR_BIT;
+ }
}
else
VALUE_BITSIZE (v) = bit_size;
- unpacked = (unsigned char*) VALUE_CONTENTS (v);
+ unpacked = (unsigned char *) VALUE_CONTENTS (v);
srcBitsLeft = bit_size;
nsrc = len;
@@ -1481,34 +1429,34 @@ ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
}
else if (BITS_BIG_ENDIAN)
{
- src = len-1;
- if (has_negatives (type) &&
- ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT-1))))
+ src = len - 1;
+ if (has_negatives (type) &&
+ ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1))))
sign = ~0;
-
- unusedLS =
+
+ unusedLS =
(HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT)
% HOST_CHAR_BIT;
switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_UNION:
- case TYPE_CODE_STRUCT:
- /* Non-scalar values must be aligned at a byte boundary. */
- accumSize =
- (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT;
+ {
+ case TYPE_CODE_ARRAY:
+ case TYPE_CODE_UNION:
+ case TYPE_CODE_STRUCT:
+ /* Non-scalar values must be aligned at a byte boundary. */
+ accumSize =
+ (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT;
/* And are placed at the beginning (most-significant) bytes
* of the target. */
targ = src;
- break;
- default:
+ break;
+ default:
accumSize = 0;
targ = TYPE_LENGTH (type) - 1;
- break;
- }
+ break;
+ }
}
- else
+ else
{
int sign_bit_offset = (bit_size + bit_offset - 1) % 8;
@@ -1516,23 +1464,24 @@ ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
unusedLS = bit_offset;
accumSize = 0;
- if (has_negatives (type) && (bytes[len-1] & (1 << sign_bit_offset)))
+ if (has_negatives (type) && (bytes[len - 1] & (1 << sign_bit_offset)))
sign = ~0;
}
-
+
accum = 0;
while (nsrc > 0)
{
/* Mask for removing bits of the next source byte that are not
* part of the value. */
- unsigned int unusedMSMask =
- (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft))-1;
+ unsigned int unusedMSMask =
+ (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) -
+ 1;
/* Sign-extend bits for this byte. */
unsigned int signMask = sign & ~unusedMSMask;
- accum |=
+ accum |=
(((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
accumSize += HOST_CHAR_BIT - unusedLS;
- if (accumSize >= HOST_CHAR_BIT)
+ if (accumSize >= HOST_CHAR_BIT)
{
unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
accumSize -= HOST_CHAR_BIT;
@@ -1557,12 +1506,12 @@ ada_value_primitive_packed_val (obj, valaddr, offset, bit_offset,
return v;
}
-
+
/* Move N bits from SOURCE, starting at bit offset SRC_OFFSET to
TARGET, starting at bit offset TARG_OFFSET. SOURCE and TARGET must
not overlap. */
static void
-move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
+move_bits (char *target, int targ_offset, char *source, int src_offset, int n)
{
unsigned int accum, mask;
int accum_bits, chunk_size;
@@ -1571,13 +1520,13 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
targ_offset %= HOST_CHAR_BIT;
source += src_offset / HOST_CHAR_BIT;
src_offset %= HOST_CHAR_BIT;
- if (BITS_BIG_ENDIAN)
+ if (BITS_BIG_ENDIAN)
{
accum = (unsigned char) *source;
source += 1;
accum_bits = HOST_CHAR_BIT - src_offset;
- while (n > 0)
+ while (n > 0)
{
int unused_right;
accum = (accum << HOST_CHAR_BIT) + (unsigned char) *source;
@@ -1588,8 +1537,8 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
chunk_size = n;
unused_right = HOST_CHAR_BIT - (chunk_size + targ_offset);
mask = ((1 << chunk_size) - 1) << unused_right;
- *target =
- (*target & ~mask)
+ *target =
+ (*target & ~mask)
| ((accum >> (accum_bits - chunk_size - unused_right)) & mask);
n -= chunk_size;
accum_bits -= chunk_size;
@@ -1603,7 +1552,7 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
source += 1;
accum_bits = HOST_CHAR_BIT - src_offset;
- while (n > 0)
+ while (n > 0)
{
accum = accum + ((unsigned char) *source << accum_bits);
accum_bits += HOST_CHAR_BIT;
@@ -1612,8 +1561,7 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
if (chunk_size > n)
chunk_size = n;
mask = ((1 << chunk_size) - 1) << targ_offset;
- *target =
- (*target & ~mask) | ((accum << targ_offset) & mask);
+ *target = (*target & ~mask) | ((accum << targ_offset) & mask);
n -= chunk_size;
accum_bits -= chunk_size;
accum >>= chunk_size;
@@ -1629,10 +1577,10 @@ move_bits (char* target, int targ_offset, char* source, int src_offset, int n)
FROMVAL. Handles assignment into packed fields that have
floating-point or non-scalar types. */
-static struct value*
-ada_value_assign (struct value* toval, struct value* fromval)
+static struct value *
+ada_value_assign (struct value *toval, struct value *fromval)
{
- struct type* type = VALUE_TYPE (toval);
+ struct type *type = VALUE_TYPE (toval);
int bits = VALUE_BITSIZE (toval);
if (!toval->modifiable)
@@ -1640,36 +1588,36 @@ ada_value_assign (struct value* toval, struct value* fromval)
COERCE_REF (toval);
- if (VALUE_LVAL (toval) == lval_memory
+ if (VALUE_LVAL (toval) == lval_memory
&& bits > 0
- && (TYPE_CODE (type) == TYPE_CODE_FLT
+ && (TYPE_CODE (type) == TYPE_CODE_FLT
|| TYPE_CODE (type) == TYPE_CODE_STRUCT))
{
- int len =
- (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1)
- / HOST_CHAR_BIT;
- char* buffer = (char*) alloca (len);
- struct value* val;
+ int len =
+ (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+ char *buffer = (char *) alloca (len);
+ struct value *val;
if (TYPE_CODE (type) == TYPE_CODE_FLT)
fromval = value_cast (type, fromval);
read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len);
if (BITS_BIG_ENDIAN)
- move_bits (buffer, VALUE_BITPOS (toval),
- VALUE_CONTENTS (fromval),
- TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT - bits,
- bits);
+ move_bits (buffer, VALUE_BITPOS (toval),
+ VALUE_CONTENTS (fromval),
+ TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT -
+ bits, bits);
else
- move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval),
+ move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval),
0, bits);
- write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len);
+ write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer,
+ len);
val = value_copy (toval);
memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval),
TYPE_LENGTH (type));
VALUE_TYPE (val) = type;
-
+
return val;
}
@@ -1681,27 +1629,24 @@ ada_value_assign (struct value* toval, struct value* fromval)
ARR may be either a simple array, GNAT array descriptor, or pointer
thereto. */
-struct value*
-ada_value_subscript (arr, arity, ind)
- struct value* arr;
- int arity;
- struct value** ind;
+struct value *
+ada_value_subscript (struct value *arr, int arity, struct value **ind)
{
int k;
- struct value* elt;
- struct type* elt_type;
+ struct value *elt;
+ struct type *elt_type;
elt = ada_coerce_to_simple_array (arr);
elt_type = check_typedef (VALUE_TYPE (elt));
- if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY
+ if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY
&& TYPE_FIELD_BITSIZE (elt_type, 0) > 0)
return value_subscript_packed (elt, arity, ind);
for (k = 0; k < arity; k += 1)
{
if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY)
- error("too many subscripts (%d expected)", k);
+ error ("too many subscripts (%d expected)", k);
elt = value_subscript (elt, value_pos_atr (ind[k]));
}
return elt;
@@ -1711,26 +1656,23 @@ ada_value_subscript (arr, arity, ind)
value of the element of *ARR at the ARITY indices given in
IND. Does not read the entire array into memory. */
-struct value*
-ada_value_ptr_subscript (arr, type, arity, ind)
- struct value* arr;
- struct type* type;
- int arity;
- struct value** ind;
+struct value *
+ada_value_ptr_subscript (struct value *arr, struct type *type, int arity,
+ struct value **ind)
{
int k;
for (k = 0; k < arity; k += 1)
{
LONGEST lwb, upb;
- struct value* idx;
+ struct value *idx;
if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
- error("too many subscripts (%d expected)", k);
- arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+ error ("too many subscripts (%d expected)", k);
+ arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
value_copy (arr));
get_discrete_bounds (TYPE_INDEX_TYPE (type), &lwb, &upb);
- if (lwb == 0)
+ if (lwb == 0)
idx = ind[k];
else
idx = value_sub (ind[k], value_from_longest (builtin_type_int, lwb));
@@ -1747,8 +1689,7 @@ ada_value_ptr_subscript (arr, type, arity, ind)
type designation. Otherwise, returns 0. */
int
-ada_array_arity (type)
- struct type* type;
+ada_array_arity (struct type *type)
{
int arity;
@@ -1758,15 +1699,15 @@ ada_array_arity (type)
type = desc_base_type (type);
arity = 0;
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
return desc_arity (desc_bounds_type (type));
- else
- while (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ else
+ while (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
arity += 1;
type = check_typedef (TYPE_TARGET_TYPE (type));
}
-
+
return arity;
}
@@ -1775,29 +1716,27 @@ ada_array_arity (type)
TYPE after indexing by NINDICES indices, or by all indices if
NINDICES is -1. Otherwise, returns NULL. */
-struct type*
-ada_array_element_type (type, nindices)
- struct type* type;
- int nindices;
+struct type *
+ada_array_element_type (struct type *type, int nindices)
{
type = desc_base_type (type);
- if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
int k;
- struct type* p_array_type;
+ struct type *p_array_type;
p_array_type = desc_data_type (type);
k = ada_array_arity (type);
if (k == 0)
return NULL;
-
+
/* Initially p_array_type = elt_type(*)[]...(k times)...[] */
if (nindices >= 0 && k > nindices)
k = nindices;
p_array_type = TYPE_TARGET_TYPE (p_array_type);
- while (k > 0 && p_array_type != NULL)
+ while (k > 0 && p_array_type != NULL)
{
p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type));
k -= 1;
@@ -1820,10 +1759,8 @@ ada_array_element_type (type, nindices)
/* The type of nth index in arrays of given type (n numbering from 1). Does
not examine memory. */
-struct type*
-ada_index_type (type, n)
- struct type* type;
- int n;
+struct type *
+ada_index_type (struct type *type, int n)
{
type = desc_base_type (type);
@@ -1839,7 +1776,7 @@ ada_index_type (type, n)
return TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
}
- else
+ else
return desc_index_type (desc_bounds_type (type), n);
}
@@ -1851,23 +1788,20 @@ ada_index_type (type, n)
run-time quantities other than discriminants. */
LONGEST
-ada_array_bound_from_type (arr_type, n, which, typep)
- struct type* arr_type;
- int n;
- int which;
- struct type** typep;
+ada_array_bound_from_type (struct type * arr_type, int n, int which,
+ struct type ** typep)
{
- struct type* type;
- struct type* index_type_desc;
+ struct type *type;
+ struct type *index_type_desc;
if (ada_is_packed_array_type (arr_type))
arr_type = decode_packed_array_type (arr_type);
- if (arr_type == NULL || ! ada_is_simple_array (arr_type))
+ if (arr_type == NULL || !ada_is_simple_array (arr_type))
{
if (typep != NULL)
*typep = builtin_type_int;
- return (LONGEST) -which;
+ return (LONGEST) - which;
}
if (TYPE_CODE (arr_type) == TYPE_CODE_PTR)
@@ -1876,12 +1810,12 @@ ada_array_bound_from_type (arr_type, n, which, typep)
type = arr_type;
index_type_desc = ada_find_parallel_type (type, "___XA");
- if (index_type_desc == NULL)
+ if (index_type_desc == NULL)
{
- struct type* range_type;
- struct type* index_type;
+ struct type *range_type;
+ struct type *index_type;
- while (n > 1)
+ while (n > 1)
{
type = TYPE_TARGET_TYPE (type);
n -= 1;
@@ -1890,23 +1824,23 @@ ada_array_bound_from_type (arr_type, n, which, typep)
range_type = TYPE_INDEX_TYPE (type);
index_type = TYPE_TARGET_TYPE (range_type);
if (TYPE_CODE (index_type) == TYPE_CODE_UNDEF)
- index_type = builtin_type_long;
+ index_type = builtin_type_long;
if (typep != NULL)
*typep = index_type;
- return
- (LONGEST) (which == 0
+ return
+ (LONGEST) (which == 0
? TYPE_LOW_BOUND (range_type)
: TYPE_HIGH_BOUND (range_type));
}
- else
+ else
{
- struct type* index_type =
- to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n-1),
+ struct type *index_type =
+ to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n - 1),
NULL, TYPE_OBJFILE (arr_type));
if (typep != NULL)
*typep = TYPE_TARGET_TYPE (index_type);
- return
- (LONGEST) (which == 0
+ return
+ (LONGEST) (which == 0
? TYPE_LOW_BOUND (index_type)
: TYPE_HIGH_BOUND (index_type));
}
@@ -1917,19 +1851,19 @@ ada_array_bound_from_type (arr_type, n, which, typep)
which is 1. This routine will also work for arrays with bounds
supplied by run-time quantities other than discriminants. */
-struct value*
+struct value *
ada_array_bound (arr, n, which)
- struct value* arr;
- int n;
+ struct value *arr;
+ int n;
int which;
{
- struct type* arr_type = VALUE_TYPE (arr);
+ struct type *arr_type = VALUE_TYPE (arr);
if (ada_is_packed_array_type (arr_type))
return ada_array_bound (decode_packed_array (arr), n, which);
- else if (ada_is_simple_array (arr_type))
+ else if (ada_is_simple_array (arr_type))
{
- struct type* type;
+ struct type *type;
LONGEST v = ada_array_bound_from_type (arr_type, n, which, &type);
return value_from_longest (type, v);
}
@@ -1941,46 +1875,42 @@ ada_array_bound (arr, n, which)
nth index. This routine will also work for arrays with bounds
supplied by run-time quantities other than discriminants. Does not
work for arrays indexed by enumeration types with representation
- clauses at the moment. */
+ clauses at the moment. */
-struct value*
-ada_array_length (arr, n)
- struct value* arr;
- int n;
+struct value *
+ada_array_length (struct value *arr, int n)
{
- struct type* arr_type = check_typedef (VALUE_TYPE (arr));
- struct type* index_type_desc;
+ struct type *arr_type = check_typedef (VALUE_TYPE (arr));
+ struct type *index_type_desc;
if (ada_is_packed_array_type (arr_type))
return ada_array_length (decode_packed_array (arr), n);
if (ada_is_simple_array (arr_type))
{
- struct type* type;
+ struct type *type;
LONGEST v =
ada_array_bound_from_type (arr_type, n, 1, &type) -
ada_array_bound_from_type (arr_type, n, 0, NULL) + 1;
return value_from_longest (type, v);
}
else
- return
+ return
value_from_longest (builtin_type_ada_int,
value_as_long (desc_one_bound (desc_bounds (arr),
n, 1))
- value_as_long (desc_one_bound (desc_bounds (arr),
- n, 0))
- + 1);
+ n, 0)) + 1);
}
-
+
/* Name resolution */
/* The "demangled" name for the user-definable Ada operator corresponding
to op. */
-static const char*
-ada_op_name (op)
- enum exp_opcode op;
+static const char *
+ada_op_name (enum exp_opcode op)
{
int i;
@@ -2004,9 +1934,7 @@ ada_op_name (op)
May change (expand) *EXP. */
void
-ada_resolve (expp, context_type)
- struct expression** expp;
- struct type* context_type;
+ada_resolve (struct expression **expp, struct type *context_type)
{
int pc;
pc = 0;
@@ -2021,18 +1949,15 @@ ada_resolve (expp, context_type)
function-valued variables into parameterless calls. May expand
EXP. The CONTEXT_TYPE functions as in ada_resolve, above. */
-static struct value*
-ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
- struct expression** expp;
- int *pos;
- int deprocedure_p;
- struct type* context_type;
+static struct value *
+ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
+ struct type *context_type)
{
int pc = *pos;
int i;
- struct expression* exp; /* Convenience: == *expp */
+ struct expression *exp; /* Convenience: == *expp */
enum exp_opcode op = (*expp)->elts[pc].opcode;
- struct value** argvec; /* Vector of operand types (alloca'ed). */
+ struct value **argvec; /* Vector of operand types (alloca'ed). */
int nargs; /* Number of operands */
argvec = NULL;
@@ -2043,7 +1968,7 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
switch (op)
{
case OP_VAR_VALUE:
- /* case OP_UNRESOLVED_VALUE:*/
+ /* case OP_UNRESOLVED_VALUE: */
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
*pos += 4;
break;
@@ -2051,43 +1976,43 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
case OP_FUNCALL:
nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
- /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)
- {
- *pos += 7;
-
- argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1));
- for (i = 0; i < nargs-1; i += 1)
- argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL);
- argvec[i] = NULL;
- }
- else
- {
- *pos += 3;
- ada_resolve_subexp (expp, pos, 0, NULL);
- for (i = 1; i < nargs; i += 1)
- ada_resolve_subexp (expp, pos, 1, NULL);
- }
- */
+ /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)
+ {
+ *pos += 7;
+
+ argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1));
+ for (i = 0; i < nargs-1; i += 1)
+ argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL);
+ argvec[i] = NULL;
+ }
+ else
+ {
+ *pos += 3;
+ ada_resolve_subexp (expp, pos, 0, NULL);
+ for (i = 1; i < nargs; i += 1)
+ ada_resolve_subexp (expp, pos, 1, NULL);
+ }
+ */
exp = *expp;
break;
/* FIXME: UNOP_QUAL should be defined in expression.h */
/* case UNOP_QUAL:
- nargs = 1;
- *pos += 3;
- ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type);
- exp = *expp;
- break;
- */
- /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
+ nargs = 1;
+ *pos += 3;
+ ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type);
+ exp = *expp;
+ break;
+ */
+ /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
/* case OP_ATTRIBUTE:
- nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
- *pos += 4;
- for (i = 0; i < nargs; i += 1)
- ada_resolve_subexp (expp, pos, 1, NULL);
- exp = *expp;
- break;
- */
+ nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
+ *pos += 4;
+ for (i = 0; i < nargs; i += 1)
+ ada_resolve_subexp (expp, pos, 1, NULL);
+ exp = *expp;
+ break;
+ */
case UNOP_ADDR:
nargs = 1;
*pos += 1;
@@ -2097,7 +2022,7 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
case BINOP_ASSIGN:
{
- struct value* arg1;
+ struct value *arg1;
nargs = 2;
*pos += 1;
arg1 = ada_resolve_subexp (expp, pos, 0, NULL);
@@ -2109,16 +2034,16 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
}
default:
- switch (op)
+ switch (op)
{
default:
error ("Unexpected operator during name resolution");
case UNOP_CAST:
- /* case UNOP_MBR:
- nargs = 1;
- *pos += 3;
- break;
- */
+ /* case UNOP_MBR:
+ nargs = 1;
+ *pos += 3;
+ break;
+ */
case BINOP_ADD:
case BINOP_SUB:
case BINOP_MUL:
@@ -2182,29 +2107,30 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
break;
case OP_ARRAY:
- *pos += 4;
+ *pos += 4;
nargs = longest_to_int (exp->elts[pc + 2].longconst) + 1;
nargs -= longest_to_int (exp->elts[pc + 1].longconst);
/* A null array contains one dummy element to give the type. */
- /* if (nargs == 0)
- nargs = 1;
- break;*/
+ /* if (nargs == 0)
+ nargs = 1;
+ break; */
case TERNOP_SLICE:
/* FIXME: TERNOP_MBR should be defined in expression.h */
- /* case TERNOP_MBR:
- *pos += 1;
- nargs = 3;
- break;
- */
+ /* case TERNOP_MBR:
+ *pos += 1;
+ nargs = 3;
+ break;
+ */
/* FIXME: BINOP_MBR should be defined in expression.h */
- /* case BINOP_MBR:
- *pos += 3;
- nargs = 2;
- break;*/
+ /* case BINOP_MBR:
+ *pos += 3;
+ nargs = 2;
+ break; */
}
- argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1));
+ argvec =
+ (struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
for (i = 0; i < nargs; i += 1)
argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL);
argvec[i] = NULL;
@@ -2220,97 +2146,98 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
/* case OP_UNRESOLVED_VALUE:
- {
- struct symbol** candidate_syms;
- struct block** candidate_blocks;
- int n_candidates;
-
- n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name,
- exp->elts[pc + 1].block,
- VAR_NAMESPACE,
- &candidate_syms,
- &candidate_blocks);
-
- if (n_candidates > 1)
- {*/
- /* Types tend to get re-introduced locally, so if there
- are any local symbols that are not types, first filter
- out all types.*/ /*
- int j;
- for (j = 0; j < n_candidates; j += 1)
- switch (SYMBOL_CLASS (candidate_syms[j]))
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG:
- case LOC_BASEREG_ARG:
- goto FoundNonType;
- default:
- break;
- }
- FoundNonType:
- if (j < n_candidates)
- {
- j = 0;
- while (j < n_candidates)
- {
- if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF)
- {
- candidate_syms[j] = candidate_syms[n_candidates-1];
- candidate_blocks[j] = candidate_blocks[n_candidates-1];
- n_candidates -= 1;
- }
- else
- j += 1;
- }
- }
- }
+ {
+ struct symbol** candidate_syms;
+ struct block** candidate_blocks;
+ int n_candidates;
+
+ n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name,
+ exp->elts[pc + 1].block,
+ VAR_NAMESPACE,
+ &candidate_syms,
+ &candidate_blocks);
+
+ if (n_candidates > 1)
+ { */
+ /* Types tend to get re-introduced locally, so if there
+ are any local symbols that are not types, first filter
+ out all types. *//*
+ int j;
+ for (j = 0; j < n_candidates; j += 1)
+ switch (SYMBOL_CLASS (candidate_syms[j]))
+ {
+ case LOC_REGISTER:
+ case LOC_ARG:
+ case LOC_REF_ARG:
+ case LOC_REGPARM:
+ case LOC_REGPARM_ADDR:
+ case LOC_LOCAL:
+ case LOC_LOCAL_ARG:
+ case LOC_BASEREG:
+ case LOC_BASEREG_ARG:
+ goto FoundNonType;
+ default:
+ break;
+ }
+ FoundNonType:
+ if (j < n_candidates)
+ {
+ j = 0;
+ while (j < n_candidates)
+ {
+ if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF)
+ {
+ candidate_syms[j] = candidate_syms[n_candidates-1];
+ candidate_blocks[j] = candidate_blocks[n_candidates-1];
+ n_candidates -= 1;
+ }
+ else
+ j += 1;
+ }
+ }
+ }
- if (n_candidates == 0)
- error ("No definition found for %s",
- ada_demangle (exp->elts[pc + 2].name));
- else if (n_candidates == 1)
- i = 0;
- else if (deprocedure_p
- && ! is_nonfunction (candidate_syms, n_candidates))
- {
- i = ada_resolve_function (candidate_syms, candidate_blocks,
- n_candidates, NULL, 0,
- exp->elts[pc + 2].name, context_type);
- if (i < 0)
- error ("Could not find a match for %s",
- ada_demangle (exp->elts[pc + 2].name));
- }
- else
- {
- printf_filtered ("Multiple matches for %s\n",
- ada_demangle (exp->elts[pc+2].name));
- user_select_syms (candidate_syms, candidate_blocks,
- n_candidates, 1);
- i = 0;
- }
+ if (n_candidates == 0)
+ error ("No definition found for %s",
+ ada_demangle (exp->elts[pc + 2].name));
+ else if (n_candidates == 1)
+ i = 0;
+ else if (deprocedure_p
+ && ! is_nonfunction (candidate_syms, n_candidates))
+ {
+ i = ada_resolve_function (candidate_syms, candidate_blocks,
+ n_candidates, NULL, 0,
+ exp->elts[pc + 2].name, context_type);
+ if (i < 0)
+ error ("Could not find a match for %s",
+ ada_demangle (exp->elts[pc + 2].name));
+ }
+ else
+ {
+ printf_filtered ("Multiple matches for %s\n",
+ ada_demangle (exp->elts[pc+2].name));
+ user_select_syms (candidate_syms, candidate_blocks,
+ n_candidates, 1);
+ i = 0;
+ }
- exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE;
- exp->elts[pc + 1].block = candidate_blocks[i];
- exp->elts[pc + 2].symbol = candidate_syms[i];
- if (innermost_block == NULL ||
- contained_in (candidate_blocks[i], innermost_block))
- innermost_block = candidate_blocks[i];
- }*/
+ exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE;
+ exp->elts[pc + 1].block = candidate_blocks[i];
+ exp->elts[pc + 2].symbol = candidate_syms[i];
+ if (innermost_block == NULL ||
+ contained_in (candidate_blocks[i], innermost_block))
+ innermost_block = candidate_blocks[i];
+ } */
/* FALL THROUGH */
case OP_VAR_VALUE:
- if (deprocedure_p &&
- TYPE_CODE (SYMBOL_TYPE (exp->elts[pc+2].symbol)) == TYPE_CODE_FUNC)
+ if (deprocedure_p &&
+ TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 2].symbol)) ==
+ TYPE_CODE_FUNC)
{
- replace_operator_with_call (expp, pc, 0, 0,
- exp->elts[pc+2].symbol,
- exp->elts[pc+1].block);
+ replace_operator_with_call (expp, pc, 0, 0,
+ exp->elts[pc + 2].symbol,
+ exp->elts[pc + 1].block);
exp = *expp;
}
break;
@@ -2318,37 +2245,37 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
case OP_FUNCALL:
{
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
- /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)
- {
- struct symbol** candidate_syms;
- struct block** candidate_blocks;
- int n_candidates;
-
- n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name,
- exp->elts[pc + 4].block,
- VAR_NAMESPACE,
- &candidate_syms,
- &candidate_blocks);
- if (n_candidates == 1)
- i = 0;
- else
- {
- i = ada_resolve_function (candidate_syms, candidate_blocks,
- n_candidates, argvec, nargs-1,
- exp->elts[pc + 5].name, context_type);
- if (i < 0)
- error ("Could not find a match for %s",
- ada_demangle (exp->elts[pc + 5].name));
- }
+ /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)
+ {
+ struct symbol** candidate_syms;
+ struct block** candidate_blocks;
+ int n_candidates;
+
+ n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name,
+ exp->elts[pc + 4].block,
+ VAR_NAMESPACE,
+ &candidate_syms,
+ &candidate_blocks);
+ if (n_candidates == 1)
+ i = 0;
+ else
+ {
+ i = ada_resolve_function (candidate_syms, candidate_blocks,
+ n_candidates, argvec, nargs-1,
+ exp->elts[pc + 5].name, context_type);
+ if (i < 0)
+ error ("Could not find a match for %s",
+ ada_demangle (exp->elts[pc + 5].name));
+ }
+
+ exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE;
+ exp->elts[pc + 4].block = candidate_blocks[i];
+ exp->elts[pc + 5].symbol = candidate_syms[i];
+ if (innermost_block == NULL ||
+ contained_in (candidate_blocks[i], innermost_block))
+ innermost_block = candidate_blocks[i];
+ } */
- exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE;
- exp->elts[pc + 4].block = candidate_blocks[i];
- exp->elts[pc + 5].symbol = candidate_syms[i];
- if (innermost_block == NULL ||
- contained_in (candidate_blocks[i], innermost_block))
- innermost_block = candidate_blocks[i];
- }*/
-
}
break;
case BINOP_ADD:
@@ -2374,18 +2301,18 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
case UNOP_ABS:
if (possible_user_operator_p (op, argvec))
{
- struct symbol** candidate_syms;
- struct block** candidate_blocks;
+ struct symbol **candidate_syms;
+ struct block **candidate_blocks;
int n_candidates;
- n_candidates = ada_lookup_symbol_list (ada_mangle (ada_op_name (op)),
- (struct block*) NULL,
- VAR_NAMESPACE,
- &candidate_syms,
- &candidate_blocks);
- i = ada_resolve_function (candidate_syms, candidate_blocks,
- n_candidates, argvec, nargs,
- ada_op_name (op), NULL);
+ n_candidates =
+ ada_lookup_symbol_list (ada_mangle (ada_op_name (op)),
+ (struct block *) NULL, VAR_NAMESPACE,
+ &candidate_syms, &candidate_blocks);
+ i =
+ ada_resolve_function (candidate_syms, candidate_blocks,
+ n_candidates, argvec, nargs,
+ ada_op_name (op), NULL);
if (i < 0)
break;
@@ -2402,14 +2329,14 @@ ada_resolve_subexp (expp, pos, deprocedure_p, context_type)
/* Return non-zero if formal type FTYPE matches actual type ATYPE. If
MAY_DEREF is non-zero, the formal may be a pointer and the actual
- a non-pointer. */
+ a non-pointer. */
/* The term "match" here is rather loose. The match is heuristic and
liberal. FIXME: TOO liberal, in fact. */
static int
ada_type_match (ftype, atype, may_deref)
- struct type* ftype;
- struct type* atype;
+ struct type *ftype;
+ struct type *atype;
int may_deref;
{
CHECK_TYPEDEF (ftype);
@@ -2420,11 +2347,11 @@ ada_type_match (ftype, atype, may_deref)
if (TYPE_CODE (atype) == TYPE_CODE_REF)
atype = TYPE_TARGET_TYPE (atype);
- if (TYPE_CODE (ftype) == TYPE_CODE_VOID
+ if (TYPE_CODE (ftype) == TYPE_CODE_VOID
|| TYPE_CODE (atype) == TYPE_CODE_VOID)
return 1;
- switch (TYPE_CODE (ftype))
+ switch (TYPE_CODE (ftype))
{
default:
return 1;
@@ -2432,8 +2359,9 @@ ada_type_match (ftype, atype, may_deref)
if (TYPE_CODE (atype) == TYPE_CODE_PTR)
return ada_type_match (TYPE_TARGET_TYPE (ftype),
TYPE_TARGET_TYPE (atype), 0);
- else return (may_deref &&
- ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0));
+ else
+ return (may_deref &&
+ ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0));
case TYPE_CODE_INT:
case TYPE_CODE_ENUM:
case TYPE_CODE_RANGE:
@@ -2448,16 +2376,16 @@ ada_type_match (ftype, atype, may_deref)
}
case TYPE_CODE_ARRAY:
- return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
+ return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
|| ada_is_array_descriptor (atype));
case TYPE_CODE_STRUCT:
if (ada_is_array_descriptor (ftype))
- return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
+ return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
|| ada_is_array_descriptor (atype));
else
return (TYPE_CODE (atype) == TYPE_CODE_STRUCT
- && ! ada_is_array_descriptor (atype));
+ && !ada_is_array_descriptor (atype));
case TYPE_CODE_UNION:
case TYPE_CODE_FLT:
@@ -2471,15 +2399,12 @@ ada_type_match (ftype, atype, may_deref)
argument function. */
static int
-ada_args_match (func, actuals, n_actuals)
- struct symbol* func;
- struct value** actuals;
- int n_actuals;
+ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
{
int i;
- struct type* func_type = SYMBOL_TYPE (func);
+ struct type *func_type = SYMBOL_TYPE (func);
- if (SYMBOL_CLASS (func) == LOC_CONST &&
+ if (SYMBOL_CLASS (func) == LOC_CONST &&
TYPE_CODE (func_type) == TYPE_CODE_ENUM)
return (n_actuals == 0);
else if (func_type == NULL || TYPE_CODE (func_type) != TYPE_CODE_FUNC)
@@ -2490,11 +2415,11 @@ ada_args_match (func, actuals, n_actuals)
for (i = 0; i < n_actuals; i += 1)
{
- struct type* ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i));
- struct type* atype = check_typedef (VALUE_TYPE (actuals[i]));
+ struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i));
+ struct type *atype = check_typedef (VALUE_TYPE (actuals[i]));
- if (! ada_type_match (TYPE_FIELD_TYPE (func_type, i),
- VALUE_TYPE (actuals[i]), 1))
+ if (!ada_type_match (TYPE_FIELD_TYPE (func_type, i),
+ VALUE_TYPE (actuals[i]), 1))
return 0;
}
return 1;
@@ -2506,25 +2431,23 @@ ada_args_match (func, actuals, n_actuals)
or an enumerated type. A null CONTEXT_TYPE indicates any non-void type. */
static int
-return_match (func_type, context_type)
- struct type* func_type;
- struct type* context_type;
+return_match (struct type *func_type, struct type *context_type)
{
- struct type* return_type;
+ struct type *return_type;
if (func_type == NULL)
return 1;
/* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */
/* if (TYPE_CODE (func_type) == TYPE_CODE_FUNC)
- return_type = base_type (TYPE_TARGET_TYPE (func_type));
- else
- return_type = base_type (func_type);*/
+ return_type = base_type (TYPE_TARGET_TYPE (func_type));
+ else
+ return_type = base_type (func_type); */
if (return_type == NULL)
return 1;
/* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */
- /* context_type = base_type (context_type);*/
+ /* context_type = base_type (context_type); */
if (TYPE_CODE (return_type) == TYPE_CODE_ENUM)
return context_type == NULL || return_type == context_type;
@@ -2547,18 +2470,14 @@ return_match (func_type, context_type)
is modified in parallel to SYMS. */
int
-ada_resolve_function (syms, blocks, nsyms, args, nargs, name, context_type)
- struct symbol* syms[];
- struct block* blocks[];
- struct value** args;
- int nsyms, nargs;
- const char* name;
- struct type* context_type;
+ada_resolve_function (struct symbol *syms[], struct block *blocks[],
+ int nsyms, struct value **args, int nargs,
+ const char *name, struct type *context_type)
{
int k;
int m; /* Number of hits */
- struct type* fallback;
- struct type* return_type;
+ struct type *fallback;
+ struct type *return_type;
return_type = context_type;
if (context_type == NULL)
@@ -2566,12 +2485,12 @@ ada_resolve_function (syms, blocks, nsyms, args, nargs, name, context_type)
else
fallback = NULL;
- m = 0;
+ m = 0;
while (1)
{
for (k = 0; k < nsyms; k += 1)
{
- struct type* type = check_typedef (SYMBOL_TYPE (syms[k]));
+ struct type *type = check_typedef (SYMBOL_TYPE (syms[k]));
if (ada_args_match (syms[k], args, nargs)
&& return_match (SYMBOL_TYPE (syms[k]), return_type))
@@ -2605,7 +2524,7 @@ ada_resolve_function (syms, blocks, nsyms, args, nargs, name, context_type)
/* same package should sort in their source order. We settle for ordering */
/* such symbols by their trailing number (__N or $N). */
static int
-mangled_ordered_before (char* N0, char* N1)
+mangled_ordered_before (char *N0, char *N1)
{
if (N1 == NULL)
return 0;
@@ -2614,53 +2533,50 @@ mangled_ordered_before (char* N0, char* N1)
else
{
int k0, k1;
- for (k0 = strlen (N0)-1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
+ for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
;
- for (k1 = strlen (N1)-1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
+ for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
;
- if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0+1] != '\000'
- && (N1[k1] == '_' || N1[k1] == '$') && N1[k1+1] != '\000')
+ if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0 + 1] != '\000'
+ && (N1[k1] == '_' || N1[k1] == '$') && N1[k1 + 1] != '\000')
{
int n0, n1;
n0 = k0;
- while (N0[n0] == '_' && n0 > 0 && N0[n0-1] == '_')
+ while (N0[n0] == '_' && n0 > 0 && N0[n0 - 1] == '_')
n0 -= 1;
n1 = k1;
- while (N1[n1] == '_' && n1 > 0 && N1[n1-1] == '_')
+ while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_')
n1 -= 1;
if (n0 == n1 && STREQN (N0, N1, n0))
- return (atoi (N0+k0+1) < atoi (N1+k1+1));
+ return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
}
return (strcmp (N0, N1) < 0);
}
}
-
+
/* Sort SYMS[0..NSYMS-1] to put the choices in a canonical order by their */
/* mangled names, rearranging BLOCKS[0..NSYMS-1] according to the same */
/* permutation. */
-static void
-sort_choices (syms, blocks, nsyms)
- struct symbol* syms[];
- struct block* blocks[];
- int nsyms;
+static void
+sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms)
{
int i, j;
- for (i = 1; i < nsyms; i += 1)
+ for (i = 1; i < nsyms; i += 1)
{
- struct symbol* sym = syms[i];
- struct block* block = blocks[i];
+ struct symbol *sym = syms[i];
+ struct block *block = blocks[i];
int j;
- for (j = i-1; j >= 0; j -= 1)
+ for (j = i - 1; j >= 0; j -= 1)
{
if (mangled_ordered_before (SYMBOL_NAME (syms[j]),
SYMBOL_NAME (sym)))
break;
- syms[j+1] = syms[j];
- blocks[j+1] = blocks[j];
+ syms[j + 1] = syms[j];
+ blocks[j + 1] = blocks[j];
}
- syms[j+1] = sym;
- blocks[j+1] = block;
+ syms[j + 1] = sym;
+ blocks[j + 1] = block;
}
}
@@ -2675,14 +2591,11 @@ sort_choices (syms, blocks, nsyms)
to be re-integrated one of these days. */
int
-user_select_syms (syms, blocks, nsyms, max_results)
- struct symbol* syms[];
- struct block* blocks[];
- int nsyms;
- int max_results;
+user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms,
+ int max_results)
{
int i;
- int* chosen = (int*) alloca (sizeof(int) * nsyms);
+ int *chosen = (int *) alloca (sizeof (int) * nsyms);
int n_chosen;
int first_choice = (max_results == 1) ? 1 : 2;
@@ -2691,9 +2604,9 @@ user_select_syms (syms, blocks, nsyms, max_results)
if (nsyms <= 1)
return nsyms;
- printf_unfiltered("[0] cancel\n");
+ printf_unfiltered ("[0] cancel\n");
if (max_results > 1)
- printf_unfiltered("[1] all\n");
+ printf_unfiltered ("[1] all\n");
sort_choices (syms, blocks, nsyms);
@@ -2706,30 +2619,27 @@ user_select_syms (syms, blocks, nsyms, max_results)
{
struct symtab_and_line sal = find_function_start_sal (syms[i], 1);
printf_unfiltered ("[%d] %s at %s:%d\n",
- i + first_choice,
+ i + first_choice,
SYMBOL_SOURCE_NAME (syms[i]),
- sal.symtab == NULL
- ? "<no source file available>"
- : sal.symtab->filename,
- sal.line);
+ sal.symtab == NULL
+ ? "<no source file available>"
+ : sal.symtab->filename, sal.line);
continue;
}
- else
+ else
{
- int is_enumeral =
+ int is_enumeral =
(SYMBOL_CLASS (syms[i]) == LOC_CONST
&& SYMBOL_TYPE (syms[i]) != NULL
- && TYPE_CODE (SYMBOL_TYPE (syms[i]))
- == TYPE_CODE_ENUM);
- struct symtab* symtab = symtab_for_sym (syms[i]);
+ && TYPE_CODE (SYMBOL_TYPE (syms[i])) == TYPE_CODE_ENUM);
+ struct symtab *symtab = symtab_for_sym (syms[i]);
if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL)
printf_unfiltered ("[%d] %s at %s:%d\n",
i + first_choice,
SYMBOL_SOURCE_NAME (syms[i]),
symtab->filename, SYMBOL_LINE (syms[i]));
- else if (is_enumeral &&
- TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL)
+ else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL)
{
printf_unfiltered ("[%d] ", i + first_choice);
ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0);
@@ -2737,7 +2647,7 @@ user_select_syms (syms, blocks, nsyms, max_results)
SYMBOL_SOURCE_NAME (syms[i]));
}
else if (symtab != NULL)
- printf_unfiltered (is_enumeral
+ printf_unfiltered (is_enumeral
? "[%d] %s in %s (enumeral)\n"
: "[%d] %s at %s:?\n",
i + first_choice,
@@ -2747,17 +2657,18 @@ user_select_syms (syms, blocks, nsyms, max_results)
printf_unfiltered (is_enumeral
? "[%d] %s (enumeral)\n"
: "[%d] %s at ?\n",
- i + first_choice, SYMBOL_SOURCE_NAME (syms[i]));
+ i + first_choice,
+ SYMBOL_SOURCE_NAME (syms[i]));
}
}
-
+
n_chosen = get_selections (chosen, nsyms, max_results, max_results > 1,
"overload-choice");
for (i = 0; i < n_chosen; i += 1)
{
syms[i] = syms[chosen[i]];
- if (blocks != NULL)
+ if (blocks != NULL)
blocks[i] = blocks[chosen[i]];
}
@@ -2781,20 +2692,15 @@ user_select_syms (syms, blocks, nsyms, max_results)
prompts (for use with the -f switch). */
int
-get_selections (choices, n_choices, max_results, is_all_choice,
- annotation_suffix)
- int* choices;
- int n_choices;
- int max_results;
- int is_all_choice;
- char* annotation_suffix;
+get_selections (int *choices, int n_choices, int max_results,
+ int is_all_choice, char *annotation_suffix)
{
int i;
- char* args;
- const char* prompt;
+ char *args;
+ const char *prompt;
int n_chosen;
int first_choice = is_all_choice ? 2 : 1;
-
+
prompt = getenv ("PS2");
if (prompt == NULL)
prompt = ">";
@@ -2803,7 +2709,7 @@ get_selections (choices, n_choices, max_results, is_all_choice,
gdb_flush (gdb_stdout);
args = command_line_input ((char *) NULL, 0, annotation_suffix);
-
+
if (args == NULL)
error_no_arg ("one or more choice numbers");
@@ -2813,7 +2719,7 @@ get_selections (choices, n_choices, max_results, is_all_choice,
order, as given in args. Choices are validated. */
while (1)
{
- char* args2;
+ char *args2;
int choice, j;
while (isspace (*args))
@@ -2824,11 +2730,12 @@ get_selections (choices, n_choices, max_results, is_all_choice,
break;
choice = strtol (args, &args2, 10);
- if (args == args2 || choice < 0 || choice > n_choices + first_choice - 1)
+ if (args == args2 || choice < 0
+ || choice > n_choices + first_choice - 1)
error ("Argument must be choice number");
args = args2;
- if (choice == 0)
+ if (choice == 0)
error ("cancelled");
if (choice < first_choice)
@@ -2840,22 +2747,23 @@ get_selections (choices, n_choices, max_results, is_all_choice,
}
choice -= first_choice;
- for (j = n_chosen-1; j >= 0 && choice < choices[j]; j -= 1)
- {}
+ for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1)
+ {
+ }
if (j < 0 || choice != choices[j])
{
int k;
- for (k = n_chosen-1; k > j; k -= 1)
- choices[k+1] = choices[k];
- choices[j+1] = choice;
+ for (k = n_chosen - 1; k > j; k -= 1)
+ choices[k + 1] = choices[k];
+ choices[j + 1] = choice;
n_chosen += 1;
}
}
if (n_chosen > max_results)
error ("Select no more than %d of the above", max_results);
-
+
return n_chosen;
}
@@ -2864,23 +2772,21 @@ get_selections (choices, n_choices, max_results, is_all_choice,
/* arguments. Update *EXPP as needed to hold more space. */
static void
-replace_operator_with_call (expp, pc, nargs, oplen, sym, block)
- struct expression** expp;
- int pc, nargs, oplen;
- struct symbol* sym;
- struct block* block;
+replace_operator_with_call (struct expression **expp, int pc, int nargs,
+ int oplen, struct symbol *sym,
+ struct block *block)
{
/* A new expression, with 6 more elements (3 for funcall, 4 for function
symbol, -oplen for operator being replaced). */
- struct expression* newexp = (struct expression*)
+ struct expression *newexp = (struct expression *)
xmalloc (sizeof (struct expression)
+ EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen));
- struct expression* exp = *expp;
+ struct expression *exp = *expp;
newexp->nelts = exp->nelts + 7 - oplen;
newexp->language_defn = exp->language_defn;
memcpy (newexp->elts, exp->elts, EXP_ELEM_TO_BYTES (pc));
- memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen,
+ memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen,
EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen));
newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL;
@@ -2891,8 +2797,8 @@ replace_operator_with_call (expp, pc, nargs, oplen, sym, block)
newexp->elts[pc + 5].symbol = sym;
*expp = newexp;
- free (exp);
-}
+ xfree (exp);
+}
/* Type-class predicates */
@@ -2900,89 +2806,89 @@ replace_operator_with_call (expp, pc, nargs, oplen, sym, block)
/* FLOAT.) */
static int
-numeric_type_p (type)
- struct type* type;
+numeric_type_p (struct type *type)
{
if (type == NULL)
return 0;
- else {
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- return 1;
- case TYPE_CODE_RANGE:
- return (type == TYPE_TARGET_TYPE (type)
- || numeric_type_p (TYPE_TARGET_TYPE (type)));
- default:
- return 0;
- }
- }
+ else
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_FLT:
+ return 1;
+ case TYPE_CODE_RANGE:
+ return (type == TYPE_TARGET_TYPE (type)
+ || numeric_type_p (TYPE_TARGET_TYPE (type)));
+ default:
+ return 0;
+ }
+ }
}
/* True iff TYPE is integral (an INT or RANGE of INTs). */
static int
-integer_type_p (type)
- struct type* type;
+integer_type_p (struct type *type)
{
if (type == NULL)
return 0;
- else {
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_INT:
- return 1;
- case TYPE_CODE_RANGE:
- return (type == TYPE_TARGET_TYPE (type)
- || integer_type_p (TYPE_TARGET_TYPE (type)));
- default:
- return 0;
- }
- }
+ else
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_INT:
+ return 1;
+ case TYPE_CODE_RANGE:
+ return (type == TYPE_TARGET_TYPE (type)
+ || integer_type_p (TYPE_TARGET_TYPE (type)));
+ default:
+ return 0;
+ }
+ }
}
/* True iff TYPE is scalar (INT, RANGE, FLOAT, ENUM). */
static int
-scalar_type_p (type)
- struct type* type;
+scalar_type_p (struct type *type)
{
if (type == NULL)
return 0;
- else {
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FLT:
- return 1;
- default:
- return 0;
- }
- }
+ else
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_FLT:
+ return 1;
+ default:
+ return 0;
+ }
+ }
}
/* True iff TYPE is discrete (INT, RANGE, ENUM). */
static int
-discrete_type_p (type)
- struct type* type;
+discrete_type_p (struct type *type)
{
if (type == NULL)
return 0;
- else {
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_INT:
- case TYPE_CODE_RANGE:
- case TYPE_CODE_ENUM:
- return 1;
- default:
- return 0;
- }
- }
+ else
+ {
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_RANGE:
+ case TYPE_CODE_ENUM:
+ return 1;
+ default:
+ return 0;
+ }
+ }
}
/* Returns non-zero if OP with operatands in the vector ARGS could be
@@ -2990,14 +2896,12 @@ discrete_type_p (type)
(i.e., result 0). */
static int
-possible_user_operator_p (op, args)
- enum exp_opcode op;
- struct value* args[];
+possible_user_operator_p (enum exp_opcode op, struct value *args[])
{
- struct type* type0 = check_typedef (VALUE_TYPE (args[0]));
- struct type* type1 =
+ struct type *type0 = check_typedef (VALUE_TYPE (args[0]));
+ struct type *type1 =
(args[1] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[1]));
-
+
switch (op)
{
default:
@@ -3007,14 +2911,14 @@ possible_user_operator_p (op, args)
case BINOP_SUB:
case BINOP_MUL:
case BINOP_DIV:
- return (! (numeric_type_p (type0) && numeric_type_p (type1)));
+ return (!(numeric_type_p (type0) && numeric_type_p (type1)));
case BINOP_REM:
case BINOP_MOD:
case BINOP_BITWISE_AND:
case BINOP_BITWISE_IOR:
case BINOP_BITWISE_XOR:
- return (! (integer_type_p (type0) && integer_type_p (type1)));
+ return (!(integer_type_p (type0) && integer_type_p (type1)));
case BINOP_EQUAL:
case BINOP_NOTEQUAL:
@@ -3022,26 +2926,25 @@ possible_user_operator_p (op, args)
case BINOP_GTR:
case BINOP_LEQ:
case BINOP_GEQ:
- return (! (scalar_type_p (type0) && scalar_type_p (type1)));
+ return (!(scalar_type_p (type0) && scalar_type_p (type1)));
case BINOP_CONCAT:
- return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY &&
- (TYPE_CODE (type0) != TYPE_CODE_PTR ||
- TYPE_CODE (TYPE_TARGET_TYPE (type0))
- != TYPE_CODE_ARRAY))
- || (TYPE_CODE (type1) != TYPE_CODE_ARRAY &&
- (TYPE_CODE (type1) != TYPE_CODE_PTR ||
- TYPE_CODE (TYPE_TARGET_TYPE (type1))
- != TYPE_CODE_ARRAY)));
+ return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY &&
+ (TYPE_CODE (type0) != TYPE_CODE_PTR ||
+ TYPE_CODE (TYPE_TARGET_TYPE (type0))
+ != TYPE_CODE_ARRAY))
+ || (TYPE_CODE (type1) != TYPE_CODE_ARRAY &&
+ (TYPE_CODE (type1) != TYPE_CODE_PTR ||
+ TYPE_CODE (TYPE_TARGET_TYPE (type1)) != TYPE_CODE_ARRAY)));
case BINOP_EXP:
- return (! (numeric_type_p (type0) && integer_type_p (type1)));
+ return (!(numeric_type_p (type0) && integer_type_p (type1)));
case UNOP_NEG:
case UNOP_PLUS:
case UNOP_LOGICAL_NOT:
- case UNOP_ABS:
- return (! numeric_type_p (type0));
+ case UNOP_ABS:
+ return (!numeric_type_p (type0));
}
}
@@ -3056,16 +2959,15 @@ possible_user_operator_p (op, args)
* is XR for an object renaming, XRP for a procedure renaming, XRE for
* an exception renaming, and XRS for a subprogram renaming. Returns
* NULL if NAME encodes none of these. */
-const char*
-ada_renaming_type (type)
- struct type* type;
+const char *
+ada_renaming_type (struct type *type)
{
if (type != NULL && TYPE_CODE (type) == TYPE_CODE_ENUM)
{
- const char* name = type_name_no_tag (type);
- const char* suffix = (name == NULL) ? NULL : strstr (name, "___XR");
- if (suffix == NULL
- || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL))
+ const char *name = type_name_no_tag (type);
+ const char *suffix = (name == NULL) ? NULL : strstr (name, "___XR");
+ if (suffix == NULL
+ || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL))
return NULL;
else
return suffix + 3;
@@ -3076,25 +2978,23 @@ ada_renaming_type (type)
/* Return non-zero iff SYM encodes an object renaming. */
int
-ada_is_object_renaming (sym)
- struct symbol* sym;
+ada_is_object_renaming (struct symbol *sym)
{
- const char* renaming_type = ada_renaming_type (SYMBOL_TYPE (sym));
- return renaming_type != NULL
+ const char *renaming_type = ada_renaming_type (SYMBOL_TYPE (sym));
+ return renaming_type != NULL
&& (renaming_type[2] == '\0' || renaming_type[2] == '_');
}
/* Assuming that SYM encodes a non-object renaming, returns the original
* name of the renamed entity. The name is good until the end of
* parsing. */
-const char*
-ada_simple_renamed_entity (sym)
- struct symbol* sym;
+const char *
+ada_simple_renamed_entity (struct symbol *sym)
{
- struct type* type;
- const char* raw_name;
+ struct type *type;
+ const char *raw_name;
int len;
- char* result;
+ char *result;
type = SYMBOL_TYPE (sym);
if (type == NULL || TYPE_NFIELDS (type) < 1)
@@ -3106,31 +3006,30 @@ ada_simple_renamed_entity (sym)
error ("Improperly encoded renaming.");
result = xmalloc (len + 1);
- /* FIXME: add_name_string_cleanup should be defined in parse.c */
- /* add_name_string_cleanup (result);*/
+ /* FIXME: add_name_string_cleanup should be defined in parse.c */
+ /* add_name_string_cleanup (result); */
strncpy (result, raw_name, len);
result[len] = '\000';
return result;
}
-
+
/* Evaluation: Function Calls */
/* Copy VAL onto the stack, using and updating *SP as the stack
pointer. Return VAL as an lvalue. */
-static struct value*
-place_on_stack (val, sp)
- struct value* val;
- CORE_ADDR* sp;
+static struct value *
+place_on_stack (struct value *val, CORE_ADDR *sp)
{
CORE_ADDR old_sp = *sp;
#ifdef STACK_ALIGN
- *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
- STACK_ALIGN (TYPE_LENGTH (check_typedef (VALUE_TYPE (val)))));
+ *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
+ STACK_ALIGN (TYPE_LENGTH
+ (check_typedef (VALUE_TYPE (val)))));
#else
- *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
+ *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
TYPE_LENGTH (check_typedef (VALUE_TYPE (val))));
#endif
@@ -3146,22 +3045,20 @@ place_on_stack (val, sp)
/* Return the value ACTUAL, converted to be an appropriate value for a
formal of type FORMAL_TYPE. Use *SP as a stack pointer for
allocating any necessary descriptors (fat pointers), or copies of
- values not residing in memory, updating it as needed. */
-
-static struct value*
-convert_actual (actual, formal_type0, sp)
- struct value* actual;
- struct type* formal_type0;
- CORE_ADDR* sp;
-{
- struct type* actual_type = check_typedef (VALUE_TYPE (actual));
- struct type* formal_type = check_typedef (formal_type0);
- struct type* formal_target =
- TYPE_CODE (formal_type) == TYPE_CODE_PTR
- ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type;
- struct type* actual_target =
- TYPE_CODE (actual_type) == TYPE_CODE_PTR
- ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type;
+ values not residing in memory, updating it as needed. */
+
+static struct value *
+convert_actual (struct value *actual, struct type *formal_type0,
+ CORE_ADDR *sp)
+{
+ struct type *actual_type = check_typedef (VALUE_TYPE (actual));
+ struct type *formal_type = check_typedef (formal_type0);
+ struct type *formal_target =
+ TYPE_CODE (formal_type) == TYPE_CODE_PTR
+ ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type;
+ struct type *actual_target =
+ TYPE_CODE (actual_type) == TYPE_CODE_PTR
+ ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type;
if (ada_is_array_descriptor (formal_target)
&& TYPE_CODE (actual_target) == TYPE_CODE_ARRAY)
@@ -3169,17 +3066,17 @@ convert_actual (actual, formal_type0, sp)
else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR)
{
if (TYPE_CODE (formal_target) == TYPE_CODE_ARRAY
- && ada_is_array_descriptor (actual_target))
+ && ada_is_array_descriptor (actual_target))
return desc_data (actual);
else if (TYPE_CODE (actual_type) != TYPE_CODE_PTR)
{
if (VALUE_LVAL (actual) != lval_memory)
{
- struct value* val;
+ struct value *val;
actual_type = check_typedef (VALUE_TYPE (actual));
val = allocate_value (actual_type);
- memcpy ((char*) VALUE_CONTENTS_RAW (val),
- (char*) VALUE_CONTENTS (actual),
+ memcpy ((char *) VALUE_CONTENTS_RAW (val),
+ (char *) VALUE_CONTENTS (actual),
TYPE_LENGTH (actual_type));
actual = place_on_stack (val, sp);
}
@@ -3199,33 +3096,30 @@ convert_actual (actual, formal_type0, sp)
to-descriptor type rather than a descriptor type), a struct value*
representing a pointer to this descriptor. */
-static struct value*
-make_array_descriptor (type, arr, sp)
- struct type* type;
- struct value* arr;
- CORE_ADDR* sp;
+static struct value *
+make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
{
- struct type* bounds_type = desc_bounds_type (type);
- struct type* desc_type = desc_base_type (type);
- struct value* descriptor = allocate_value (desc_type);
- struct value* bounds = allocate_value (bounds_type);
+ struct type *bounds_type = desc_bounds_type (type);
+ struct type *desc_type = desc_base_type (type);
+ struct value *descriptor = allocate_value (desc_type);
+ struct value *bounds = allocate_value (bounds_type);
CORE_ADDR bounds_addr;
int i;
-
+
for (i = ada_array_arity (check_typedef (VALUE_TYPE (arr))); i > 0; i -= 1)
{
modify_general_field (VALUE_CONTENTS (bounds),
- value_as_long (ada_array_bound (arr, i, 0)),
+ value_as_long (ada_array_bound (arr, i, 0)),
desc_bound_bitpos (bounds_type, i, 0),
desc_bound_bitsize (bounds_type, i, 0));
modify_general_field (VALUE_CONTENTS (bounds),
- value_as_long (ada_array_bound (arr, i, 1)),
+ value_as_long (ada_array_bound (arr, i, 1)),
desc_bound_bitpos (bounds_type, i, 1),
desc_bound_bitsize (bounds_type, i, 1));
}
-
+
bounds = place_on_stack (bounds, sp);
-
+
modify_general_field (VALUE_CONTENTS (descriptor),
arr,
fat_pntr_data_bitpos (desc_type),
@@ -3253,26 +3147,21 @@ make_array_descriptor (type, arr, sp)
value as needed. */
void
-ada_convert_actuals (func, nargs, args, sp)
- struct value* func;
- int nargs;
- struct value* args[];
- CORE_ADDR* sp;
+ada_convert_actuals (struct value *func, int nargs, struct value *args[],
+ CORE_ADDR *sp)
{
int i;
- if (TYPE_NFIELDS (VALUE_TYPE (func)) == 0
+ if (TYPE_NFIELDS (VALUE_TYPE (func)) == 0
|| nargs != TYPE_NFIELDS (VALUE_TYPE (func)))
return;
for (i = 0; i < nargs; i += 1)
- args[i] =
- convert_actual (args[i],
- TYPE_FIELD_TYPE (VALUE_TYPE (func), i),
- sp);
+ args[i] =
+ convert_actual (args[i], TYPE_FIELD_TYPE (VALUE_TYPE (func), i), sp);
}
-
+
/* Symbol Lookup */
@@ -3280,36 +3169,32 @@ ada_convert_actuals (func, nargs, args, sp)
/* ada_lookup_symbol_list. */
/* Current size of defn_symbols and defn_blocks */
-static size_t defn_vector_size = 0;
+static size_t defn_vector_size = 0;
/* Current number of symbols found. */
static int ndefns = 0;
-static struct symbol** defn_symbols = NULL;
-static struct block** defn_blocks = NULL;
+static struct symbol **defn_symbols = NULL;
+static struct block **defn_blocks = NULL;
/* Return the result of a standard (literal, C-like) lookup of NAME in
* given NAMESPACE. */
-static struct symbol*
-standard_lookup (name, namespace)
- const char* name;
- namespace_enum namespace;
+static struct symbol *
+standard_lookup (const char *name, namespace_enum namespace)
{
- struct symbol* sym;
- struct symtab* symtab;
- sym = lookup_symbol (name, (struct block*) NULL, namespace, 0, &symtab);
+ struct symbol *sym;
+ struct symtab *symtab;
+ sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, &symtab);
return sym;
}
-
+
/* Non-zero iff there is at least one non-function/non-enumeral symbol */
/* in SYMS[0..N-1]. We treat enumerals as functions, since they */
-/* contend in overloading in the same way. */
+/* contend in overloading in the same way. */
static int
-is_nonfunction (syms, n)
- struct symbol* syms[];
- int n;
+is_nonfunction (struct symbol *syms[], int n)
{
int i;
@@ -3325,21 +3210,19 @@ is_nonfunction (syms, n)
struct types. Otherwise, they may not. */
static int
-equiv_types (type0, type1)
- struct type* type0;
- struct type* type1;
+equiv_types (struct type *type0, struct type *type1)
{
- if (type0 == type1)
+ if (type0 == type1)
return 1;
- if (type0 == NULL || type1 == NULL
+ if (type0 == NULL || type1 == NULL
|| TYPE_CODE (type0) != TYPE_CODE (type1))
return 0;
- if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT
+ if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT
|| TYPE_CODE (type0) == TYPE_CODE_ENUM)
&& ada_type_name (type0) != NULL && ada_type_name (type1) != NULL
&& STREQ (ada_type_name (type0), ada_type_name (type1)))
return 1;
-
+
return 0;
}
@@ -3347,9 +3230,7 @@ equiv_types (type0, type1)
no more defined than that of SYM1. */
static int
-lesseq_defined_than (sym0, sym1)
- struct symbol* sym0;
- struct symbol* sym1;
+lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
{
if (sym0 == sym1)
return 1;
@@ -3357,18 +3238,18 @@ lesseq_defined_than (sym0, sym1)
|| SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1))
return 0;
- switch (SYMBOL_CLASS (sym0))
+ switch (SYMBOL_CLASS (sym0))
{
case LOC_UNDEF:
return 1;
case LOC_TYPEDEF:
{
- struct type* type0 = SYMBOL_TYPE (sym0);
- struct type* type1 = SYMBOL_TYPE (sym1);
- char* name0 = SYMBOL_NAME (sym0);
- char* name1 = SYMBOL_NAME (sym1);
+ struct type *type0 = SYMBOL_TYPE (sym0);
+ struct type *type1 = SYMBOL_TYPE (sym1);
+ char *name0 = SYMBOL_NAME (sym0);
+ char *name1 = SYMBOL_NAME (sym1);
int len0 = strlen (name0);
- return
+ return
TYPE_CODE (type0) == TYPE_CODE (type1)
&& (equiv_types (type0, type1)
|| (len0 < strlen (name1) && STREQN (name0, name1, len0)
@@ -3377,8 +3258,8 @@ lesseq_defined_than (sym0, sym1)
case LOC_CONST:
return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1)
&& equiv_types (SYMBOL_TYPE (sym0), SYMBOL_TYPE (sym1));
- default:
- return 0;
+ default:
+ return 0;
}
}
@@ -3387,14 +3268,12 @@ lesseq_defined_than (sym0, sym1)
defn_blocks as needed. Do not include SYM if it is a duplicate. */
static void
-add_defn_to_vec (sym, block)
- struct symbol* sym;
- struct block* block;
+add_defn_to_vec (struct symbol *sym, struct block *block)
{
int i;
size_t tmp;
- if (SYMBOL_TYPE (sym) != NULL)
+ if (SYMBOL_TYPE (sym) != NULL)
CHECK_TYPEDEF (SYMBOL_TYPE (sym));
for (i = 0; i < ndefns; i += 1)
{
@@ -3409,8 +3288,8 @@ add_defn_to_vec (sym, block)
}
tmp = defn_vector_size;
- GROW_VECT (defn_symbols, tmp, ndefns+2);
- GROW_VECT (defn_blocks, defn_vector_size, ndefns+2);
+ GROW_VECT (defn_symbols, tmp, ndefns + 2);
+ GROW_VECT (defn_blocks, defn_vector_size, ndefns + 2);
defn_symbols[ndefns] = sym;
defn_blocks[ndefns] = block;
@@ -3422,12 +3301,8 @@ add_defn_to_vec (sym, block)
wild-card match if WILD. */
static struct partial_symbol *
-ada_lookup_partial_symbol (pst, name, global, namespace, wild)
- struct partial_symtab *pst;
- const char *name;
- int global;
- namespace_enum namespace;
- int wild;
+ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
+ int global, namespace_enum namespace, int wild)
{
struct partial_symbol **start;
int name_len = strlen (name);
@@ -3438,16 +3313,16 @@ ada_lookup_partial_symbol (pst, name, global, namespace, wild)
{
return (NULL);
}
-
+
start = (global ?
pst->objfile->global_psymbols.list + pst->globals_offset :
- pst->objfile->static_psymbols.list + pst->statics_offset );
+ pst->objfile->static_psymbols.list + pst->statics_offset);
if (wild)
{
for (i = 0; i < length; i += 1)
{
- struct partial_symbol* psym = start[i];
+ struct partial_symbol *psym = start[i];
if (SYMBOL_NAMESPACE (psym) == namespace &&
wild_match (name, name_len, SYMBOL_NAME (psym)))
@@ -3455,22 +3330,23 @@ ada_lookup_partial_symbol (pst, name, global, namespace, wild)
}
return NULL;
}
- else
+ else
{
if (global)
{
int U;
- i = 0; U = length-1;
- while (U - i > 4)
+ i = 0;
+ U = length - 1;
+ while (U - i > 4)
{
- int M = (U+i) >> 1;
- struct partial_symbol* psym = start[M];
+ int M = (U + i) >> 1;
+ struct partial_symbol *psym = start[M];
if (SYMBOL_NAME (psym)[0] < name[0])
- i = M+1;
+ i = M + 1;
else if (SYMBOL_NAME (psym)[0] > name[0])
- U = M-1;
+ U = M - 1;
else if (strcmp (SYMBOL_NAME (psym), name) < 0)
- i = M+1;
+ i = M + 1;
else
U = M;
}
@@ -3485,14 +3361,14 @@ ada_lookup_partial_symbol (pst, name, global, namespace, wild)
if (SYMBOL_NAMESPACE (psym) == namespace)
{
int cmp = strncmp (name, SYMBOL_NAME (psym), name_len);
-
- if (cmp < 0)
+
+ if (cmp < 0)
{
if (global)
break;
}
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (psym) + name_len))
+ else if (cmp == 0
+ && is_name_suffix (SYMBOL_NAME (psym) + name_len))
return psym;
}
i += 1;
@@ -3501,17 +3377,18 @@ ada_lookup_partial_symbol (pst, name, global, namespace, wild)
if (global)
{
int U;
- i = 0; U = length-1;
- while (U - i > 4)
+ i = 0;
+ U = length - 1;
+ while (U - i > 4)
{
- int M = (U+i) >> 1;
+ int M = (U + i) >> 1;
struct partial_symbol *psym = start[M];
if (SYMBOL_NAME (psym)[0] < '_')
- i = M+1;
+ i = M + 1;
else if (SYMBOL_NAME (psym)[0] > '_')
- U = M-1;
+ U = M - 1;
else if (strcmp (SYMBOL_NAME (psym), "_ada_") < 0)
- i = M+1;
+ i = M + 1;
else
U = M;
}
@@ -3521,115 +3398,111 @@ ada_lookup_partial_symbol (pst, name, global, namespace, wild)
while (i < length)
{
- struct partial_symbol* psym = start[i];
+ struct partial_symbol *psym = start[i];
if (SYMBOL_NAMESPACE (psym) == namespace)
{
int cmp;
cmp = (int) '_' - (int) SYMBOL_NAME (psym)[0];
- if (cmp == 0)
+ if (cmp == 0)
{
cmp = strncmp ("_ada_", SYMBOL_NAME (psym), 5);
if (cmp == 0)
cmp = strncmp (name, SYMBOL_NAME (psym) + 5, name_len);
}
-
- if (cmp < 0)
+
+ if (cmp < 0)
{
if (global)
break;
}
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5))
+ else if (cmp == 0
+ && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5))
return psym;
}
i += 1;
}
-
+
}
return NULL;
}
/* Find a symbol table containing symbol SYM or NULL if none. */
-static struct symtab*
-symtab_for_sym (sym)
- struct symbol* sym;
+static struct symtab *
+symtab_for_sym (struct symbol *sym)
{
- struct symtab* s;
+ struct symtab *s;
struct objfile *objfile;
struct block *b;
+ struct symbol *tmp_sym;
int i, j;
ALL_SYMTABS (objfile, s)
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_REGISTER:
- case LOC_LABEL:
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
- for (i = 0; i < BLOCK_NSYMS (b); i += 1)
- if (sym == BLOCK_SYM (b, i))
- return s;
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
- for (i = 0; i < BLOCK_NSYMS (b); i += 1)
- if (sym == BLOCK_SYM (b, i))
+ {
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_CONST:
+ case LOC_STATIC:
+ case LOC_TYPEDEF:
+ case LOC_REGISTER:
+ case LOC_LABEL:
+ case LOC_BLOCK:
+ case LOC_CONST_BYTES:
+ b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+ ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
+ return s;
+ b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+ ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
+ return s;
+ break;
+ default:
+ break;
+ }
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_REGISTER:
+ case LOC_ARG:
+ case LOC_REF_ARG:
+ case LOC_REGPARM:
+ case LOC_REGPARM_ADDR:
+ case LOC_LOCAL:
+ case LOC_TYPEDEF:
+ case LOC_LOCAL_ARG:
+ case LOC_BASEREG:
+ case LOC_BASEREG_ARG:
+ for (j = FIRST_LOCAL_BLOCK;
+ j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1)
+ {
+ b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
+ ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
return s;
- break;
- default:
- break;
- }
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL:
- case LOC_TYPEDEF:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG:
- case LOC_BASEREG_ARG:
- for (j = FIRST_LOCAL_BLOCK;
- j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1)
- {
- b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
- for (i = 0; i < BLOCK_NSYMS (b); i += 1)
- if (sym == BLOCK_SYM (b, i))
- return s;
- }
- break;
- default:
- break;
- }
- }
+ }
+ break;
+ default:
+ break;
+ }
+ }
return NULL;
}
/* Return a minimal symbol matching NAME according to Ada demangling
rules. Returns NULL if there is no such minimal symbol. */
-struct minimal_symbol*
-ada_lookup_minimal_symbol (name)
- const char* name;
+struct minimal_symbol *
+ada_lookup_minimal_symbol (const char *name)
{
- struct objfile* objfile;
- struct minimal_symbol* msymbol;
+ struct objfile *objfile;
+ struct minimal_symbol *msymbol;
int wild_match = (strstr (name, "__") == NULL);
ALL_MSYMBOLS (objfile, msymbol)
- {
- if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)
- && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
- return msymbol;
- }
+ {
+ if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)
+ && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
+ return msymbol;
+ }
return NULL;
}
@@ -3644,18 +3517,16 @@ ada_lookup_minimal_symbol (name)
* frame as a static link, and then searches up the call stack for a
* frame with that same local-variable base. */
static void
-add_symbols_from_enclosing_procs (name, namespace, wild_match)
- const char* name;
- namespace_enum namespace;
- int wild_match;
+add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace,
+ int wild_match)
{
#ifdef i386
static struct symbol static_link_sym;
static struct symbol *static_link;
- struct cleanup* old_chain = make_cleanup (null_cleanup, NULL);
- struct frame_info* frame;
- struct frame_info* target_frame;
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+ struct frame_info *frame;
+ struct frame_info *target_frame;
if (static_link == NULL)
{
@@ -3667,15 +3538,15 @@ add_symbols_from_enclosing_procs (name, namespace, wild_match)
SYMBOL_CLASS (static_link) = LOC_LOCAL;
SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE;
SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void);
- SYMBOL_VALUE (static_link) =
- - (long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
+ SYMBOL_VALUE (static_link) =
+ -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
}
frame = selected_frame;
while (frame != NULL && ndefns == 0)
{
- struct block* block;
- struct value* target_link_val = read_var_value (static_link, frame);
+ struct block *block;
+ struct value *target_link_val = read_var_value (static_link, frame);
CORE_ADDR target_link;
if (target_link_val == NULL)
@@ -3683,10 +3554,12 @@ add_symbols_from_enclosing_procs (name, namespace, wild_match)
QUIT;
target_link = target_link_val;
- do {
+ do
+ {
QUIT;
frame = get_prev_frame (frame);
- } while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link);
+ }
+ while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link);
if (frame == NULL)
break;
@@ -3695,7 +3568,7 @@ add_symbols_from_enclosing_procs (name, namespace, wild_match)
while (block != NULL && block_function (block) != NULL && ndefns == 0)
{
ada_add_block_symbols (block, name, namespace, NULL, wild_match);
-
+
block = BLOCK_SUPERBLOCK (block);
}
}
@@ -3707,10 +3580,9 @@ add_symbols_from_enclosing_procs (name, namespace, wild_match)
/* True if TYPE is definitely an artificial type supplied to a symbol
* for which no debugging information was given in the symbol file. */
static int
-is_nondebugging_type (type)
- struct type* type;
+is_nondebugging_type (struct type *type)
{
- char* name = ada_type_name (type);
+ char *name = ada_type_name (type);
return (name != NULL && STREQ (name, "<variable, no debug info>"));
}
@@ -3723,33 +3595,31 @@ is_nondebugging_type (type)
* correspondence between SYMS[i] and BLOCKS[i]. Returns the number
* of symbols in the modified list. */
static int
-remove_extra_symbols (syms, blocks, nsyms)
- struct symbol** syms;
- struct block** blocks;
- int nsyms;
+remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms)
{
int i, j;
i = 0;
while (i < nsyms)
{
- if (SYMBOL_NAME (syms[i]) != NULL && SYMBOL_CLASS (syms[i]) == LOC_STATIC
+ if (SYMBOL_NAME (syms[i]) != NULL
+ && SYMBOL_CLASS (syms[i]) == LOC_STATIC
&& is_nondebugging_type (SYMBOL_TYPE (syms[i])))
{
for (j = 0; j < nsyms; j += 1)
{
- if (i != j
+ if (i != j
&& SYMBOL_NAME (syms[j]) != NULL
&& STREQ (SYMBOL_NAME (syms[i]), SYMBOL_NAME (syms[j]))
&& SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j])
- && SYMBOL_VALUE_ADDRESS (syms[i])
+ && SYMBOL_VALUE_ADDRESS (syms[i])
== SYMBOL_VALUE_ADDRESS (syms[j]))
{
int k;
- for (k = i+1; k < nsyms; k += 1)
+ for (k = i + 1; k < nsyms; k += 1)
{
- syms[k-1] = syms[k];
- blocks[k-1] = blocks[k];
+ syms[k - 1] = syms[k];
+ blocks[k - 1] = blocks[k];
}
nsyms -= 1;
goto NextSymbol;
@@ -3775,12 +3645,9 @@ remove_extra_symbols (syms, blocks, nsyms)
surrounding BLOCK0, then these alone are returned. */
int
-ada_lookup_symbol_list (name, block0, namespace, syms, blocks)
- const char *name;
- struct block *block0;
- namespace_enum namespace;
- struct symbol*** syms;
- struct block*** blocks;
+ada_lookup_symbol_list (const char *name, struct block *block0,
+ namespace_enum namespace, struct symbol ***syms,
+ struct block ***blocks)
{
struct symbol *sym;
struct symtab *s;
@@ -3818,117 +3685,117 @@ ada_lookup_symbol_list (name, block0, namespace, syms, blocks)
if (ndefns > 0)
goto done;
-
+
cacheIfUnique = 1;
/* Now add symbols from all global blocks: symbol tables, minimal symbol
tables, and psymtab's */
ALL_SYMTABS (objfile, s)
- {
- QUIT;
- if (! s->primary)
- continue;
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
- }
+ {
+ QUIT;
+ if (!s->primary)
+ continue;
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ }
if (namespace == VAR_NAMESPACE)
{
ALL_MSYMBOLS (objfile, msymbol)
- {
- if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match))
- {
- switch (MSYMBOL_TYPE (msymbol))
- {
- case mst_solib_trampoline:
- break;
- default:
- s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol));
- if (s != NULL)
- {
- int old_ndefns = ndefns;
- QUIT;
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block,
- SYMBOL_NAME (msymbol),
- namespace, objfile, wild_match);
- if (ndefns == old_ndefns)
- {
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block,
- SYMBOL_NAME (msymbol),
- namespace, objfile,
- wild_match);
- }
- }
- }
- }
- }
+ {
+ if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match))
+ {
+ switch (MSYMBOL_TYPE (msymbol))
+ {
+ case mst_solib_trampoline:
+ break;
+ default:
+ s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol));
+ if (s != NULL)
+ {
+ int old_ndefns = ndefns;
+ QUIT;
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ ada_add_block_symbols (block,
+ SYMBOL_NAME (msymbol),
+ namespace, objfile, wild_match);
+ if (ndefns == old_ndefns)
+ {
+ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ ada_add_block_symbols (block,
+ SYMBOL_NAME (msymbol),
+ namespace, objfile,
+ wild_match);
+ }
+ }
+ }
+ }
+ }
}
-
+
ALL_PSYMTABS (objfile, ps)
- {
- QUIT;
- if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match))
- {
- s = PSYMTAB_TO_SYMTAB (ps);
- if (! s->primary)
- continue;
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
- }
- }
-
+ {
+ QUIT;
+ if (!ps->readin
+ && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match))
+ {
+ s = PSYMTAB_TO_SYMTAB (ps);
+ if (!s->primary)
+ continue;
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ }
+ }
+
/* Now add symbols from all per-file blocks if we've gotten no hits.
(Not strictly correct, but perhaps better than an error).
Do the symtabs first, then check the psymtabs */
-
+
if (ndefns == 0)
{
ALL_SYMTABS (objfile, s)
- {
- QUIT;
- if (! s->primary)
- continue;
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
- }
-
+ {
+ QUIT;
+ if (!s->primary)
+ continue;
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ }
+
ALL_PSYMTABS (objfile, ps)
- {
- QUIT;
- if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match))
- {
- s = PSYMTAB_TO_SYMTAB(ps);
- bv = BLOCKVECTOR (s);
- if (! s->primary)
- continue;
- block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace,
- objfile, wild_match);
- }
- }
- }
+ {
+ QUIT;
+ if (!ps->readin
+ && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match))
+ {
+ s = PSYMTAB_TO_SYMTAB (ps);
+ bv = BLOCKVECTOR (s);
+ if (!s->primary)
+ continue;
+ block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ ada_add_block_symbols (block, name, namespace,
+ objfile, wild_match);
+ }
+ }
+ }
/* Finally, we try to find NAME as a local symbol in some lexically
enclosing block. We do this last, expecting this case to be
rare. */
- if (ndefns == 0)
+ if (ndefns == 0)
{
add_symbols_from_enclosing_procs (name, namespace, wild_match);
if (ndefns > 0)
goto done;
}
- done:
+done:
ndefns = remove_extra_symbols (defn_symbols, defn_blocks, ndefns);
@@ -3946,14 +3813,12 @@ ada_lookup_symbol_list (name, block0, namespace, syms, blocks)
* Otherwise, the result is as for ada_lookup_symbol_list, but is
* disambiguated by user query if needed. */
-struct symbol*
-ada_lookup_symbol (name, block0, namespace)
- const char *name;
- struct block *block0;
- namespace_enum namespace;
+struct symbol *
+ada_lookup_symbol (const char *name, struct block *block0,
+ namespace_enum namespace)
{
- struct symbol** candidate_syms;
- struct block** candidate_blocks;
+ struct symbol **candidate_syms;
+ struct block **candidate_blocks;
int n_candidates;
n_candidates = ada_lookup_symbol_list (name,
@@ -3977,29 +3842,28 @@ ada_lookup_symbol (name, block0, namespace)
*
*/
static int
-is_name_suffix (str)
- const char* str;
+is_name_suffix (const char *str)
{
int k;
if (str[0] == 'X')
{
str += 1;
- while (str[0] != '_' && str[0] != '\0')
+ while (str[0] != '_' && str[0] != '\0')
{
if (str[0] != 'n' && str[0] != 'b')
return 0;
str += 1;
- }
+ }
}
if (str[0] == '\000')
return 1;
- if (str[0] == '_')
+ if (str[0] == '_')
{
if (str[1] != '_' || str[2] == '\000')
return 0;
- if (str[2] == '_')
+ if (str[2] == '_')
{
- if (STREQ (str+3, "LJM"))
+ if (STREQ (str + 3, "LJM"))
return 1;
if (str[3] != 'X')
return 0;
@@ -4024,48 +3888,49 @@ is_name_suffix (str)
}
return 0;
}
-
+
/* True if NAME represents a name of the form A1.A2....An, n>=1 and
* PATN[0..PATN_LEN-1] = Ak.Ak+1.....An for some k >= 1. Ignores
* informational suffixes of NAME (i.e., for which is_name_suffix is
- * true). */
+ * true). */
static int
-wild_match (patn, patn_len, name)
- const char* patn;
- int patn_len;
- const char* name;
+wild_match (const char *patn, int patn_len, const char *name)
{
int name_len;
int s, e;
name_len = strlen (name);
- if (name_len >= patn_len+5 && STREQN (name, "_ada_", 5)
- && STREQN (patn, name+5, patn_len)
- && is_name_suffix (name+patn_len+5))
+ if (name_len >= patn_len + 5 && STREQN (name, "_ada_", 5)
+ && STREQN (patn, name + 5, patn_len)
+ && is_name_suffix (name + patn_len + 5))
return 1;
- while (name_len >= patn_len)
+ while (name_len >= patn_len)
{
- if (STREQN (patn, name, patn_len)
- && is_name_suffix (name+patn_len))
+ if (STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len))
return 1;
- do {
- name += 1; name_len -= 1;
- } while (name_len > 0
- && name[0] != '.' && (name[0] != '_' || name[1] != '_'));
+ do
+ {
+ name += 1;
+ name_len -= 1;
+ }
+ while (name_len > 0
+ && name[0] != '.' && (name[0] != '_' || name[1] != '_'));
if (name_len <= 0)
return 0;
if (name[0] == '_')
{
- if (! islower (name[2]))
+ if (!islower (name[2]))
return 0;
- name += 2; name_len -= 2;
+ name += 2;
+ name_len -= 2;
}
else
{
- if (! islower (name[1]))
+ if (!islower (name[1]))
return 0;
- name += 1; name_len -= 1;
+ name += 1;
+ name_len -= 1;
}
}
@@ -4079,13 +3944,10 @@ wild_match (patn, patn_len, name)
currently stored in *defn_symbols). If WILD, treat as NAME with a
wildcard prefix. OBJFILE is the section containing BLOCK. */
-static void
-ada_add_block_symbols (block, name, namespace, objfile, wild)
- struct block* block;
- const char* name;
- namespace_enum namespace;
- struct objfile* objfile;
- int wild;
+static void
+ada_add_block_symbols (struct block *block, const char *name,
+ namespace_enum namespace, struct objfile *objfile,
+ int wild)
{
int i;
int name_len = strlen (name);
@@ -4094,54 +3956,56 @@ ada_add_block_symbols (block, name, namespace, objfile, wild)
/* Set true when we find a matching non-argument symbol */
int found_sym;
int is_sorted = BLOCK_SHOULD_SORT (block);
+ struct symbol *sym;
- arg_sym = NULL; found_sym = 0;
+ arg_sym = NULL;
+ found_sym = 0;
if (wild)
{
- for (i = 0; i < BLOCK_NSYMS (block); i += 1)
- {
- struct symbol *sym = BLOCK_SYM (block, i);
-
- if (SYMBOL_NAMESPACE (sym) == namespace &&
- wild_match (name, name_len, SYMBOL_NAME (sym)))
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_ARG:
- case LOC_LOCAL_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_BASEREG_ARG:
- arg_sym = sym;
- break;
- case LOC_UNRESOLVED:
- continue;
- default:
- found_sym = 1;
- fill_in_ada_prototype (sym);
- add_defn_to_vec (fixup_symbol_section (sym, objfile), block);
- break;
- }
- }
- }
+ struct symbol *sym;
+ ALL_BLOCK_SYMBOLS (block, i, sym)
+ {
+ if (SYMBOL_NAMESPACE (sym) == namespace &&
+ wild_match (name, name_len, SYMBOL_NAME (sym)))
+ {
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_ARG:
+ case LOC_LOCAL_ARG:
+ case LOC_REF_ARG:
+ case LOC_REGPARM:
+ case LOC_REGPARM_ADDR:
+ case LOC_BASEREG_ARG:
+ arg_sym = sym;
+ break;
+ case LOC_UNRESOLVED:
+ continue;
+ default:
+ found_sym = 1;
+ fill_in_ada_prototype (sym);
+ add_defn_to_vec (fixup_symbol_section (sym, objfile), block);
+ break;
+ }
+ }
+ }
}
- else
+ else
{
if (is_sorted)
{
int U;
- i = 0; U = BLOCK_NSYMS (block)-1;
- while (U - i > 4)
+ i = 0;
+ U = BLOCK_NSYMS (block) - 1;
+ while (U - i > 4)
{
- int M = (U+i) >> 1;
+ int M = (U + i) >> 1;
struct symbol *sym = BLOCK_SYM (block, M);
if (SYMBOL_NAME (sym)[0] < name[0])
- i = M+1;
+ i = M + 1;
else if (SYMBOL_NAME (sym)[0] > name[0])
- U = M-1;
+ U = M - 1;
else if (strcmp (SYMBOL_NAME (sym), name) < 0)
- i = M+1;
+ i = M + 1;
else
U = M;
}
@@ -4149,69 +4013,73 @@ ada_add_block_symbols (block, name, namespace, objfile, wild)
else
i = 0;
- for (; i < BLOCK_NSYMS (block); i += 1)
- {
- struct symbol *sym = BLOCK_SYM (block, i);
+ for (; i < BLOCK_BUCKETS (block); i += 1)
+ for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next)
+ {
+ if (SYMBOL_NAMESPACE (sym) == namespace)
+ {
+ int cmp = strncmp (name, SYMBOL_NAME (sym), name_len);
- if (SYMBOL_NAMESPACE (sym) == namespace)
- {
- int cmp = strncmp (name, SYMBOL_NAME (sym), name_len);
-
- if (cmp < 0)
- {
- if (is_sorted)
- break;
- }
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (sym) + name_len))
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_ARG:
- case LOC_LOCAL_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_BASEREG_ARG:
- arg_sym = sym;
- break;
- case LOC_UNRESOLVED:
- break;
- default:
- found_sym = 1;
- fill_in_ada_prototype (sym);
- add_defn_to_vec (fixup_symbol_section (sym, objfile),
- block);
- break;
- }
- }
- }
- }
+ if (cmp < 0)
+ {
+ if (is_sorted)
+ {
+ i = BLOCK_BUCKETS (block);
+ break;
+ }
+ }
+ else if (cmp == 0
+ && is_name_suffix (SYMBOL_NAME (sym) + name_len))
+ {
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_ARG:
+ case LOC_LOCAL_ARG:
+ case LOC_REF_ARG:
+ case LOC_REGPARM:
+ case LOC_REGPARM_ADDR:
+ case LOC_BASEREG_ARG:
+ arg_sym = sym;
+ break;
+ case LOC_UNRESOLVED:
+ break;
+ default:
+ found_sym = 1;
+ fill_in_ada_prototype (sym);
+ add_defn_to_vec (fixup_symbol_section (sym, objfile),
+ block);
+ break;
+ }
+ }
+ }
+ }
}
- if (! found_sym && arg_sym != NULL)
+ if (!found_sym && arg_sym != NULL)
{
fill_in_ada_prototype (arg_sym);
add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block);
}
- if (! wild)
+ if (!wild)
{
- arg_sym = NULL; found_sym = 0;
+ arg_sym = NULL;
+ found_sym = 0;
if (is_sorted)
{
int U;
- i = 0; U = BLOCK_NSYMS (block)-1;
- while (U - i > 4)
+ i = 0;
+ U = BLOCK_NSYMS (block) - 1;
+ while (U - i > 4)
{
- int M = (U+i) >> 1;
+ int M = (U + i) >> 1;
struct symbol *sym = BLOCK_SYM (block, M);
if (SYMBOL_NAME (sym)[0] < '_')
- i = M+1;
+ i = M + 1;
else if (SYMBOL_NAME (sym)[0] > '_')
- U = M-1;
+ U = M - 1;
else if (strcmp (SYMBOL_NAME (sym), "_ada_") < 0)
- i = M+1;
+ i = M + 1;
else
U = M;
}
@@ -4219,79 +4087,83 @@ ada_add_block_symbols (block, name, namespace, objfile, wild)
else
i = 0;
- for (; i < BLOCK_NSYMS (block); i += 1)
- {
- struct symbol *sym = BLOCK_SYM (block, i);
+ for (; i < BLOCK_BUCKETS (block); i += 1)
+ for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next)
+ {
+ struct symbol *sym = BLOCK_SYM (block, i);
- if (SYMBOL_NAMESPACE (sym) == namespace)
- {
- int cmp;
+ if (SYMBOL_NAMESPACE (sym) == namespace)
+ {
+ int cmp;
+
+ cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0];
+ if (cmp == 0)
+ {
+ cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5);
+ if (cmp == 0)
+ cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len);
+ }
+
+ if (cmp < 0)
+ {
+ if (is_sorted)
+ {
+ i = BLOCK_BUCKETS (block);
+ break;
+ }
+ }
+ else if (cmp == 0
+ && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5))
+ {
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_ARG:
+ case LOC_LOCAL_ARG:
+ case LOC_REF_ARG:
+ case LOC_REGPARM:
+ case LOC_REGPARM_ADDR:
+ case LOC_BASEREG_ARG:
+ arg_sym = sym;
+ break;
+ case LOC_UNRESOLVED:
+ break;
+ default:
+ found_sym = 1;
+ fill_in_ada_prototype (sym);
+ add_defn_to_vec (fixup_symbol_section (sym, objfile),
+ block);
+ break;
+ }
+ }
+ }
+ }
- cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0];
- if (cmp == 0)
- {
- cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5);
- if (cmp == 0)
- cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len);
- }
-
- if (cmp < 0)
- {
- if (is_sorted)
- break;
- }
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5))
- {
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_ARG:
- case LOC_LOCAL_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_BASEREG_ARG:
- arg_sym = sym;
- break;
- case LOC_UNRESOLVED:
- break;
- default:
- found_sym = 1;
- fill_in_ada_prototype (sym);
- add_defn_to_vec (fixup_symbol_section (sym, objfile),
- block);
- break;
- }
- }
- }
- }
-
/* NOTE: This really shouldn't be needed for _ada_ symbols.
- They aren't parameters, right? */
- if (! found_sym && arg_sym != NULL)
+ They aren't parameters, right? */
+ if (!found_sym && arg_sym != NULL)
{
fill_in_ada_prototype (arg_sym);
add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block);
}
}
}
-
+
/* Function Types */
/* Assuming that SYM is the symbol for a function, fill in its type
with prototype information, if it is not already there. */
static void
-fill_in_ada_prototype (func)
- struct symbol* func;
+fill_in_ada_prototype (struct symbol *func)
{
- struct block* b;
+ struct block *b;
int nargs, nsyms;
int i;
- struct type* ftype;
- struct type* rtype;
+ struct type *ftype;
+ struct type *rtype;
size_t max_fields;
+ struct symbol *sym;
if (func == NULL
|| TYPE_CODE (SYMBOL_TYPE (func)) != TYPE_CODE_FUNC
@@ -4308,47 +4180,44 @@ fill_in_ada_prototype (func)
SYMBOL_TYPE (func) = ftype;
b = SYMBOL_BLOCK_VALUE (func);
- nsyms = BLOCK_NSYMS (b);
nargs = 0;
- max_fields = 8;
- TYPE_FIELDS (ftype) =
- (struct field*) xmalloc (sizeof (struct field) * max_fields);
- for (i = 0; i < nsyms; i += 1)
- {
- struct symbol *sym = BLOCK_SYM (b, i);
+ max_fields = 8;
+ TYPE_FIELDS (ftype) =
+ (struct field *) xmalloc (sizeof (struct field) * max_fields);
+ ALL_BLOCK_SYMBOLS (b, i, sym)
+ {
+ GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs + 1);
- GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs+1);
-
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_REF_ARG:
- case LOC_REGPARM_ADDR:
- TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
- TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
- TYPE_FIELD_TYPE (ftype, nargs) =
- lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym)));
- TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
- nargs += 1;
-
- break;
+ switch (SYMBOL_CLASS (sym))
+ {
+ case LOC_REF_ARG:
+ case LOC_REGPARM_ADDR:
+ TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
+ TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
+ TYPE_FIELD_TYPE (ftype, nargs) =
+ lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym)));
+ TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
+ nargs += 1;
- case LOC_ARG:
- case LOC_REGPARM:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG_ARG:
- TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
- TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
- TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym));
- TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
- nargs += 1;
-
- break;
+ break;
- default:
- break;
- }
- }
+ case LOC_ARG:
+ case LOC_REGPARM:
+ case LOC_LOCAL_ARG:
+ case LOC_BASEREG_ARG:
+ TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
+ TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
+ TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym));
+ TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym);
+ nargs += 1;
+
+ break;
+
+ default:
+ break;
+ }
+ }
/* Re-allocate fields vector; if there are no fields, make the */
/* fields pointer non-null anyway, to mark that this function type */
@@ -4357,38 +4226,37 @@ fill_in_ada_prototype (func)
TYPE_NFIELDS (ftype) = nargs;
if (nargs == 0)
{
- static struct field dummy_field = {0, 0, 0, 0};
- free (TYPE_FIELDS (ftype));
+ static struct field dummy_field = { 0, 0, 0, 0 };
+ xfree (TYPE_FIELDS (ftype));
TYPE_FIELDS (ftype) = &dummy_field;
}
else
{
- struct field* fields =
- (struct field*) TYPE_ALLOC (ftype, nargs * sizeof (struct field));
- memcpy ((char*) fields,
- (char*) TYPE_FIELDS (ftype),
- nargs * sizeof (struct field));
- free (TYPE_FIELDS (ftype));
+ struct field *fields =
+ (struct field *) TYPE_ALLOC (ftype, nargs * sizeof (struct field));
+ memcpy ((char *) fields,
+ (char *) TYPE_FIELDS (ftype), nargs * sizeof (struct field));
+ xfree (TYPE_FIELDS (ftype));
TYPE_FIELDS (ftype) = fields;
}
}
-
+
/* Breakpoint-related */
-char no_symtab_msg[] = "No symbol table is loaded. Use the \"file\" command.";
+char no_symtab_msg[] =
+ "No symbol table is loaded. Use the \"file\" command.";
/* Assuming that LINE is pointing at the beginning of an argument to
'break', return a pointer to the delimiter for the initial segment
of that name. This is the first ':', ' ', or end of LINE.
*/
-char*
-ada_start_decode_line_1 (line)
- char* line;
+char *
+ada_start_decode_line_1 (char *line)
{
/* [NOTE: strpbrk would be more elegant, but I am reluctant to be
the first to use such a library function in GDB code.] */
- char* p;
+ char *p;
for (p = line; *p != '\000' && *p != ' ' && *p != ':'; p += 1)
;
return p;
@@ -4438,23 +4306,20 @@ ada_start_decode_line_1 (line)
is the caller's responsibility to free them. */
struct symtabs_and_lines
-ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
- char** spec;
- struct symtab* file_table;
- int funfirstline;
- char*** canonical;
-{
- struct symbol** symbols;
- struct block** blocks;
- struct block* block;
+ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
+ int funfirstline, char ***canonical)
+{
+ struct symbol **symbols;
+ struct block **blocks;
+ struct block *block;
int n_matches, i, line_num;
struct symtabs_and_lines selected;
- struct cleanup* old_chain = make_cleanup (null_cleanup, NULL);
- char* name;
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+ char *name;
int len;
- char* lower_name;
- char* unquoted_name;
+ char *lower_name;
+ char *unquoted_name;
if (file_table == NULL)
block = get_selected_block (NULL);
@@ -4462,15 +4327,15 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_table), STATIC_BLOCK);
if (canonical != NULL)
- *canonical = (char**) NULL;
+ *canonical = (char **) NULL;
name = *spec;
- if (**spec == '*')
+ if (**spec == '*')
*spec += 1;
else
{
- while (**spec != '\000' &&
- ! strchr (ada_completer_word_break_characters, **spec))
+ while (**spec != '\000' &&
+ !strchr (ada_completer_word_break_characters, **spec))
*spec += 1;
}
len = *spec - name;
@@ -4479,11 +4344,11 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
if (file_table != NULL && (*spec)[0] == ':' && isdigit ((*spec)[1]))
{
line_num = strtol (*spec + 1, spec, 10);
- while (**spec == ' ' || **spec == '\t')
+ while (**spec == ' ' || **spec == '\t')
*spec += 1;
}
- if (name[0] == '*')
+ if (name[0] == '*')
{
if (line_num == -1)
error ("Wild-card function with no line number or file name.");
@@ -4499,28 +4364,28 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
if (name[0] == '<')
{
- unquoted_name = (char*) alloca (len-1);
- memcpy (unquoted_name, name+1, len-2);
- unquoted_name[len-2] = '\000';
+ unquoted_name = (char *) alloca (len - 1);
+ memcpy (unquoted_name, name + 1, len - 2);
+ unquoted_name[len - 2] = '\000';
lower_name = NULL;
}
else
{
- unquoted_name = (char*) alloca (len+1);
+ unquoted_name = (char *) alloca (len + 1);
memcpy (unquoted_name, name, len);
unquoted_name[len] = '\000';
- lower_name = (char*) alloca (len + 1);
+ lower_name = (char *) alloca (len + 1);
for (i = 0; i < len; i += 1)
lower_name[i] = tolower (name[i]);
lower_name[len] = '\000';
}
n_matches = 0;
- if (lower_name != NULL)
- n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block,
+ if (lower_name != NULL)
+ n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block,
VAR_NAMESPACE, &symbols, &blocks);
if (n_matches == 0)
- n_matches = ada_lookup_symbol_list (unquoted_name, block,
+ n_matches = ada_lookup_symbol_list (unquoted_name, block,
VAR_NAMESPACE, &symbols, &blocks);
if (n_matches == 0 && line_num >= 0)
error ("No line number information found for %s.", unquoted_name);
@@ -4530,22 +4395,22 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
/* FIXME: See comment in symtab.c::decode_line_1 */
#undef volatile
volatile struct symtab_and_line val;
-#define volatile /*nothing*/
+#define volatile /*nothing */
#else
struct symtab_and_line val;
#endif
- struct minimal_symbol* msymbol;
+ struct minimal_symbol *msymbol;
INIT_SAL (&val);
msymbol = NULL;
- if (lower_name != NULL)
+ if (lower_name != NULL)
msymbol = ada_lookup_minimal_symbol (ada_mangle (lower_name));
if (msymbol == NULL)
msymbol = ada_lookup_minimal_symbol (unquoted_name);
if (msymbol != NULL)
{
- val.pc = SYMBOL_VALUE_ADDRESS (msymbol);
+ val.pc = SYMBOL_VALUE_ADDRESS (msymbol);
val.section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
@@ -4557,38 +4422,39 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
selected.sals[0] = val;
selected.nelts = 1;
return selected;
- }
-
+ }
+
if (!have_full_symbols () &&
!have_partial_symbols () && !have_minimal_symbols ())
error (no_symtab_msg);
error ("Function \"%s\" not defined.", unquoted_name);
- return selected; /* for lint */
+ return selected; /* for lint */
}
if (line_num >= 0)
{
- return
- find_sal_from_funcs_and_line (file_table->filename, line_num,
+ return
+ find_sal_from_funcs_and_line (file_table->filename, line_num,
symbols, n_matches);
}
else
{
- selected.nelts = user_select_syms (symbols, blocks, n_matches, n_matches);
+ selected.nelts =
+ user_select_syms (symbols, blocks, n_matches, n_matches);
}
- selected.sals = (struct symtab_and_line*)
+ selected.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line) * selected.nelts);
memset (selected.sals, 0, selected.nelts * sizeof (selected.sals[i]));
- make_cleanup (free, selected.sals);
+ make_cleanup (xfree, selected.sals);
i = 0;
while (i < selected.nelts)
{
- if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK)
+ if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK)
selected.sals[i] = find_function_start_sal (symbols[i], funfirstline);
- else if (SYMBOL_LINE (symbols[i]) != 0)
+ else if (SYMBOL_LINE (symbols[i]) != 0)
{
selected.sals[i].symtab = symtab_for_sym (symbols[i]);
selected.sals[i].line = SYMBOL_LINE (symbols[i]);
@@ -4596,90 +4462,89 @@ ada_finish_decode_line_1 (spec, file_table, funfirstline, canonical)
else if (line_num >= 0)
{
/* Ignore this choice */
- symbols[i] = symbols[selected.nelts-1];
- blocks[i] = blocks[selected.nelts-1];
+ symbols[i] = symbols[selected.nelts - 1];
+ blocks[i] = blocks[selected.nelts - 1];
selected.nelts -= 1;
continue;
}
- else
+ else
error ("Line number not known for symbol \"%s\"", unquoted_name);
i += 1;
}
if (canonical != NULL && (line_num >= 0 || n_matches > 1))
{
- *canonical = (char**) xmalloc (sizeof(char*) * selected.nelts);
+ *canonical = (char **) xmalloc (sizeof (char *) * selected.nelts);
for (i = 0; i < selected.nelts; i += 1)
- (*canonical)[i] =
- extended_canonical_line_spec (selected.sals[i],
+ (*canonical)[i] =
+ extended_canonical_line_spec (selected.sals[i],
SYMBOL_SOURCE_NAME (symbols[i]));
}
-
+
discard_cleanups (old_chain);
return selected;
-}
-
+}
+
/* The (single) sal corresponding to line LINE_NUM in a symbol table
with file name FILENAME that occurs in one of the functions listed
- in SYMBOLS[0 .. NSYMS-1]. */
+ in SYMBOLS[0 .. NSYMS-1]. */
static struct symtabs_and_lines
-find_sal_from_funcs_and_line (filename, line_num, symbols, nsyms)
- const char* filename;
- int line_num;
- struct symbol** symbols;
- int nsyms;
+find_sal_from_funcs_and_line (const char *filename, int line_num,
+ struct symbol **symbols, int nsyms)
{
struct symtabs_and_lines sals;
int best_index, best;
- struct linetable* best_linetable;
- struct objfile* objfile;
- struct symtab* s;
- struct symtab* best_symtab;
+ struct linetable *best_linetable;
+ struct objfile *objfile;
+ struct symtab *s;
+ struct symtab *best_symtab;
read_all_symtabs (filename);
- best_index = 0; best_linetable = NULL; best_symtab = NULL;
+ best_index = 0;
+ best_linetable = NULL;
+ best_symtab = NULL;
best = 0;
ALL_SYMTABS (objfile, s)
- {
- struct linetable *l;
- int ind, exact;
+ {
+ struct linetable *l;
+ int ind, exact;
- QUIT;
+ QUIT;
- if (!STREQ (filename, s->filename))
- continue;
- l = LINETABLE (s);
- ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact);
- if (ind >= 0)
- {
- if (exact)
- {
- best_index = ind;
- best_linetable = l;
- best_symtab = s;
- goto done;
- }
- if (best == 0 || l->item[ind].line < best)
- {
- best = l->item[ind].line;
- best_index = ind;
- best_linetable = l;
- best_symtab = s;
- }
- }
- }
+ if (!STREQ (filename, s->filename))
+ continue;
+ l = LINETABLE (s);
+ ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact);
+ if (ind >= 0)
+ {
+ if (exact)
+ {
+ best_index = ind;
+ best_linetable = l;
+ best_symtab = s;
+ goto done;
+ }
+ if (best == 0 || l->item[ind].line < best)
+ {
+ best = l->item[ind].line;
+ best_index = ind;
+ best_linetable = l;
+ best_symtab = s;
+ }
+ }
+ }
if (best == 0)
error ("Line number not found in designated function.");
- done:
-
+done:
+
sals.nelts = 1;
- sals.sals = (struct symtab_and_line*) xmalloc (sizeof (sals.sals[0]));
+ sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0]));
INIT_SAL (&sals.sals[0]);
-
+
sals.sals[0].line = best_linetable->item[best_index].line;
sals.sals[0].pc = best_linetable->item[best_index].pc;
sals.sals[0].symtab = best_symtab;
@@ -4691,12 +4556,8 @@ find_sal_from_funcs_and_line (filename, line_num, symbols, nsyms)
pc falls within one of the functions denoted by SYMBOLS[0..NSYMS-1].
Set *EXACTP to the 1 if the match is exact, and 0 otherwise. */
static int
-find_line_in_linetable (linetable, line_num, symbols, nsyms, exactp)
- struct linetable* linetable;
- int line_num;
- struct symbol** symbols;
- int nsyms;
- int* exactp;
+find_line_in_linetable (struct linetable *linetable, int line_num,
+ struct symbol **symbols, int nsyms, int *exactp)
{
int i, len, best_index, best;
@@ -4707,7 +4568,7 @@ find_line_in_linetable (linetable, line_num, symbols, nsyms, exactp)
for (i = 0, best_index = -1, best = 0; i < len; i += 1)
{
int k;
- struct linetable_entry* item = &(linetable->item[i]);
+ struct linetable_entry *item = &(linetable->item[i]);
for (k = 0; k < nsyms; k += 1)
{
@@ -4741,9 +4602,7 @@ find_line_in_linetable (linetable, line_num, symbols, nsyms, exactp)
LINETABLE, and k falls strictly within a named function that begins at
or before LINE_NUM. Return -1 if there is no such k. */
static int
-nearest_line_number_in_linetable (linetable, line_num)
- struct linetable* linetable;
- int line_num;
+nearest_line_number_in_linetable (struct linetable *linetable, int line_num)
{
int i, len, best;
@@ -4751,15 +4610,16 @@ nearest_line_number_in_linetable (linetable, line_num)
return -1;
len = linetable->nitems;
- i = 0; best = INT_MAX;
+ i = 0;
+ best = INT_MAX;
while (i < len)
{
int k;
- struct linetable_entry* item = &(linetable->item[i]);
+ struct linetable_entry *item = &(linetable->item[i]);
if (item->line >= line_num && item->line < best)
{
- char* func_name;
+ char *func_name;
CORE_ADDR start, end;
func_name = NULL;
@@ -4769,9 +4629,9 @@ nearest_line_number_in_linetable (linetable, line_num)
{
if (item->line == line_num)
return line_num;
- else
+ else
{
- struct symbol* sym =
+ struct symbol *sym =
standard_lookup (func_name, VAR_NAMESPACE);
if (is_plausible_func_for_line (sym, line_num))
best = item->line;
@@ -4802,11 +4662,8 @@ nearest_line_number_in_linetable (linetable, line_num)
IND == -1 corresponds to no function. */
static int
-find_next_line_in_linetable (linetable, line_num, starting_line, ind)
- struct linetable* linetable;
- int line_num;
- int starting_line;
- int ind;
+find_next_line_in_linetable (struct linetable *linetable, int line_num,
+ int starting_line, int ind)
{
int i, len;
@@ -4814,12 +4671,12 @@ find_next_line_in_linetable (linetable, line_num, starting_line, ind)
return -1;
len = linetable->nitems;
- if (ind >= 0)
+ if (ind >= 0)
{
CORE_ADDR start, end;
if (find_pc_partial_function (linetable->item[ind].pc,
- (char**) NULL, &start, &end))
+ (char **) NULL, &start, &end))
{
while (ind < len && linetable->item[ind].pc < end)
ind += 1;
@@ -4834,11 +4691,11 @@ find_next_line_in_linetable (linetable, line_num, starting_line, ind)
while (i < len)
{
int k;
- struct linetable_entry* item = &(linetable->item[i]);
+ struct linetable_entry *item = &(linetable->item[i]);
if (item->line >= line_num)
{
- char* func_name;
+ char *func_name;
CORE_ADDR start, end;
func_name = NULL;
@@ -4848,13 +4705,13 @@ find_next_line_in_linetable (linetable, line_num, starting_line, ind)
{
if (item->line == line_num)
{
- struct symbol* sym =
+ struct symbol *sym =
standard_lookup (func_name, VAR_NAMESPACE);
if (is_plausible_func_for_line (sym, starting_line))
return i;
else
{
- while ((i+1) < len && linetable->item[i+1].pc < end)
+ while ((i + 1) < len && linetable->item[i + 1].pc < end)
i += 1;
}
}
@@ -4869,9 +4726,7 @@ find_next_line_in_linetable (linetable, line_num, starting_line, ind)
/* True iff function symbol SYM starts somewhere at or before line #
LINE_NUM. */
static int
-is_plausible_func_for_line (sym, line_num)
- struct symbol* sym;
- int line_num;
+is_plausible_func_for_line (struct symbol *sym, int line_num)
{
struct symtab_and_line start_sal;
@@ -4884,12 +4739,11 @@ is_plausible_func_for_line (sym, line_num)
}
static void
-debug_print_lines (lt)
- struct linetable* lt;
+debug_print_lines (struct linetable *lt)
{
int i;
- if (lt == NULL)
+ if (lt == NULL)
return;
fprintf (stderr, "\t");
@@ -4899,155 +4753,152 @@ debug_print_lines (lt)
}
static void
-debug_print_block (b)
- struct block* b;
+debug_print_block (struct block *b)
{
int i;
- fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]",
- b, BLOCK_START(b), BLOCK_END(b));
- if (BLOCK_FUNCTION(b) != NULL)
- fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION(b)));
+ struct symbol *i;
+
+ fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]",
+ b, BLOCK_START (b), BLOCK_END (b));
+ if (BLOCK_FUNCTION (b) != NULL)
+ fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION (b)));
fprintf (stderr, "\n");
- fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK(b));
+ fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK (b));
fprintf (stderr, "\t Symbols:");
- for (i = 0; i < BLOCK_NSYMS (b); i += 1)
- {
- if (i > 0 && i % 4 == 0)
- fprintf (stderr, "\n\t\t ");
- fprintf (stderr, " %s", SYMBOL_NAME (BLOCK_SYM (b, i)));
- }
+ ALL_BLOCK_SYMBOLS (b, i, sym)
+ {
+ if (i > 0 && i % 4 == 0)
+ fprintf (stderr, "\n\t\t ");
+ fprintf (stderr, " %s", SYMBOL_NAME (sym));
+ }
fprintf (stderr, "\n");
}
static void
-debug_print_blocks (bv)
- struct blockvector* bv;
+debug_print_blocks (struct blockvector *bv)
{
int i;
if (bv == NULL)
return;
- for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1) {
- fprintf (stderr, "%6d. ", i);
- debug_print_block (BLOCKVECTOR_BLOCK (bv, i));
- }
+ for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1)
+ {
+ fprintf (stderr, "%6d. ", i);
+ debug_print_block (BLOCKVECTOR_BLOCK (bv, i));
+ }
}
static void
-debug_print_symtab (s)
- struct symtab* s;
+debug_print_symtab (struct symtab *s)
{
fprintf (stderr, "Symtab %p\n File: %s; Dir: %s\n", s,
s->filename, s->dirname);
fprintf (stderr, " Blockvector: %p, Primary: %d\n",
- BLOCKVECTOR(s), s->primary);
- debug_print_blocks (BLOCKVECTOR(s));
+ BLOCKVECTOR (s), s->primary);
+ debug_print_blocks (BLOCKVECTOR (s));
fprintf (stderr, " Line table: %p\n", LINETABLE (s));
- debug_print_lines (LINETABLE(s));
+ debug_print_lines (LINETABLE (s));
}
/* Read in all symbol tables corresponding to partial symbol tables
with file name FILENAME. */
static void
-read_all_symtabs (filename)
- const char* filename;
+read_all_symtabs (const char *filename)
{
- struct partial_symtab* ps;
- struct objfile* objfile;
+ struct partial_symtab *ps;
+ struct objfile *objfile;
ALL_PSYMTABS (objfile, ps)
- {
- QUIT;
+ {
+ QUIT;
- if (STREQ (filename, ps->filename))
- PSYMTAB_TO_SYMTAB (ps);
- }
+ if (STREQ (filename, ps->filename))
+ PSYMTAB_TO_SYMTAB (ps);
+ }
}
/* All sals corresponding to line LINE_NUM in a symbol table from file
FILENAME, as filtered by the user. If CANONICAL is not null, set
it to a corresponding array of canonical line specs. */
static struct symtabs_and_lines
-all_sals_for_line (filename, line_num, canonical)
- const char* filename;
- int line_num;
- char*** canonical;
+all_sals_for_line (const char *filename, int line_num, char ***canonical)
{
struct symtabs_and_lines result;
- struct objfile* objfile;
- struct symtab* s;
- struct cleanup* old_chain = make_cleanup (null_cleanup, NULL);
+ struct objfile *objfile;
+ struct symtab *s;
+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
size_t len;
read_all_symtabs (filename);
- result.sals = (struct symtab_and_line*) xmalloc (4 * sizeof (result.sals[0]));
+ result.sals =
+ (struct symtab_and_line *) xmalloc (4 * sizeof (result.sals[0]));
result.nelts = 0;
len = 4;
make_cleanup (free_current_contents, &result.sals);
- ALL_SYMTABS (objfile, s)
- {
- int ind, target_line_num;
+ ALL_SYMTABS (objfile, s)
+ {
+ int ind, target_line_num;
- QUIT;
+ QUIT;
- if (!STREQ (s->filename, filename))
- continue;
+ if (!STREQ (s->filename, filename))
+ continue;
- target_line_num =
- nearest_line_number_in_linetable (LINETABLE (s), line_num);
- if (target_line_num == -1)
- continue;
+ target_line_num =
+ nearest_line_number_in_linetable (LINETABLE (s), line_num);
+ if (target_line_num == -1)
+ continue;
- ind = -1;
- while (1)
- {
- ind =
- find_next_line_in_linetable (LINETABLE (s),
- target_line_num, line_num, ind);
-
- if (ind < 0)
- break;
+ ind = -1;
+ while (1)
+ {
+ ind =
+ find_next_line_in_linetable (LINETABLE (s),
+ target_line_num, line_num, ind);
- GROW_VECT (result.sals, len, result.nelts+1);
- INIT_SAL (&result.sals[result.nelts]);
- result.sals[result.nelts].line = LINETABLE(s)->item[ind].line;
- result.sals[result.nelts].pc = LINETABLE(s)->item[ind].pc;
- result.sals[result.nelts].symtab = s;
- result.nelts += 1;
- }
- }
+ if (ind < 0)
+ break;
+
+ GROW_VECT (result.sals, len, result.nelts + 1);
+ INIT_SAL (&result.sals[result.nelts]);
+ result.sals[result.nelts].line = LINETABLE (s)->item[ind].line;
+ result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
+ result.sals[result.nelts].symtab = s;
+ result.nelts += 1;
+ }
+ }
if (canonical != NULL || result.nelts > 1)
{
int k;
- char** func_names = (char**) alloca (result.nelts * sizeof (char*));
+ char **func_names = (char **) alloca (result.nelts * sizeof (char *));
int first_choice = (result.nelts > 1) ? 2 : 1;
int n;
- int* choices = (int*) alloca (result.nelts * sizeof (int));
-
- for (k = 0; k < result.nelts; k += 1)
+ int *choices = (int *) alloca (result.nelts * sizeof (int));
+
+ for (k = 0; k < result.nelts; k += 1)
{
- find_pc_partial_function (result.sals[k].pc, &func_names[k],
- (CORE_ADDR*) NULL, (CORE_ADDR*) NULL);
+ find_pc_partial_function (result.sals[k].pc, &func_names[k],
+ (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
if (func_names[k] == NULL)
error ("Could not find function for one or more breakpoints.");
}
-
- if (result.nelts > 1)
+
+ if (result.nelts > 1)
{
- printf_unfiltered("[0] cancel\n");
- if (result.nelts > 1)
- printf_unfiltered("[1] all\n");
+ printf_unfiltered ("[0] cancel\n");
+ if (result.nelts > 1)
+ printf_unfiltered ("[1] all\n");
for (k = 0; k < result.nelts; k += 1)
- printf_unfiltered ("[%d] %s\n", k + first_choice,
+ printf_unfiltered ("[%d] %s\n", k + first_choice,
ada_demangle (func_names[k]));
-
+
n = get_selections (choices, result.nelts, result.nelts,
result.nelts > 1, "instance-choice");
-
- for (k = 0; k < n; k += 1)
+
+ for (k = 0; k < n; k += 1)
{
result.sals[k] = result.sals[choices[k]];
func_names[k] = func_names[choices[k]];
@@ -5055,17 +4906,17 @@ all_sals_for_line (filename, line_num, canonical)
result.nelts = n;
}
- if (canonical != NULL)
+ if (canonical != NULL)
{
- *canonical = (char**) xmalloc (result.nelts * sizeof (char**));
- make_cleanup (free, *canonical);
- for (k = 0; k < result.nelts; k += 1)
+ *canonical = (char **) xmalloc (result.nelts * sizeof (char **));
+ make_cleanup (xfree, *canonical);
+ for (k = 0; k < result.nelts; k += 1)
{
- (*canonical)[k] =
+ (*canonical)[k] =
extended_canonical_line_spec (result.sals[k], func_names[k]);
if ((*canonical)[k] == NULL)
error ("Could not locate one or more breakpoints.");
- make_cleanup (free, (*canonical)[k]);
+ make_cleanup (xfree, (*canonical)[k]);
}
}
}
@@ -5080,19 +4931,16 @@ all_sals_for_line (filename, line_num, canonical)
information. The caller is responsible for releasing any space
allocated. */
-static char*
-extended_canonical_line_spec (sal, name)
- struct symtab_and_line sal;
- const char* name;
+static char *
+extended_canonical_line_spec (struct symtab_and_line sal, const char *name)
{
- char* r;
+ char *r;
- if (sal.symtab == NULL || sal.symtab->filename == NULL ||
- sal.line <= 0)
+ if (sal.symtab == NULL || sal.symtab->filename == NULL || sal.line <= 0)
return NULL;
- r = (char*) xmalloc (strlen (name) + strlen (sal.symtab->filename)
- + sizeof(sal.line)*3 + 3);
+ r = (char *) xmalloc (strlen (name) + strlen (sal.symtab->filename)
+ + sizeof (sal.line) * 3 + 3);
sprintf (r, "%s:'%s':%d", sal.symtab->filename, name, sal.line);
return r;
}
@@ -5102,118 +4950,112 @@ int begin_bnum = -1;
#endif
int begin_annotate_level = 0;
-static void
-begin_cleanup (void* dummy)
+static void
+begin_cleanup (void *dummy)
{
begin_annotate_level = 0;
}
static void
-begin_command (args, from_tty)
- char *args;
- int from_tty;
+begin_command (char *args, int from_tty)
{
struct minimal_symbol *msym;
CORE_ADDR main_program_name_addr;
char main_program_name[1024];
- struct cleanup* old_chain = make_cleanup (begin_cleanup, NULL);
+ struct cleanup *old_chain = make_cleanup (begin_cleanup, NULL);
begin_annotate_level = 2;
/* Check that there is a program to debug */
if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
-
+
/* Check that we are debugging an Ada program */
/* if (ada_update_initial_language (language_unknown, NULL) != language_ada)
- error ("Cannot find the Ada initialization procedure. Is this an Ada main program?");
- */
+ error ("Cannot find the Ada initialization procedure. Is this an Ada main program?");
+ */
/* FIXME: language_ada should be defined in defs.h */
/* Get the address of the name of the main procedure */
msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL);
if (msym != NULL)
- {
- main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym);
- if (main_program_name_addr == 0)
- error ("Invalid address for Ada main program name.");
+ {
+ main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym);
+ if (main_program_name_addr == 0)
+ error ("Invalid address for Ada main program name.");
- /* Read the name of the main procedure */
- extract_string (main_program_name_addr, main_program_name);
+ /* Read the name of the main procedure */
+ extract_string (main_program_name_addr, main_program_name);
- /* Put a temporary breakpoint in the Ada main program and run */
- do_command ("tbreak ", main_program_name, 0);
- do_command ("run ", args, 0);
- }
+ /* Put a temporary breakpoint in the Ada main program and run */
+ do_command ("tbreak ", main_program_name, 0);
+ do_command ("run ", args, 0);
+ }
else
- {
- /* If we could not find the symbol containing the name of the
- main program, that means that the compiler that was used to build
- was not recent enough. In that case, we fallback to the previous
- mechanism, which is a little bit less reliable, but has proved to work
- in most cases. The only cases where it will fail is when the user
- has set some breakpoints which will be hit before the end of the
- begin command processing (eg in the initialization code).
-
- The begining of the main Ada subprogram is located by breaking
- on the adainit procedure. Since we know that the binder generates
- the call to this procedure exactly 2 calls before the call to the
- Ada main subprogram, it is then easy to put a breakpoint on this
- Ada main subprogram once we hit adainit.
- */
- do_command ("tbreak adainit", 0);
- do_command ("run ", args, 0);
- do_command ("up", 0);
- do_command ("tbreak +2", 0);
- do_command ("continue", 0);
- do_command ("step", 0);
- }
+ {
+ /* If we could not find the symbol containing the name of the
+ main program, that means that the compiler that was used to build
+ was not recent enough. In that case, we fallback to the previous
+ mechanism, which is a little bit less reliable, but has proved to work
+ in most cases. The only cases where it will fail is when the user
+ has set some breakpoints which will be hit before the end of the
+ begin command processing (eg in the initialization code).
+
+ The begining of the main Ada subprogram is located by breaking
+ on the adainit procedure. Since we know that the binder generates
+ the call to this procedure exactly 2 calls before the call to the
+ Ada main subprogram, it is then easy to put a breakpoint on this
+ Ada main subprogram once we hit adainit.
+ */
+ do_command ("tbreak adainit", 0);
+ do_command ("run ", args, 0);
+ do_command ("up", 0);
+ do_command ("tbreak +2", 0);
+ do_command ("continue", 0);
+ do_command ("step", 0);
+ }
do_cleanups (old_chain);
}
int
-is_ada_runtime_file (filename)
- char *filename;
+is_ada_runtime_file (char *filename)
{
return (STREQN (filename, "s-", 2) ||
STREQN (filename, "a-", 2) ||
- STREQN (filename, "g-", 2) ||
- STREQN (filename, "i-", 2));
+ STREQN (filename, "g-", 2) || STREQN (filename, "i-", 2));
}
/* find the first frame that contains debugging information and that is not
part of the Ada run-time, starting from fi and moving upward. */
int
-find_printable_frame (fi, level)
- struct frame_info *fi;
- int level;
+find_printable_frame (struct frame_info *fi, int level)
{
struct symtab_and_line sal;
-
+
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. */
+ 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,
+ find_pc_line (fi->pc,
fi->next != NULL
&& !fi->next->signal_handler_caller
&& !frame_in_dummy (fi->next));
if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
{
#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
- /* libpthread.so contains some debugging information that prevents us
- from finding the right frame */
+ /* libpthread.so contains some debugging information that prevents us
+ from finding the right frame */
if (sal.symtab->objfile &&
STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so"))
- continue;
+ continue;
#endif
selected_frame = fi;
break;
@@ -5224,64 +5066,62 @@ find_printable_frame (fi, level)
}
void
-ada_report_exception_break (b)
- struct breakpoint *b;
+ada_report_exception_break (struct breakpoint *b)
{
#ifdef UI_OUT
/* FIXME: break_on_exception should be defined in breakpoint.h */
/* if (b->break_on_exception == 1)
- {
- /* Assume that cond has 16 elements, the 15th
- being the exception */ /*
- if (b->cond && b->cond->nelts == 16)
- {
- ui_out_text (uiout, "on ");
- ui_out_field_string (uiout, "exception",
- SYMBOL_NAME (b->cond->elts[14].symbol));
- }
- else
- ui_out_text (uiout, "on all exceptions");
- }
- else if (b->break_on_exception == 2)
- ui_out_text (uiout, "on unhandled exception");
- else if (b->break_on_exception == 3)
- ui_out_text (uiout, "on assert failure");
-#else
- if (b->break_on_exception == 1)
- {*/
- /* Assume that cond has 16 elements, the 15th
- being the exception */ /*
- if (b->cond && b->cond->nelts == 16)
- {
- fputs_filtered ("on ", gdb_stdout);
- fputs_filtered (SYMBOL_NAME
- (b->cond->elts[14].symbol), gdb_stdout);
- }
- else
- fputs_filtered ("on all exceptions", gdb_stdout);
- }
- else if (b->break_on_exception == 2)
- fputs_filtered ("on unhandled exception", gdb_stdout);
- else if (b->break_on_exception == 3)
- fputs_filtered ("on assert failure", gdb_stdout);
-*/
+ {
+ /* Assume that cond has 16 elements, the 15th
+ being the exception *//*
+ if (b->cond && b->cond->nelts == 16)
+ {
+ ui_out_text (uiout, "on ");
+ ui_out_field_string (uiout, "exception",
+ SYMBOL_NAME (b->cond->elts[14].symbol));
+ }
+ else
+ ui_out_text (uiout, "on all exceptions");
+ }
+ else if (b->break_on_exception == 2)
+ ui_out_text (uiout, "on unhandled exception");
+ else if (b->break_on_exception == 3)
+ ui_out_text (uiout, "on assert failure");
+ #else
+ if (b->break_on_exception == 1)
+ { */
+ /* Assume that cond has 16 elements, the 15th
+ being the exception *//*
+ if (b->cond && b->cond->nelts == 16)
+ {
+ fputs_filtered ("on ", gdb_stdout);
+ fputs_filtered (SYMBOL_NAME
+ (b->cond->elts[14].symbol), gdb_stdout);
+ }
+ else
+ fputs_filtered ("on all exceptions", gdb_stdout);
+ }
+ else if (b->break_on_exception == 2)
+ fputs_filtered ("on unhandled exception", gdb_stdout);
+ else if (b->break_on_exception == 3)
+ fputs_filtered ("on assert failure", gdb_stdout);
+ */
#endif
}
int
-ada_is_exception_sym (struct symbol* sym)
+ada_is_exception_sym (struct symbol *sym)
{
char *type_name = type_name_no_tag (SYMBOL_TYPE (sym));
-
+
return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST
- && type_name != NULL
- && STREQ (type_name, "exception"));
+ && type_name != NULL && STREQ (type_name, "exception"));
}
int
-ada_maybe_exception_partial_symbol (struct partial_symbol* sym)
+ada_maybe_exception_partial_symbol (struct partial_symbol *sym)
{
return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
@@ -5292,94 +5132,92 @@ ada_maybe_exception_partial_symbol (struct partial_symbol* sym)
into equivalent form. Return resulting argument string. Set
*BREAK_ON_EXCEPTIONP to 1 for ordinary break on exception, 2 for
break on unhandled, 3 for assert, 0 otherwise. */
-char* ada_breakpoint_rewrite (char* arg, int* break_on_exceptionp)
+char *
+ada_breakpoint_rewrite (char *arg, int *break_on_exceptionp)
{
if (arg == NULL)
return arg;
*break_on_exceptionp = 0;
- /* FIXME: language_ada should be defined in defs.h */
+ /* FIXME: language_ada should be defined in defs.h */
/* if (current_language->la_language == language_ada
- && STREQN (arg, "exception", 9) &&
- (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0'))
- {
- char *tok, *end_tok;
- int toklen;
-
- *break_on_exceptionp = 1;
-
- tok = arg+9;
- while (*tok == ' ' || *tok == '\t')
- tok += 1;
-
- end_tok = tok;
-
- while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
- end_tok += 1;
-
- toklen = end_tok - tok;
-
- arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if "
- "long_integer(e) = long_integer(&)")
- + toklen + 1);
- make_cleanup (free, arg);
- if (toklen == 0)
- strcpy (arg, "__gnat_raise_nodefer_with_msg");
- else if (STREQN (tok, "unhandled", toklen))
- {
- *break_on_exceptionp = 2;
- strcpy (arg, "__gnat_unhandled_exception");
- }
- else
- {
- sprintf (arg, "__gnat_raise_nodefer_with_msg if "
- "long_integer(e) = long_integer(&%.*s)",
- toklen, tok);
- }
- }
- else if (current_language->la_language == language_ada
- && STREQN (arg, "assert", 6) &&
- (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0'))
- {
- char *tok = arg + 6;
-
- *break_on_exceptionp = 3;
-
- arg = (char*)
- xmalloc (sizeof ("system__assertions__raise_assert_failure")
- + strlen (tok) + 1);
- make_cleanup (free, arg);
- sprintf (arg, "system__assertions__raise_assert_failure%s", tok);
- }
- */
+ && STREQN (arg, "exception", 9) &&
+ (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0'))
+ {
+ char *tok, *end_tok;
+ int toklen;
+
+ *break_on_exceptionp = 1;
+
+ tok = arg+9;
+ while (*tok == ' ' || *tok == '\t')
+ tok += 1;
+
+ end_tok = tok;
+
+ while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
+ end_tok += 1;
+
+ toklen = end_tok - tok;
+
+ arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if "
+ "long_integer(e) = long_integer(&)")
+ + toklen + 1);
+ make_cleanup (xfree, arg);
+ if (toklen == 0)
+ strcpy (arg, "__gnat_raise_nodefer_with_msg");
+ else if (STREQN (tok, "unhandled", toklen))
+ {
+ *break_on_exceptionp = 2;
+ strcpy (arg, "__gnat_unhandled_exception");
+ }
+ else
+ {
+ sprintf (arg, "__gnat_raise_nodefer_with_msg if "
+ "long_integer(e) = long_integer(&%.*s)",
+ toklen, tok);
+ }
+ }
+ else if (current_language->la_language == language_ada
+ && STREQN (arg, "assert", 6) &&
+ (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0'))
+ {
+ char *tok = arg + 6;
+
+ *break_on_exceptionp = 3;
+
+ arg = (char*)
+ xmalloc (sizeof ("system__assertions__raise_assert_failure")
+ + strlen (tok) + 1);
+ make_cleanup (xfree, arg);
+ sprintf (arg, "system__assertions__raise_assert_failure%s", tok);
+ }
+ */
return arg;
}
-
+
/* Field Access */
/* True if field number FIELD_NUM in struct or union type TYPE is supposed
to be invisible to users. */
int
-ada_is_ignored_field (type, field_num)
- struct type *type;
- int field_num;
+ada_is_ignored_field (struct type *type, int field_num)
{
if (field_num < 0 || field_num > TYPE_NFIELDS (type))
return 1;
- else
+ else
{
- const char* name = TYPE_FIELD_NAME (type, field_num);
+ const char *name = TYPE_FIELD_NAME (type, field_num);
return (name == NULL
- || (name[0] == '_' && ! STREQN (name, "_parent", 7)));
+ || (name[0] == '_' && !STREQN (name, "_parent", 7)));
}
}
/* True iff structure type TYPE has a tag field. */
int
-ada_is_tagged_type (type)
- struct type *type;
+ada_is_tagged_type (struct type *type)
{
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT)
return 0;
@@ -5389,27 +5227,24 @@ ada_is_tagged_type (type)
/* The type of the tag on VAL. */
-struct type*
-ada_tag_type (val)
- struct value* val;
+struct type *
+ada_tag_type (struct value *val)
{
return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 0, NULL);
}
/* The value of the tag on VAL. */
-struct value*
-ada_value_tag (val)
- struct value* val;
+struct value *
+ada_value_tag (struct value *val)
{
return ada_value_struct_elt (val, "_tag", "record");
}
/* The parent type of TYPE, or NULL if none. */
-struct type*
-ada_parent_type (type)
- struct type *type;
+struct type *
+ada_parent_type (struct type *type)
{
int i;
@@ -5430,12 +5265,10 @@ ada_parent_type (type)
a structure type with at least FIELD_NUM+1 fields. */
int
-ada_is_parent_field (type, field_num)
- struct type *type;
- int field_num;
+ada_is_parent_field (struct type *type, int field_num)
{
- const char* name = TYPE_FIELD_NAME (check_typedef (type), field_num);
- return (name != NULL &&
+ const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num);
+ return (name != NULL &&
(STREQN (name, "PARENT", 6) || STREQN (name, "_parent", 7)));
}
@@ -5446,44 +5279,38 @@ ada_is_parent_field (type, field_num)
structures. */
int
-ada_is_wrapper_field (type, field_num)
- struct type *type;
- int field_num;
+ada_is_wrapper_field (struct type *type, int field_num)
{
- const char* name = TYPE_FIELD_NAME (type, field_num);
- return (name != NULL
- && (STREQN (name, "PARENT", 6) || STREQ (name, "REP")
+ const char *name = TYPE_FIELD_NAME (type, field_num);
+ return (name != NULL
+ && (STREQN (name, "PARENT", 6) || STREQ (name, "REP")
|| STREQN (name, "_parent", 7)
|| name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
}
/* True iff field number FIELD_NUM of structure or union type TYPE
is a variant wrapper. Assumes TYPE is a structure type with at least
- FIELD_NUM+1 fields. */
+ FIELD_NUM+1 fields. */
int
-ada_is_variant_part (type, field_num)
- struct type *type;
- int field_num;
+ada_is_variant_part (struct type *type, int field_num)
{
- struct type* field_type = TYPE_FIELD_TYPE (type, field_num);
+ struct type *field_type = TYPE_FIELD_TYPE (type, field_num);
return (TYPE_CODE (field_type) == TYPE_CODE_UNION
|| (is_dynamic_field (type, field_num)
- && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) == TYPE_CODE_UNION));
+ && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) ==
+ TYPE_CODE_UNION));
}
/* Assuming that VAR_TYPE is a variant wrapper (type of the variant part)
whose discriminants are contained in the record type OUTER_TYPE,
returns the type of the controlling discriminant for the variant. */
-struct type*
-ada_variant_discrim_type (var_type, outer_type)
- struct type *var_type;
- struct type *outer_type;
+struct type *
+ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
{
- char* name = ada_variant_discrim_name (var_type);
- struct type *type =
- ada_lookup_struct_elt_type (outer_type, name, 1, NULL);
+ char *name = ada_variant_discrim_name (var_type);
+ struct type *type = ada_lookup_struct_elt_type (outer_type, name, 1, NULL);
if (type == NULL)
return builtin_type_int;
else
@@ -5495,11 +5322,9 @@ ada_variant_discrim_type (var_type, outer_type)
represents a 'when others' clause; otherwise 0. */
int
-ada_is_others_clause (type, field_num)
- struct type *type;
- int field_num;
+ada_is_others_clause (struct type *type, int field_num)
{
- const char* name = TYPE_FIELD_NAME (type, field_num);
+ const char *name = TYPE_FIELD_NAME (type, field_num);
return (name != NULL && name[0] == 'O');
}
@@ -5507,16 +5332,15 @@ ada_is_others_clause (type, field_num)
returns the name of the discriminant controlling the variant. The
value is valid until the next call to ada_variant_discrim_name. */
-char *
-ada_variant_discrim_name (type0)
- struct type *type0;
+char *
+ada_variant_discrim_name (struct type *type0)
{
- static char* result = NULL;
+ static char *result = NULL;
static size_t result_len = 0;
- struct type* type;
- const char* name;
- const char* discrim_end;
- const char* discrim_start;
+ struct type *type;
+ const char *name;
+ const char *discrim_end;
+ const char *discrim_start;
if (TYPE_CODE (type0) == TYPE_CODE_PTR)
type = TYPE_TARGET_TYPE (type0);
@@ -5537,19 +5361,19 @@ ada_variant_discrim_name (type0)
if (discrim_end == name)
return "";
- for (discrim_start = discrim_end; discrim_start != name+3;
+ for (discrim_start = discrim_end; discrim_start != name + 3;
discrim_start -= 1)
{
- if (discrim_start == name+1)
+ if (discrim_start == name + 1)
return "";
- if ((discrim_start > name+3 && STREQN (discrim_start-3, "___", 3))
+ if ((discrim_start > name + 3 && STREQN (discrim_start - 3, "___", 3))
|| discrim_start[-1] == '.')
break;
}
GROW_VECT (result, result_len, discrim_end - discrim_start + 1);
strncpy (result, discrim_start, discrim_end - discrim_start);
- result[discrim_end-discrim_start] = '\0';
+ result[discrim_end - discrim_start] = '\0';
return result;
}
@@ -5562,15 +5386,11 @@ ada_variant_discrim_name (type0)
does not occur. */
int
-ada_scan_number (str, k, R, new_k)
- const char str[];
- int k;
- LONGEST *R;
- int *new_k;
+ada_scan_number (const char str[], int k, LONGEST * R, int *new_k)
{
ULONGEST RU;
- if (! isdigit (str[k]))
+ if (!isdigit (str[k]))
return 0;
/* Do it the hard way so as not to make any assumption about
@@ -5579,14 +5399,14 @@ ada_scan_number (str, k, R, new_k)
RU = 0;
while (isdigit (str[k]))
{
- RU = RU*10 + (str[k] - '0');
+ RU = RU * 10 + (str[k] - '0');
k += 1;
}
- if (str[k] == 'm')
+ if (str[k] == 'm')
{
if (R != NULL)
- *R = (- (LONGEST) (RU-1)) - 1;
+ *R = (-(LONGEST) (RU - 1)) - 1;
k += 1;
}
else if (R != NULL)
@@ -5607,26 +5427,23 @@ ada_scan_number (str, k, R, new_k)
and FIELD_NUM is a valid field number within it, returns 1 iff VAL is
in the range encoded by field FIELD_NUM of TYPE; otherwise 0. */
-int
-ada_in_variant (val, type, field_num)
- LONGEST val;
- struct type *type;
- int field_num;
+int
+ada_in_variant (LONGEST val, struct type *type, int field_num)
{
- const char* name = TYPE_FIELD_NAME (type, field_num);
+ const char *name = TYPE_FIELD_NAME (type, field_num);
int p;
p = 0;
while (1)
{
- switch (name[p])
+ switch (name[p])
{
case '\0':
return 0;
case 'S':
{
LONGEST W;
- if (! ada_scan_number (name, p + 1, &W, &p))
+ if (!ada_scan_number (name, p + 1, &W, &p))
return 0;
if (val == W)
return 1;
@@ -5635,9 +5452,8 @@ ada_in_variant (val, type, field_num)
case 'R':
{
LONGEST L, U;
- if (! ada_scan_number (name, p + 1, &L, &p)
- || name[p] != 'T'
- || ! ada_scan_number (name, p + 1, &U, &p))
+ if (!ada_scan_number (name, p + 1, &L, &p)
+ || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
return 0;
if (val >= L && val <= U)
return 1;
@@ -5657,14 +5473,11 @@ ada_in_variant (val, type, field_num)
FIELDNO says which field. Differs from value_primitive_field only
in that it can handle packed values of arbitrary type. */
-struct value*
-ada_value_primitive_field (arg1, offset, fieldno, arg_type)
- struct value* arg1;
- int offset;
- int fieldno;
- struct type *arg_type;
+struct value *
+ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
+ struct type *arg_type)
{
- struct value* v;
+ struct value *v;
struct type *type;
CHECK_TYPEDEF (arg_type);
@@ -5676,10 +5489,10 @@ ada_value_primitive_field (arg1, offset, fieldno, arg_type)
{
int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
-
+
return ada_value_primitive_packed_val (arg1, VALUE_CONTENTS (arg1),
- offset + bit_pos/8, bit_pos % 8,
- bit_size, type);
+ offset + bit_pos / 8,
+ bit_pos % 8, bit_size, type);
}
else
return value_primitive_field (arg1, offset, fieldno, arg_type);
@@ -5692,17 +5505,14 @@ ada_value_primitive_field (arg1, offset, fieldno, arg_type)
Searches recursively through wrapper fields (e.g., '_parent'). */
-struct value*
-ada_search_struct_field (name, arg, offset, type)
- char *name;
- struct value* arg;
- int offset;
- struct type *type;
+struct value *
+ada_search_struct_field (char *name, struct value *arg, int offset,
+ struct type *type)
{
int i;
CHECK_TYPEDEF (type);
- for (i = TYPE_NFIELDS (type)-1; i >= 0; i -= 1)
+ for (i = TYPE_NFIELDS (type) - 1; i >= 0; i -= 1)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -5710,14 +5520,17 @@ ada_search_struct_field (name, arg, offset, type)
continue;
else if (field_name_match (t_field_name, name))
- return ada_value_primitive_field (arg, offset, i, type);
+ return ada_value_primitive_field (arg, offset, i, type);
else if (ada_is_wrapper_field (type, i))
{
- struct value* v =
- ada_search_struct_field (name, arg,
- offset + TYPE_FIELD_BITPOS (type, i) / 8,
- TYPE_FIELD_TYPE (type, i));
+ struct value *v = ada_search_struct_field (name, arg,
+ offset +
+ TYPE_FIELD_BITPOS (type,
+ i) /
+ 8,
+ TYPE_FIELD_TYPE (type,
+ i));
if (v != NULL)
return v;
}
@@ -5730,11 +5543,13 @@ ada_search_struct_field (name, arg, offset, type)
for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
{
- struct value* v =
- ada_search_struct_field (name, arg,
- var_offset
- + TYPE_FIELD_BITPOS (field_type, j)/8,
- TYPE_FIELD_TYPE (field_type, j));
+ struct value *v = ada_search_struct_field (name, arg,
+ var_offset
+ +
+ TYPE_FIELD_BITPOS
+ (field_type, j) / 8,
+ TYPE_FIELD_TYPE
+ (field_type, j));
if (v != NULL)
return v;
}
@@ -5742,7 +5557,7 @@ ada_search_struct_field (name, arg, offset, type)
}
return NULL;
}
-
+
/* Given ARG, a value of type (pointer to a)* structure/union,
extract the component named NAME from the ultimate target structure/union
and return it as a value with its appropriate type.
@@ -5754,14 +5569,11 @@ ada_search_struct_field (name, arg, offset, type)
ERR is a name (for use in error messages) that identifies the class
of entity that ARG is supposed to be. */
-struct value*
-ada_value_struct_elt (arg, name, err)
- struct value* arg;
- char *name;
- char *err;
+struct value *
+ada_value_struct_elt (struct value *arg, char *name, char *err)
{
struct type *t;
- struct value* v;
+ struct value *v;
arg = ada_coerce_ref (arg);
t = check_typedef (VALUE_TYPE (arg));
@@ -5774,9 +5586,9 @@ ada_value_struct_elt (arg, name, err)
t = check_typedef (VALUE_TYPE (arg));
}
- if ( TYPE_CODE (t) != TYPE_CODE_STRUCT
- && TYPE_CODE (t) != TYPE_CODE_UNION)
- error ("Attempt to extract a component of a value that is not a %s.", err);
+ if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION)
+ error ("Attempt to extract a component of a value that is not a %s.",
+ err);
v = ada_search_struct_field (name, arg, 0, t);
if (v == NULL)
@@ -5802,11 +5614,8 @@ ada_value_struct_elt (arg, name, err)
If NOERR is nonzero, return NULL if NAME is not suitably defined. */
struct type *
-ada_lookup_struct_elt_type (type, name, noerr, dispp)
- struct type *type;
- char *name;
- int noerr;
- int *dispp;
+ada_lookup_struct_elt_type (struct type *type, char *name, int noerr,
+ int *dispp)
{
int i;
@@ -5839,13 +5648,13 @@ ada_lookup_struct_elt_type (type, name, noerr, dispp)
char *t_field_name = TYPE_FIELD_NAME (type, i);
struct type *t;
int disp;
-
+
if (t_field_name == NULL)
continue;
else if (field_name_match (t_field_name, name))
{
- if (dispp != NULL)
+ if (dispp != NULL)
*dispp += TYPE_FIELD_BITPOS (type, i) / 8;
return check_typedef (TYPE_FIELD_TYPE (type, i));
}
@@ -5853,7 +5662,7 @@ ada_lookup_struct_elt_type (type, name, noerr, dispp)
else if (ada_is_wrapper_field (type, i))
{
disp = 0;
- t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name,
+ t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name,
1, &disp);
if (t != NULL)
{
@@ -5875,7 +5684,7 @@ ada_lookup_struct_elt_type (type, name, noerr, dispp)
name, 1, &disp);
if (t != NULL)
{
- if (dispp != NULL)
+ if (dispp != NULL)
*dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8;
return t;
}
@@ -5885,7 +5694,7 @@ ada_lookup_struct_elt_type (type, name, noerr, dispp)
}
BadName:
- if (! noerr)
+ if (!noerr)
{
target_terminal_ours ();
gdb_flush (gdb_stdout);
@@ -5903,21 +5712,19 @@ BadName:
OUTER_VALADDR, determine which variant clause (field number in VAR_TYPE,
numbering from 0) is applicable. Returns -1 if none are. */
-int
-ada_which_variant_applies (var_type, outer_type, outer_valaddr)
- struct type *var_type;
- struct type *outer_type;
- char* outer_valaddr;
+int
+ada_which_variant_applies (struct type *var_type, struct type *outer_type,
+ char *outer_valaddr)
{
int others_clause;
int i;
int disp;
- struct type* discrim_type;
- char* discrim_name = ada_variant_discrim_name (var_type);
+ struct type *discrim_type;
+ char *discrim_name = ada_variant_discrim_name (var_type);
LONGEST discrim_val;
disp = 0;
- discrim_type =
+ discrim_type =
ada_lookup_struct_elt_type (outer_type, discrim_name, 1, &disp);
if (discrim_type == NULL)
return -1;
@@ -5934,9 +5741,9 @@ ada_which_variant_applies (var_type, outer_type, outer_valaddr)
return others_clause;
}
+
-
/* Dynamic-Sized Records */
/* Strategy: The type ostensibly attached to a value with dynamic size
@@ -5976,30 +5783,29 @@ ada_which_variant_applies (var_type, outer_type, outer_valaddr)
dereferencing it. Differs from value_ind in its treatment of
dynamic-sized types. */
-struct value*
-ada_value_ind (val0)
- struct value* val0;
+struct value *
+ada_value_ind (struct value *val0)
{
- struct value* val = unwrap_value (value_ind (val0));
+ struct value *val = unwrap_value (value_ind (val0));
return ada_to_fixed_value (VALUE_TYPE (val), 0,
- VALUE_ADDRESS (val) + VALUE_OFFSET (val),
- val);
+ VALUE_ADDRESS (val) + VALUE_OFFSET (val), val);
}
/* The value resulting from dereferencing any "reference to"
* qualifiers on VAL0. */
-static struct value*
-ada_coerce_ref (val0)
- struct value* val0;
-{
- if (TYPE_CODE (VALUE_TYPE (val0)) == TYPE_CODE_REF) {
- struct value* val = val0;
- COERCE_REF (val);
- val = unwrap_value (val);
- return ada_to_fixed_value (VALUE_TYPE (val), 0,
- VALUE_ADDRESS (val) + VALUE_OFFSET (val),
- val);
- } else
+static struct value *
+ada_coerce_ref (struct value *val0)
+{
+ if (TYPE_CODE (VALUE_TYPE (val0)) == TYPE_CODE_REF)
+ {
+ struct value *val = val0;
+ COERCE_REF (val);
+ val = unwrap_value (val);
+ return ada_to_fixed_value (VALUE_TYPE (val), 0,
+ VALUE_ADDRESS (val) + VALUE_OFFSET (val),
+ val);
+ }
+ else
return val0;
}
@@ -6007,9 +5813,7 @@ ada_coerce_ref (val0)
ALIGNMENT (a power of 2). */
static unsigned int
-align_value (off, alignment)
- unsigned int off;
- unsigned int alignment;
+align_value (unsigned int off, unsigned int alignment)
{
return (off + alignment - 1) & ~(alignment - 1);
}
@@ -6018,9 +5822,7 @@ align_value (off, alignment)
type TYPE. */
static unsigned int
-field_offset (type, f)
- struct type *type;
- int f;
+field_offset (struct type *type, int f)
{
int n = TYPE_FIELD_BITPOS (type, f);
/* Kludge (temporary?) to fix problem with dwarf output. */
@@ -6034,34 +5836,31 @@ field_offset (type, f)
/* Return the bit alignment required for field #F of template type TYPE. */
static unsigned int
-field_alignment (type, f)
- struct type *type;
- int f;
+field_alignment (struct type *type, int f)
{
- const char* name = TYPE_FIELD_NAME (type, f);
+ const char *name = TYPE_FIELD_NAME (type, f);
int len = (name == NULL) ? 0 : strlen (name);
int align_offset;
- if (len < 8 || ! isdigit (name[len-1]))
+ if (len < 8 || !isdigit (name[len - 1]))
return TARGET_CHAR_BIT;
- if (isdigit (name[len-2]))
+ if (isdigit (name[len - 2]))
align_offset = len - 2;
else
align_offset = len - 1;
- if (align_offset < 7 || ! STREQN ("___XV", name+align_offset-6, 5))
+ if (align_offset < 7 || !STREQN ("___XV", name + align_offset - 6, 5))
return TARGET_CHAR_BIT;
- return atoi (name+align_offset) * TARGET_CHAR_BIT;
+ return atoi (name + align_offset) * TARGET_CHAR_BIT;
}
/* Find a type named NAME. Ignores ambiguity. */
-struct type*
-ada_find_any_type (name)
- const char *name;
+struct type *
+ada_find_any_type (const char *name)
{
- struct symbol* sym;
+ struct symbol *sym;
sym = standard_lookup (name, VAR_NAMESPACE);
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
@@ -6079,9 +5878,7 @@ ada_find_any_type (name)
that of TYPE1 for purposes of type printing, return non-zero;
otherwise return 0. */
int
-ada_prefer_type (type0, type1)
- struct type* type0;
- struct type* type1;
+ada_prefer_type (struct type *type0, struct type *type1)
{
if (type1 == NULL)
return 1;
@@ -6093,9 +5890,10 @@ ada_prefer_type (type0, type1)
return 0;
else if (ada_is_packed_array_type (type0))
return 1;
- else if (ada_is_array_descriptor (type0) && ! ada_is_array_descriptor (type1))
+ else if (ada_is_array_descriptor (type0)
+ && !ada_is_array_descriptor (type1))
return 1;
- else if (ada_renaming_type (type0) != NULL
+ else if (ada_renaming_type (type0) != NULL
&& ada_renaming_type (type1) == NULL)
return 1;
return 0;
@@ -6103,11 +5901,10 @@ ada_prefer_type (type0, type1)
/* The name of TYPE, which is either its TYPE_NAME, or, if that is
null, its TYPE_TAG_NAME. Null if TYPE is null. */
-char*
-ada_type_name (type)
- struct type* type;
+char *
+ada_type_name (struct type *type)
{
- if (type == NULL)
+ if (type == NULL)
return NULL;
else if (TYPE_NAME (type) != NULL)
return TYPE_NAME (type);
@@ -6118,25 +5915,23 @@ ada_type_name (type)
/* Find a parallel type to TYPE whose name is formed by appending
SUFFIX to the name of TYPE. */
-struct type*
-ada_find_parallel_type (type, suffix)
- struct type *type;
- const char *suffix;
+struct type *
+ada_find_parallel_type (struct type *type, const char *suffix)
{
- static char* name;
+ static char *name;
static size_t name_len = 0;
- struct symbol** syms;
- struct block** blocks;
+ struct symbol **syms;
+ struct block **blocks;
int nsyms;
int len;
- char* typename = ada_type_name (type);
-
+ char *typename = ada_type_name (type);
+
if (typename == NULL)
return NULL;
len = strlen (typename);
- GROW_VECT (name, name_len, len+strlen (suffix)+1);
+ GROW_VECT (name, name_len, len + strlen (suffix) + 1);
strcpy (name, typename);
strcpy (name + len, suffix);
@@ -6148,16 +5943,15 @@ ada_find_parallel_type (type, suffix)
/* If TYPE is a variable-size record type, return the corresponding template
type describing its fields. Otherwise, return NULL. */
-static struct type*
-dynamic_template_type (type)
- struct type* type;
+static struct type *
+dynamic_template_type (struct type *type)
{
CHECK_TYPEDEF (type);
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT
- || ada_type_name (type) == NULL)
+ || ada_type_name (type) == NULL)
return NULL;
- else
+ else
{
int len = strlen (ada_type_name (type));
if (len > 6 && STREQ (ada_type_name (type) + len - 6, "___XVE"))
@@ -6170,13 +5964,11 @@ dynamic_template_type (type)
/* Assuming that TEMPL_TYPE is a union or struct type, returns
non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size. */
-static int
-is_dynamic_field (templ_type, field_num)
- struct type* templ_type;
- int field_num;
+static int
+is_dynamic_field (struct type *templ_type, int field_num)
{
const char *name = TYPE_FIELD_NAME (templ_type, field_num);
- return name != NULL
+ return name != NULL
&& TYPE_CODE (TYPE_FIELD_TYPE (templ_type, field_num)) == TYPE_CODE_PTR
&& strstr (name, "___XVL") != NULL;
}
@@ -6184,9 +5976,8 @@ is_dynamic_field (templ_type, field_num)
/* Assuming that TYPE is a struct type, returns non-zero iff TYPE
contains a variant part. */
-static int
-contains_variant_part (type)
- struct type* type;
+static int
+contains_variant_part (struct type *type)
{
int f;
@@ -6197,11 +5988,10 @@ contains_variant_part (type)
}
/* A record type with no fields, . */
-static struct type*
-empty_record (objfile)
- struct objfile* objfile;
+static struct type *
+empty_record (struct objfile *objfile)
{
- struct type* type = alloc_type (objfile);
+ struct type *type = alloc_type (objfile);
TYPE_CODE (type) = TYPE_CODE_STRUCT;
TYPE_NFIELDS (type) = 0;
TYPE_FIELDS (type) = NULL;
@@ -6224,17 +6014,13 @@ empty_record (objfile)
* variants occupy whole numbers of bytes. However, they need not be
* byte-aligned. */
-static struct type*
-template_to_fixed_record_type (type, valaddr, address, dval0)
- struct type* type;
- char* valaddr;
- CORE_ADDR address;
- struct value* dval0;
-
+static struct type *
+template_to_fixed_record_type (struct type *type, char *valaddr,
+ CORE_ADDR address, struct value *dval0)
{
- struct value* mark = value_mark();
- struct value* dval;
- struct type* rtype;
+ struct value *mark = value_mark ();
+ struct value *dval;
+ struct type *rtype;
int nfields, bit_len;
long off;
int f;
@@ -6244,44 +6030,44 @@ template_to_fixed_record_type (type, valaddr, address, dval0)
TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
INIT_CPLUS_SPECIFIC (rtype);
TYPE_NFIELDS (rtype) = nfields;
- TYPE_FIELDS (rtype) = (struct field*)
+ TYPE_FIELDS (rtype) = (struct field *)
TYPE_ALLOC (rtype, nfields * sizeof (struct field));
memset (TYPE_FIELDS (rtype), 0, sizeof (struct field) * nfields);
TYPE_NAME (rtype) = ada_type_name (type);
TYPE_TAG_NAME (rtype) = NULL;
/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in
- gdbtypes.h */
- /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE;*/
+ gdbtypes.h */
+ /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */
- off = 0; bit_len = 0;
+ off = 0;
+ bit_len = 0;
for (f = 0; f < nfields; f += 1)
{
int fld_bit_len, bit_incr;
- off =
- align_value (off, field_alignment (type, f))+TYPE_FIELD_BITPOS (type,f);
+ off =
+ align_value (off,
+ field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f);
/* NOTE: used to use field_offset above, but that causes
* problems with really negative bit positions. So, let's
* rediscover why we needed field_offset and fix it properly. */
TYPE_FIELD_BITPOS (rtype, f) = off;
- TYPE_FIELD_BITSIZE (rtype, f) = 0;
+ TYPE_FIELD_BITSIZE (rtype, f) = 0;
- if (ada_is_variant_part (type, f))
+ if (ada_is_variant_part (type, f))
{
struct type *branch_type;
if (dval0 == NULL)
- dval =
- value_from_contents_and_address (rtype, valaddr, address);
+ dval = value_from_contents_and_address (rtype, valaddr, address);
else
dval = dval0;
- branch_type =
- to_fixed_variant_branch_type
- (TYPE_FIELD_TYPE (type, f),
- cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
- cond_offset_target (address, off / TARGET_CHAR_BIT),
- dval);
- if (branch_type == NULL)
+ branch_type =
+ to_fixed_variant_branch_type
+ (TYPE_FIELD_TYPE (type, f),
+ cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
+ cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
+ if (branch_type == NULL)
TYPE_NFIELDS (rtype) -= 1;
else
{
@@ -6295,18 +6081,16 @@ template_to_fixed_record_type (type, valaddr, address, dval0)
else if (is_dynamic_field (type, f))
{
if (dval0 == NULL)
- dval =
- value_from_contents_and_address (rtype, valaddr, address);
+ dval = value_from_contents_and_address (rtype, valaddr, address);
else
dval = dval0;
- TYPE_FIELD_TYPE (rtype, f) =
- ada_to_fixed_type
- (ada_get_base_type
- (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))),
- cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
- cond_offset_target (address, off / TARGET_CHAR_BIT),
- dval);
+ TYPE_FIELD_TYPE (rtype, f) =
+ ada_to_fixed_type
+ (ada_get_base_type
+ (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))),
+ cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
+ cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
bit_incr = fld_bit_len =
TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT;
@@ -6316,7 +6100,7 @@ template_to_fixed_record_type (type, valaddr, address, dval0)
TYPE_FIELD_TYPE (rtype, f) = TYPE_FIELD_TYPE (type, f);
TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
if (TYPE_FIELD_BITSIZE (type, f) > 0)
- bit_incr = fld_bit_len =
+ bit_incr = fld_bit_len =
TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f);
else
bit_incr = fld_bit_len =
@@ -6330,7 +6114,7 @@ template_to_fixed_record_type (type, valaddr, address, dval0)
TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), TYPE_LENGTH (type));
value_free_to_mark (mark);
- if (TYPE_LENGTH (rtype) > varsize_limit)
+ if (TYPE_LENGTH (rtype) > varsize_limit)
error ("record type with dynamic size is larger than varsize-limit");
return rtype;
}
@@ -6342,9 +6126,8 @@ template_to_fixed_record_type (type, valaddr, address, dval0)
Representation note: to save space, we memoize the result of this
function in the TYPE_TARGET_TYPE of the template type. */
-static struct type*
-template_to_static_fixed_type (templ_type)
- struct type* templ_type;
+static struct type *
+template_to_static_fixed_type (struct type *templ_type)
{
struct type *type;
int nfields;
@@ -6354,34 +6137,35 @@ template_to_static_fixed_type (templ_type)
return TYPE_TARGET_TYPE (templ_type);
nfields = TYPE_NFIELDS (templ_type);
- TYPE_TARGET_TYPE (templ_type) = type = alloc_type (TYPE_OBJFILE (templ_type));
+ TYPE_TARGET_TYPE (templ_type) = type =
+ alloc_type (TYPE_OBJFILE (templ_type));
TYPE_CODE (type) = TYPE_CODE (templ_type);
INIT_CPLUS_SPECIFIC (type);
TYPE_NFIELDS (type) = nfields;
- TYPE_FIELDS (type) = (struct field*)
+ TYPE_FIELDS (type) = (struct field *)
TYPE_ALLOC (type, nfields * sizeof (struct field));
memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nfields);
TYPE_NAME (type) = ada_type_name (templ_type);
TYPE_TAG_NAME (type) = NULL;
- /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
+ /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* TYPE_FLAGS (type) |= TYPE_FLAG_FIXED_INSTANCE; */
TYPE_LENGTH (type) = 0;
for (f = 0; f < nfields; f += 1)
{
TYPE_FIELD_BITPOS (type, f) = 0;
- TYPE_FIELD_BITSIZE (type, f) = 0;
+ TYPE_FIELD_BITSIZE (type, f) = 0;
if (is_dynamic_field (templ_type, f))
{
- TYPE_FIELD_TYPE (type, f) =
- to_static_fixed_type (TYPE_TARGET_TYPE
+ TYPE_FIELD_TYPE (type, f) =
+ to_static_fixed_type (TYPE_TARGET_TYPE
(TYPE_FIELD_TYPE (templ_type, f)));
TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f);
}
else
{
- TYPE_FIELD_TYPE (type, f) =
+ TYPE_FIELD_TYPE (type, f) =
check_typedef (TYPE_FIELD_TYPE (templ_type, f));
TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f);
}
@@ -6393,15 +6177,12 @@ template_to_static_fixed_type (templ_type)
/* A revision of TYPE0 -- a non-dynamic-sized record with a variant
part -- in which the variant part is replaced with the appropriate
branch. */
-static struct type*
-to_record_with_fixed_variant_part (type, valaddr, address, dval)
- struct type* type;
- char* valaddr;
- CORE_ADDR address;
- struct value* dval;
-{
- struct value* mark = value_mark();
- struct type* rtype;
+static struct type *
+to_record_with_fixed_variant_part (struct type *type, char *valaddr,
+ CORE_ADDR address, struct value *dval)
+{
+ struct value *mark = value_mark ();
+ struct type *rtype;
struct type *branch_type;
int nfields = TYPE_NFIELDS (type);
@@ -6412,38 +6193,41 @@ to_record_with_fixed_variant_part (type, valaddr, address, dval)
TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
INIT_CPLUS_SPECIFIC (type);
TYPE_NFIELDS (rtype) = TYPE_NFIELDS (type);
- TYPE_FIELDS (rtype) =
- (struct field*) TYPE_ALLOC (rtype, nfields * sizeof (struct field));
- memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type),
+ TYPE_FIELDS (rtype) =
+ (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field));
+ memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type),
sizeof (struct field) * nfields);
TYPE_NAME (rtype) = ada_type_name (type);
TYPE_TAG_NAME (rtype) = NULL;
- /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
+ /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */
TYPE_LENGTH (rtype) = TYPE_LENGTH (type);
- branch_type =
- to_fixed_variant_branch_type
- (TYPE_FIELD_TYPE (type, nfields - 1),
- cond_offset_host (valaddr,
- TYPE_FIELD_BITPOS (type, nfields-1) / TARGET_CHAR_BIT),
- cond_offset_target (address,
- TYPE_FIELD_BITPOS (type, nfields-1) / TARGET_CHAR_BIT),
- dval);
- if (branch_type == NULL)
+ branch_type =
+ to_fixed_variant_branch_type
+ (TYPE_FIELD_TYPE (type, nfields - 1),
+ cond_offset_host (valaddr,
+ TYPE_FIELD_BITPOS (type,
+ nfields - 1) / TARGET_CHAR_BIT),
+ cond_offset_target (address,
+ TYPE_FIELD_BITPOS (type,
+ nfields - 1) / TARGET_CHAR_BIT),
+ dval);
+ if (branch_type == NULL)
{
TYPE_NFIELDS (rtype) -= 1;
- TYPE_LENGTH (rtype) -= TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
+ TYPE_LENGTH (rtype) -=
+ TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
}
else
{
- TYPE_FIELD_TYPE (rtype, nfields-1) = branch_type;
- TYPE_FIELD_NAME (rtype, nfields-1) = "S";
- TYPE_FIELD_BITSIZE (rtype, nfields-1) = 0;
+ TYPE_FIELD_TYPE (rtype, nfields - 1) = branch_type;
+ TYPE_FIELD_NAME (rtype, nfields - 1) = "S";
+ TYPE_FIELD_BITSIZE (rtype, nfields - 1) = 0;
TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type);
- - TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
+ -TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
}
-
+
return rtype;
}
@@ -6453,22 +6237,19 @@ to_record_with_fixed_variant_part (type, valaddr, address, dval)
should be in DVAL, a record value; it should be NULL if the object
at ADDR itself contains any necessary discriminant values. A
variant field (unless unchecked) is replaced by a particular branch
- of the variant. */
+ of the variant. */
-static struct type*
-to_fixed_record_type (type0, valaddr, address, dval)
- struct type* type0;
- char* valaddr;
- CORE_ADDR address;
- struct value* dval;
+static struct type *
+to_fixed_record_type (struct type *type0, char *valaddr, CORE_ADDR address,
+ struct value *dval)
{
- struct type* templ_type;
+ struct type *templ_type;
/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
- return type0;
- */
- templ_type = dynamic_template_type (type0);
+ return type0;
+ */
+ templ_type = dynamic_template_type (type0);
if (templ_type != NULL)
return template_to_fixed_record_type (templ_type, valaddr, address, dval);
@@ -6476,7 +6257,7 @@ to_fixed_record_type (type0, valaddr, address, dval)
return to_record_with_fixed_variant_part (type0, valaddr, address, dval);
else
{
- /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
+ /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* TYPE_FLAGS (type0) |= TYPE_FLAG_FIXED_INSTANCE; */
return type0;
}
@@ -6490,20 +6271,17 @@ to_fixed_record_type (type0, valaddr, address, dval)
branch of the union at ADDR according to the discriminant value
indicated in the union's type name. */
-static struct type*
-to_fixed_variant_branch_type (var_type0, valaddr, address, dval)
- struct type* var_type0;
- char* valaddr;
- CORE_ADDR address;
- struct value* dval;
+static struct type *
+to_fixed_variant_branch_type (struct type *var_type0, char *valaddr,
+ CORE_ADDR address, struct value *dval)
{
int which;
- struct type* templ_type;
- struct type* var_type;
+ struct type *templ_type;
+ struct type *var_type;
if (TYPE_CODE (var_type0) == TYPE_CODE_PTR)
var_type = TYPE_TARGET_TYPE (var_type0);
- else
+ else
var_type = var_type0;
templ_type = ada_find_parallel_type (var_type, "___XVU");
@@ -6511,21 +6289,21 @@ to_fixed_variant_branch_type (var_type0, valaddr, address, dval)
if (templ_type != NULL)
var_type = templ_type;
- which =
- ada_which_variant_applies (var_type,
+ which =
+ ada_which_variant_applies (var_type,
VALUE_TYPE (dval), VALUE_CONTENTS (dval));
if (which < 0)
return empty_record (TYPE_OBJFILE (var_type));
else if (is_dynamic_field (var_type, which))
- return
- to_fixed_record_type
- (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)),
- valaddr, address, dval);
+ return
+ to_fixed_record_type
+ (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)),
+ valaddr, address, dval);
else if (contains_variant_part (TYPE_FIELD_TYPE (var_type, which)))
- return
- to_fixed_record_type
- (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval);
+ return
+ to_fixed_record_type
+ (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval);
else
return TYPE_FIELD_TYPE (var_type, which);
}
@@ -6539,19 +6317,17 @@ to_fixed_variant_branch_type (var_type0, valaddr, address, dval)
varsize_limit.
*/
-static struct type*
-to_fixed_array_type (type0, dval, ignore_too_big)
- struct type* type0;
- struct value* dval;
- int ignore_too_big;
+static struct type *
+to_fixed_array_type (struct type *type0, struct value *dval,
+ int ignore_too_big)
{
- struct type* index_type_desc;
- struct type* result;
+ struct type *index_type_desc;
+ struct type *result;
/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
- /* if (ada_is_packed_array_type (type0) /* revisit? */ /*
- || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE))
- return type0;*/
+/* if (ada_is_packed_array_type (type0) /* revisit? *//*
+ || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE))
+ return type0; */
index_type_desc = ada_find_parallel_type (type0, "___XA");
if (index_type_desc == NULL)
@@ -6559,14 +6335,13 @@ to_fixed_array_type (type0, dval, ignore_too_big)
struct type *elt_type0 = check_typedef (TYPE_TARGET_TYPE (type0));
/* NOTE: elt_type---the fixed version of elt_type0---should never
* depend on the contents of the array in properly constructed
- * debugging data. */
- struct type *elt_type =
- ada_to_fixed_type (elt_type0, 0, 0, dval);
+ * debugging data. */
+ struct type *elt_type = ada_to_fixed_type (elt_type0, 0, 0, dval);
if (elt_type0 == elt_type)
result = type0;
else
- result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
+ result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
elt_type, TYPE_INDEX_TYPE (type0));
}
else
@@ -6580,25 +6355,24 @@ to_fixed_array_type (type0, dval, ignore_too_big)
/* NOTE: result---the fixed version of elt_type0---should never
* depend on the contents of the array in properly constructed
- * debugging data. */
- result =
- ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval);
+ * debugging data. */
+ result = ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval);
for (i = TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1)
{
- struct type *range_type =
+ struct type *range_type =
to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i),
dval, TYPE_OBJFILE (type0));
result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
result, range_type);
}
- if (! ignore_too_big && TYPE_LENGTH (result) > varsize_limit)
+ if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit)
error ("array type with dynamic size is larger than varsize-limit");
}
/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* TYPE_FLAGS (result) |= TYPE_FLAG_FIXED_INSTANCE; */
return result;
-}
+}
/* A standard type (containing no dynamically sized components)
@@ -6606,54 +6380,51 @@ to_fixed_array_type (type0, dval, ignore_too_big)
DVAL describes a record containing any discriminants used in TYPE0,
and may be NULL if there are none. */
-struct type*
-ada_to_fixed_type (type, valaddr, address, dval)
- struct type* type;
- char* valaddr;
- CORE_ADDR address;
- struct value* dval;
+struct type *
+ada_to_fixed_type (struct type *type, char *valaddr, CORE_ADDR address,
+ struct value *dval)
{
CHECK_TYPEDEF (type);
- switch (TYPE_CODE (type)) {
- default:
- return type;
- case TYPE_CODE_STRUCT:
- return to_fixed_record_type (type, valaddr, address, NULL);
- case TYPE_CODE_ARRAY:
- return to_fixed_array_type (type, dval, 0);
- case TYPE_CODE_UNION:
- if (dval == NULL)
+ switch (TYPE_CODE (type))
+ {
+ default:
return type;
- else
- return to_fixed_variant_branch_type (type, valaddr, address, dval);
- }
+ case TYPE_CODE_STRUCT:
+ return to_fixed_record_type (type, valaddr, address, NULL);
+ case TYPE_CODE_ARRAY:
+ return to_fixed_array_type (type, dval, 0);
+ case TYPE_CODE_UNION:
+ if (dval == NULL)
+ return type;
+ else
+ return to_fixed_variant_branch_type (type, valaddr, address, dval);
+ }
}
/* A standard (static-sized) type corresponding as well as possible to
TYPE0, but based on no runtime data. */
-static struct type*
-to_static_fixed_type (type0)
- struct type* type0;
+static struct type *
+to_static_fixed_type (struct type *type0)
{
- struct type* type;
+ struct type *type;
if (type0 == NULL)
return NULL;
/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
/* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
- return type0;
- */
+ return type0;
+ */
CHECK_TYPEDEF (type0);
-
+
switch (TYPE_CODE (type0))
{
default:
return type0;
case TYPE_CODE_STRUCT:
type = dynamic_template_type (type0);
- if (type != NULL)
+ if (type != NULL)
return template_to_static_fixed_type (type);
return type0;
case TYPE_CODE_UNION:
@@ -6665,22 +6436,21 @@ to_static_fixed_type (type0)
}
/* A static approximation of TYPE with all type wrappers removed. */
-static struct type*
-static_unwrap_type (type)
- struct type* type;
+static struct type *
+static_unwrap_type (struct type *type)
{
if (ada_is_aligner_type (type))
{
- struct type* type1 = TYPE_FIELD_TYPE (check_typedef (type), 0);
+ struct type *type1 = TYPE_FIELD_TYPE (check_typedef (type), 0);
if (ada_type_name (type1) == NULL)
TYPE_NAME (type1) = ada_type_name (type);
return static_unwrap_type (type1);
}
- else
+ else
{
- struct type* raw_real_type = ada_get_base_type (type);
- if (raw_real_type == type)
+ struct type *raw_real_type = ada_get_base_type (type);
+ if (raw_real_type == type)
return type;
else
return to_static_fixed_type (raw_real_type);
@@ -6700,19 +6470,18 @@ static_unwrap_type (type)
/* A type equivalent to TYPE that is not a non-record stub, if one
exists, otherwise TYPE. */
-struct type*
-ada_completed_type (type)
- struct type* type;
+struct type *
+ada_completed_type (struct type *type)
{
CHECK_TYPEDEF (type);
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
|| (TYPE_FLAGS (type) & TYPE_FLAG_STUB) == 0
|| TYPE_TAG_NAME (type) == NULL)
return type;
- else
+ else
{
- char* name = TYPE_TAG_NAME (type);
- struct type* type1 = ada_find_any_type (name);
+ char *name = TYPE_TAG_NAME (type);
+ struct type *type1 = ada_find_any_type (name);
return (type1 == NULL) ? type : type1;
}
}
@@ -6721,19 +6490,17 @@ ada_completed_type (type)
type TYPE0, but with a standard (static-sized) type that correctly
describes it. If VAL0 is not NULL and TYPE0 already is a standard
type, then return VAL0 [this feature is simply to avoid redundant
- creation of struct values]. */
+ creation of struct values]. */
-struct value*
-ada_to_fixed_value (type0, valaddr, address, val0)
- struct type* type0;
- char* valaddr;
- CORE_ADDR address;
- struct value* val0;
+struct value *
+ada_to_fixed_value (struct type *type0, char *valaddr, CORE_ADDR address,
+ struct value *val0)
{
- struct type* type = ada_to_fixed_type (type0, valaddr, address, NULL);
+ struct type *type = ada_to_fixed_type (type0, valaddr, address, NULL);
if (type == type0 && val0 != NULL)
return val0;
- else return value_from_contents_and_address (type, valaddr, address);
+ else
+ return value_from_contents_and_address (type, valaddr, address);
}
/* A value representing VAL, but with a standard (static-sized) type
@@ -6741,20 +6508,19 @@ ada_to_fixed_value (type0, valaddr, address, val0)
without consulting any runtime values. For Ada dynamic-sized
types, therefore, the type of the result is likely to be inaccurate. */
-struct value*
-ada_to_static_fixed_value (val)
- struct value* val;
+struct value *
+ada_to_static_fixed_value (struct value *val)
{
- struct type *type =
+ struct type *type =
to_static_fixed_type (static_unwrap_type (VALUE_TYPE (val)));
if (type == VALUE_TYPE (val))
return val;
else
return coerce_unspec_val_to_type (val, 0, type);
}
+
-
/* Attributes */
@@ -6762,26 +6528,24 @@ ada_to_static_fixed_value (val)
/* Table mapping attribute numbers to names */
/* NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h */
-static const char* attribute_names[] = {
+static const char *attribute_names[] = {
"<?>",
- "first",
+ "first",
"last",
"length",
"image",
"img",
"max",
"min",
- "pos"
- "tag",
+ "pos" "tag",
"val",
0
};
-const char*
-ada_attribute_name (n)
- int n;
+const char *
+ada_attribute_name (int n)
{
if (n > 0 && n < (int) ATR_END)
return attribute_names[n];
@@ -6791,13 +6555,12 @@ ada_attribute_name (n)
/* Evaluate the 'POS attribute applied to ARG. */
-static struct value*
-value_pos_atr (arg)
- struct value* arg;
+static struct value *
+value_pos_atr (struct value *arg)
{
struct type *type = VALUE_TYPE (arg);
- if (! discrete_type_p (type))
+ if (!discrete_type_p (type))
error ("'POS only defined on discrete types");
if (TYPE_CODE (type) == TYPE_CODE_ENUM)
@@ -6805,7 +6568,7 @@ value_pos_atr (arg)
int i;
LONGEST v = value_as_long (arg);
- for (i = 0; i < TYPE_NFIELDS (type); i += 1)
+ for (i = 0; i < TYPE_NFIELDS (type); i += 1)
{
if (v == TYPE_FIELD_BITPOS (type, i))
return value_from_longest (builtin_type_ada_int, i);
@@ -6818,14 +6581,12 @@ value_pos_atr (arg)
/* Evaluate the TYPE'VAL attribute applied to ARG. */
-static struct value*
-value_val_atr (type, arg)
- struct type *type;
- struct value* arg;
+static struct value *
+value_val_atr (struct type *type, struct value *arg)
{
- if (! discrete_type_p (type))
+ if (!discrete_type_p (type))
error ("'VAL only defined on discrete types");
- if (! integer_type_p (VALUE_TYPE (arg)))
+ if (!integer_type_p (VALUE_TYPE (arg)))
error ("'VAL requires integral argument");
if (TYPE_CODE (type) == TYPE_CODE_ENUM)
@@ -6833,28 +6594,26 @@ value_val_atr (type, arg)
long pos = value_as_long (arg);
if (pos < 0 || pos >= TYPE_NFIELDS (type))
error ("argument to 'VAL out of range");
- return
- value_from_longest (type, TYPE_FIELD_BITPOS (type, pos));
+ return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos));
}
else
return value_from_longest (type, value_as_long (arg));
}
-
+
/* Evaluation */
/* True if TYPE appears to be an Ada character type.
* [At the moment, this is true only for Character and Wide_Character;
* It is a heuristic test that could stand improvement]. */
-int
-ada_is_character_type (type)
- struct type* type;
+int
+ada_is_character_type (struct type *type)
{
- const char* name = ada_type_name (type);
- return
+ const char *name = ada_type_name (type);
+ return
name != NULL
- && (TYPE_CODE (type) == TYPE_CODE_CHAR
+ && (TYPE_CODE (type) == TYPE_CODE_CHAR
|| TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_RANGE)
&& (STREQ (name, "character") || STREQ (name, "wide_character")
@@ -6864,11 +6623,10 @@ ada_is_character_type (type)
/* True if TYPE appears to be an Ada string type. */
int
-ada_is_string_type (type)
- struct type *type;
+ada_is_string_type (struct type *type)
{
CHECK_TYPEDEF (type);
- if (type != NULL
+ if (type != NULL
&& TYPE_CODE (type) != TYPE_CODE_PTR
&& (ada_is_simple_array (type) || ada_is_array_descriptor (type))
&& ada_array_arity (type) == 1)
@@ -6877,7 +6635,7 @@ ada_is_string_type (type)
return ada_is_character_type (elttype);
}
- else
+ else
return 0;
}
@@ -6887,8 +6645,7 @@ ada_is_string_type (type)
distinctive name. */
int
-ada_is_aligner_type (type)
- struct type *type;
+ada_is_aligner_type (struct type *type)
{
CHECK_TYPEDEF (type);
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
@@ -6899,35 +6656,33 @@ ada_is_aligner_type (type)
/* If there is an ___XVS-convention type parallel to SUBTYPE, return
the parallel type. */
-struct type*
-ada_get_base_type (raw_type)
- struct type* raw_type;
+struct type *
+ada_get_base_type (struct type *raw_type)
{
- struct type* real_type_namer;
- struct type* raw_real_type;
- struct type* real_type;
+ struct type *real_type_namer;
+ struct type *raw_real_type;
+ struct type *real_type;
if (raw_type == NULL || TYPE_CODE (raw_type) != TYPE_CODE_STRUCT)
return raw_type;
real_type_namer = ada_find_parallel_type (raw_type, "___XVS");
- if (real_type_namer == NULL
+ if (real_type_namer == NULL
|| TYPE_CODE (real_type_namer) != TYPE_CODE_STRUCT
|| TYPE_NFIELDS (real_type_namer) != 1)
return raw_type;
raw_real_type = ada_find_any_type (TYPE_FIELD_NAME (real_type_namer, 0));
- if (raw_real_type == NULL)
+ if (raw_real_type == NULL)
return raw_type;
else
return raw_real_type;
-}
+}
/* The type of value designated by TYPE, with all aligners removed. */
-struct type*
-ada_aligned_type (type)
- struct type* type;
+struct type *
+ada_aligned_type (struct type *type)
{
if (ada_is_aligner_type (type))
return ada_aligned_type (TYPE_FIELD_TYPE (type, 0));
@@ -6939,33 +6694,31 @@ ada_aligned_type (type)
/* The address of the aligned value in an object at address VALADDR
having type TYPE. Assumes ada_is_aligner_type (TYPE). */
-char*
-ada_aligned_value_addr (type, valaddr)
- struct type *type;
- char *valaddr;
+char *
+ada_aligned_value_addr (struct type *type, char *valaddr)
{
- if (ada_is_aligner_type (type))
+ if (ada_is_aligner_type (type))
return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0),
- valaddr +
- TYPE_FIELD_BITPOS (type, 0)/TARGET_CHAR_BIT);
+ valaddr +
+ TYPE_FIELD_BITPOS (type,
+ 0) / TARGET_CHAR_BIT);
else
return valaddr;
}
/* The printed representation of an enumeration literal with encoded
name NAME. The value is good to the next call of ada_enum_name. */
-const char*
-ada_enum_name (name)
- const char* name;
+const char *
+ada_enum_name (const char *name)
{
- char* tmp;
+ char *tmp;
- while (1)
+ while (1)
{
if ((tmp = strstr (name, "__")) != NULL)
- name = tmp+2;
+ name = tmp + 2;
else if ((tmp = strchr (name, '.')) != NULL)
- name = tmp+1;
+ name = tmp + 1;
else
break;
}
@@ -6976,7 +6729,7 @@ ada_enum_name (name)
int v;
if (name[1] == 'U' || name[1] == 'W')
{
- if (sscanf (name+2, "%x", &v) != 1)
+ if (sscanf (name + 2, "%x", &v) != 1)
return name;
}
else
@@ -6991,16 +6744,13 @@ ada_enum_name (name)
return result;
}
- else
+ else
return name;
}
-static struct value*
-evaluate_subexp (expect_type, exp, pos, noside)
- struct type *expect_type;
- struct expression *exp;
- int *pos;
- enum noside noside;
+static struct value *
+evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos,
+ enum noside noside)
{
return (*exp->language_defn->evaluate_exp) (expect_type, exp, pos, noside);
}
@@ -7009,65 +6759,60 @@ evaluate_subexp (expect_type, exp, pos, noside)
evaluate_type, updating *POS to point just past the evaluated
expression. */
-static struct value*
-evaluate_subexp_type (exp, pos)
- struct expression* exp;
- int* pos;
+static struct value *
+evaluate_subexp_type (struct expression *exp, int *pos)
{
- return (*exp->language_defn->evaluate_exp)
+ return (*exp->language_defn->evaluate_exp)
(NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
}
/* If VAL is wrapped in an aligner or subtype wrapper, return the
- value it wraps. */
+ value it wraps. */
-static struct value*
-unwrap_value (val)
- struct value* val;
+static struct value *
+unwrap_value (struct value *val)
{
- struct type* type = check_typedef (VALUE_TYPE (val));
+ struct type *type = check_typedef (VALUE_TYPE (val));
if (ada_is_aligner_type (type))
{
- struct value* v = value_struct_elt (&val, NULL, "F",
- NULL, "internal structure");
- struct type* val_type = check_typedef (VALUE_TYPE (v));
+ struct value *v = value_struct_elt (&val, NULL, "F",
+ NULL, "internal structure");
+ struct type *val_type = check_typedef (VALUE_TYPE (v));
if (ada_type_name (val_type) == NULL)
TYPE_NAME (val_type) = ada_type_name (type);
return unwrap_value (v);
}
- else
+ else
{
- struct type* raw_real_type =
+ struct type *raw_real_type =
ada_completed_type (ada_get_base_type (type));
-
+
if (type == raw_real_type)
return val;
- return
- coerce_unspec_val_to_type
+ return
+ coerce_unspec_val_to_type
(val, 0, ada_to_fixed_type (raw_real_type, 0,
VALUE_ADDRESS (val) + VALUE_OFFSET (val),
NULL));
}
}
-
-static struct value*
-cast_to_fixed (type, arg)
- struct type *type;
- struct value* arg;
+
+static struct value *
+cast_to_fixed (struct type *type, struct value *arg)
{
LONGEST val;
if (type == VALUE_TYPE (arg))
return arg;
else if (ada_is_fixed_point_type (VALUE_TYPE (arg)))
- val = ada_float_to_fixed (type,
+ val = ada_float_to_fixed (type,
ada_fixed_to_float (VALUE_TYPE (arg),
value_as_long (arg)));
- else
+ else
{
- DOUBLEST argd =
+ DOUBLEST argd =
value_as_double (value_cast (builtin_type_double, value_copy (arg)));
val = ada_float_to_fixed (type, argd);
}
@@ -7075,9 +6820,8 @@ cast_to_fixed (type, arg)
return value_from_longest (type, val);
}
-static struct value*
-cast_from_fixed_to_double (arg)
- struct value* arg;
+static struct value *
+cast_from_fixed_to_double (struct value *arg)
{
DOUBLEST val = ada_fixed_to_float (VALUE_TYPE (arg),
value_as_long (arg));
@@ -7086,42 +6830,38 @@ cast_from_fixed_to_double (arg)
/* Coerce VAL as necessary for assignment to an lval of type TYPE, and
* return the converted value. */
-static struct value*
-coerce_for_assign (type, val)
- struct type* type;
- struct value* val;
+static struct value *
+coerce_for_assign (struct type *type, struct value *val)
{
- struct type* type2 = VALUE_TYPE (val);
+ struct type *type2 = VALUE_TYPE (val);
if (type == type2)
return val;
CHECK_TYPEDEF (type2);
CHECK_TYPEDEF (type);
- if (TYPE_CODE (type2) == TYPE_CODE_PTR && TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ if (TYPE_CODE (type2) == TYPE_CODE_PTR
+ && TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
val = ada_value_ind (val);
type2 = VALUE_TYPE (val);
}
- if (TYPE_CODE (type2) == TYPE_CODE_ARRAY
+ if (TYPE_CODE (type2) == TYPE_CODE_ARRAY
&& TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
if (TYPE_LENGTH (type2) != TYPE_LENGTH (type)
|| TYPE_LENGTH (TYPE_TARGET_TYPE (type2))
- != TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
+ != TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
error ("Incompatible types in assignment");
VALUE_TYPE (val) = type;
}
- return val;
+ return val;
}
-struct value*
-ada_evaluate_subexp (expect_type, exp, pos, noside)
- struct type *expect_type;
- struct expression *exp;
- int *pos;
- enum noside noside;
+struct value *
+ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
enum exp_opcode op;
enum ada_attribute atr;
@@ -7130,16 +6870,19 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
struct value *arg1 = NULL, *arg2 = NULL, *arg3;
struct type *type;
int nargs;
- struct value* *argvec;
+ struct value **argvec;
- pc = *pos; *pos += 1;
+ pc = *pos;
+ *pos += 1;
op = exp->elts[pc].opcode;
- switch (op)
+ switch (op)
{
default:
*pos -= 1;
- return unwrap_value (evaluate_subexp_standard (expect_type, exp, pos, noside));
+ return
+ unwrap_value (evaluate_subexp_standard
+ (expect_type, exp, pos, noside));
case UNOP_CAST:
(*pos) += 2;
@@ -7153,30 +6896,30 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
arg1 = cast_to_fixed (type, arg1);
else if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
arg1 = value_cast (type, cast_from_fixed_to_double (arg1));
- else if (VALUE_LVAL (arg1) == lval_memory)
+ else if (VALUE_LVAL (arg1) == lval_memory)
{
/* This is in case of the really obscure (and undocumented,
- but apparently expected) case of (Foo) Bar.all, where Bar
- is an integer constant and Foo is a dynamic-sized type.
- If we don't do this, ARG1 will simply be relabeled with
- TYPE. */
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ but apparently expected) case of (Foo) Bar.all, where Bar
+ is an integer constant and Foo is a dynamic-sized type.
+ If we don't do this, ARG1 will simply be relabeled with
+ TYPE. */
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (to_static_fixed_type (type), not_lval);
- arg1 =
- ada_to_fixed_value
- (type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0);
+ arg1 =
+ ada_to_fixed_value
+ (type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0);
}
- else
- arg1 = value_cast (type, arg1);
+ else
+ arg1 = value_cast (type, arg1);
}
return arg1;
/* FIXME: UNOP_QUAL should be defined in expression.h */
/* case UNOP_QUAL:
- (*pos) += 2;
- type = exp->elts[pc + 1].type;
- return ada_evaluate_subexp (type, exp, pos, noside);
- */
+ (*pos) += 2;
+ type = exp->elts[pc + 1].type;
+ return ada_evaluate_subexp (type, exp, pos, noside);
+ */
case BINOP_ASSIGN:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
@@ -7184,13 +6927,14 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
return arg1;
if (binop_user_defined_p (op, arg1, arg2))
return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL);
- else
+ else
{
if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
arg2 = cast_to_fixed (VALUE_TYPE (arg1), arg2);
else if (ada_is_fixed_point_type (VALUE_TYPE (arg2)))
- error ("Fixed-point values must be assigned to fixed-point variables");
- else
+ error
+ ("Fixed-point values must be assigned to fixed-point variables");
+ else
arg2 = coerce_for_assign (VALUE_TYPE (arg1), arg2);
return ada_value_assign (arg1, arg2);
}
@@ -7207,7 +6951,8 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
|| ada_is_fixed_point_type (VALUE_TYPE (arg2)))
&& VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
- error ("Operands of fixed-point addition must have the same type");
+ error
+ ("Operands of fixed-point addition must have the same type");
return value_cast (VALUE_TYPE (arg1), value_add (arg1, arg2));
}
@@ -7223,7 +6968,8 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
|| ada_is_fixed_point_type (VALUE_TYPE (arg2)))
&& VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
- error ("Operands of fixed-point subtraction must have the same type");
+ error
+ ("Operands of fixed-point subtraction must have the same type");
return value_cast (VALUE_TYPE (arg1), value_sub (arg1, arg2));
}
@@ -7238,7 +6984,7 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
else
if (noside == EVAL_AVOID_SIDE_EFFECTS
&& (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
- return value_zero (VALUE_TYPE (arg1), not_lval);
+ return value_zero (VALUE_TYPE (arg1), not_lval);
else
{
if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
@@ -7261,38 +7007,39 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
/* case OP_UNRESOLVED_VALUE:
- /* Only encountered when an unresolved symbol occurs in a
+ /* Only encountered when an unresolved symbol occurs in a
context other than a function call, in which case, it is
- illegal. *//*
- (*pos) += 3;
- if (noside == EVAL_SKIP)
- goto nosideret;
- else
- error ("Unexpected unresolved symbol, %s, during evaluation",
- ada_demangle (exp->elts[pc + 2].name));
- */
+ illegal. *//*
+ (*pos) += 3;
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else
+ error ("Unexpected unresolved symbol, %s, during evaluation",
+ ada_demangle (exp->elts[pc + 2].name));
+ */
case OP_VAR_VALUE:
*pos -= 1;
if (noside == EVAL_SKIP)
{
*pos += 4;
goto nosideret;
- }
+ }
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
*pos += 4;
- return value_zero
- (to_static_fixed_type
- (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc+2].symbol))),
+ return value_zero
+ (to_static_fixed_type
+ (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))),
not_lval);
}
- else
+ else
{
- arg1 = unwrap_value (evaluate_subexp_standard (expect_type, exp, pos,
- noside));
+ arg1 =
+ unwrap_value (evaluate_subexp_standard
+ (expect_type, exp, pos, noside));
return ada_to_fixed_value (VALUE_TYPE (arg1), 0,
- VALUE_ADDRESS (arg1) + VALUE_OFFSET(arg1),
- arg1);
+ VALUE_ADDRESS (arg1) +
+ VALUE_OFFSET (arg1), arg1);
}
case OP_ARRAY:
@@ -7302,7 +7049,8 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
nargs = tem3 - tem2 + 1;
type = expect_type ? check_typedef (expect_type) : NULL_TYPE;
- argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1));
+ argvec =
+ (struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
for (tem = 0; tem == 0 || tem < nargs; tem += 1)
/* At least one element gets inserted for the type */
{
@@ -7317,17 +7065,18 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
(*pos) += 2;
/* Allocate arg vector, including space for the function to be
- called in argvec[0] and a terminating NULL */
+ called in argvec[0] and a terminating NULL */
nargs = longest_to_int (exp->elts[pc + 1].longconst);
- argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 2));
+ argvec =
+ (struct value * *) alloca (sizeof (struct value *) * (nargs + 2));
/* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
/* FIXME: name should be defined in expresion.h */
/* if (exp->elts[*pos].opcode == OP_UNRESOLVED_VALUE)
- error ("Unexpected unresolved symbol, %s, during evaluation",
- ada_demangle (exp->elts[pc + 5].name));
- */
- if (0)
+ error ("Unexpected unresolved symbol, %s, during evaluation",
+ ada_demangle (exp->elts[pc + 5].name));
+ */
+ if (0)
{
error ("unexpected code path, FIXME");
}
@@ -7349,7 +7098,7 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
type = check_typedef (VALUE_TYPE (argvec[0]));
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- {
+ {
switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type))))
{
case TYPE_CODE_FUNC:
@@ -7366,53 +7115,55 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
error ("cannot subscript or call something of type `%s'",
ada_type_name (VALUE_TYPE (argvec[0])));
break;
- }
+ }
}
-
+
switch (TYPE_CODE (type))
{
case TYPE_CODE_FUNC:
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (TYPE_TARGET_TYPE (type));
return call_function_by_hand (argvec[0], nargs, argvec + 1);
- case TYPE_CODE_STRUCT:
+ case TYPE_CODE_STRUCT:
{
int arity = ada_array_arity (type);
type = ada_array_element_type (type, nargs);
- if (type == NULL)
+ if (type == NULL)
error ("cannot subscript or call a record");
- if (arity != nargs)
+ if (arity != nargs)
error ("wrong number of subscripts; expecting %d", arity);
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (ada_aligned_type (type));
- return unwrap_value (ada_value_subscript (argvec[0], nargs, argvec+1));
+ return
+ unwrap_value (ada_value_subscript
+ (argvec[0], nargs, argvec + 1));
}
case TYPE_CODE_ARRAY:
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
+ {
type = ada_array_element_type (type, nargs);
if (type == NULL)
error ("element type of array unknown");
else
return allocate_value (ada_aligned_type (type));
}
- return
+ return
unwrap_value (ada_value_subscript
(ada_coerce_to_simple_array (argvec[0]),
- nargs, argvec+1));
- case TYPE_CODE_PTR: /* Pointer to array */
+ nargs, argvec + 1));
+ case TYPE_CODE_PTR: /* Pointer to array */
type = to_fixed_array_type (TYPE_TARGET_TYPE (type), NULL, 1);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
+ {
type = ada_array_element_type (type, nargs);
if (type == NULL)
error ("element type of array unknown");
else
return allocate_value (ada_aligned_type (type));
}
- return
- unwrap_value (ada_value_ptr_subscript (argvec[0], type,
- nargs, argvec+1));
+ return
+ unwrap_value (ada_value_ptr_subscript (argvec[0], type,
+ nargs, argvec + 1));
default:
error ("Internal error in evaluate_subexp");
@@ -7420,47 +7171,46 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
case TERNOP_SLICE:
{
- struct value* array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
int lowbound
= value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
int upper
= value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
if (noside == EVAL_SKIP)
goto nosideret;
-
- /* If this is a reference to an array, then dereference it */
- if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF
- && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
- TYPE_CODE_ARRAY
- && !ada_is_array_descriptor (check_typedef (VALUE_TYPE
- (array))))
- {
- array = ada_coerce_ref (array);
- }
+
+ /* If this is a reference to an array, then dereference it */
+ if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF
+ && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
+ && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
+ TYPE_CODE_ARRAY
+ && !ada_is_array_descriptor (check_typedef (VALUE_TYPE (array))))
+ {
+ array = ada_coerce_ref (array);
+ }
if (noside == EVAL_AVOID_SIDE_EFFECTS &&
ada_is_array_descriptor (check_typedef (VALUE_TYPE (array))))
{
/* Try to dereference the array, in case it is an access to array */
- struct type * arrType = ada_type_of_array (array, 0);
+ struct type *arrType = ada_type_of_array (array, 0);
if (arrType != NULL)
- array = value_at_lazy (arrType, 0, NULL);
+ array = value_at_lazy (arrType, 0, NULL);
}
if (ada_is_array_descriptor (VALUE_TYPE (array)))
array = ada_coerce_to_simple_array (array);
- /* If at this point we have a pointer to an array, it means that
- it is a pointer to a simple (non-ada) array. We just then
- dereference it */
- if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR
- && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
- && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
- TYPE_CODE_ARRAY)
- {
- array = ada_value_ind (array);
- }
-
+ /* If at this point we have a pointer to an array, it means that
+ it is a pointer to a simple (non-ada) array. We just then
+ dereference it */
+ if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR
+ && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
+ && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
+ TYPE_CODE_ARRAY)
+ {
+ array = ada_value_ind (array);
+ }
+
if (noside == EVAL_AVOID_SIDE_EFFECTS)
/* The following will get the bounds wrong, but only in contexts
where the value is not being requested (FIXME?). */
@@ -7471,295 +7221,295 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
/* FIXME: UNOP_MBR should be defined in expression.h */
/* case UNOP_MBR:
- (*pos) += 2;
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- type = exp->elts[pc + 1].type;
-
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- switch (TYPE_CODE (type))
- {
- default:
- warning ("Membership test incompletely implemented; always returns true");
- return value_from_longest (builtin_type_int, (LONGEST) 1);
-
- case TYPE_CODE_RANGE:
- arg2 = value_from_longest (builtin_type_int,
- (LONGEST) TYPE_LOW_BOUND (type));
- arg3 = value_from_longest (builtin_type_int,
- (LONGEST) TYPE_HIGH_BOUND (type));
- return
- value_from_longest (builtin_type_int,
- (value_less (arg1,arg3)
- || value_equal (arg1,arg3))
- && (value_less (arg2,arg1)
- || value_equal (arg2,arg1)));
- }
- */
- /* FIXME: BINOP_MBR should be defined in expression.h */
+ (*pos) += 2;
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ type = exp->elts[pc + 1].type;
+
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ switch (TYPE_CODE (type))
+ {
+ default:
+ warning ("Membership test incompletely implemented; always returns true");
+ return value_from_longest (builtin_type_int, (LONGEST) 1);
+
+ case TYPE_CODE_RANGE:
+ arg2 = value_from_longest (builtin_type_int,
+ (LONGEST) TYPE_LOW_BOUND (type));
+ arg3 = value_from_longest (builtin_type_int,
+ (LONGEST) TYPE_HIGH_BOUND (type));
+ return
+ value_from_longest (builtin_type_int,
+ (value_less (arg1,arg3)
+ || value_equal (arg1,arg3))
+ && (value_less (arg2,arg1)
+ || value_equal (arg2,arg1)));
+ }
+ */
+ /* FIXME: BINOP_MBR should be defined in expression.h */
/* case BINOP_MBR:
- (*pos) += 2;
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ (*pos) += 2;
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
+ if (noside == EVAL_SKIP)
+ goto nosideret;
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (builtin_type_int, not_lval);
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (builtin_type_int, not_lval);
- tem = longest_to_int (exp->elts[pc + 1].longconst);
+ tem = longest_to_int (exp->elts[pc + 1].longconst);
- if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2)))
- error ("invalid dimension number to '%s", "range");
+ if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2)))
+ error ("invalid dimension number to '%s", "range");
- arg3 = ada_array_bound (arg2, tem, 1);
- arg2 = ada_array_bound (arg2, tem, 0);
+ arg3 = ada_array_bound (arg2, tem, 1);
+ arg2 = ada_array_bound (arg2, tem, 0);
- return
- value_from_longest (builtin_type_int,
- (value_less (arg1,arg3)
- || value_equal (arg1,arg3))
- && (value_less (arg2,arg1)
- || value_equal (arg2,arg1)));
- */
+ return
+ value_from_longest (builtin_type_int,
+ (value_less (arg1,arg3)
+ || value_equal (arg1,arg3))
+ && (value_less (arg2,arg1)
+ || value_equal (arg2,arg1)));
+ */
/* FIXME: TERNOP_MBR should be defined in expression.h */
/* case TERNOP_MBR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- return
- value_from_longest (builtin_type_int,
- (value_less (arg1,arg3)
- || value_equal (arg1,arg3))
- && (value_less (arg2,arg1)
- || value_equal (arg2,arg1)));
- */
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ return
+ value_from_longest (builtin_type_int,
+ (value_less (arg1,arg3)
+ || value_equal (arg1,arg3))
+ && (value_less (arg2,arg1)
+ || value_equal (arg2,arg1)));
+ */
/* FIXME: OP_ATTRIBUTE should be defined in expression.h */
/* case OP_ATTRIBUTE:
- *pos += 3;
- atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst);
- switch (atr)
- {
- default:
- error ("unexpected attribute encountered");
-
- case ATR_FIRST:
- case ATR_LAST:
- case ATR_LENGTH:
- {
- struct type* type_arg;
- if (exp->elts[*pos].opcode == OP_TYPE)
- {
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- arg1 = NULL;
- type_arg = exp->elts[pc + 5].type;
- }
- else
- {
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- type_arg = NULL;
- }
-
- if (exp->elts[*pos].opcode != OP_LONG)
- error ("illegal operand to '%s", ada_attribute_name (atr));
- tem = longest_to_int (exp->elts[*pos+2].longconst);
- *pos += 4;
-
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- if (type_arg == NULL)
- {
- arg1 = ada_coerce_ref (arg1);
-
- if (ada_is_packed_array_type (VALUE_TYPE (arg1)))
- arg1 = ada_coerce_to_simple_array (arg1);
-
- if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1)))
- error ("invalid dimension number to '%s",
- ada_attribute_name (atr));
-
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- type = ada_index_type (VALUE_TYPE (arg1), tem);
- if (type == NULL)
- error ("attempt to take bound of something that is not an array");
- return allocate_value (type);
- }
-
- switch (atr)
- {
- default:
- error ("unexpected attribute encountered");
- case ATR_FIRST:
- return ada_array_bound (arg1, tem, 0);
- case ATR_LAST:
- return ada_array_bound (arg1, tem, 1);
- case ATR_LENGTH:
- return ada_array_length (arg1, tem);
- }
- }
- else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE
- || TYPE_CODE (type_arg) == TYPE_CODE_INT)
- {
- struct type* range_type;
- char* name = ada_type_name (type_arg);
- if (name == NULL)
- {
- if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE)
- range_type = type_arg;
- else
- error ("unimplemented type attribute");
- }
- else
- range_type =
- to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg));
- switch (atr)
- {
- default:
- error ("unexpected attribute encountered");
- case ATR_FIRST:
- return value_from_longest (TYPE_TARGET_TYPE (range_type),
- TYPE_LOW_BOUND (range_type));
- case ATR_LAST:
- return value_from_longest (TYPE_TARGET_TYPE (range_type),
- TYPE_HIGH_BOUND (range_type));
- }
- }
- else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM)
- {
- switch (atr)
- {
- default:
- error ("unexpected attribute encountered");
- case ATR_FIRST:
- return value_from_longest
- (type_arg, TYPE_FIELD_BITPOS (type_arg, 0));
- case ATR_LAST:
- return value_from_longest
- (type_arg,
- TYPE_FIELD_BITPOS (type_arg,
- TYPE_NFIELDS (type_arg) - 1));
- }
- }
- else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT)
- error ("unimplemented type attribute");
- else
- {
- LONGEST low, high;
-
- if (ada_is_packed_array_type (type_arg))
- type_arg = decode_packed_array_type (type_arg);
-
- if (tem < 1 || tem > ada_array_arity (type_arg))
- error ("invalid dimension number to '%s",
- ada_attribute_name (atr));
-
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- {
- type = ada_index_type (type_arg, tem);
- if (type == NULL)
- error ("attempt to take bound of something that is not an array");
- return allocate_value (type);
- }
-
- switch (atr)
- {
- default:
- error ("unexpected attribute encountered");
- case ATR_FIRST:
- low = ada_array_bound_from_type (type_arg, tem, 0, &type);
- return value_from_longest (type, low);
- case ATR_LAST:
- high = ada_array_bound_from_type (type_arg, tem, 1, &type);
- return value_from_longest (type, high);
- case ATR_LENGTH:
- low = ada_array_bound_from_type (type_arg, tem, 0, &type);
- high = ada_array_bound_from_type (type_arg, tem, 1, NULL);
- return value_from_longest (type, high-low+1);
- }
- }
- }
-
- case ATR_TAG:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return
- value_zero (ada_tag_type (arg1), not_lval);
-
- return ada_value_tag (arg1);
-
- case ATR_MIN:
- case ATR_MAX:
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (VALUE_TYPE (arg1), not_lval);
- else
- return value_binop (arg1, arg2,
- atr == ATR_MIN ? BINOP_MIN : BINOP_MAX);
-
- case ATR_MODULUS:
- {
- struct type* type_arg = exp->elts[pc + 5].type;
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- *pos += 4;
-
- if (noside == EVAL_SKIP)
- goto nosideret;
-
- if (! ada_is_modular_type (type_arg))
- error ("'modulus must be applied to modular type");
-
- return value_from_longest (TYPE_TARGET_TYPE (type_arg),
- ada_modulus (type_arg));
- }
-
-
- case ATR_POS:
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (builtin_type_ada_int, not_lval);
- else
- return value_pos_atr (arg1);
-
- case ATR_SIZE:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- if (noside == EVAL_SKIP)
- goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (builtin_type_ada_int, not_lval);
- else
- return value_from_longest (builtin_type_ada_int,
- TARGET_CHAR_BIT
- * TYPE_LENGTH (VALUE_TYPE (arg1)));
-
- case ATR_VAL:
- evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
- type = exp->elts[pc + 5].type;
- if (noside == EVAL_SKIP)
- goto nosideret;
- else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (type, not_lval);
- else
- return value_val_atr (type, arg1);
- }*/
+ *pos += 3;
+ atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst);
+ switch (atr)
+ {
+ default:
+ error ("unexpected attribute encountered");
+
+ case ATR_FIRST:
+ case ATR_LAST:
+ case ATR_LENGTH:
+ {
+ struct type* type_arg;
+ if (exp->elts[*pos].opcode == OP_TYPE)
+ {
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+ arg1 = NULL;
+ type_arg = exp->elts[pc + 5].type;
+ }
+ else
+ {
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ type_arg = NULL;
+ }
+
+ if (exp->elts[*pos].opcode != OP_LONG)
+ error ("illegal operand to '%s", ada_attribute_name (atr));
+ tem = longest_to_int (exp->elts[*pos+2].longconst);
+ *pos += 4;
+
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ if (type_arg == NULL)
+ {
+ arg1 = ada_coerce_ref (arg1);
+
+ if (ada_is_packed_array_type (VALUE_TYPE (arg1)))
+ arg1 = ada_coerce_to_simple_array (arg1);
+
+ if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1)))
+ error ("invalid dimension number to '%s",
+ ada_attribute_name (atr));
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ {
+ type = ada_index_type (VALUE_TYPE (arg1), tem);
+ if (type == NULL)
+ error ("attempt to take bound of something that is not an array");
+ return allocate_value (type);
+ }
+
+ switch (atr)
+ {
+ default:
+ error ("unexpected attribute encountered");
+ case ATR_FIRST:
+ return ada_array_bound (arg1, tem, 0);
+ case ATR_LAST:
+ return ada_array_bound (arg1, tem, 1);
+ case ATR_LENGTH:
+ return ada_array_length (arg1, tem);
+ }
+ }
+ else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE
+ || TYPE_CODE (type_arg) == TYPE_CODE_INT)
+ {
+ struct type* range_type;
+ char* name = ada_type_name (type_arg);
+ if (name == NULL)
+ {
+ if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE)
+ range_type = type_arg;
+ else
+ error ("unimplemented type attribute");
+ }
+ else
+ range_type =
+ to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg));
+ switch (atr)
+ {
+ default:
+ error ("unexpected attribute encountered");
+ case ATR_FIRST:
+ return value_from_longest (TYPE_TARGET_TYPE (range_type),
+ TYPE_LOW_BOUND (range_type));
+ case ATR_LAST:
+ return value_from_longest (TYPE_TARGET_TYPE (range_type),
+ TYPE_HIGH_BOUND (range_type));
+ }
+ }
+ else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM)
+ {
+ switch (atr)
+ {
+ default:
+ error ("unexpected attribute encountered");
+ case ATR_FIRST:
+ return value_from_longest
+ (type_arg, TYPE_FIELD_BITPOS (type_arg, 0));
+ case ATR_LAST:
+ return value_from_longest
+ (type_arg,
+ TYPE_FIELD_BITPOS (type_arg,
+ TYPE_NFIELDS (type_arg) - 1));
+ }
+ }
+ else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT)
+ error ("unimplemented type attribute");
+ else
+ {
+ LONGEST low, high;
+
+ if (ada_is_packed_array_type (type_arg))
+ type_arg = decode_packed_array_type (type_arg);
+
+ if (tem < 1 || tem > ada_array_arity (type_arg))
+ error ("invalid dimension number to '%s",
+ ada_attribute_name (atr));
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ {
+ type = ada_index_type (type_arg, tem);
+ if (type == NULL)
+ error ("attempt to take bound of something that is not an array");
+ return allocate_value (type);
+ }
+
+ switch (atr)
+ {
+ default:
+ error ("unexpected attribute encountered");
+ case ATR_FIRST:
+ low = ada_array_bound_from_type (type_arg, tem, 0, &type);
+ return value_from_longest (type, low);
+ case ATR_LAST:
+ high = ada_array_bound_from_type (type_arg, tem, 1, &type);
+ return value_from_longest (type, high);
+ case ATR_LENGTH:
+ low = ada_array_bound_from_type (type_arg, tem, 0, &type);
+ high = ada_array_bound_from_type (type_arg, tem, 1, NULL);
+ return value_from_longest (type, high-low+1);
+ }
+ }
+ }
+
+ case ATR_TAG:
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return
+ value_zero (ada_tag_type (arg1), not_lval);
+
+ return ada_value_tag (arg1);
+
+ case ATR_MIN:
+ case ATR_MAX:
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (VALUE_TYPE (arg1), not_lval);
+ else
+ return value_binop (arg1, arg2,
+ atr == ATR_MIN ? BINOP_MIN : BINOP_MAX);
+
+ case ATR_MODULUS:
+ {
+ struct type* type_arg = exp->elts[pc + 5].type;
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+ *pos += 4;
+
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+
+ if (! ada_is_modular_type (type_arg))
+ error ("'modulus must be applied to modular type");
+
+ return value_from_longest (TYPE_TARGET_TYPE (type_arg),
+ ada_modulus (type_arg));
+ }
+
+
+ case ATR_POS:
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (builtin_type_ada_int, not_lval);
+ else
+ return value_pos_atr (arg1);
+
+ case ATR_SIZE:
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (builtin_type_ada_int, not_lval);
+ else
+ return value_from_longest (builtin_type_ada_int,
+ TARGET_CHAR_BIT
+ * TYPE_LENGTH (VALUE_TYPE (arg1)));
+
+ case ATR_VAL:
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ type = exp->elts[pc + 5].type;
+ if (noside == EVAL_SKIP)
+ goto nosideret;
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (type, not_lval);
+ else
+ return value_val_atr (type, arg1);
+ } */
case BINOP_EXP:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
@@ -7767,10 +7517,9 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
goto nosideret;
if (binop_user_defined_p (op, arg1, arg2))
return unwrap_value (value_x_binop (arg1, arg2, op, OP_NULL,
- EVAL_NORMAL));
- else
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (VALUE_TYPE (arg1), not_lval);
+ EVAL_NORMAL));
+ else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+ return value_zero (VALUE_TYPE (arg1), not_lval);
else
return value_binop (arg1, arg2, op);
@@ -7794,7 +7543,7 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
case UNOP_IND:
if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
- expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
+ expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
@@ -7804,21 +7553,20 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
if (ada_is_array_descriptor (type))
/* GDB allows dereferencing GNAT array descriptors. */
{
- struct type* arrType = ada_type_of_array (arg1, 0);
+ struct type *arrType = ada_type_of_array (arg1, 0);
if (arrType == NULL)
error ("Attempt to dereference null array pointer.");
return value_at_lazy (arrType, 0, NULL);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR
- || TYPE_CODE (type) == TYPE_CODE_REF
- /* In C you can dereference an array to get the 1st elt. */
- || TYPE_CODE (type) == TYPE_CODE_ARRAY
- )
- return
- value_zero
- (to_static_fixed_type
- (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))),
- lval_memory);
+ || TYPE_CODE (type) == TYPE_CODE_REF
+ /* In C you can dereference an array to get the 1st elt. */
+ || TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ return
+ value_zero
+ (to_static_fixed_type
+ (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))),
+ lval_memory);
else if (TYPE_CODE (type) == TYPE_CODE_INT)
/* GDB allows dereferencing an int. */
return value_zero (builtin_type_int, lval_memory);
@@ -7827,7 +7575,7 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
}
arg1 = ada_coerce_ref (arg1);
type = check_typedef (VALUE_TYPE (arg1));
-
+
if (ada_is_array_descriptor (type))
/* GDB allows dereferencing GNAT array descriptors. */
return ada_coerce_to_simple_array (arg1);
@@ -7841,9 +7589,10 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
if (noside == EVAL_SKIP)
goto nosideret;
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (ada_aligned_type
+ return value_zero (ada_aligned_type
(ada_lookup_struct_elt_type (VALUE_TYPE (arg1),
- &exp->elts[pc + 2].string,
+ &exp->elts[pc +
+ 2].string,
0, NULL)),
lval_memory);
else
@@ -7858,9 +7607,9 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
goto nosideret;
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (builtin_type_void);
- else
+ else
error ("Attempt to use a type name as an expression");
-
+
case STRUCTOP_PTR:
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
@@ -7868,9 +7617,10 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
if (noside == EVAL_SKIP)
goto nosideret;
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (ada_aligned_type
+ return value_zero (ada_aligned_type
(ada_lookup_struct_elt_type (VALUE_TYPE (arg1),
- &exp->elts[pc + 2].string,
+ &exp->elts[pc +
+ 2].string,
0, NULL)),
lval_memory);
else
@@ -7882,28 +7632,26 @@ ada_evaluate_subexp (expect_type, exp, pos, noside)
nosideret:
return value_from_longest (builtin_type_long, (LONGEST) 1);
}
-
+
/* Fixed point */
/* If TYPE encodes an Ada fixed-point type, return the suffix of the
type name that encodes the 'small and 'delta information.
Otherwise, return NULL. */
-static const char*
-fixed_type_info (type)
- struct type *type;
+static const char *
+fixed_type_info (struct type *type)
{
- const char* name = ada_type_name (type);
+ const char *name = ada_type_name (type);
enum type_code code = (type == NULL) ? TYPE_CODE_UNDEF : TYPE_CODE (type);
- if ((code == TYPE_CODE_INT || code == TYPE_CODE_RANGE)
- && name != NULL)
- {
+ if ((code == TYPE_CODE_INT || code == TYPE_CODE_RANGE) && name != NULL)
+ {
const char *tail = strstr (name, "___XF_");
if (tail == NULL)
return NULL;
- else
+ else
return tail + 5;
}
else if (code == TYPE_CODE_RANGE && TYPE_TARGET_TYPE (type) != type)
@@ -7915,8 +7663,7 @@ fixed_type_info (type)
/* Returns non-zero iff TYPE represents an Ada fixed-point type. */
int
-ada_is_fixed_point_type (type)
- struct type *type;
+ada_is_fixed_point_type (struct type *type)
{
return fixed_type_info (type) != NULL;
}
@@ -7926,15 +7673,14 @@ ada_is_fixed_point_type (type)
delta cannot be determined. */
DOUBLEST
-ada_delta (type)
- struct type *type;
+ada_delta (struct type *type)
{
const char *encoding = fixed_type_info (type);
long num, den;
if (sscanf (encoding, "_%ld_%ld", &num, &den) < 2)
return -1.0;
- else
+ else
return (DOUBLEST) num / (DOUBLEST) den;
}
@@ -7942,20 +7688,19 @@ ada_delta (type)
factor ('SMALL value) associated with the type. */
static DOUBLEST
-scaling_factor (type)
- struct type *type;
+scaling_factor (struct type *type)
{
const char *encoding = fixed_type_info (type);
unsigned long num0, den0, num1, den1;
int n;
-
+
n = sscanf (encoding, "_%lu_%lu_%lu_%lu", &num0, &den0, &num1, &den1);
if (n < 2)
return 1.0;
else if (n == 4)
return (DOUBLEST) num1 / (DOUBLEST) den1;
- else
+ else
return (DOUBLEST) num0 / (DOUBLEST) den0;
}
@@ -7964,20 +7709,16 @@ scaling_factor (type)
type TYPE, return its floating-point equivalent. */
DOUBLEST
-ada_fixed_to_float (type, x)
- struct type *type;
- LONGEST x;
+ada_fixed_to_float (struct type *type, LONGEST x)
{
- return (DOUBLEST) x * scaling_factor (type);
+ return (DOUBLEST) x *scaling_factor (type);
}
/* The representation of a fixed-point value of type TYPE
corresponding to the value X. */
LONGEST
-ada_float_to_fixed (type, x)
- struct type *type;
- DOUBLEST x;
+ada_float_to_fixed (struct type *type, DOUBLEST x)
{
return (LONGEST) (x / scaling_factor (type) + 0.5);
}
@@ -7988,14 +7729,13 @@ ada_float_to_fixed (type, x)
/* Non-zero iff TYPE represents one of the special VAX floating-point
types. */
int
-ada_is_vax_floating_type (type)
- struct type* type;
+ada_is_vax_floating_type (struct type *type)
{
- int name_len =
+ int name_len =
(ada_type_name (type) == NULL) ? 0 : strlen (ada_type_name (type));
- return
+ return
name_len > 6
- && (TYPE_CODE (type) == TYPE_CODE_INT
+ && (TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_RANGE)
&& STREQN (ada_type_name (type) + name_len - 6, "___XF", 5);
}
@@ -8003,36 +7743,31 @@ ada_is_vax_floating_type (type)
/* The type of special VAX floating-point type this is, assuming
ada_is_vax_floating_point */
int
-ada_vax_float_type_suffix (type)
- struct type* type;
+ada_vax_float_type_suffix (struct type *type)
{
- return ada_type_name (type)[strlen (ada_type_name (type))-1];
+ return ada_type_name (type)[strlen (ada_type_name (type)) - 1];
}
/* A value representing the special debugging function that outputs
VAX floating-point values of the type represented by TYPE. Assumes
ada_is_vax_floating_type (TYPE). */
-struct value*
-ada_vax_float_print_function (type)
-
- struct type* type;
-{
- switch (ada_vax_float_type_suffix (type)) {
- case 'F':
- return
- get_var_value ("DEBUG_STRING_F", 0);
- case 'D':
- return
- get_var_value ("DEBUG_STRING_D", 0);
- case 'G':
- return
- get_var_value ("DEBUG_STRING_G", 0);
- default:
- error ("invalid VAX floating-point type");
- }
+struct value *
+ada_vax_float_print_function (struct type *type)
+{
+ switch (ada_vax_float_type_suffix (type))
+ {
+ case 'F':
+ return get_var_value ("DEBUG_STRING_F", 0);
+ case 'D':
+ return get_var_value ("DEBUG_STRING_D", 0);
+ case 'G':
+ return get_var_value ("DEBUG_STRING_G", 0);
+ default:
+ error ("invalid VAX floating-point type");
+ }
}
-
+
/* Range types */
/* Scan STR beginning at position K for a discriminant name, and
@@ -8042,39 +7777,34 @@ ada_vax_float_print_function (type)
not alter *PX and *PNEW_K if unsuccessful. */
static int
-scan_discrim_bound (str, k, dval, px, pnew_k)
- char *str;
- int k;
- struct value* dval;
- LONGEST *px;
- int *pnew_k;
+scan_discrim_bound (char *, int k, struct value *dval, LONGEST * px,
+ int *pnew_k)
{
static char *bound_buffer = NULL;
static size_t bound_buffer_len = 0;
char *bound;
char *pend;
- struct value* bound_val;
+ struct value *bound_val;
if (dval == NULL || str == NULL || str[k] == '\0')
return 0;
- pend = strstr (str+k, "__");
+ pend = strstr (str + k, "__");
if (pend == NULL)
{
- bound = str+k;
+ bound = str + k;
k += strlen (bound);
}
- else
+ else
{
- GROW_VECT (bound_buffer, bound_buffer_len, pend - (str+k) + 1);
+ GROW_VECT (bound_buffer, bound_buffer_len, pend - (str + k) + 1);
bound = bound_buffer;
- strncpy (bound_buffer, str+k, pend-(str+k));
- bound[pend-(str+k)] = '\0';
- k = pend-str;
+ strncpy (bound_buffer, str + k, pend - (str + k));
+ bound[pend - (str + k)] = '\0';
+ k = pend - str;
}
-
- bound_val =
- ada_search_struct_field (bound, dval, 0, VALUE_TYPE (dval));
+
+ bound_val = ada_search_struct_field (bound, dval, 0, VALUE_TYPE (dval));
if (bound_val == NULL)
return 0;
@@ -8087,17 +7817,16 @@ scan_discrim_bound (str, k, dval, px, pnew_k)
/* Value of variable named NAME in the current environment. If
no such variable found, then if ERR_MSG is null, returns 0, and
otherwise causes an error with message ERR_MSG. */
-static struct value*
-get_var_value (name, err_msg)
- char* name;
- char* err_msg;
+static struct value *
+get_var_value (char *name, char *err_msg)
{
- struct symbol** syms;
- struct block** blocks;
+ struct symbol **syms;
+ struct block **blocks;
int nsyms;
- nsyms = ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE,
- &syms, &blocks);
+ nsyms =
+ ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE,
+ &syms, &blocks);
if (nsyms != 1)
{
@@ -8109,18 +7838,15 @@ get_var_value (name, err_msg)
return value_of_variable (syms[0], blocks[0]);
}
-
+
/* Value of integer variable named NAME in the current environment. If
no such variable found, then if ERR_MSG is null, returns 0, and sets
*FLAG to 0. If successful, sets *FLAG to 1. */
LONGEST
-get_int_var_value (name, err_msg, flag)
- char* name;
- char* err_msg;
- int* flag;
+get_int_var_value (char *name, char *err_msg, int *flag)
{
- struct value* var_val = get_var_value (name, err_msg);
-
+ struct value *var_val = get_var_value (name, err_msg);
+
if (var_val == 0)
{
if (flag != NULL)
@@ -8134,7 +7860,7 @@ get_int_var_value (name, err_msg, flag)
return value_as_long (var_val);
}
}
-
+
/* Return a range type whose base type is that of the range type named
NAME in the current environment, and whose bounds are calculated
@@ -8144,16 +7870,13 @@ get_int_var_value (name, err_msg, flag)
information, in general, is encoded in NAME, the base type given in
the named range type. */
-static struct type*
-to_fixed_range_type (name, dval, objfile)
- char *name;
- struct value *dval;
- struct objfile *objfile;
+static struct type *
+to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
{
struct type *raw_type = ada_find_any_type (name);
struct type *base_type;
LONGEST low, high;
- char* subtype_info;
+ char *subtype_info;
if (raw_type == NULL)
base_type = builtin_type_int;
@@ -8183,62 +7906,60 @@ to_fixed_range_type (name, dval, objfile)
bounds_str = strchr (subtype_info, '_');
n = 1;
- if (*subtype_info == 'L')
+ if (*subtype_info == 'L')
{
- if (! ada_scan_number (bounds_str, n, &L, &n)
- && ! scan_discrim_bound (bounds_str, n, dval, &L, &n))
+ if (!ada_scan_number (bounds_str, n, &L, &n)
+ && !scan_discrim_bound (bounds_str, n, dval, &L, &n))
return raw_type;
if (bounds_str[n] == '_')
n += 2;
- else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */
+ else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */
n += 1;
subtype_info += 1;
}
- else
+ else
{
- strcpy (name_buf+prefix_len, "___L");
+ strcpy (name_buf + prefix_len, "___L");
L = get_int_var_value (name_buf, "Index bound unknown.", NULL);
}
- if (*subtype_info == 'U')
+ if (*subtype_info == 'U')
{
- if (! ada_scan_number (bounds_str, n, &U, &n)
+ if (!ada_scan_number (bounds_str, n, &U, &n)
&& !scan_discrim_bound (bounds_str, n, dval, &U, &n))
return raw_type;
}
- else
+ else
{
- strcpy (name_buf+prefix_len, "___U");
+ strcpy (name_buf + prefix_len, "___U");
U = get_int_var_value (name_buf, "Index bound unknown.", NULL);
}
- if (objfile == NULL)
+ if (objfile == NULL)
objfile = TYPE_OBJFILE (base_type);
type = create_range_type (alloc_type (objfile), base_type, L, U);
- TYPE_NAME (type) = name;
+ TYPE_NAME (type) = name;
return type;
}
}
/* True iff NAME is the name of a range type. */
int
-ada_is_range_type_name (name)
- const char* name;
+ada_is_range_type_name (const char *name)
{
return (name != NULL && strstr (name, "___XD"));
-}
-
+}
+
/* Modular types */
/* True iff TYPE is an Ada modular type. */
int
-ada_is_modular_type (type)
- struct type* type;
+ada_is_modular_type (struct type *type)
{
/* FIXME: base_type should be declared in gdbtypes.h, implemented in
- valarith.c */
- struct type* subranged_type; /* = base_type (type);*/
+ valarith.c */
+ struct type *subranged_type; /* = base_type (type); */
return (subranged_type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
&& TYPE_CODE (subranged_type) != TYPE_CODE_ENUM
@@ -8247,105 +7968,99 @@ ada_is_modular_type (type)
/* Assuming ada_is_modular_type (TYPE), the modulus of TYPE. */
LONGEST
-ada_modulus (type)
- struct type* type;
+ada_modulus (struct type * type)
{
- return TYPE_HIGH_BOUND (type) + 1;
+ return TYPE_HIGH_BOUND (type) + 1;
}
+
-
/* Operators */
/* Table mapping opcodes into strings for printing operators
and precedences of the operators. */
-static const struct op_print ada_op_print_tab[] =
- {
- {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"or else", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
- {"and then", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
- {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
- {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
- {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
- {"=", BINOP_EQUAL, PREC_EQUAL, 0},
- {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {">>", BINOP_RSH, PREC_SHIFT, 0},
- {"<<", BINOP_LSH, PREC_SHIFT, 0},
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"&", BINOP_CONCAT, PREC_ADD, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"rem", BINOP_REM, PREC_MUL, 0},
- {"mod", BINOP_MOD, PREC_MUL, 0},
- {"**", BINOP_EXP, PREC_REPEAT, 0 },
- {"@", BINOP_REPEAT, PREC_REPEAT, 0},
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"+", UNOP_PLUS, PREC_PREFIX, 0},
- {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
- {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0},
- {"abs ", UNOP_ABS, PREC_PREFIX, 0},
- {".all", UNOP_IND, PREC_SUFFIX, 1}, /* FIXME: postfix .ALL */
- {"'access", UNOP_ADDR, PREC_SUFFIX, 1}, /* FIXME: postfix 'ACCESS */
- {NULL, 0, 0, 0}
+static const struct op_print ada_op_print_tab[] = {
+ {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
+ {"or else", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
+ {"and then", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
+ {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
+ {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
+ {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
+ {"=", BINOP_EQUAL, PREC_EQUAL, 0},
+ {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
+ {"<=", BINOP_LEQ, PREC_ORDER, 0},
+ {">=", BINOP_GEQ, PREC_ORDER, 0},
+ {">", BINOP_GTR, PREC_ORDER, 0},
+ {"<", BINOP_LESS, PREC_ORDER, 0},
+ {">>", BINOP_RSH, PREC_SHIFT, 0},
+ {"<<", BINOP_LSH, PREC_SHIFT, 0},
+ {"+", BINOP_ADD, PREC_ADD, 0},
+ {"-", BINOP_SUB, PREC_ADD, 0},
+ {"&", BINOP_CONCAT, PREC_ADD, 0},
+ {"*", BINOP_MUL, PREC_MUL, 0},
+ {"/", BINOP_DIV, PREC_MUL, 0},
+ {"rem", BINOP_REM, PREC_MUL, 0},
+ {"mod", BINOP_MOD, PREC_MUL, 0},
+ {"**", BINOP_EXP, PREC_REPEAT, 0},
+ {"@", BINOP_REPEAT, PREC_REPEAT, 0},
+ {"-", UNOP_NEG, PREC_PREFIX, 0},
+ {"+", UNOP_PLUS, PREC_PREFIX, 0},
+ {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
+ {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0},
+ {"abs ", UNOP_ABS, PREC_PREFIX, 0},
+ {".all", UNOP_IND, PREC_SUFFIX, 1}, /* FIXME: postfix .ALL */
+ {"'access", UNOP_ADDR, PREC_SUFFIX, 1}, /* FIXME: postfix 'ACCESS */
+ {NULL, 0, 0, 0}
};
/* Assorted Types and Interfaces */
-struct type* builtin_type_ada_int;
-struct type* builtin_type_ada_short;
-struct type* builtin_type_ada_long;
-struct type* builtin_type_ada_long_long;
-struct type* builtin_type_ada_char;
-struct type* builtin_type_ada_float;
-struct type* builtin_type_ada_double;
-struct type* builtin_type_ada_long_double;
-struct type* builtin_type_ada_natural;
-struct type* builtin_type_ada_positive;
-struct type* builtin_type_ada_system_address;
-
-struct type ** const (ada_builtin_types[]) =
-{
-
+struct type *builtin_type_ada_int;
+struct type *builtin_type_ada_short;
+struct type *builtin_type_ada_long;
+struct type *builtin_type_ada_long_long;
+struct type *builtin_type_ada_char;
+struct type *builtin_type_ada_float;
+struct type *builtin_type_ada_double;
+struct type *builtin_type_ada_long_double;
+struct type *builtin_type_ada_natural;
+struct type *builtin_type_ada_positive;
+struct type *builtin_type_ada_system_address;
+
+struct type **const (ada_builtin_types[]) =
+{
+
&builtin_type_ada_int,
- &builtin_type_ada_long,
- &builtin_type_ada_short,
- &builtin_type_ada_char,
- &builtin_type_ada_float,
- &builtin_type_ada_double,
- &builtin_type_ada_long_long,
- &builtin_type_ada_long_double,
- &builtin_type_ada_natural,
- &builtin_type_ada_positive,
-
- /* The following types are carried over from C for convenience. */
- &builtin_type_int,
- &builtin_type_long,
- &builtin_type_short,
- &builtin_type_char,
- &builtin_type_float,
- &builtin_type_double,
- &builtin_type_long_long,
- &builtin_type_void,
- &builtin_type_signed_char,
- &builtin_type_unsigned_char,
- &builtin_type_unsigned_short,
- &builtin_type_unsigned_int,
- &builtin_type_unsigned_long,
- &builtin_type_unsigned_long_long,
- &builtin_type_long_double,
- &builtin_type_complex,
- &builtin_type_double_complex,
- 0
-};
+ &builtin_type_ada_long,
+ &builtin_type_ada_short,
+ &builtin_type_ada_char,
+ &builtin_type_ada_float,
+ &builtin_type_ada_double,
+ &builtin_type_ada_long_long,
+ &builtin_type_ada_long_double,
+ &builtin_type_ada_natural, &builtin_type_ada_positive,
+ /* The following types are carried over from C for convenience. */
+&builtin_type_int,
+ &builtin_type_long,
+ &builtin_type_short,
+ &builtin_type_char,
+ &builtin_type_float,
+ &builtin_type_double,
+ &builtin_type_long_long,
+ &builtin_type_void,
+ &builtin_type_signed_char,
+ &builtin_type_unsigned_char,
+ &builtin_type_unsigned_short,
+ &builtin_type_unsigned_int,
+ &builtin_type_unsigned_long,
+ &builtin_type_unsigned_long_long,
+ &builtin_type_long_double,
+ &builtin_type_complex, &builtin_type_double_complex, 0};
/* Not really used, but needed in the ada_language_defn. */
-static void emit_char (int c, struct ui_file* stream, int quoter)
+static void
+emit_char (int c, struct ui_file *stream, int quoter)
{
ada_emit_char (c, stream, quoter, 1);
}
@@ -8370,16 +8085,16 @@ const struct language_defn ada_language_defn = {
ada_print_type, /* Print a type using appropriate syntax */
ada_val_print, /* Print a value using appropriate syntax */
ada_value_print, /* Print a top-level value */
- {"", "", "", ""}, /* Binary format info */
+ {"", "", "", ""}, /* Binary format info */
#if 0
- {"8#%lo#", "8#", "o", "#"}, /* Octal format info */
- {"%ld", "", "d", ""}, /* Decimal format info */
- {"16#%lx#", "16#", "x", "#"}, /* Hex format info */
+ {"8#%lo#", "8#", "o", "#"}, /* Octal format info */
+ {"%ld", "", "d", ""}, /* Decimal format info */
+ {"16#%lx#", "16#", "x", "#"}, /* Hex format info */
#else
/* Copied from c-lang.c. */
- {"0%lo", "0", "o", ""}, /* Octal format info */
- {"%ld", "", "d", ""}, /* Decimal format info */
- {"0x%lx", "0x", "x", ""}, /* Hex format info */
+ {"0%lo", "0", "o", ""}, /* Octal format info */
+ {"%ld", "", "d", ""}, /* Decimal format info */
+ {"0x%lx", "0x", "x", ""}, /* Hex format info */
#endif
ada_op_print_tab, /* expression operators for printing */
1, /* c-style arrays (FIXME?) */
@@ -8393,59 +8108,48 @@ _initialize_ada_language ()
{
builtin_type_ada_int =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "integer", (struct objfile *) NULL);
+ 0, "integer", (struct objfile *) NULL);
builtin_type_ada_long =
init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long_integer", (struct objfile *) NULL);
+ 0, "long_integer", (struct objfile *) NULL);
builtin_type_ada_short =
init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0,
- "short_integer", (struct objfile *) NULL);
+ 0, "short_integer", (struct objfile *) NULL);
builtin_type_ada_char =
init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0,
- "character", (struct objfile *) NULL);
+ 0, "character", (struct objfile *) NULL);
builtin_type_ada_float =
init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
- 0,
- "float", (struct objfile *) NULL);
+ 0, "float", (struct objfile *) NULL);
builtin_type_ada_double =
init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
- "long_float", (struct objfile *) NULL);
+ 0, "long_float", (struct objfile *) NULL);
builtin_type_ada_long_long =
init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "long_long_integer", (struct objfile *) NULL);
+ 0, "long_long_integer", (struct objfile *) NULL);
builtin_type_ada_long_double =
init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
- "long_long_float", (struct objfile *) NULL);
+ 0, "long_long_float", (struct objfile *) NULL);
builtin_type_ada_natural =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "natural", (struct objfile *) NULL);
+ 0, "natural", (struct objfile *) NULL);
builtin_type_ada_positive =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0,
- "positive", (struct objfile *) NULL);
+ 0, "positive", (struct objfile *) NULL);
- builtin_type_ada_system_address =
- lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void",
+ builtin_type_ada_system_address =
+ lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void",
(struct objfile *) NULL));
TYPE_NAME (builtin_type_ada_system_address) = "system__address";
add_language (&ada_language_defn);
- add_show_from_set
+ add_show_from_set
(add_set_cmd ("varsize-limit", class_support, var_uinteger,
- (char*) &varsize_limit,
+ (char *) &varsize_limit,
"Set maximum bytes in dynamic-sized object.",
- &setlist),
- &showlist);
+ &setlist), &showlist);
varsize_limit = 65536;
add_com ("begin", class_breakpoint, begin_command,
@@ -8479,140 +8183,135 @@ the \"run\" command (q.v.).");
debugging information supplied by the compiler. fnf@cygnus.com */
static struct type *
-ada_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+ada_create_fundamental_type (struct objfile *objfile, int typeid)
{
struct type *type = NULL;
switch (typeid)
{
- default:
- /* FIXME: For now, if we are asked to produce a type not in this
- language, create the equivalent of a C integer type with the
- name "<?type?>". When all the dust settles from the type
- reconstruction work, this should probably become an error. */
- type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "<?type?>", objfile);
- warning ("internal error: no Ada fundamental type %d", typeid);
- break;
- case FT_VOID:
- type = init_type (TYPE_CODE_VOID,
- TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0, "void", objfile);
- break;
- case FT_CHAR:
- type = init_type (TYPE_CODE_INT,
- TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0, "character", objfile);
- break;
- case FT_SIGNED_CHAR:
- type = init_type (TYPE_CODE_INT,
- TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- 0, "signed char", objfile);
- break;
- case FT_UNSIGNED_CHAR:
- type = init_type (TYPE_CODE_INT,
- TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
- break;
- case FT_SHORT:
- type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0, "short_integer", objfile);
- break;
- case FT_SIGNED_SHORT:
- type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- 0, "short_integer", objfile);
- break;
- case FT_UNSIGNED_SHORT:
- type = init_type (TYPE_CODE_INT,
- TARGET_SHORT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
- break;
- case FT_INTEGER:
- type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "integer", objfile);
- break;
- case FT_SIGNED_INTEGER:
- type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
- 0, "integer", objfile); /* FIXME -fnf */
- break;
- case FT_UNSIGNED_INTEGER:
- type = init_type (TYPE_CODE_INT,
- TARGET_INT_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
- break;
- case FT_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_integer", objfile);
- break;
- case FT_SIGNED_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_integer", objfile);
- break;
- case FT_UNSIGNED_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
- break;
- case FT_LONG_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_long_integer", objfile);
- break;
- case FT_SIGNED_LONG_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- 0, "long_long_integer", objfile);
- break;
- case FT_UNSIGNED_LONG_LONG:
- type = init_type (TYPE_CODE_INT,
- TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
- break;
- case FT_FLOAT:
- type = init_type (TYPE_CODE_FLT,
- TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
- 0, "float", objfile);
- break;
- case FT_DBL_PREC_FLOAT:
- type = init_type (TYPE_CODE_FLT,
- TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0, "long_float", objfile);
- break;
- case FT_EXT_PREC_FLOAT:
- type = init_type (TYPE_CODE_FLT,
- TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0, "long_long_float", objfile);
- break;
- }
+ default:
+ /* FIXME: For now, if we are asked to produce a type not in this
+ language, create the equivalent of a C integer type with the
+ name "<?type?>". When all the dust settles from the type
+ reconstruction work, this should probably become an error. */
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ 0, "<?type?>", objfile);
+ warning ("internal error: no Ada fundamental type %d", typeid);
+ break;
+ case FT_VOID:
+ type = init_type (TYPE_CODE_VOID,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "void", objfile);
+ break;
+ case FT_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "character", objfile);
+ break;
+ case FT_SIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ 0, "signed char", objfile);
+ break;
+ case FT_UNSIGNED_CHAR:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
+ break;
+ case FT_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ 0, "short_integer", objfile);
+ break;
+ case FT_SIGNED_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ 0, "short_integer", objfile);
+ break;
+ case FT_UNSIGNED_SHORT:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
+ break;
+ case FT_INTEGER:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ 0, "integer", objfile);
+ break;
+ case FT_SIGNED_INTEGER:
+ type = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0, "integer", objfile); /* FIXME -fnf */
+ break;
+ case FT_UNSIGNED_INTEGER:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_INT_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
+ break;
+ case FT_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ 0, "long_integer", objfile);
+ break;
+ case FT_SIGNED_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ 0, "long_integer", objfile);
+ break;
+ case FT_UNSIGNED_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
+ break;
+ case FT_LONG_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ 0, "long_long_integer", objfile);
+ break;
+ case FT_SIGNED_LONG_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ 0, "long_long_integer", objfile);
+ break;
+ case FT_UNSIGNED_LONG_LONG:
+ type = init_type (TYPE_CODE_INT,
+ TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+ TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
+ break;
+ case FT_FLOAT:
+ type = init_type (TYPE_CODE_FLT,
+ TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+ 0, "float", objfile);
+ break;
+ case FT_DBL_PREC_FLOAT:
+ type = init_type (TYPE_CODE_FLT,
+ TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "long_float", objfile);
+ break;
+ case FT_EXT_PREC_FLOAT:
+ type = init_type (TYPE_CODE_FLT,
+ TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "long_long_float", objfile);
+ break;
+ }
return (type);
}
-void ada_dump_symtab (struct symtab* s)
+void
+ada_dump_symtab (struct symtab *s)
{
int i;
fprintf (stderr, "New symtab: [\n");
- fprintf (stderr, " Name: %s/%s;\n",
- s->dirname ? s->dirname : "?",
- s->filename ? s->filename : "?");
+ fprintf (stderr, " Name: %s/%s;\n",
+ s->dirname ? s->dirname : "?", s->filename ? s->filename : "?");
fprintf (stderr, " Format: %s;\n", s->debugformat);
if (s->linetable != NULL)
{
fprintf (stderr, " Line table (section %d):\n", s->block_line_section);
for (i = 0; i < s->linetable->nitems; i += 1)
{
- struct linetable_entry* e = s->linetable->item + i;
+ struct linetable_entry *e = s->linetable->item + i;
fprintf (stderr, " %4ld: %8lx\n", (long) e->line, (long) e->pc);
}
}
fprintf (stderr, "]\n");
}
-
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index e5353f8524b..d2b426c8ceb 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -32,13 +32,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Chain of cleanups for arguments of OP_UNRESOLVED_VALUE names. Created in
yyparse and freed in ada_resolve. */
-extern struct cleanup* unresolved_names;
+extern struct cleanup *unresolved_names;
/* Corresponding mangled/demangled names and opcodes for Ada user-definable
operators. */
-struct ada_opname_map {
- const char* mangled;
- const char* demangled;
+struct ada_opname_map
+{
+ const char *mangled;
+ const char *demangled;
enum exp_opcode op;
};
@@ -53,7 +54,8 @@ extern const int MAX_NUMBER_OF_KNOWN_TASKS;
to update the table attribute_names in ada-lang.c whenever you change this.
*/
-enum ada_attribute {
+enum ada_attribute
+{
/* Invalid attribute for error checking. */
ATR_INVALID,
@@ -74,7 +76,8 @@ enum ada_attribute {
ATR_END
};
-enum task_states {
+enum task_states
+{
Unactivated,
Runnable,
Terminated,
@@ -89,14 +92,18 @@ enum task_states {
extern char *ada_task_states[];
-typedef struct {
+typedef struct
+{
char *P_ARRAY;
int *P_BOUNDS;
-} fat_string;
+}
+fat_string;
-typedef struct entry_call {
+typedef struct entry_call
+{
void *self;
-} *entry_call_link;
+}
+ *entry_call_link;
struct task_fields
{
@@ -126,7 +133,7 @@ struct task_fields
#if (defined (VXWORKS_TARGET) && defined (M68K_TARGET))
__attribute__ ((packed))
#endif
-;
+ ;
struct task_entry
{
@@ -139,17 +146,17 @@ struct task_entry
int stack_per;
};
-extern struct type* builtin_type_ada_int;
-extern struct type* builtin_type_ada_short;
-extern struct type* builtin_type_ada_long;
-extern struct type* builtin_type_ada_long_long;
-extern struct type* builtin_type_ada_char;
-extern struct type* builtin_type_ada_float;
-extern struct type* builtin_type_ada_double;
-extern struct type* builtin_type_ada_long_double;
-extern struct type* builtin_type_ada_natural;
-extern struct type* builtin_type_ada_positive;
-extern struct type* builtin_type_ada_system_address;
+extern struct type *builtin_type_ada_int;
+extern struct type *builtin_type_ada_short;
+extern struct type *builtin_type_ada_long;
+extern struct type *builtin_type_ada_long_long;
+extern struct type *builtin_type_ada_char;
+extern struct type *builtin_type_ada_float;
+extern struct type *builtin_type_ada_double;
+extern struct type *builtin_type_ada_long_double;
+extern struct type *builtin_type_ada_natural;
+extern struct type *builtin_type_ada_positive;
+extern struct type *builtin_type_ada_system_address;
/* Assuming V points to an array of S objects, make sure that it contains at
least M objects, updating V and S as necessary. */
@@ -157,209 +164,225 @@ extern struct type* builtin_type_ada_system_address;
#define GROW_VECT(v, s, m) \
if ((s) < (m)) grow_vect ((void**) &(v), &(s), (m), sizeof(*(v)));
-extern void grow_vect (void**, size_t*, size_t, int);
+extern void grow_vect (void **, size_t *, size_t, int);
extern int ada_parse (void); /* Defined in ada-exp.y */
extern void ada_error (char *); /* Defined in ada-exp.y */
- /* Defined in ada-typeprint.c */
-extern void ada_print_type (struct type*, char*, struct ui_file*, int, int);
+ /* Defined in ada-typeprint.c */
+extern void ada_print_type (struct type *, char *, struct ui_file *, int,
+ int);
-extern int ada_val_print (struct type*, char*, int, CORE_ADDR,
- struct ui_file*, int, int, int, enum val_prettyprint);
+extern int ada_val_print (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
-extern int ada_value_print (struct value*, struct ui_file*, int,
+extern int ada_value_print (struct value *, struct ui_file *, int,
enum val_prettyprint);
/* Defined in ada-lang.c */
-extern struct value* value_from_contents_and_address (struct type*, char*, CORE_ADDR);
+extern struct value *value_from_contents_and_address (struct type *, char *,
+ CORE_ADDR);
extern void ada_emit_char (int, struct ui_file *, int, int);
-extern void ada_printchar (int, struct ui_file*);
+extern void ada_printchar (int, struct ui_file *);
-extern void ada_printstr (struct ui_file*, char *, unsigned int, int, int);
+extern void ada_printstr (struct ui_file *, char *, unsigned int, int, int);
-extern void ada_convert_actuals (struct value*, int, struct value**, CORE_ADDR*);
+extern void ada_convert_actuals (struct value *, int, struct value **,
+ CORE_ADDR *);
-extern struct value* ada_value_subscript (struct value*, int, struct value**);
+extern struct value *ada_value_subscript (struct value *, int,
+ struct value **);
-extern struct type* ada_array_element_type (struct type*, int);
+extern struct type *ada_array_element_type (struct type *, int);
-extern int ada_array_arity (struct type*);
+extern int ada_array_arity (struct type *);
-struct type* ada_type_of_array (struct value*, int);
+struct type *ada_type_of_array (struct value *, int);
-extern struct value* ada_coerce_to_simple_array (struct value*);
+extern struct value *ada_coerce_to_simple_array (struct value *);
-extern struct value* ada_coerce_to_simple_array_ptr (struct value*);
+extern struct value *ada_coerce_to_simple_array_ptr (struct value *);
-extern int ada_is_simple_array (struct type*);
+extern int ada_is_simple_array (struct type *);
-extern int ada_is_array_descriptor (struct type*);
+extern int ada_is_array_descriptor (struct type *);
-extern int ada_is_bogus_array_descriptor (struct type*);
+extern int ada_is_bogus_array_descriptor (struct type *);
-extern struct type* ada_index_type (struct type*, int);
+extern struct type *ada_index_type (struct type *, int);
-extern struct value* ada_array_bound (struct value*, int, int);
+extern struct value *ada_array_bound (struct value *, int, int);
-extern int ada_lookup_symbol_list (const char*, struct block*, namespace_enum,
- struct symbol***, struct block***);
+extern int ada_lookup_symbol_list (const char *, struct block *,
+ namespace_enum, struct symbol ***,
+ struct block ***);
-extern char* ada_fold_name (const char*);
+extern char *ada_fold_name (const char *);
-extern struct symbol* ada_lookup_symbol (const char*, struct block*, namespace_enum);
+extern struct symbol *ada_lookup_symbol (const char *, struct block *,
+ namespace_enum);
-extern struct minimal_symbol* ada_lookup_minimal_symbol (const char*);
+extern struct minimal_symbol *ada_lookup_minimal_symbol (const char *);
-extern void ada_resolve (struct expression**, struct type*);
+extern void ada_resolve (struct expression **, struct type *);
-extern int ada_resolve_function (struct symbol**, struct block**, int,
- struct value**, int, const char*, struct type*);
+extern int ada_resolve_function (struct symbol **, struct block **, int,
+ struct value **, int, const char *,
+ struct type *);
-extern void ada_fill_in_ada_prototype (struct symbol*);
+extern void ada_fill_in_ada_prototype (struct symbol *);
-extern int user_select_syms (struct symbol**, struct block**, int, int);
+extern int user_select_syms (struct symbol **, struct block **, int, int);
-extern int get_selections (int*, int, int, int, char*);
+extern int get_selections (int *, int, int, int, char *);
-extern char* ada_start_decode_line_1 (char*);
+extern char *ada_start_decode_line_1 (char *);
-extern struct symtabs_and_lines ada_finish_decode_line_1 (char**, struct symtab*, int, char***);
+extern struct symtabs_and_lines ada_finish_decode_line_1 (char **,
+ struct symtab *,
+ int, char ***);
-extern int ada_scan_number (const char*, int, LONGEST*, int*);
+extern int ada_scan_number (const char *, int, LONGEST *, int *);
-extern struct type* ada_parent_type (struct type*);
+extern struct type *ada_parent_type (struct type *);
-extern int ada_is_ignored_field (struct type*, int);
+extern int ada_is_ignored_field (struct type *, int);
-extern int ada_is_packed_array_type (struct type*);
+extern int ada_is_packed_array_type (struct type *);
-extern struct value* ada_value_primitive_packed_val (struct value*, char*, long, int,
- int, struct type*);
+extern struct value *ada_value_primitive_packed_val (struct value *, char *,
+ long, int, int,
+ struct type *);
-extern struct type* ada_coerce_to_simple_array_type (struct type*);
+extern struct type *ada_coerce_to_simple_array_type (struct type *);
-extern int ada_is_character_type (struct type*);
+extern int ada_is_character_type (struct type *);
-extern int ada_is_string_type (struct type*);
+extern int ada_is_string_type (struct type *);
-extern int ada_is_tagged_type (struct type*);
+extern int ada_is_tagged_type (struct type *);
-extern struct type* ada_tag_type (struct value*);
+extern struct type *ada_tag_type (struct value *);
-extern struct value* ada_value_tag (struct value*);
+extern struct value *ada_value_tag (struct value *);
-extern int ada_is_parent_field (struct type*, int);
+extern int ada_is_parent_field (struct type *, int);
-extern int ada_is_wrapper_field (struct type*, int);
+extern int ada_is_wrapper_field (struct type *, int);
-extern int ada_is_variant_part (struct type*, int);
+extern int ada_is_variant_part (struct type *, int);
-extern struct type* ada_variant_discrim_type (struct type*, struct type*);
+extern struct type *ada_variant_discrim_type (struct type *, struct type *);
-extern int ada_is_others_clause (struct type*, int);
+extern int ada_is_others_clause (struct type *, int);
-extern int ada_in_variant (LONGEST, struct type*, int);
+extern int ada_in_variant (LONGEST, struct type *, int);
-extern char* ada_variant_discrim_name (struct type*);
+extern char *ada_variant_discrim_name (struct type *);
-extern struct type* ada_lookup_struct_elt_type (struct type*, char*, int, int*);
+extern struct type *ada_lookup_struct_elt_type (struct type *, char *, int,
+ int *);
-extern struct value* ada_value_struct_elt (struct value*, char*, char*);
+extern struct value *ada_value_struct_elt (struct value *, char *, char *);
-extern struct value* ada_search_struct_field (char*, struct value*, int, struct type*);
+extern struct value *ada_search_struct_field (char *, struct value *, int,
+ struct type *);
-extern int ada_is_aligner_type (struct type*);
+extern int ada_is_aligner_type (struct type *);
-extern struct type* ada_aligned_type (struct type*);
+extern struct type *ada_aligned_type (struct type *);
-extern char* ada_aligned_value_addr (struct type*, char*);
+extern char *ada_aligned_value_addr (struct type *, char *);
-extern const char* ada_attribute_name (int);
+extern const char *ada_attribute_name (int);
-extern int ada_is_fixed_point_type (struct type*);
+extern int ada_is_fixed_point_type (struct type *);
-extern DOUBLEST ada_delta (struct type*);
+extern DOUBLEST ada_delta (struct type *);
extern DOUBLEST ada_fixed_to_float (struct type *, LONGEST);
-extern LONGEST ada_float_to_fixed (struct type*, DOUBLEST);
+extern LONGEST ada_float_to_fixed (struct type *, DOUBLEST);
-extern int ada_is_vax_floating_type (struct type*);
+extern int ada_is_vax_floating_type (struct type *);
-extern int ada_vax_float_type_suffix (struct type*);
+extern int ada_vax_float_type_suffix (struct type *);
-extern struct value* ada_vax_float_print_function (struct type*);
+extern struct value *ada_vax_float_print_function (struct type *);
-extern struct type* ada_system_address_type (void);
+extern struct type *ada_system_address_type (void);
-extern int ada_which_variant_applies (struct type*, struct type*, char*);
+extern int ada_which_variant_applies (struct type *, struct type *, char *);
-extern struct value* ada_to_fixed_value (struct type*, char*, CORE_ADDR, struct value*);
+extern struct value *ada_to_fixed_value (struct type *, char *, CORE_ADDR,
+ struct value *);
-extern struct type* ada_to_fixed_type (struct type*, char*, CORE_ADDR, struct value*);
+extern struct type *ada_to_fixed_type (struct type *, char *, CORE_ADDR,
+ struct value *);
-extern int ada_name_prefix_len (const char*);
+extern int ada_name_prefix_len (const char *);
-extern char* ada_type_name (struct type*);
+extern char *ada_type_name (struct type *);
-extern struct type* ada_find_parallel_type (struct type*, const char *suffix);
+extern struct type *ada_find_parallel_type (struct type *,
+ const char *suffix);
-extern LONGEST get_int_var_value (char*, char*, int* );
+extern LONGEST get_int_var_value (char *, char *, int *);
-extern struct type* ada_find_any_type (const char *name);
+extern struct type *ada_find_any_type (const char *name);
-extern int ada_prefer_type (struct type*, struct type*);
+extern int ada_prefer_type (struct type *, struct type *);
-extern struct type* ada_get_base_type (struct type*);
+extern struct type *ada_get_base_type (struct type *);
-extern struct type* ada_completed_type (struct type*);
+extern struct type *ada_completed_type (struct type *);
-extern char* ada_mangle (const char*);
+extern char *ada_mangle (const char *);
-extern const char* ada_enum_name (const char*);
+extern const char *ada_enum_name (const char *);
-extern int ada_is_modular_type (struct type*);
+extern int ada_is_modular_type (struct type *);
-extern LONGEST ada_modulus (struct type*);
+extern LONGEST ada_modulus (struct type *);
-extern struct value* ada_value_ind (struct value*);
+extern struct value *ada_value_ind (struct value *);
-extern void ada_print_scalar (struct type*, LONGEST, struct ui_file*);
+extern void ada_print_scalar (struct type *, LONGEST, struct ui_file *);
-extern int ada_is_range_type_name (const char*);
+extern int ada_is_range_type_name (const char *);
-extern const char* ada_renaming_type (struct type*);
+extern const char *ada_renaming_type (struct type *);
-extern int ada_is_object_renaming (struct symbol*);
+extern int ada_is_object_renaming (struct symbol *);
-extern const char* ada_simple_renamed_entity (struct symbol*);
+extern const char *ada_simple_renamed_entity (struct symbol *);
-extern char* ada_breakpoint_rewrite (char*, int*);
+extern char *ada_breakpoint_rewrite (char *, int *);
/* Tasking-related: ada-tasks.c */
extern int valid_task_id (int);
-extern int get_current_task (void);
+extern int get_current_task (void);
extern void init_task_list (void);
-extern void* get_self_id (void);
+extern void *get_self_id (void);
extern int get_current_task (void);
-extern int get_entry_number (void*);
+extern int get_entry_number (void *);
extern void ada_report_exception_break (struct breakpoint *);
-extern int ada_maybe_exception_partial_symbol (struct partial_symbol* sym);
+extern int ada_maybe_exception_partial_symbol (struct partial_symbol *sym);
-extern int ada_is_exception_sym (struct symbol* sym);
+extern int ada_is_exception_sym (struct symbol *sym);
#endif
diff --git a/gdb/ada-lex.c b/gdb/ada-lex.c
deleted file mode 100644
index 9538f76b0cb..00000000000
--- a/gdb/ada-lex.c
+++ /dev/null
@@ -1,3174 +0,0 @@
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header$
- * $FreeBSD: src/usr.bin/lex/flex.skl,v 1.4 1999/10/27 07:56:44 obrien Exp $
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include <stdio.h>
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif /* __STDC__ */
-#endif /* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition. This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state. The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator). This
- * avoids problems with code like:
- *
- * if ( condition_holds )
- * yyless( 5 );
- * else
- * do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- *yy_cp = yy_hold_char; \
- YY_RESTORE_YY_MORE_OFFSET \
- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
-
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
-
- int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
-#define YY_BUFFER_EOF_PENDING 2
- };
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_is_interactive = is_interactive; \
- }
-
-#define yy_set_bol(at_bol) \
- { \
- if ( ! yy_current_buffer ) \
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
- yy_current_buffer->yy_at_bol = at_bol; \
- }
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-
-#define YY_USES_REJECT
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
- yytext_ptr = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
- yy_hold_char = *yy_cp; \
- *yy_cp = '\0'; \
- yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 57
-#define YY_END_OF_BUFFER 58
-static yyconst short int yy_acclist[386] =
- { 0,
- 58, 56, 57, 1, 56, 57, 1, 57, 15, 56,
- 57, 53, 56, 57, 41, 56, 57, 56, 57, 43,
- 56, 57, 44, 56, 57, 41, 56, 57, 42, 56,
- 57, 41, 56, 57, 41, 56, 57, 41, 56, 57,
- 4, 56, 57, 4, 56, 57, 41, 56, 57, 41,
- 56, 57, 41, 56, 57, 41, 56, 57, 50, 56,
- 57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
- 47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
- 56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
- 57, 1, 56, 57, 56, 57, 16, 56, 57, 53,
-
- 56, 57, 41, 56, 57, 56, 57, 43, 56, 57,
- 44, 56, 57, 41, 56, 57, 42, 56, 57, 41,
- 56, 57, 41, 56, 57, 41, 56, 57, 4, 56,
- 57, 4, 56, 57, 41, 56, 57, 41, 56, 57,
- 41, 56, 57, 41, 56, 57, 50, 56, 57, 41,
- 56, 57, 47, 56, 57, 47, 56, 57, 47, 56,
- 57, 47, 56, 57, 47, 56, 57, 47, 56, 57,
- 47, 56, 57, 47, 56, 57, 47, 56, 57, 47,
- 56, 57, 56, 57, 40, 56, 57, 51, 55, 54,
- 55, 55, 35, 2, 34, 46, 46, 37, 4, 36,
-
- 38, 33, 39, 47, 47, 47, 47, 47, 19, 47,
- 23, 47, 47, 47, 47, 47, 28, 47, 47, 47,
- 47, 16, 51, 55, 54, 55, 55, 16, 35, 2,
- 34, 46, 46, 37, 4, 36, 38, 33, 39, 16,
- 47, 47, 47, 47, 47, 19, 47, 23, 47, 47,
- 47, 47, 47, 28, 47, 47, 47, 47,16398, 52,
- 55, 12, 12, 32, 2, 46, 46, 9, 3, 7,
- 47, 47, 49, 20, 47, 21, 47, 47, 24, 47,
- 25, 47, 26, 47, 47, 29, 47, 47, 31, 47,
- 52, 55, 16, 32, 2, 2, 16, 2, 46, 46,
-
- 9, 3, 7, 47, 16, 47, 49, 20, 47, 21,
- 47, 47, 24, 47, 25, 47, 26, 47, 47, 29,
- 47, 47, 31, 47, 8206, 46, 45, 46, 6, 9,
- 3, 47, 22, 47, 27, 47, 30, 47, 2, 16,
- 46, 45, 46, 6, 9, 3, 47, 22, 47, 27,
- 47, 30, 47, 48, 47, 48, 2, 2, 18, 47,
- 5, 11, 8, 18, 2, 2, 5, 11, 8, 17,
- 5, 8, 17, 2, 18, 2, 5, 8, 13, 2,
- 17, 10, 10, 10, 10
- } ;
-
-static yyconst short int yy_accept[364] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 2, 4, 7,
- 9, 12, 15, 18, 20, 23, 26, 29, 32, 35,
- 38, 41, 44, 47, 50, 53, 56, 59, 62, 65,
- 68, 71, 74, 77, 80, 83, 86, 89, 92, 95,
- 97, 100, 103, 106, 108, 111, 114, 117, 120, 123,
- 126, 129, 132, 135, 138, 141, 144, 147, 150, 153,
- 156, 159, 162, 165, 168, 171, 174, 177, 180, 183,
- 185, 188, 188, 188, 188, 188, 188, 188, 188, 188,
- 188, 188, 188, 190, 192, 193, 193, 193, 193, 193,
- 193, 193, 193, 194, 195, 195, 196, 196, 197, 198,
-
- 199, 199, 199, 200, 200, 200, 201, 202, 202, 203,
- 204, 204, 204, 205, 205, 206, 206, 207, 208, 209,
- 211, 213, 214, 215, 216, 217, 219, 220, 221, 222,
- 222, 223, 223, 225, 227, 228, 228, 228, 229, 229,
- 229, 230, 231, 231, 232, 232, 233, 234, 235, 235,
- 235, 236, 236, 236, 237, 238, 238, 239, 240, 241,
- 241, 242, 242, 243, 243, 244, 245, 246, 248, 250,
- 251, 252, 253, 254, 256, 257, 258, 259, 259, 260,
- 260, 260, 260, 260, 260, 260, 262, 262, 263, 264,
- 264, 265, 266, 266, 267, 268, 268, 269, 269, 270,
-
- 271, 271, 272, 272, 272, 272, 273, 274, 276, 278,
- 279, 281, 283, 285, 286, 288, 289, 291, 293, 293,
- 294, 295, 296, 298, 299, 299, 300, 301, 301, 302,
- 302, 303, 304, 304, 305, 305, 305, 305, 306, 306,
- 307, 308, 310, 312, 313, 315, 317, 319, 320, 322,
- 323, 325, 325, 326, 326, 326, 326, 326, 327, 329,
- 330, 330, 330, 331, 331, 332, 332, 332, 332, 332,
- 332, 332, 332, 332, 332, 332, 332, 332, 333, 335,
- 337, 339, 339, 339, 339, 339, 341, 341, 342, 344,
- 345, 345, 345, 346, 346, 347, 347, 347, 347, 348,
-
- 350, 352, 354, 355, 355, 355, 355, 355, 356, 356,
- 356, 356, 356, 356, 356, 356, 357, 357, 357, 358,
- 359, 359, 359, 359, 360, 360, 360, 361, 361, 361,
- 362, 363, 363, 364, 365, 365, 366, 367, 367, 368,
- 369, 369, 370, 371, 371, 372, 372, 373, 374, 376,
- 377, 378, 378, 379, 380, 380, 382, 382, 383, 384,
- 385, 386, 386
- } ;
-
-static yyconst int yy_ec[256] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 4, 5, 6, 7, 8, 5, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 21, 22, 23,
- 24, 25, 5, 26, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 36, 36, 39, 40, 41, 42, 36,
- 36, 43, 44, 45, 46, 36, 47, 48, 36, 36,
- 27, 5, 28, 5, 29, 5, 30, 31, 32, 33,
-
- 34, 35, 36, 37, 38, 36, 36, 39, 40, 41,
- 42, 36, 36, 43, 44, 45, 46, 36, 47, 48,
- 36, 36, 26, 22, 26, 5, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1
- } ;
-
-static yyconst int yy_meta[49] =
- { 0,
- 1, 2, 3, 4, 5, 6, 7, 8, 5, 9,
- 5, 5, 5, 5, 5, 5, 10, 5, 11, 11,
- 9, 5, 12, 13, 14, 5, 5, 5, 15, 16,
- 16, 16, 16, 16, 16, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17
- } ;
-
-static yyconst short int yy_base[385] =
- { 0,
- 0, 0, 48, 0, 91, 92, 1405, 1771, 1771, 1771,
- 94, 96, 1771, 142, 1771, 1771, 1391, 1771, 1387, 189,
- 1378, 188, 194, 1377, 1376, 1374, 1361, 1771, 222, 242,
- 82, 91, 89, 196, 68, 163, 179, 97, 100, 194,
- 0, 280, 223, 328, 227, 228, 234, 229, 235, 375,
- 242, 418, 1335, 243, 463, 247, 251, 252, 254, 510,
- 168, 1343, 161, 1333, 234, 1331, 1336, 1323, 1316, 0,
- 558, 1340, 127, 258, 420, 422, 398, 1299, 1285, 1258,
- 1266, 1257, 411, 413, 0, 605, 1288, 1287, 1286, 1285,
- 119, 644, 1771, 0, 691, 1771, 0, 0, 1255, 1771,
-
- 0, 421, 690, 429, 0, 1771, 1771, 1244, 1771, 1771,
- 608, 696, 1771, 699, 419, 1247, 420, 422, 582, 583,
- 586, 587, 624, 625, 591, 590, 627, 628, 684, 430,
- 1771, 705, 653, 1256, 710, 1252, 731, 0, 1254, 750,
- 710, 798, 1222, 717, 802, 832, 1199, 720, 875, 730,
- 1189, 732, 892, 733, 795, 924, 796, 797, 1230, 971,
- 800, 997, 0, 876, 1183, 1191, 1176, 0, 0, 1174,
- 1151, 1150, 1097, 0, 1095, 1100, 1089, 1096, 805, 1043,
- 1047, 1043, 1023, 1016, 1010, 439, 808, 883, 1771, 1027,
- 1041, 0, 971, 0, 952, 736, 864, 614, 799, 0,
-
- 965, 976, 1046, 1061, 0, 1061, 1771, 714, 717, 858,
- 774, 789, 859, 1042, 860, 953, 954, 1047, 1086, 1108,
- 0, 1092, 0, 1094, 1140, 0, 950, 1182, 1091, 1110,
- 1199, 1210, 0, 1244, 981, 0, 0, 0, 1243, 1273,
- 890, 0, 0, 949, 0, 0, 0, 943, 0, 935,
- 0, 1120, 1771, 1188, 900, 1303, 895, 1771, 0, 882,
- 0, 1098, 1174, 440, 1177, 909, 421, 1048, 1093, 1102,
- 1169, 846, 818, 814, 822, 779, 792, 1249, 1190, 1191,
- 1192, 1322, 1228, 750, 1331, 1361, 0, 1106, 0, 1229,
- 1378, 0, 1325, 1326, 1349, 726, 725, 1410, 0, 0,
-
- 0, 0, 1771, 722, 839, 713, 644, 1369, 668, 671,
- 663, 615, 617, 576, 591, 1198, 540, 459, 456, 1440,
- 1462, 1483, 1458, 1771, 414, 0, 1517, 249, 794, 1238,
- 237, 258, 1310, 0, 203, 190, 209, 1460, 1477, 1350,
- 0, 1480, 1771, 131, 1328, 726, 1472, 0, 0, 86,
- 1516, 1523, 1522, 1385, 835, 0, 1505, 1511, 1527, 1533,
- 1549, 1771, 1571, 1587, 1592, 1608, 1622, 1639, 1642, 1649,
- 89, 187, 1656, 1672, 1689, 1701, 1707, 1718, 1720, 1736,
- 902, 903, 1743, 1754
- } ;
-
-static yyconst short int yy_def[385] =
- { 0,
- 362, 1, 362, 3, 1, 1, 362, 362, 362, 362,
- 362, 363, 362, 362, 362, 362, 362, 362, 362, 364,
- 362, 362, 362, 362, 365, 362, 362, 362, 366, 366,
- 30, 30, 30, 30, 30, 30, 30, 30, 367, 367,
- 11, 362, 367, 362, 367, 367, 367, 367, 367, 362,
- 367, 367, 52, 367, 362, 367, 367, 367, 367, 362,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 11,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 363, 363, 363, 71, 71, 71, 86, 362,
- 86, 86, 362, 368, 364, 362, 369, 370, 370, 362,
-
- 371, 362, 362, 362, 372, 362, 362, 373, 362, 362,
- 362, 362, 362, 374, 30, 362, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 367,
- 362, 367, 42, 42, 42, 44, 44, 86, 137, 137,
- 367, 375, 50, 367, 55, 145, 146, 367, 367, 367,
- 52, 367, 149, 367, 367, 362, 367, 367, 376, 367,
- 367, 362, 60, 367, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 92, 362, 362,
- 362, 362, 362, 362, 362, 363, 362, 362, 362, 86,
- 92, 368, 377, 370, 370, 378, 362, 362, 362, 372,
-
- 373, 362, 374, 362, 379, 380, 362, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 42, 367, 86,
- 140, 375, 368, 375, 362, 146, 146, 149, 367, 367,
- 367, 149, 156, 367, 362, 381, 162, 204, 145, 60,
- 367, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 362, 362, 362, 362, 86, 377, 362, 370, 362,
- 382, 378, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 383, 380, 30, 30,
- 30, 367, 367, 86, 86, 368, 225, 367, 146, 367,
- 149, 228, 367, 367, 367, 362, 362, 362, 240, 60,
-
- 60, 60, 362, 86, 362, 384, 362, 362, 362, 362,
- 362, 362, 362, 362, 383, 367, 86, 86, 368, 368,
- 367, 149, 367, 362, 362, 298, 367, 86, 362, 362,
- 362, 384, 362, 86, 86, 368, 368, 367, 367, 367,
- 322, 367, 362, 86, 362, 362, 362, 86, 368, 368,
- 367, 367, 367, 362, 362, 368, 367, 362, 367, 362,
- 367, 0, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362
- } ;
-
-static yyconst short int yy_nxt[1820] =
- { 0,
- 8, 9, 10, 9, 8, 11, 8, 12, 13, 14,
- 15, 16, 17, 13, 18, 19, 20, 21, 22, 23,
- 24, 13, 25, 26, 27, 28, 13, 13, 29, 30,
- 29, 29, 29, 31, 29, 29, 29, 32, 29, 33,
- 34, 35, 36, 29, 37, 29, 29, 38, 8, 9,
- 10, 39, 40, 41, 40, 42, 43, 44, 45, 46,
- 47, 43, 48, 49, 50, 51, 52, 53, 54, 43,
- 55, 56, 57, 58, 59, 43, 60, 61, 60, 60,
- 60, 62, 60, 60, 60, 63, 60, 64, 65, 66,
- 67, 60, 68, 60, 60, 69, 70, 70, 115, 196,
-
- 71, 71, 72, 83, 196, 131, 73, 72, 115, 72,
- 126, 74, 115, 356, 84, 84, 75, 72, 76, 115,
- 119, 115, 115, 77, 190, 120, 132, 115, 188, 115,
- 122, 121, 179, 78, 79, 80, 81, 115, 129, 72,
- 354, 82, 86, 87, 87, 88, 89, 89, 89, 89,
- 89, 90, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 91, 89,
- 89, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 95, 95, 95, 115, 101, 168, 127, 200, 165, 131,
-
- 101, 169, 200, 115, 102, 96, 103, 103, 166, 115,
- 102, 97, 103, 103, 350, 128, 103, 349, 99, 115,
- 132, 104, 103, 111, 111, 112, 115, 104, 131, 123,
- 348, 113, 131, 131, 131, 105, 115, 124, 114, 131,
- 131, 125, 116, 111, 111, 112, 141, 131, 131, 132,
- 142, 113, 131, 132, 132, 132, 131, 131, 114, 159,
- 132, 132, 116, 179, 331, 148, 154, 171, 132, 132,
- 346, 157, 117, 132, 158, 172, 344, 132, 132, 173,
- 132, 72, 118, 130, 130, 131, 130, 133, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 134, 134,
-
- 130, 130, 130, 130, 130, 130, 132, 130, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135, 86, 87,
- 87, 136, 137, 138, 137, 137, 137, 130, 137, 137,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 137, 137, 139, 137, 137, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 95, 95, 143, 130,
- 131, 130, 130, 130, 130, 130, 130, 130, 130, 130,
- 130, 144, 130, 130, 130, 130, 130, 145, 130, 130,
-
- 130, 132, 130, 146, 147, 146, 146, 146, 146, 146,
- 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
- 146, 146, 146, 131, 149, 179, 308, 179, 180, 186,
- 186, 84, 84, 266, 150, 131, 151, 151, 181, 197,
- 197, 343, 198, 72, 132, 72, 151, 199, 199, 115,
- 115, 152, 115, 307, 209, 307, 132, 186, 186, 115,
- 115, 336, 115, 208, 335, 153, 130, 130, 131, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 155, 130, 130, 132,
- 130, 156, 156, 156, 156, 156, 156, 156, 156, 156,
-
- 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 111, 111, 160, 130, 131, 130, 130, 130, 161,
- 130, 130, 130, 130, 130, 130, 162, 130, 163, 163,
- 164, 130, 130, 130, 130, 130, 132, 130, 163, 163,
- 163, 163, 163, 163, 163, 163, 163, 163, 163, 163,
- 163, 163, 163, 163, 163, 163, 163, 163, 86, 87,
- 87, 87, 86, 86, 86, 86, 86, 334, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
-
- 178, 178, 178, 178, 178, 178, 86, 86, 86, 111,
- 111, 111, 115, 115, 187, 308, 115, 115, 266, 211,
- 115, 115, 115, 115, 114, 210, 115, 115, 116, 214,
- 115, 115, 199, 199, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 188, 115, 115, 266, 115, 115, 266,
- 135, 216, 333, 333, 115, 115, 215, 115, 115, 213,
- 212, 218, 218, 191, 191, 191, 191, 191, 191, 191,
- 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
- 191, 191, 95, 95, 95, 266, 101, 111, 111, 112,
-
- 203, 203, 203, 266, 204, 113, 102, 362, 103, 103,
- 159, 266, 114, 97, 115, 131, 116, 135, 103, 331,
- 99, 205, 131, 104, 115, 131, 217, 328, 135, 135,
- 325, 132, 86, 86, 137, 131, 132, 131, 131, 355,
- 219, 355, 260, 132, 115, 230, 132, 115, 229, 229,
- 231, 231, 261, 324, 115, 317, 132, 115, 132, 132,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 221,
- 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
- 221, 221, 221, 221, 221, 221, 221, 221, 192, 192,
-
- 131, 131, 131, 223, 115, 131, 252, 252, 252, 254,
- 254, 254, 330, 330, 115, 253, 308, 265, 265, 115,
- 314, 132, 132, 132, 224, 130, 132, 265, 255, 115,
- 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
- 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
- 226, 226, 329, 358, 358, 313, 266, 330, 330, 312,
- 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
- 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
- 131, 131, 263, 263, 254, 254, 254, 311, 115, 115,
- 115, 279, 263, 228, 228, 131, 241, 264, 115, 115,
-
- 115, 132, 132, 255, 228, 228, 228, 228, 228, 228,
- 232, 232, 297, 306, 308, 305, 132, 297, 306, 258,
- 303, 232, 232, 232, 232, 232, 232, 130, 130, 131,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
- 130, 130, 233, 233, 130, 130, 130, 130, 234, 130,
- 132, 130, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 111, 111, 160, 302, 131, 111, 111, 112,
- 161, 301, 300, 115, 115, 113, 296, 162, 289, 202,
- 259, 164, 114, 281, 115, 258, 116, 132, 203, 203,
-
- 237, 130, 238, 130, 130, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 239,
- 130, 130, 130, 132, 130, 240, 240, 240, 240, 240,
- 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
- 240, 240, 240, 240, 240, 256, 256, 203, 203, 203,
- 187, 204, 72, 308, 135, 72, 256, 256, 256, 256,
- 256, 256, 111, 111, 112, 218, 218, 72, 205, 266,
- 113, 266, 115, 267, 266, 72, 266, 114, 268, 72,
- 280, 116, 115, 269, 266, 270, 72, 254, 254, 282,
- 271, 131, 192, 192, 192, 192, 131, 223, 308, 286,
-
- 272, 273, 274, 275, 260, 187, 283, 308, 276, 293,
- 293, 131, 132, 284, 261, 131, 266, 132, 224, 293,
- 224, 252, 252, 252, 294, 266, 285, 285, 231, 231,
- 253, 251, 132, 250, 249, 248, 132, 285, 285, 285,
- 285, 285, 285, 130, 130, 131, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 287, 287,
- 130, 130, 130, 130, 288, 130, 132, 130, 287, 287,
- 287, 287, 287, 287, 287, 287, 287, 287, 287, 287,
- 287, 287, 287, 287, 287, 287, 287, 287, 290, 254,
- 254, 254, 263, 263, 247, 265, 265, 246, 291, 309,
-
- 292, 292, 263, 131, 131, 265, 245, 264, 255, 310,
- 292, 292, 292, 292, 292, 292, 292, 295, 295, 244,
- 115, 115, 115, 243, 132, 132, 242, 295, 232, 232,
- 115, 115, 115, 131, 131, 235, 130, 227, 130, 232,
- 232, 232, 232, 232, 232, 111, 111, 160, 316, 131,
- 111, 111, 112, 161, 132, 132, 345, 345, 113, 220,
- 162, 219, 321, 135, 164, 114, 345, 207, 202, 116,
- 132, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 298, 299, 299, 195, 189, 188, 188, 187, 185, 184,
-
- 72, 299, 299, 299, 299, 299, 299, 299, 299, 299,
- 299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
- 299, 304, 304, 254, 254, 282, 183, 131, 347, 347,
- 131, 131, 304, 304, 304, 304, 304, 304, 347, 323,
- 182, 323, 283, 293, 293, 179, 345, 345, 132, 318,
- 318, 132, 132, 293, 131, 131, 345, 177, 294, 176,
- 318, 318, 318, 318, 318, 318, 319, 295, 295, 175,
- 111, 111, 112, 174, 170, 132, 132, 295, 113, 320,
- 320, 167, 130, 352, 110, 114, 254, 254, 254, 116,
- 320, 320, 320, 320, 320, 320, 322, 322, 109, 107,
-
- 106, 100, 94, 93, 362, 255, 362, 322, 322, 322,
- 322, 322, 322, 130, 130, 131, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 326, 326,
- 130, 130, 130, 130, 327, 130, 132, 130, 326, 326,
- 326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
- 326, 326, 326, 326, 326, 326, 326, 326, 337, 337,
- 362, 362, 362, 131, 362, 131, 362, 131, 362, 337,
- 337, 337, 337, 337, 337, 338, 342, 342, 339, 339,
- 339, 339, 131, 362, 132, 131, 132, 362, 132, 340,
- 347, 347, 362, 362, 362, 351, 351, 362, 353, 353,
-
- 347, 341, 341, 132, 362, 351, 132, 362, 353, 362,
- 131, 341, 341, 341, 341, 341, 341, 341, 111, 111,
- 160, 131, 131, 359, 359, 362, 161, 131, 131, 360,
- 360, 132, 131, 162, 351, 351, 357, 164, 357, 360,
- 353, 353, 132, 132, 351, 361, 361, 362, 132, 132,
- 353, 360, 360, 132, 131, 361, 362, 362, 362, 362,
- 362, 360, 362, 362, 362, 362, 362, 361, 361, 362,
- 362, 362, 362, 362, 362, 132, 362, 361, 85, 362,
- 362, 85, 362, 362, 362, 85, 85, 85, 98, 98,
- 98, 362, 362, 362, 362, 362, 98, 362, 98, 362,
-
- 362, 98, 98, 98, 108, 362, 108, 108, 108, 115,
- 115, 115, 362, 362, 362, 362, 115, 115, 115, 362,
- 362, 362, 115, 115, 115, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 192,
- 192, 362, 192, 192, 192, 192, 192, 192, 192, 192,
- 192, 192, 192, 192, 192, 192, 193, 193, 193, 194,
- 362, 362, 362, 194, 194, 194, 201, 362, 362, 201,
- 201, 201, 201, 206, 206, 206, 362, 206, 362, 362,
- 362, 362, 362, 206, 362, 362, 206, 206, 206, 222,
- 222, 362, 222, 222, 222, 222, 222, 222, 222, 222,
-
- 222, 222, 222, 222, 222, 222, 236, 362, 362, 362,
- 362, 236, 362, 362, 362, 362, 236, 257, 362, 362,
- 257, 257, 257, 257, 262, 362, 362, 262, 262, 362,
- 362, 362, 262, 262, 277, 277, 277, 278, 278, 278,
- 362, 362, 362, 362, 278, 278, 278, 362, 362, 362,
- 278, 278, 278, 315, 362, 362, 315, 315, 315, 315,
- 332, 362, 362, 362, 332, 362, 362, 362, 332, 332,
- 7, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
-
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362
- } ;
-
-static yyconst short int yy_chk[1820] =
- { 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 5, 6, 35, 371,
-
- 5, 6, 11, 12, 371, 39, 11, 11, 35, 11,
- 35, 11, 31, 350, 12, 12, 11, 11, 11, 33,
- 31, 32, 31, 11, 91, 32, 39, 38, 91, 33,
- 33, 32, 73, 11, 11, 11, 11, 38, 38, 73,
- 344, 11, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 20, 20, 20, 36, 22, 63, 36, 372, 61, 40,
-
- 23, 63, 372, 36, 22, 20, 22, 22, 61, 37,
- 23, 20, 23, 23, 337, 37, 22, 336, 20, 37,
- 40, 22, 23, 29, 29, 29, 34, 23, 43, 34,
- 335, 29, 45, 46, 48, 22, 34, 34, 29, 47,
- 49, 34, 29, 30, 30, 30, 47, 51, 54, 43,
- 49, 30, 56, 45, 46, 48, 57, 58, 30, 59,
- 47, 49, 30, 74, 332, 51, 54, 65, 51, 54,
- 331, 56, 30, 56, 57, 65, 328, 57, 58, 65,
- 59, 74, 30, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
-
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 42, 42, 42, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
- 44, 44, 44, 44, 44, 44, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
-
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
- 50, 50, 50, 52, 52, 75, 267, 76, 77, 83,
- 83, 84, 84, 267, 52, 130, 52, 52, 77, 102,
- 102, 325, 104, 75, 52, 76, 52, 104, 104, 115,
- 117, 52, 118, 264, 118, 264, 130, 186, 186, 115,
- 117, 319, 118, 117, 318, 52, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
-
- 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
- 60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 317, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
- 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
-
- 71, 71, 71, 71, 71, 71, 86, 86, 86, 111,
- 111, 111, 119, 120, 86, 315, 121, 122, 314, 122,
- 126, 125, 119, 120, 111, 119, 121, 122, 111, 125,
- 126, 125, 198, 198, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 92, 123, 124, 313, 127, 128, 312,
- 133, 128, 307, 307, 123, 124, 127, 127, 128, 124,
- 123, 133, 133, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 95, 95, 95, 311, 103, 112, 112, 112,
-
- 114, 114, 114, 310, 114, 112, 103, 95, 103, 103,
- 132, 309, 112, 95, 129, 141, 112, 135, 103, 306,
- 95, 114, 144, 103, 129, 148, 129, 304, 135, 135,
- 297, 132, 137, 137, 137, 150, 141, 152, 154, 346,
- 137, 346, 196, 144, 208, 152, 148, 209, 150, 150,
- 152, 152, 196, 296, 208, 284, 150, 209, 152, 154,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
- 137, 137, 137, 137, 137, 137, 137, 137, 137, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 142, 142,
-
- 155, 157, 158, 142, 211, 161, 179, 179, 179, 187,
- 187, 187, 329, 329, 211, 179, 277, 199, 199, 212,
- 276, 155, 157, 158, 142, 145, 161, 199, 187, 212,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
- 146, 146, 305, 355, 355, 275, 274, 305, 305, 273,
- 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
- 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
- 149, 164, 197, 197, 188, 188, 188, 272, 210, 213,
- 215, 210, 197, 149, 149, 241, 164, 197, 210, 213,
-
- 215, 149, 164, 188, 149, 149, 149, 149, 149, 149,
- 153, 153, 381, 382, 266, 260, 241, 381, 382, 257,
- 255, 153, 153, 153, 153, 153, 153, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 160, 160, 160, 250, 160, 202, 202, 202,
- 160, 248, 244, 216, 217, 202, 235, 160, 227, 201,
- 195, 160, 202, 216, 217, 193, 202, 160, 162, 162,
-
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 190, 190, 203, 203, 203,
- 191, 203, 185, 268, 218, 184, 190, 190, 190, 190,
- 190, 190, 206, 206, 206, 218, 218, 183, 203, 204,
- 206, 268, 214, 204, 204, 182, 204, 206, 204, 181,
- 214, 206, 214, 204, 204, 204, 180, 219, 219, 219,
- 204, 219, 222, 222, 224, 224, 229, 222, 269, 224,
-
- 204, 204, 204, 204, 262, 178, 219, 270, 204, 229,
- 229, 288, 219, 220, 262, 230, 269, 229, 222, 229,
- 224, 252, 252, 252, 229, 270, 220, 220, 230, 230,
- 252, 177, 288, 176, 175, 173, 230, 220, 220, 220,
- 220, 220, 220, 225, 225, 225, 225, 225, 225, 225,
- 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
- 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
- 225, 225, 225, 225, 225, 225, 225, 225, 225, 225,
- 225, 225, 225, 225, 225, 225, 225, 225, 228, 254,
- 254, 254, 263, 263, 172, 265, 265, 171, 228, 271,
-
- 228, 228, 263, 316, 231, 265, 170, 263, 254, 271,
- 228, 228, 228, 228, 228, 228, 228, 231, 231, 167,
- 279, 280, 281, 166, 316, 231, 165, 231, 232, 232,
- 279, 280, 281, 283, 290, 159, 151, 147, 143, 232,
- 232, 232, 232, 232, 232, 234, 234, 234, 283, 234,
- 278, 278, 278, 234, 283, 290, 330, 330, 278, 139,
- 234, 136, 290, 134, 234, 278, 330, 116, 108, 278,
- 234, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
- 239, 240, 240, 99, 90, 89, 88, 87, 82, 81,
-
- 80, 240, 240, 240, 240, 240, 240, 240, 240, 240,
- 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
- 240, 256, 256, 282, 282, 282, 79, 282, 333, 333,
- 293, 294, 256, 256, 256, 256, 256, 256, 333, 294,
- 78, 294, 282, 293, 293, 72, 345, 345, 282, 285,
- 285, 293, 294, 293, 295, 340, 345, 69, 293, 68,
- 285, 285, 285, 285, 285, 285, 286, 295, 295, 67,
- 308, 308, 308, 66, 64, 295, 340, 295, 308, 286,
- 286, 62, 53, 340, 27, 308, 354, 354, 354, 308,
- 286, 286, 286, 286, 286, 286, 291, 291, 26, 25,
-
- 24, 21, 19, 17, 7, 354, 0, 291, 291, 291,
- 291, 291, 291, 298, 298, 298, 298, 298, 298, 298,
- 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 298, 298, 298, 298, 298, 298, 298, 298, 298, 298,
- 298, 298, 298, 298, 298, 298, 298, 298, 320, 320,
- 0, 0, 0, 323, 0, 338, 0, 321, 0, 320,
- 320, 320, 320, 320, 320, 321, 323, 323, 338, 338,
- 321, 321, 339, 0, 323, 342, 338, 0, 321, 322,
- 347, 347, 0, 0, 0, 339, 339, 0, 342, 342,
-
- 347, 322, 322, 339, 0, 339, 342, 0, 342, 0,
- 357, 322, 322, 322, 322, 322, 322, 322, 327, 327,
- 327, 351, 327, 357, 357, 0, 327, 353, 352, 358,
- 358, 357, 359, 327, 351, 351, 352, 327, 352, 358,
- 353, 353, 351, 327, 351, 359, 359, 0, 353, 352,
- 353, 360, 360, 359, 361, 359, 0, 0, 0, 0,
- 0, 360, 0, 0, 0, 0, 0, 361, 361, 0,
- 0, 0, 0, 0, 0, 361, 0, 361, 363, 0,
- 0, 363, 0, 0, 0, 363, 363, 363, 364, 364,
- 364, 0, 0, 0, 0, 0, 364, 0, 364, 0,
-
- 0, 364, 364, 364, 365, 0, 365, 365, 365, 366,
- 366, 366, 0, 0, 0, 0, 366, 366, 366, 0,
- 0, 0, 366, 366, 366, 367, 367, 367, 367, 367,
- 367, 367, 367, 367, 367, 367, 367, 367, 367, 368,
- 368, 0, 368, 368, 368, 368, 368, 368, 368, 368,
- 368, 368, 368, 368, 368, 368, 369, 369, 369, 370,
- 0, 0, 0, 370, 370, 370, 373, 0, 0, 373,
- 373, 373, 373, 374, 374, 374, 0, 374, 0, 0,
- 0, 0, 0, 374, 0, 0, 374, 374, 374, 375,
- 375, 0, 375, 375, 375, 375, 375, 375, 375, 375,
-
- 375, 375, 375, 375, 375, 375, 376, 0, 0, 0,
- 0, 376, 0, 0, 0, 0, 376, 377, 0, 0,
- 377, 377, 377, 377, 378, 0, 0, 378, 378, 0,
- 0, 0, 378, 378, 379, 379, 379, 380, 380, 380,
- 0, 0, 0, 0, 380, 380, 380, 0, 0, 0,
- 380, 380, 380, 383, 0, 0, 383, 383, 383, 383,
- 384, 0, 0, 0, 384, 0, 0, 0, 384, 384,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
-
- 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
- 362, 362, 362, 362, 362, 362, 362, 362, 362
- } ;
-
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
-static char *yy_full_match;
-static int yy_lp;
-static int yy_looking_for_trail_begin = 0;
-static int yy_full_lp;
-static int *yy_full_state;
-#define YY_TRAILING_MASK 0x2000
-#define YY_TRAILING_HEAD_MASK 0x4000
-#define REJECT \
-{ \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
-yy_state_ptr = yy_full_state; /* restore orig. state */ \
-yy_current_state = *yy_state_ptr; /* restore curr. state */ \
-++yy_lp; \
-goto find_rule; \
-}
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "./ada-lex.l"
-#define INITIAL 0
-/* FLEX lexer for Ada expressions, for GDB.
- Copyright (C) 1994, 1997, 2000
- Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-/*----------------------------------------------------------------------*/
-/* The converted version of this file is to be included in ada-exp.y, */
-/* the Ada parser for gdb. The function yylex obtains characters from */
-/* the global pointer lexptr. It returns a syntactic category for */
-/* each successive token and places a semantic value into yylval */
-/* (ada-lval), defined by the parser. */
-/* Run flex with (at least) the -i option (case-insensitive), and the -I */
-/* option (interactive---no unnecessary lookahead). */
-#line 48 "./ada-lex.l"
-#define NUMERAL_WIDTH 256
-#define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
-
-/* Temporary staging for numeric literals. */
-static char numbuf[NUMERAL_WIDTH];
- static void canonicalizeNumeral (char* s1, const char*);
-static int processInt (const char*, const char*, const char*);
-static int processReal (const char*);
-static int processId (const char*, int);
-static int processAttribute (const char*);
-static int find_dot_all (const char*);
-
-#undef YY_DECL
-#define YY_DECL static int yylex ( void )
-
-#undef YY_INPUT
-#define YY_INPUT(BUF, RESULT, MAX_SIZE) \
- if ( *lexptr == '\000' ) \
- (RESULT) = YY_NULL; \
- else \
- { \
- *(BUF) = *lexptr; \
- (RESULT) = 1; \
- lexptr += 1; \
- }
-
-static char *tempbuf = NULL;
-static int tempbufsize = 0;
-static int tempbuf_len;
-static struct block* left_block_context;
-
-static void resize_tempbuf (unsigned int);
-
-static void block_lookup (char*, char*);
-
-static int name_lookup (char*, char*, int*);
-
-static int find_dot_all (const char*);
-
-#define IN_STRING 1
-#define BEFORE_QUAL_QUOTE 2
-
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines. This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
- if ( yy_current_buffer->yy_is_interactive ) \
- { \
- int c = '*', n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
- && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
- YY_USER_ACTION
-
-YY_DECL
- {
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
-
-#line 91 "./ada-lex.l"
-
-
-
- if ( yy_init )
- {
- yy_init = 0;
-
-#ifdef YY_USER_INIT
- YY_USER_INIT;
-#endif
-
- if ( ! yy_start )
- yy_start = 1; /* first start state */
-
- if ( ! yyin )
- yyin = stdin;
-
- if ( ! yyout )
- yyout = stdout;
-
- if ( ! yy_current_buffer )
- yy_current_buffer =
- yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_load_buffer_state();
- }
-
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = yy_c_buf_p;
-
- /* Support of yytext. */
- *yy_cp = yy_hold_char;
-
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 363 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
- ++yy_cp;
- }
- while ( yy_base[yy_current_state] != 1771 );
-
-yy_find_action:
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
-find_rule: /* we branch to this label when backing up */
- for ( ; ; ) /* until we find what rule we matched */
- {
- if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
- {
- yy_act = yy_acclist[yy_lp];
- if ( yy_act & YY_TRAILING_HEAD_MASK ||
- yy_looking_for_trail_begin )
- {
- if ( yy_act == yy_looking_for_trail_begin )
- {
- yy_looking_for_trail_begin = 0;
- yy_act &= ~YY_TRAILING_HEAD_MASK;
- break;
- }
- }
- else if ( yy_act & YY_TRAILING_MASK )
- {
- yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
- yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
- }
- else
- {
- yy_full_match = yy_cp;
- yy_full_state = yy_state_ptr;
- yy_full_lp = yy_lp;
- break;
- }
- ++yy_lp;
- goto find_rule;
- }
- --yy_cp;
- yy_current_state = *--yy_state_ptr;
- yy_lp = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-
-do_action: /* This label is used only to access EOF actions. */
-
-
- switch ( yy_act )
- { /* beginning of action switch */
-case 1:
-YY_RULE_SETUP
-#line 93 "./ada-lex.l"
-{ }
- YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 95 "./ada-lex.l"
-{ yyterminate(); }
- YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 97 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
- }
- YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 102 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processInt (NULL, numbuf, NULL);
- }
- YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 107 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processInt (numbuf,
- strchr (numbuf, '#') + 1,
- strrchr(numbuf, '#') + 1);
- }
- YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 114 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processInt (numbuf, strchr (numbuf, '#') + 1, NULL);
- }
- YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 119 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext+2);
- return processInt ("16#", numbuf, NULL);
- }
- YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 125 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processReal (numbuf);
- }
- YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 130 "./ada-lex.l"
-{
- canonicalizeNumeral (numbuf, yytext);
- return processReal (numbuf);
- }
- YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 135 "./ada-lex.l"
-{
- error ("Based real literals not implemented yet.");
- }
- YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 139 "./ada-lex.l"
-{
- error ("Based real literals not implemented yet.");
- }
- YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 143 "./ada-lex.l"
-{
- yylval.typed_val.type = builtin_type_ada_char;
- yylval.typed_val.val = yytext[1];
- return CHARLIT;
- }
- YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 149 "./ada-lex.l"
-{
- int v;
- yylval.typed_val.type = builtin_type_ada_char;
- sscanf (yytext+3, "%2x", &v);
- yylval.typed_val.val = v;
- return CHARLIT;
- }
- YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 157 "./ada-lex.l"
-{ return processId (yytext, yyleng); }
- YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 159 "./ada-lex.l"
-{
- tempbuf_len = 0;
- BEGIN IN_STRING;
- }
- YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 164 "./ada-lex.l"
-{
- resize_tempbuf (yyleng+tempbuf_len);
- strncpy (tempbuf+tempbuf_len, yytext, yyleng-1);
- tempbuf_len += yyleng-1;
- yylval.sval.ptr = tempbuf;
- yylval.sval.length = tempbuf_len;
- BEGIN INITIAL;
- return STRING;
- }
- YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 174 "./ada-lex.l"
-{
- int n;
- resize_tempbuf (yyleng-5+tempbuf_len+1);
- strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
- sscanf(yytext+yyleng-4, "%2x", &n);
- tempbuf[yyleng-6+tempbuf_len] = (char) n;
- tempbuf_len += yyleng-5;
- }
- YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 183 "./ada-lex.l"
-{
- int n;
- resize_tempbuf (yyleng-4+tempbuf_len+1);
- strncpy (tempbuf+tempbuf_len, yytext, yyleng-6);
- tempbuf[yyleng-5+tempbuf_len] = '"';
- tempbuf_len += yyleng-4;
- }
- YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 191 "./ada-lex.l"
-{
- while (*lexptr != 'i' && *lexptr != 'I')
- lexptr -= 1;
- yyrestart(NULL);
- return 0;
- }
- YY_BREAK
-/* ADA KEYWORDS */
-case 20:
-YY_RULE_SETUP
-#line 200 "./ada-lex.l"
-{ return ABS; }
- YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 201 "./ada-lex.l"
-{ return _AND_; }
- YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 202 "./ada-lex.l"
-{ return ELSE; }
- YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 203 "./ada-lex.l"
-{ return IN; }
- YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 204 "./ada-lex.l"
-{ return MOD; }
- YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 205 "./ada-lex.l"
-{ return NEW; }
- YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 206 "./ada-lex.l"
-{ return NOT; }
- YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 207 "./ada-lex.l"
-{ return NULL_PTR; }
- YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 208 "./ada-lex.l"
-{ return OR; }
- YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 209 "./ada-lex.l"
-{ return REM; }
- YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 210 "./ada-lex.l"
-{ return THEN; }
- YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 211 "./ada-lex.l"
-{ return XOR; }
- YY_BREAK
-/* ATTRIBUTES */
-case 32:
-YY_RULE_SETUP
-#line 215 "./ada-lex.l"
-{ return processAttribute (yytext+1); }
- YY_BREAK
-/* PUNCTUATION */
-case 33:
-YY_RULE_SETUP
-#line 219 "./ada-lex.l"
-{ return ARROW; }
- YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 220 "./ada-lex.l"
-{ return DOTDOT; }
- YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 221 "./ada-lex.l"
-{ return STARSTAR; }
- YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 222 "./ada-lex.l"
-{ return ASSIGN; }
- YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 223 "./ada-lex.l"
-{ return NOTEQUAL; }
- YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 224 "./ada-lex.l"
-{ return LEQ; }
- YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 225 "./ada-lex.l"
-{ return GEQ; }
- YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 227 "./ada-lex.l"
-{ BEGIN INITIAL; return '\''; }
- YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 229 "./ada-lex.l"
-{ return yytext[0]; }
- YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 231 "./ada-lex.l"
-{ if (paren_depth == 0 && comma_terminates)
- {
- lexptr -= 1;
- yyrestart(NULL);
- return 0;
- }
- else
- return ',';
- }
- YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 241 "./ada-lex.l"
-{ paren_depth += 1; return '('; }
- YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 242 "./ada-lex.l"
-{ if (paren_depth == 0)
- {
- lexptr -= 1;
- yyrestart(NULL);
- return 0;
- }
- else
- {
- paren_depth -= 1;
- return ')';
- }
- }
- YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 255 "./ada-lex.l"
-{ return DOT_ALL; }
- YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 257 "./ada-lex.l"
-{
- processId (yytext+1, yyleng-1);
- return DOT_ID;
- }
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 262 "./ada-lex.l"
-{
- int all_posn = find_dot_all (yytext);
- int token_type, segments, k;
- int quote_follows;
-
- if (all_posn == -1 && yytext[yyleng-1] == '\'')
- {
- quote_follows = 1;
- do {
- yyless (yyleng-1);
- } while (yytext[yyleng-1] == ' ');
- }
- else
- quote_follows = 0;
-
- if (all_posn >= 0)
- yyless (all_posn);
- processId(yytext, yyleng);
- segments = name_lookup (ada_mangle (yylval.ssym.stoken.ptr),
- yylval.ssym.stoken.ptr, &token_type);
- left_block_context = NULL;
- for (k = yyleng; segments > 0 && k > 0; k -= 1)
- {
- if (yytext[k-1] == '.')
- segments -= 1;
- quote_follows = 0;
- }
- if (k <= 0)
- error ("confused by name %s", yytext);
- yyless (k);
- if (quote_follows)
- BEGIN BEFORE_QUAL_QUOTE;
- return token_type;
- }
- YY_BREAK
-/* GDB EXPRESSION CONSTRUCTS */
-case 48:
-YY_RULE_SETUP
-#line 300 "./ada-lex.l"
-{
- processId(yytext, yyleng-2);
- block_lookup (yylval.ssym.stoken.ptr, yylval.ssym.stoken.ptr);
- return BLOCKNAME;
- }
- YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 306 "./ada-lex.l"
-{
- processId(yytext, yyleng-2);
- block_lookup (ada_mangle (yylval.ssym.stoken.ptr),
- yylval.ssym.stoken.ptr);
- return BLOCKNAME;
- }
- YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 313 "./ada-lex.l"
-{ return yytext[0]; }
- YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 315 "./ada-lex.l"
-{ yylval.lval = -1; return LAST; }
- YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 316 "./ada-lex.l"
-{ yylval.lval = -atoi(yytext+2); return LAST; }
- YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 317 "./ada-lex.l"
-{ yylval.lval = 0; return LAST; }
- YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 318 "./ada-lex.l"
-{ yylval.lval = atoi(yytext+1); return LAST; }
- YY_BREAK
-/* REGISTERS AND GDB CONVENIENCE VARIABLES */
-case 55:
-YY_RULE_SETUP
-#line 323 "./ada-lex.l"
-{
- int c;
- for (c = 0; c < NUM_REGS; c++)
- if (REGISTER_NAME (c) &&
- strcmp (yytext + 1, REGISTER_NAME (c)) == 0)
- {
- yylval.lval = c;
- return REGNAME;
- }
- yylval.sval.ptr = yytext;
- yylval.sval.length = yyleng;
- yylval.ivar =
- lookup_internalvar (copy_name (yylval.sval) + 1);
- return INTERNAL_VARIABLE;
- }
- YY_BREAK
-/* CATCH-ALL ERROR CASE */
-case 56:
-YY_RULE_SETUP
-#line 341 "./ada-lex.l"
-{ error ("Invalid character '%s' in expression.", yytext); }
- YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 342 "./ada-lex.l"
-YY_FATAL_ERROR( "flex scanner jammed" );
- YY_BREAK
- case YY_STATE_EOF(INITIAL):
- case YY_STATE_EOF(IN_STRING):
- case YY_STATE_EOF(BEFORE_QUAL_QUOTE):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = yy_hold_char;
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between yy_current_buffer and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yy_current_buffer->yy_input_file = yyin;
- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = yytext_ptr + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++yy_c_buf_p;
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = yy_c_buf_p;
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_END_OF_FILE:
- {
- yy_did_buffer_switch_on_eof = 0;
-
- if ( yywrap() )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p =
- yytext_ptr + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- yy_c_buf_p =
- &yy_current_buffer->yy_ch_buf[yy_n_chars];
-
- yy_current_state = yy_get_previous_state();
-
- yy_cp = yy_c_buf_p;
- yy_bp = yytext_ptr + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
- } /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
- {
- register char *dest = yy_current_buffer->yy_ch_buf;
- register char *source = yytext_ptr;
- register int number_to_move, i;
- int ret_val;
-
- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( yy_current_buffer->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
- else
- {
- int num_to_read =
- yy_current_buffer->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
- YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = yy_current_buffer;
-
- int yy_c_buf_p_offset =
- (int) (yy_c_buf_p - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yy_flex_realloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = yy_current_buffer->yy_buf_size -
- number_to_move - 1;
-#endif
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
- yy_n_chars, num_to_read );
-
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- if ( yy_n_chars == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- yy_current_buffer->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- yy_n_chars += number_to_move;
- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
- return ret_val;
- }
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
- {
- register yy_state_type yy_current_state;
- register char *yy_cp;
-
- yy_current_state = yy_start;
- yy_state_ptr = yy_state_buf;
- *yy_state_ptr++ = yy_current_state;
-
- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 363 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- *yy_state_ptr++ = yy_current_state;
- }
-
- return yy_current_state;
- }
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- * next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
- {
- register int yy_is_jam;
-
- register YY_CHAR yy_c = 1;
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
- {
- yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 363 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 362);
- if ( ! yy_is_jam )
- *yy_state_ptr++ = yy_current_state;
-
- return yy_is_jam ? 0 : yy_current_state;
- }
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
- {
- register char *yy_cp = yy_c_buf_p;
-
- /* undo effects of setting up yytext */
- *yy_cp = yy_hold_char;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = yy_n_chars + 2;
- register char *dest = &yy_current_buffer->yy_ch_buf[
- yy_current_buffer->yy_buf_size + 2];
- register char *source =
- &yy_current_buffer->yy_ch_buf[number_to_move];
-
- while ( source > yy_current_buffer->yy_ch_buf )
- *--dest = *--source;
-
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- yy_current_buffer->yy_n_chars =
- yy_n_chars = yy_current_buffer->yy_buf_size;
-
- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
-
- *--yy_cp = (char) c;
-
-
- yytext_ptr = yy_bp;
- yy_hold_char = *yy_cp;
- yy_c_buf_p = yy_cp;
- }
-#endif /* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
- {
- int c;
-
- *yy_c_buf_p = yy_hold_char;
-
- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
- /* This was really a NUL. */
- *yy_c_buf_p = '\0';
-
- else
- { /* need more input */
- int offset = yy_c_buf_p - yytext_ptr;
- ++yy_c_buf_p;
-
- switch ( yy_get_next_buffer() )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart( yyin );
-
- /* fall through */
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap() )
- return EOF;
-
- if ( ! yy_did_buffer_switch_on_eof )
- YY_NEW_FILE;
-#ifdef __cplusplus
- return yyinput();
-#else
- return input();
-#endif
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- yy_c_buf_p = yytext_ptr + offset;
- break;
- }
- }
- }
-
- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
- *yy_c_buf_p = '\0'; /* preserve yytext */
- yy_hold_char = *++yy_c_buf_p;
-
-
- return c;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
- {
- if ( ! yy_current_buffer )
- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
- yy_init_buffer( yy_current_buffer, input_file );
- yy_load_buffer_state();
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
- {
- if ( yy_current_buffer == new_buffer )
- return;
-
- if ( yy_current_buffer )
- {
- /* Flush out information for old buffer. */
- *yy_c_buf_p = yy_hold_char;
- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
- yy_current_buffer->yy_n_chars = yy_n_chars;
- }
-
- yy_current_buffer = new_buffer;
- yy_load_buffer_state();
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- yy_did_buffer_switch_on_eof = 1;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
- {
- yy_n_chars = yy_current_buffer->yy_n_chars;
- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
- yyin = yy_current_buffer->yy_input_file;
- yy_hold_char = *yy_c_buf_p;
- }
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_buf_size = size;
-
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
- b->yy_is_our_buffer = 1;
-
- yy_init_buffer( b, file );
-
- return b;
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
- {
- if ( ! b )
- return;
-
- if ( b == yy_current_buffer )
- yy_current_buffer = (YY_BUFFER_STATE) 0;
-
- if ( b->yy_is_our_buffer )
- yy_flex_free( (void *) b->yy_ch_buf );
-
- yy_flex_free( (void *) b );
- }
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
- {
- yy_flush_buffer( b );
-
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
-#else
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
- }
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
- {
- if ( ! b )
- return;
-
- b->yy_n_chars = 0;
-
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
- b->yy_buf_pos = &b->yy_ch_buf[0];
-
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- if ( b == yy_current_buffer )
- yy_load_buffer_state();
- }
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
- {
- YY_BUFFER_STATE b;
-
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer( b );
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
- {
- int len;
- for ( len = 0; yy_str[len]; ++len )
- ;
-
- return yy_scan_bytes( yy_str, len );
- }
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
- {
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
-
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = len + 2;
- buf = (char *) yy_flex_alloc( n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
- for ( i = 0; i < len; ++i )
- buf[i] = bytes[i];
-
- buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
- b = yy_scan_buffer( buf, n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
-
- return b;
- }
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
- {
- if ( yy_start_stack_ptr >= yy_start_stack_depth )
- {
- yy_size_t new_size;
-
- yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yy_start_stack_depth * sizeof( int );
-
- if ( ! yy_start_stack )
- yy_start_stack = (int *) yy_flex_alloc( new_size );
-
- else
- yy_start_stack = (int *) yy_flex_realloc(
- (void *) yy_start_stack, new_size );
-
- if ( ! yy_start_stack )
- YY_FATAL_ERROR(
- "out of memory expanding start-condition stack" );
- }
-
- yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
- BEGIN(new_state);
- }
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
- {
- if ( --yy_start_stack_ptr < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
-
- BEGIN(yy_start_stack[yy_start_stack_ptr]);
- }
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
- {
- return yy_start_stack[yy_start_stack_ptr - 1];
- }
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
- {
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
- }
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
- yytext[yyleng] = yy_hold_char; \
- yy_c_buf_p = yytext + n; \
- yy_hold_char = *yy_c_buf_p; \
- *yy_c_buf_p = '\0'; \
- yyleng = n; \
- } \
- while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
- {
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
- }
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
- {
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
-
- return n;
- }
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
- {
- return (void *) malloc( size );
- }
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
- {
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
- }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
- {
- free( ptr );
- }
-
-#if YY_MAIN
-int main()
- {
- yylex();
- return 0;
- }
-#endif
-#line 342 "./ada-lex.l"
-
-
-#include <ctype.h>
-#include <string.h>
-
-/* Initialize the lexer for processing new expression */
-void
-lexer_init (FILE* inp)
-{
- BEGIN INITIAL;
- yyrestart (inp);
-}
-
-
-/* Make sure that tempbuf points at an array at least N characters long. */
-
-static void
-resize_tempbuf (n)
- unsigned int n;
-{
- if (tempbufsize < n)
- {
- tempbufsize = (n+63) & ~63;
- tempbuf = (char*) xrealloc (tempbuf, tempbufsize);
- }
-}
-
-/* Copy S2 to S1, removing all underscores, and downcasing all letters. */
-
-static void
-canonicalizeNumeral (s1,s2)
- char* s1;
- const char* s2;
-{
- for (; *s2 != '\000'; s2 += 1)
- {
- if (*s2 != '_')
- {
- *s1 = tolower(*s2);
- s1 += 1;
- }
- }
- s1[0] = '\000';
-}
-
-#define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
-
-/* True (non-zero) iff DIGIT is a valid digit in radix BASE,
- where 2 <= BASE <= 16. */
-
-static int
-is_digit_in_base (digit, base)
- unsigned char digit;
- int base;
-{
- if (!isxdigit (digit))
- return 0;
- if (base <= 10)
- return (isdigit (digit) && digit < base + '0');
- else
- return (isdigit (digit) || tolower (digit) < base - 10 + 'a');
-}
-
-static int
-digit_to_int (c)
- unsigned char c;
-{
- if (isdigit (c))
- return c - '0';
- else
- return tolower (c) - 'a' + 10;
-}
-
-/* As for strtoul, but for ULONGEST results. */
-ULONGEST
-strtoulst (num, trailer, base)
- const char *num;
- const char **trailer;
- int base;
-{
- unsigned int high_part;
- ULONGEST result;
- int i;
- unsigned char lim;
-
- if (base < 2 || base > 16)
- {
- errno = EINVAL;
- return 0;
- }
- lim = base - 1 + '0';
-
- result = high_part = 0;
- for (i = 0; is_digit_in_base (num[i], base); i += 1)
- {
- result = result*base + digit_to_int (num[i]);
- high_part = high_part*base + (unsigned int) (result >> HIGH_BYTE_POSN);
- result &= ((ULONGEST) 1 << HIGH_BYTE_POSN) - 1;
- if (high_part > 0xff)
- {
- errno = ERANGE;
- result = high_part = 0;
- break;
- }
- }
-
- if (trailer != NULL)
- *trailer = &num[i];
-
- return result + ((ULONGEST) high_part << HIGH_BYTE_POSN);
-}
-
-
-
-/* Interprets the prefix of NUM that consists of digits of the given BASE
- as an integer of that BASE, with the string EXP as an exponent.
- Puts value in yylval, and returns INT, if the string is valid. Causes
- an error if the number is improperly formated. BASE, if NULL, defaults
- to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'. */
-
-static int
-processInt (base0, num0, exp0)
- const char* num0;
- const char* base0;
- const char* exp0;
-{
- ULONGEST result;
- long exp;
- int base;
-
- char* trailer;
-
- if (base0 == NULL)
- base = 10;
- else
- {
- base = strtol (base0, (char**) NULL, 10);
- if (base < 2 || base > 16)
- error ("Invalid base: %d.", base);
- }
-
- if (exp0 == NULL)
- exp = 0;
- else
- exp = strtol(exp0, (char**) NULL, 10);
-
- errno = 0;
- result = strtoulst (num0, &trailer, base);
- if (errno == ERANGE)
- error ("Integer literal out of range");
- if (isxdigit(*trailer))
- error ("Invalid digit `%c' in based literal", *trailer);
-
- while (exp > 0)
- {
- if (result > (ULONG_MAX / base))
- error ("Integer literal out of range");
- result *= base;
- exp -= 1;
- }
-
- if ((result >> (TARGET_INT_BIT-1)) == 0)
- yylval.typed_val.type = builtin_type_ada_int;
- else if ((result >> (TARGET_LONG_BIT-1)) == 0)
- yylval.typed_val.type = builtin_type_ada_long;
- else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
- {
- /* We have a number representable as an unsigned integer quantity.
- For consistency with the C treatment, we will treat it as an
- anonymous modular (unsigned) quantity. Alas, the types are such
- that we need to store .val as a signed quantity. Sorry
- for the mess, but C doesn't officially guarantee that a simple
- assignment does the trick (no, it doesn't; read the reference manual).
- */
- yylval.typed_val.type = builtin_type_unsigned_long;
- if (result & LONGEST_SIGN)
- yylval.typed_val.val =
- (LONGEST) (result & ~LONGEST_SIGN)
- - (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
- else
- yylval.typed_val.val = (LONGEST) result;
- return INT;
- }
- else
- yylval.typed_val.type = builtin_type_ada_long_long;
-
- yylval.typed_val.val = (LONGEST) result;
- return INT;
-}
-
-static int
-processReal (num0)
- const char* num0;
-{
- if (sizeof (DOUBLEST) <= sizeof (float))
- sscanf (num0, "%g", &yylval.typed_val_float.dval);
- else if (sizeof (DOUBLEST) <= sizeof (double))
- sscanf (num0, "%lg", &yylval.typed_val_float.dval);
- else
- {
-#ifdef PRINTF_HAS_LONG_DOUBLE
- sscanf (num0, "%Lg", &yylval.typed_val_float.dval);
-#else
- /* Scan it into a double, then convert and assign it to the
- long double. This at least wins with values representable
- in the range of doubles. */
- double temp;
- sscanf (num0, "%lg", &temp);
- yylval.typed_val_float.dval = temp;
-#endif
- }
-
- yylval.typed_val_float.type = builtin_type_ada_float;
- if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
- yylval.typed_val_float.type = builtin_type_ada_double;
- if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
- yylval.typed_val_float.type = builtin_type_ada_long_double;
-
- return FLOAT;
-}
-
-static int
-processId (name0, len)
- const char *name0;
- int len;
-{
- char* name = xmalloc (len + 11);
- int i0, i;
-
-/* add_name_string_cleanup (name); */
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
- while (len > 0 && isspace (name0[len-1]))
- len -= 1;
- i = i0 = 0;
- while (i0 < len)
- {
- if (isalnum (name0[i0]))
- {
- name[i] = tolower (name0[i0]);
- i += 1; i0 += 1;
- }
- else switch (name0[i0])
- {
- default:
- name[i] = name0[i0];
- i += 1; i0 += 1;
- break;
- case ' ': case '\t':
- i0 += 1;
- break;
- case '\'':
- i0 += 1;
- while (i0 < len && name0[i0] != '\'')
- {
- name[i] = name0[i0];
- i += 1; i0 += 1;
- }
- i0 += 1;
- break;
- case '<':
- i0 += 1;
- while (i0 < len && name0[i0] != '>')
- {
- name[i] = name0[i0];
- i += 1; i0 += 1;
- }
- i0 += 1;
- break;
- }
- }
- name[i] = '\000';
-
- yylval.ssym.sym = NULL;
- yylval.ssym.stoken.ptr = name;
- yylval.ssym.stoken.length = i;
- return NAME;
-}
-
-static void
-block_lookup (name, err_name)
- char* name;
- char* err_name;
-{
- struct symbol** syms;
- struct block** blocks;
- int nsyms;
- struct symtab *symtab;
- nsyms = ada_lookup_symbol_list (name, left_block_context,
- VAR_NAMESPACE, &syms, &blocks);
- if (left_block_context == NULL &&
- (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK))
- symtab = lookup_symtab (name);
- else
- symtab = NULL;
-
- if (symtab != NULL)
- left_block_context = yylval.bval =
- BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
- else if (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK)
- {
- if (left_block_context == NULL)
- error ("No file or function \"%s\".", err_name);
- else
- error ("No function \"%s\" in specified context.", err_name);
- }
- else
- {
- left_block_context = yylval.bval = SYMBOL_BLOCK_VALUE (syms[0]);
- if (nsyms > 1)
- warning ("Function name \"%s\" ambiguous here", err_name);
- }
-}
-
-/* Look up NAME0 (assumed to be mangled) as a name in VAR_NAMESPACE,
- setting *TOKEN_TYPE to NAME or TYPENAME, depending on what is
- found. Try first the entire name, then the name without the last
- segment (i.e., after the last .id), etc., and return the number of
- segments that had to be removed to get a match. Calls error if no
- matches are found, using ERR_NAME in any error message. When
- exactly one symbol match is found, it is placed in yylval. */
-
-static int
-name_lookup (name0, err_name, token_type)
- char* name0;
- char* err_name;
- int* token_type;
-{
- struct symbol** syms;
- struct block** blocks;
- struct type* type;
- int len0 = strlen (name0);
- char* name = savestring (name0, len0);
- int nsyms;
- int segments;
-
-/* add_name_string_cleanup (name);*/
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
- yylval.ssym.stoken.ptr = name;
- yylval.ssym.stoken.length = strlen (name);
- for (segments = 0; ; segments += 1)
- {
- struct type* preferred_type;
- int i, preferred_index;
-
- if (left_block_context == NULL)
- nsyms = ada_lookup_symbol_list (name, expression_context_block,
- VAR_NAMESPACE, &syms, &blocks);
- else
- nsyms = ada_lookup_symbol_list (name, left_block_context,
- VAR_NAMESPACE, &syms, &blocks);
-
- /* Check for a type definition. */
-
- /* Look for a symbol that doesn't denote void. This is (I think) a */
- /* temporary kludge to get around problems in GNAT output. */
- preferred_index = -1; preferred_type = NULL;
- for (i = 0; i < nsyms; i += 1)
- switch (SYMBOL_CLASS (syms[i]))
- {
- case LOC_TYPEDEF:
- if (ada_prefer_type (SYMBOL_TYPE (syms[i]), preferred_type))
- {
- preferred_index = i;
- preferred_type = SYMBOL_TYPE (syms[i]);
- }
- break;
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG:
- case LOC_BASEREG_ARG:
- goto NotType;
- default:
- break;
- }
- if (preferred_type != NULL)
- {
-/* if (TYPE_CODE (preferred_type) == TYPE_CODE_VOID)
- error ("`%s' matches only void type name(s)",
- ada_demangle (name));
-*/
-/* FIXME: ada_demangle should be defined in defs.h, and is located in ada-lang.c */
-/* else*/ if (ada_is_object_renaming (syms[preferred_index]))
- {
- yylval.ssym.sym = syms[preferred_index];
- *token_type = OBJECT_RENAMING;
- return segments;
- }
- else if (ada_renaming_type (SYMBOL_TYPE (syms[preferred_index]))
- != NULL)
- {
- int result;
- const char* renaming =
- ada_simple_renamed_entity (syms[preferred_index]);
- char* new_name = xmalloc (strlen (renaming) + len0
- - yylval.ssym.stoken.length + 1);
-/* add_name_string_cleanup (new_name);*/
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
- strcpy (new_name, renaming);
- strcat (new_name, name0 + yylval.ssym.stoken.length);
- result = name_lookup (new_name, err_name, token_type);
- if (result > segments)
- error ("Confused by renamed symbol.");
- return result;
- }
- else if (segments == 0)
- {
- yylval.tval = preferred_type;
- *token_type = TYPENAME;
- return 0;
- }
- }
-
- if (segments == 0)
- {
- type = lookup_primitive_typename (name);
- if (type == NULL && STREQ ("system__address", name))
- type = builtin_type_ada_system_address;
- if (type != NULL)
- {
- yylval.tval = type;
- *token_type = TYPENAME;
- return 0;
- }
- }
-
- NotType:
- if (nsyms == 1)
- {
- *token_type = NAME;
- yylval.ssym.sym = syms[0];
- yylval.ssym.msym = NULL;
- yylval.ssym.block = blocks[0];
- return segments;
- }
- else if (nsyms == 0) {
- int i;
- yylval.ssym.msym = ada_lookup_minimal_symbol (name);
- if (yylval.ssym.msym != NULL)
- {
- yylval.ssym.sym = NULL;
- yylval.ssym.block = NULL;
- *token_type = NAME;
- return segments;
- }
-
- for (i = yylval.ssym.stoken.length - 1; i > 0; i -= 1)
- {
- if (name[i] == '.')
- {
- name[i] = '\0';
- yylval.ssym.stoken.length = i;
- break;
- }
- else if (name[i] == '_' && name[i-1] == '_')
- {
- i -= 1;
- name[i] = '\0';
- yylval.ssym.stoken.length = i;
- break;
- }
- }
- if (i <= 0)
- {
- if (!have_full_symbols () && !have_partial_symbols ()
- && left_block_context == NULL)
- error ("No symbol table is loaded. Use the \"file\" command.");
- if (left_block_context == NULL)
- error ("No definition of \"%s\" in current context.",
- err_name);
- else
- error ("No definition of \"%s\" in specified context.",
- err_name);
- }
- }
- else
- {
- *token_type = NAME;
- yylval.ssym.sym = NULL;
- yylval.ssym.msym = NULL;
- if (left_block_context == NULL)
- yylval.ssym.block = expression_context_block;
- else
- yylval.ssym.block = left_block_context;
- return segments;
- }
- }
-}
-
-/* Returns the position within STR of the '.' in a
- '.{WHITE}*all' component of a dotted name, or -1 if there is none. */
-static int
-find_dot_all (str)
- const char* str;
-{
- int i;
- for (i = 0; str[i] != '\000'; i += 1)
- {
- if (str[i] == '.')
- {
- int i0 = i;
- do
- i += 1;
- while (isspace (str[i]));
- if (strcmp (str+i, "all") == 0
- && ! isalnum (str[i+3]) && str[i+3] != '_')
- return i0;
- }
- }
- return -1;
-}
-
-/* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
- case. */
-
-static int
-subseqMatch (subseq, str)
- const char* subseq;
- const char* str;
-{
- if (subseq[0] == '\0')
- return 1;
- else if (str[0] == '\0')
- return 0;
- else if (tolower (subseq[0]) == tolower (str[0]))
- return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
- else
- return subseqMatch (subseq, str+1);
-}
-
-
-static struct { const char* name; int code; }
-attributes[] = {
- { "address", TICK_ADDRESS },
- { "unchecked_access", TICK_ACCESS },
- { "unrestricted_access", TICK_ACCESS },
- { "access", TICK_ACCESS },
- { "first", TICK_FIRST },
- { "last", TICK_LAST },
- { "length", TICK_LENGTH },
- { "max", TICK_MAX },
- { "min", TICK_MIN },
- { "modulus", TICK_MODULUS },
- { "pos", TICK_POS },
- { "range", TICK_RANGE },
- { "size", TICK_SIZE },
- { "tag", TICK_TAG },
- { "val", TICK_VAL },
- { NULL, -1 }
-};
-
-/* Return the syntactic code corresponding to the attribute name or
- abbreviation STR. */
-
-static int
-processAttribute (str)
- const char* str;
-{
- int i, k;
-
- for (i = 0; attributes[i].code != -1; i += 1)
- if (strcasecmp (str, attributes[i].name) == 0)
- return attributes[i].code;
-
- for (i = 0, k = -1; attributes[i].code != -1; i += 1)
- if (subseqMatch (str, attributes[i].name))
- {
- if (k == -1)
- k = i;
- else
- error ("ambiguous attribute name: `%s'", str);
- }
- if (k == -1)
- error ("unrecognized attribute: `%s'", str);
-
- return attributes[k].code;
-}
-
-int
-yywrap()
-{
- return 1;
-}
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 23dc105ea9d..eccd5a1c214 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -14,9 +14,9 @@
*/
-#include <ctype.h>
-#include "defs.h"
-#include "command.h"
+#include <ctype.h>
+#include "defs.h"
+#include "command.h"
#include "value.h"
#include "language.h"
#include "inferior.h"
@@ -30,7 +30,7 @@
#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET))
#include "gregset.h"
-#endif
+#endif
#include "ada-lang.h"
@@ -71,10 +71,10 @@ extern int dec_thread_get_registers (gdb_gregset_t *, gdb_fpregset_t *);
#elif defined (sun) && defined (__SVR4)
#define GET_CURRENT_THREAD solaris_thread_get_current_thread
#define THREAD_FETCH_REGISTERS() (-1)
-extern void *GET_CURRENT_THREAD();
+extern void *GET_CURRENT_THREAD ();
#elif defined (_AIX) || (defined(__alpha__) && defined(__osf__))
-extern void *GET_CURRENT_THREAD();
+extern void *GET_CURRENT_THREAD ();
#elif defined (__WIN32__) || defined (hpux)
#define GET_CURRENT_THREAD() (inferior_pid)
@@ -90,7 +90,7 @@ extern void *GET_CURRENT_THREAD();
#define READ_MEMORY(addr, var) read_memory (addr, (char*) &var, sizeof (var))
/* external declarations */
-extern struct value* find_function_in_inferior (char *);
+extern struct value *find_function_in_inferior (char *);
/* Global visible variables */
@@ -110,8 +110,7 @@ const int MAX_NUMBER_OF_KNOWN_TASKS = 1000;
int current_task = -1, current_task_id = -1, current_task_index;
void *current_thread, *current_lwp;
-char *ada_task_states[] =
-{
+char *ada_task_states[] = {
"Unactivated",
"Runnable",
"Terminated",
@@ -131,8 +130,7 @@ char *ada_task_states[] =
/* Global internal types */
-static char *ada_long_task_states[] =
-{
+static char *ada_long_task_states[] = {
"Unactivated",
"Runnable",
"Terminated",
@@ -153,18 +151,17 @@ static char *ada_long_task_states[] =
/* Global internal variables */
static int highest_task_num = 0;
-int thread_support = 0; /* 1 if the thread library in use is supported */
+int thread_support = 0; /* 1 if the thread library in use is supported */
static int gdbtk_task_initialization = 0;
-static int add_task_entry (p_task_id, index)
- void *p_task_id;
- int index;
+static int
+add_task_entry (void *p_task_id, int index)
{
struct task_entry *new_task_entry = NULL;
struct task_entry *pt;
highest_task_num++;
- new_task_entry = malloc (sizeof (struct task_entry));
+ new_task_entry = xmalloc (sizeof (struct task_entry));
new_task_entry->task_num = highest_task_num;
new_task_entry->task_id = p_task_id;
new_task_entry->known_tasks_index = index;
@@ -177,13 +174,13 @@ static int add_task_entry (p_task_id, index)
pt->next_task = new_task_entry;
pt->stack_per = 0;
}
- else task_list = new_task_entry;
+ else
+ task_list = new_task_entry;
return new_task_entry->task_num;
}
-int
-get_entry_number (p_task_id)
- void *p_task_id;
+int
+get_entry_number (void *p_task_id)
{
struct task_entry *pt;
@@ -197,8 +194,8 @@ get_entry_number (p_task_id)
return 0;
}
-static struct task_entry *get_thread_entry_vptr (thread)
- void *thread;
+static struct task_entry *
+get_thread_entry_vptr (void *thread)
{
struct task_entry *pt;
@@ -206,14 +203,14 @@ static struct task_entry *get_thread_entry_vptr (thread)
while (pt != NULL)
{
if (pt->thread == thread)
- return pt;
+ return pt;
pt = pt->next_task;
}
return 0;
}
-static struct task_entry *get_entry_vptr (p_task_num)
- int p_task_num;
+static struct task_entry *
+get_entry_vptr (int p_task_num)
{
struct task_entry *pt;
@@ -227,7 +224,8 @@ static struct task_entry *get_entry_vptr (p_task_num)
return NULL;
}
-void init_task_list ()
+void
+init_task_list (void)
{
struct task_entry *pt, *old_pt;
@@ -236,21 +234,22 @@ void init_task_list ()
{
old_pt = pt;
pt = pt->next_task;
- free (old_pt);
+ xfree (old_pt);
};
task_list = NULL;
highest_task_num = 0;
}
-int valid_task_id (task)
- int task;
+int
+valid_task_id (int task)
{
return get_entry_vptr (task) != NULL;
}
-void *get_self_id ()
+void *
+get_self_id (void)
{
- struct value* val;
+ struct value *val;
void *self_id;
int result;
struct task_entry *ent;
@@ -270,10 +269,11 @@ void *get_self_id ()
return NULL;
}
-int get_current_task ()
+int
+get_current_task ()
{
int result;
-
+
/* FIXME: language_ada should be defined in defs.h */
/* if (current_language->la_language != language_ada) return -1; */
@@ -286,31 +286,29 @@ int get_current_task ()
/* Print detailed information about specified task */
static void
-info_task (arg, from_tty)
- char *arg;
- int from_tty;
+info_task (char *arg, int from_tty)
{
void *temp_task;
struct task_entry *pt, *pt2;
void *self_id, *caller;
struct task_fields atcb, atcb2;
struct entry_call call;
- int bounds [2];
- char image [256];
+ int bounds[2];
+ char image[256];
int num;
/* FIXME: language_ada should be defined in defs.h */
/* if (current_language->la_language != language_ada)
- {
- printf_filtered ("The current language does not support tasks.\n");
- return;
- }
- */
+ {
+ printf_filtered ("The current language does not support tasks.\n");
+ return;
+ }
+ */
pt = get_entry_vptr (atoi (arg));
if (pt == NULL)
{
- printf_filtered ("Task %s not found.\n", arg);
- return;
+ printf_filtered ("Task %s not found.\n", arg);
+ return;
}
temp_task = pt->task_id;
@@ -322,14 +320,16 @@ info_task (arg, from_tty)
printf_filtered ("Ada Task: %p\n", temp_task);
/* print the name of the task */
- if (atcb.image.P_ARRAY != NULL) {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds);
- bounds [1] = EXTRACT_INT (bounds [1]);
- read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
- (char*) &image, bounds [1]);
- printf_filtered ("Name: %.*s\n", bounds [1], image);
- }
- else printf_filtered ("<no name>\n");
+ if (atcb.image.P_ARRAY != NULL)
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds);
+ bounds[1] = EXTRACT_INT (bounds[1]);
+ read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
+ (char *) &image, bounds[1]);
+ printf_filtered ("Name: %.*s\n", bounds[1], image);
+ }
+ else
+ printf_filtered ("<no name>\n");
/* print the thread id */
@@ -341,9 +341,9 @@ info_task (arg, from_tty)
if ((long) pt->lwp != 0)
{
if ((long) pt->lwp < 65536)
- printf_filtered ("LWP: %ld\n", (long int) pt->lwp);
+ printf_filtered ("LWP: %ld\n", (long int) pt->lwp);
else
- printf_filtered ("LWP: %p\n", pt->lwp);
+ printf_filtered ("LWP: %p\n", pt->lwp);
}
/* print the parent gdb task id */
@@ -355,16 +355,17 @@ info_task (arg, from_tty)
READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2);
/* print the name of the task */
- if (atcb2.image.P_ARRAY != NULL) {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
- bounds);
- bounds [1] = EXTRACT_INT (bounds [1]);
- read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
- (char*) &image, bounds [1]);
- printf_filtered (" (%.*s)\n", bounds [1], image);
- }
+ if (atcb2.image.P_ARRAY != NULL)
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
+ bounds);
+ bounds[1] = EXTRACT_INT (bounds[1]);
+ read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
+ (char *) &image, bounds[1]);
+ printf_filtered (" (%.*s)\n", bounds[1], image);
+ }
else
- printf_filtered ("\n");
+ printf_filtered ("\n");
}
else
printf_filtered ("No parent\n");
@@ -377,11 +378,12 @@ info_task (arg, from_tty)
/* check if this task is accepting a rendezvous */
if (atcb.call == NULL)
caller = NULL;
- else {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
- caller = EXTRACT_ADDRESS (call.self);
- }
-
+ else
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
+ caller = EXTRACT_ADDRESS (call.self);
+ }
+
if (caller != NULL)
{
num = get_entry_number (caller);
@@ -393,14 +395,15 @@ info_task (arg, from_tty)
READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2);
/* print the name of the task */
- if (atcb2.image.P_ARRAY != NULL) {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
- bounds);
- bounds [1] = EXTRACT_INT (bounds [1]);
- read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
- (char*) &image, bounds [1]);
- printf_filtered (" (%.*s)\n", bounds [1], image);
- }
+ if (atcb2.image.P_ARRAY != NULL)
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
+ bounds);
+ bounds[1] = EXTRACT_INT (bounds[1]);
+ read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
+ (char *) &image, bounds[1]);
+ printf_filtered (" (%.*s)\n", bounds[1], image);
+ }
else
printf_filtered ("\n");
}
@@ -408,7 +411,7 @@ info_task (arg, from_tty)
printf_filtered ("\n");
}
else
- printf_filtered ("State: %s\n", ada_long_task_states [atcb.state]);
+ printf_filtered ("State: %s\n", ada_long_task_states[atcb.state]);
}
#if 0
@@ -417,50 +420,57 @@ info_task (arg, from_tty)
tasks_fields structure
*/
-print_align ()
+print_align (void)
{
struct task_fields tf;
- void *tf_base = &(tf);
- void *tf_state = &(tf.state);
- void *tf_entry_num = &(tf.entry_num);
- void *tf_parent = &(tf.parent);
- void *tf_priority = &(tf.priority);
+ void *tf_base = &(tf);
+ void *tf_state = &(tf.state);
+ void *tf_entry_num = &(tf.entry_num);
+ void *tf_parent = &(tf.parent);
+ void *tf_priority = &(tf.priority);
void *tf_current_priority = &(tf.current_priority);
- void *tf_image = &(tf.image);
- void *tf_call = &(tf.call);
- void *tf_thread = &(tf.thread);
- void *tf_lwp = &(tf.lwp);
+ void *tf_image = &(tf.image);
+ void *tf_call = &(tf.call);
+ void *tf_thread = &(tf.thread);
+ void *tf_lwp = &(tf.lwp);
printf_filtered ("\n");
printf_filtered ("(tf_base = 0x%x)\n", tf_base);
- printf_filtered ("task_fields.entry_num at %3d (0x%x)\n", tf_entry_num - tf_base, tf_entry_num);
- printf_filtered ("task_fields.state at %3d (0x%x)\n", tf_state - tf_base, tf_state);
- printf_filtered ("task_fields.parent at %3d (0x%x)\n", tf_parent - tf_base, tf_parent);
- printf_filtered ("task_fields.priority at %3d (0x%x)\n", tf_priority - tf_base, tf_priority);
- printf_filtered ("task_fields.current_priority at %3d (0x%x)\n", tf_current_priority - tf_base, tf_current_priority);
- printf_filtered ("task_fields.image at %3d (0x%x)\n", tf_image - tf_base, tf_image);
- printf_filtered ("task_fields.call at %3d (0x%x)\n", tf_call - tf_base, tf_call);
- printf_filtered ("task_fields.thread at %3d (0x%x)\n", tf_thread - tf_base, tf_thread);
- printf_filtered ("task_fields.lwp at %3d (0x%x)\n", tf_lwp - tf_base, tf_lwp);
- printf_filtered ("\n");
+ printf_filtered ("task_fields.entry_num at %3d (0x%x)\n",
+ tf_entry_num - tf_base, tf_entry_num);
+ printf_filtered ("task_fields.state at %3d (0x%x)\n",
+ tf_state - tf_base, tf_state);
+ printf_filtered ("task_fields.parent at %3d (0x%x)\n",
+ tf_parent - tf_base, tf_parent);
+ printf_filtered ("task_fields.priority at %3d (0x%x)\n",
+ tf_priority - tf_base, tf_priority);
+ printf_filtered ("task_fields.current_priority at %3d (0x%x)\n",
+ tf_current_priority - tf_base, tf_current_priority);
+ printf_filtered ("task_fields.image at %3d (0x%x)\n",
+ tf_image - tf_base, tf_image);
+ printf_filtered ("task_fields.call at %3d (0x%x)\n",
+ tf_call - tf_base, tf_call);
+ printf_filtered ("task_fields.thread at %3d (0x%x)\n",
+ tf_thread - tf_base, tf_thread);
+ printf_filtered ("task_fields.lwp at %3d (0x%x)\n",
+ tf_lwp - tf_base, tf_lwp);
+ printf_filtered ("\n");
}
#endif
/* Print information about currently known tasks */
static void
-info_tasks (arg, from_tty)
- char *arg;
- int from_tty;
+info_tasks (char *arg, int from_tty)
{
- struct value* val;
+ struct value *val;
int i, task_number, state;
- void *temp_task, *temp_tasks [MAX_NUMBER_OF_KNOWN_TASKS];
+ void *temp_task, *temp_tasks[MAX_NUMBER_OF_KNOWN_TASKS];
struct task_entry *pt;
- void *self_id, *caller, *thread_id=NULL;
+ void *self_id, *caller, *thread_id = NULL;
struct task_fields atcb;
struct entry_call call;
- int bounds [2];
- char image [256];
+ int bounds[2];
+ char image[256];
int size;
char car;
@@ -478,7 +488,7 @@ info_tasks (arg, from_tty)
task_number = 0;
- if (PIDGET(inferior_ptid) == 0)
+ if (PIDGET (inferior_ptid) == 0)
{
printf_filtered ("The program is not being run under gdb. ");
printf_filtered ("Use 'run' or 'attach' first.\n");
@@ -498,7 +508,7 @@ info_tasks (arg, from_tty)
known_tasks_addr = (void *) SYMBOL_VALUE_ADDRESS (msym);
else
#ifndef VXWORKS_TARGET
- return;
+ return;
#else
{
if (target_lookup_symbol (KNOWN_TASKS_NAME, &known_tasks_addr) != 0)
@@ -523,28 +533,29 @@ info_tasks (arg, from_tty)
READ_MEMORY ((CORE_ADDR) known_tasks_addr, temp_tasks);
- for (i=0; i<MAX_NUMBER_OF_KNOWN_TASKS; i++)
+ for (i = 0; i < MAX_NUMBER_OF_KNOWN_TASKS; i++)
{
temp_task = EXTRACT_ADDRESS (temp_tasks[i]);
if (temp_task != NULL)
- {
- task_number = get_entry_number (temp_task);
- if (task_number == 0)
+ {
+ task_number = get_entry_number (temp_task);
+ if (task_number == 0)
task_number = add_task_entry (temp_task, i);
- }
- }
+ }
+ }
/* Return without printing anything if this function was called in
order to init GDBTK tasking. */
- if (init_only) return;
+ if (init_only)
+ return;
/* print the header */
#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
printf_filtered
- (" ID TID P-ID Pri Stack %% State Name\n");
+ (" ID TID P-ID Pri Stack %% State Name\n");
#else
printf_filtered (" ID TID P-ID Pri State Name\n");
#endif
@@ -583,15 +594,15 @@ info_tasks (arg, from_tty)
printf_filtered (" %9lx", (long) temp_task);
#else
#ifdef TARGET_64
- printf_filtered (" %#9lx", (unsigned long)pt->thread & 0x3ffffffffff);
+ printf_filtered (" %#9lx", (unsigned long) pt->thread & 0x3ffffffffff);
#else
- printf_filtered (" %#9lx", (long)pt->thread);
+ printf_filtered (" %#9lx", (long) pt->thread);
#endif
#endif
/* print the parent gdb task id */
printf_filtered
- (" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent)));
+ (" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent)));
/* print the base priority of the task */
printf_filtered (" %3d", EXTRACT_INT (atcb.priority));
@@ -599,39 +610,41 @@ info_tasks (arg, from_tty)
#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
if (pt->task_num == 1 || atcb.state == Terminated)
{
- printf_filtered (" Unknown");
+ printf_filtered (" Unknown");
goto next;
}
- read_memory ((CORE_ADDR)atcb.thread, &thr, sizeof (thr));
+ read_memory ((CORE_ADDR) atcb.thread, &thr, sizeof (thr));
current_thread = atcb.thread;
- regs.regs [SP_REGNUM] = 0;
- if (dec_thread_get_registers (&regs, NULL) == 0) {
- pt->stack_per = (100 * ((long)thr.__stack_base -
- regs.regs [SP_REGNUM])) / thr.__stack_size;
- /* if the thread is terminated but still there, the
- stack_base/size values are erroneous. Try to patch it */
- if (pt->stack_per < 0 || pt->stack_per > 100) pt->stack_per = 0;
- }
+ regs.regs[SP_REGNUM] = 0;
+ if (dec_thread_get_registers (&regs, NULL) == 0)
+ {
+ pt->stack_per = (100 * ((long) thr.__stack_base -
+ regs.regs[SP_REGNUM])) / thr.__stack_size;
+ /* if the thread is terminated but still there, the
+ stack_base/size values are erroneous. Try to patch it */
+ if (pt->stack_per < 0 || pt->stack_per > 100)
+ pt->stack_per = 0;
+ }
/* print information about stack space used in the thread */
- if (thr.__stack_size < 1024*1024)
+ if (thr.__stack_size < 1024 * 1024)
{
size = thr.__stack_size / 1024;
car = 'K';
}
- else if (thr.__stack_size < 1024*1024*1024)
+ else if (thr.__stack_size < 1024 * 1024 * 1024)
{
size = thr.__stack_size / 1024 / 1024;
car = 'M';
}
- else /* Who knows... */
+ else /* Who knows... */
{
size = thr.__stack_size / 1024 / 1024 / 1024;
car = 'G';
}
printf_filtered (" %4d%c %2d", size, car, pt->stack_per);
-next:
+ next:
#endif
/* print the current state of the task */
@@ -639,13 +652,15 @@ next:
/* check if this task is accepting a rendezvous */
if (atcb.call == NULL)
caller = NULL;
- else {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
- caller = EXTRACT_ADDRESS (call.self);
- }
-
+ else
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
+ caller = EXTRACT_ADDRESS (call.self);
+ }
+
if (caller != NULL)
- printf_filtered (" Accepting RV with %-4d", get_entry_number (caller));
+ printf_filtered (" Accepting RV with %-4d",
+ get_entry_number (caller));
else
{
state = atcb.state;
@@ -657,18 +672,21 @@ next:
/* Replace "Runnable" by "Running" if this is the current task */
printf_filtered (" %-22s", "Running");
else
- printf_filtered (" %-22s", ada_task_states [state]);
+ printf_filtered (" %-22s", ada_task_states[state]);
}
/* finally, print the name of the task */
- if (atcb.image.P_ARRAY != NULL) {
- READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds);
- bounds [1] = EXTRACT_INT (bounds [1]);
- read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
- (char*)&image, bounds [1]);
- printf_filtered (" %.*s\n", bounds [1], image);
- }
- else printf_filtered (" <no name>\n");
+ if (atcb.image.P_ARRAY != NULL)
+ {
+ READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS),
+ bounds);
+ bounds[1] = EXTRACT_INT (bounds[1]);
+ read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
+ (char *) &image, bounds[1]);
+ printf_filtered (" %.*s\n", bounds[1], image);
+ }
+ else
+ printf_filtered (" <no name>\n");
pt = pt->next_task;
}
@@ -679,7 +697,7 @@ next:
actually print anything. */
int
-gdbtk_tcl_tasks_initialize ()
+gdbtk_tcl_tasks_initialize (void)
{
gdbtk_task_initialization = 1;
info_tasks ("", gdb_stdout);
@@ -688,21 +706,18 @@ gdbtk_tcl_tasks_initialize ()
}
static void
-info_tasks_command (arg, from_tty)
- char *arg;
- int from_tty;
+info_tasks_command (char *arg, int from_tty)
{
- if (arg == NULL || *arg == '\000')
- info_tasks (arg, from_tty);
- else
- info_task (arg, from_tty);
+ if (arg == NULL || *arg == '\000')
+ info_tasks (arg, from_tty);
+ else
+ info_task (arg, from_tty);
}
/* Switch from one thread to another. */
static void
switch_to_thread (ptid_t ptid)
-
{
if (ptid_equal (ptid, inferior_ptid))
return;
@@ -716,8 +731,8 @@ switch_to_thread (ptid_t ptid)
/* Switch to a specified task. */
-static int task_switch (tid, lwpid)
- void *tid, *lwpid;
+static int
+task_switch (void *tid, void *lwpid)
{
int res = 0, pid;
@@ -737,7 +752,8 @@ static int task_switch (tid, lwpid)
#endif
}
- if (res == 0) stop_pc = read_pc();
+ if (res == 0)
+ stop_pc = read_pc ();
select_frame (get_current_frame ());
return res;
}
@@ -745,23 +761,22 @@ static int task_switch (tid, lwpid)
return -1;
}
-static void task_command (tidstr, from_tty)
- char *tidstr;
- int from_tty;
+static void
+task_command (char *tidstr, int from_tty)
{
int num;
struct task_entry *e;
if (!tidstr)
error ("Please specify a task ID. Use the \"info tasks\" command to\n"
- "see the IDs of currently known tasks.");
+ "see the IDs of currently known tasks.");
num = atoi (tidstr);
e = get_entry_vptr (num);
if (e == NULL)
error ("Task ID %d not known. Use the \"info tasks\" command to\n"
- "see the IDs of currently known tasks.", num);
+ "see the IDs of currently known tasks.", num);
if (current_task_id == -1)
{
@@ -779,28 +794,27 @@ static void task_command (tidstr, from_tty)
if (task_switch (e->thread, e->lwp) == 0)
{
/* 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));*/
+ implemented in ada-lang.c */
+ /* find_printable_frame (selected_frame, frame_relative_level (selected_frame)); */
printf_filtered ("[Switching to task %d]\n", num);
- print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
else
printf_filtered ("Unable to switch to task %d\n", num);
}
void
-_initialize_tasks ()
+_initialize_tasks (void)
{
static struct cmd_list_element *task_cmd_list = NULL;
extern struct cmd_list_element *cmdlist;
- add_info (
- "tasks", info_tasks_command,
- "Without argument: list all known Ada tasks, with status information.\n"
- "info tasks n: print detailed information of task n.\n");
+ add_info ("tasks", info_tasks_command,
+ "Without argument: list all known Ada tasks, with status information.\n"
+ "info tasks n: print detailed information of task n.\n");
add_prefix_cmd ("task", class_run, task_command,
- "Use this command to switch between tasks.\n\
- The new task ID must be currently known.", &task_cmd_list, "task ", 1,
- &cmdlist);
+ "Use this command to switch between tasks.\n\
+ The new task ID must be currently known.", &task_cmd_list, "task ", 1, &cmdlist);
}
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 677356186b2..c18aa85b397 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
@@ -35,44 +35,45 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "ada-lang.h"
#include <ctype.h>
-#include <string.h>
+#include "gdb_string.h"
#include <errno.h>
-static int print_record_field_types (struct type *, struct type *,
+static int print_record_field_types (struct type *, struct type *,
struct ui_file *, int, int);
-static void print_array_type (struct type*, struct ui_file*, int, int);
+static void print_array_type (struct type *, struct ui_file *, int, int);
-static void print_choices (struct type*, int, struct ui_file*, struct type*);
+static void print_choices (struct type *, int, struct ui_file *,
+ struct type *);
-static void print_range (struct type*, struct ui_file*);
+static void print_range (struct type *, struct ui_file *);
-static void print_range_bound (struct type*, char*, int*, struct ui_file*);
+static void print_range_bound (struct type *, char *, int *,
+ struct ui_file *);
-static void
-print_dynamic_range_bound (struct type*, const char*, int,
- const char*, struct ui_file*);
-
-static void print_range_type_named (char*, struct ui_file*);
+static void
+print_dynamic_range_bound (struct type *, const char *, int,
+ const char *, struct ui_file *);
+static void print_range_type_named (char *, struct ui_file *);
-static char* name_buffer;
+
+static char *name_buffer;
static int name_buffer_len;
/* The (demangled) Ada name of TYPE. This value persists until the
next call. */
-static char*
-demangled_type_name (type)
- struct type *type;
+static char *
+demangled_type_name (struct type *type)
{
if (ada_type_name (type) == NULL)
return NULL;
- else
+ else
{
- char* raw_name = ada_type_name (type);
- char *s, *q;
+ char *raw_name = ada_type_name (type);
+ char *s, *q;
if (name_buffer == NULL || name_buffer_len <= strlen (raw_name))
{
@@ -81,7 +82,7 @@ demangled_type_name (type)
}
strcpy (name_buffer, raw_name);
- s = (char*) strstr (name_buffer, "___");
+ s = (char *) strstr (name_buffer, "___");
if (s != NULL)
*s = '\0';
@@ -92,18 +93,20 @@ demangled_type_name (type)
if (s == name_buffer)
return name_buffer;
- if (! islower (s[1]))
+ if (!islower (s[1]))
return NULL;
for (s = q = name_buffer; *s != '\0'; q += 1)
{
if (s[0] == '_' && s[1] == '_')
{
- *q = '.'; s += 2;
+ *q = '.';
+ s += 2;
}
else
{
- *q = *s; s += 1;
+ *q = *s;
+ s += 1;
}
}
*q = '\0';
@@ -117,30 +120,26 @@ demangled_type_name (type)
NEW is the new name for a type TYPE. */
void
-ada_typedef_print (type, new, stream)
- struct type *type;
- struct symbol *new;
- struct ui_file *stream;
+ada_typedef_print (struct type *type, struct symbol *new,
+ struct ui_file *stream)
{
- fprintf_filtered (stream, "type %.*s is ",
- ada_name_prefix_len (SYMBOL_SOURCE_NAME(new)),
- SYMBOL_SOURCE_NAME(new));
+ fprintf_filtered (stream, "type %.*s is ",
+ ada_name_prefix_len (SYMBOL_SOURCE_NAME (new)),
+ SYMBOL_SOURCE_NAME (new));
type_print (type, "", stream, 1);
}
/* Print range type TYPE on STREAM. */
static void
-print_range (type, stream)
- struct type* type;
- struct ui_file* stream;
+print_range (struct type *type, struct ui_file *stream)
{
- struct type* target_type;
+ struct type *target_type;
target_type = TYPE_TARGET_TYPE (type);
if (target_type == NULL)
target_type = type;
- switch (TYPE_CODE (target_type))
+ switch (TYPE_CODE (target_type))
{
case TYPE_CODE_RANGE:
case TYPE_CODE_INT:
@@ -162,8 +161,8 @@ print_range (type, stream)
Note that if the name is not defined, then we don't print anything.
*/
fprintf_filtered (stream, "%.*s",
- ada_name_prefix_len (TYPE_NAME (type)),
- TYPE_NAME (type));
+ ada_name_prefix_len (TYPE_NAME (type)),
+ TYPE_NAME (type));
}
else
{
@@ -171,7 +170,7 @@ print_range (type, stream)
and the last element of the type->fields array */
const LONGEST lower_bound = (LONGEST) TYPE_LOW_BOUND (type);
const LONGEST upper_bound =
- (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) -1);
+ (LONGEST) TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1);
ada_print_scalar (target_type, lower_bound, stream);
fprintf_filtered (stream, " .. ");
@@ -183,11 +182,8 @@ print_range (type, stream)
set *N past the bound and its delimiter, if any. */
static void
-print_range_bound (type, bounds, n, stream)
- struct type* type;
- char* bounds;
- int* n;
- struct ui_file* stream;
+print_range_bound (struct type *type, char *bounds, int *n,
+ struct ui_file *stream)
{
LONGEST B;
if (ada_scan_number (bounds, *n, &B, n))
@@ -199,13 +195,13 @@ print_range_bound (type, bounds, n, stream)
else
{
int bound_len;
- char* bound = bounds + *n;
- char* pend;
+ char *bound = bounds + *n;
+ char *pend;
pend = strstr (bound, "__");
if (pend == NULL)
*n += bound_len = strlen (bound);
- else
+ else
{
bound_len = pend - bound;
*n += bound_len + 2;
@@ -219,12 +215,8 @@ print_range_bound (type, bounds, n, stream)
"___U") according to the ___XD conventions. */
static void
-print_dynamic_range_bound (type, name, name_len, suffix, stream)
- struct type* type;
- const char* name;
- int name_len;
- const char* suffix;
- struct ui_file* stream;
+print_dynamic_range_bound (struct type *type, const char *name, int name_len,
+ const char *suffix, struct ui_file *stream)
{
static char *name_buf = NULL;
static size_t name_buf_len = 0;
@@ -245,14 +237,12 @@ print_dynamic_range_bound (type, name, name_len, suffix, stream)
/* Print the range type named NAME. */
static void
-print_range_type_named (name, stream)
- char* name;
- struct ui_file* stream;
+print_range_type_named (char *name, struct ui_file *stream)
{
struct type *raw_type = ada_find_any_type (name);
struct type *base_type;
LONGEST low, high;
- char* subtype_info;
+ char *subtype_info;
if (raw_type == NULL)
base_type = builtin_type_int;
@@ -276,29 +266,29 @@ print_range_type_named (name, stream)
bounds_str = strchr (subtype_info, '_');
n = 1;
- if (*subtype_info == 'L')
+ if (*subtype_info == 'L')
{
print_range_bound (raw_type, bounds_str, &n, stream);
subtype_info += 1;
}
else
- print_dynamic_range_bound (raw_type, name, prefix_len, "___L", stream);
+ print_dynamic_range_bound (raw_type, name, prefix_len, "___L",
+ stream);
fprintf_filtered (stream, " .. ");
- if (*subtype_info == 'U')
+ if (*subtype_info == 'U')
print_range_bound (raw_type, bounds_str, &n, stream);
else
- print_dynamic_range_bound (raw_type, name, prefix_len, "___U", stream);
+ print_dynamic_range_bound (raw_type, name, prefix_len, "___U",
+ stream);
}
-}
+}
/* Print enumerated type TYPE on STREAM. */
static void
-print_enum_type (type, stream)
- struct type *type;
- struct ui_file *stream;
+print_enum_type (struct type *type, struct ui_file *stream)
{
int len = TYPE_NFIELDS (type);
int i, lastval;
@@ -310,7 +300,8 @@ print_enum_type (type, stream)
for (i = 0; i < len; i++)
{
QUIT;
- if (i) fprintf_filtered (stream, ", ");
+ if (i)
+ fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
@@ -326,9 +317,7 @@ print_enum_type (type, stream)
/* Print representation of Ada fixed-point type TYPE on STREAM. */
static void
-print_fixed_point_type (type, stream)
- struct type *type;
- struct ui_file *stream;
+print_fixed_point_type (struct type *type, struct ui_file *stream)
{
DOUBLEST delta = ada_delta (type);
DOUBLEST small = ada_fixed_to_float (type, 1.0);
@@ -338,7 +327,7 @@ print_fixed_point_type (type, stream)
else
{
fprintf_filtered (stream, "delta %g", (double) delta);
- if (delta != small)
+ if (delta != small)
fprintf_filtered (stream, " <'small = %g>", (double) small);
}
}
@@ -346,9 +335,7 @@ print_fixed_point_type (type, stream)
/* Print representation of special VAX floating-point type TYPE on STREAM. */
static void
-print_vax_floating_point_type (type, stream)
- struct type *type;
- struct ui_file *stream;
+print_vax_floating_point_type (struct type *type, struct ui_file *stream)
{
fprintf_filtered (stream, "<float format %c>",
ada_vax_float_type_suffix (type));
@@ -360,11 +347,8 @@ print_vax_floating_point_type (type, stream)
structure to show (see ada_print_type). */
static void
-print_array_type (type, stream, show, level)
- struct type *type;
- struct ui_file *stream;
- int show;
- int level;
+print_array_type (struct type *type, struct ui_file *stream, int show,
+ int level)
{
int bitsize;
int n_indices;
@@ -373,17 +357,17 @@ print_array_type (type, stream, show, level)
fprintf_filtered (stream, "array (");
n_indices = -1;
- if (show < 0)
+ if (show < 0)
fprintf_filtered (stream, "...");
else
{
if (ada_is_packed_array_type (type))
type = ada_coerce_to_simple_array_type (type);
- if (ada_is_simple_array (type))
+ if (ada_is_simple_array (type))
{
- struct type* range_desc_type =
+ struct type *range_desc_type =
ada_find_parallel_type (type, "___XA");
- struct type* arr_type;
+ struct type *arr_type;
bitsize = 0;
if (range_desc_type == NULL)
@@ -398,24 +382,24 @@ print_array_type (type, stream, show, level)
bitsize = TYPE_FIELD_BITSIZE (arr_type, 0);
}
}
- else
+ else
{
int k;
- n_indices = TYPE_NFIELDS (range_desc_type);
- for (k = 0, arr_type = type;
+ n_indices = TYPE_NFIELDS (range_desc_type);
+ for (k = 0, arr_type = type;
k < n_indices;
k += 1, arr_type = TYPE_TARGET_TYPE (arr_type))
{
if (k > 0)
fprintf_filtered (stream, ", ");
- print_range_type_named (TYPE_FIELD_NAME (range_desc_type, k),
- stream);
+ print_range_type_named (TYPE_FIELD_NAME
+ (range_desc_type, k), stream);
if (TYPE_FIELD_BITSIZE (arr_type, 0) > 0)
bitsize = TYPE_FIELD_BITSIZE (arr_type, 0);
- }
+ }
}
}
- else
+ else
{
int i, i0;
for (i = i0 = ada_array_arity (type); i > 0; i -= 1)
@@ -425,8 +409,8 @@ print_array_type (type, stream, show, level)
fprintf_filtered (stream, ") of ");
wrap_here ("");
- ada_print_type (ada_array_element_type (type, n_indices), "", stream,
- show == 0 ? 0 : show-1, level+1);
+ ada_print_type (ada_array_element_type (type, n_indices), "", stream,
+ show == 0 ? 0 : show - 1, level + 1);
if (bitsize > 0)
fprintf_filtered (stream, " <packed: %d-bit elements>", bitsize);
}
@@ -435,22 +419,19 @@ print_array_type (type, stream, show, level)
STREAM, assuming the VAL_TYPE is the type of the values. */
static void
-print_choices (type, field_num, stream, val_type)
- struct type *type;
- int field_num;
- struct ui_file *stream;
- struct type *val_type;
+print_choices (struct type *type, int field_num, struct ui_file *stream,
+ struct type *val_type)
{
int have_output;
int p;
- const char* name = TYPE_FIELD_NAME (type, field_num);
+ const char *name = TYPE_FIELD_NAME (type, field_num);
have_output = 0;
/* Skip over leading 'V': NOTE soon to be obsolete. */
if (name[0] == 'V')
{
- if (! ada_scan_number (name, 1, NULL, &p))
+ if (!ada_scan_number (name, 1, NULL, &p))
goto Huh;
}
else
@@ -458,25 +439,25 @@ print_choices (type, field_num, stream, val_type)
while (1)
{
- switch (name[p])
+ switch (name[p])
{
default:
return;
case 'S':
case 'R':
case 'O':
- if (have_output)
+ if (have_output)
fprintf_filtered (stream, " | ");
have_output = 1;
break;
}
- switch (name[p])
+ switch (name[p])
{
case 'S':
{
LONGEST W;
- if (! ada_scan_number (name, p + 1, &W, &p))
+ if (!ada_scan_number (name, p + 1, &W, &p))
goto Huh;
ada_print_scalar (val_type, W, stream);
break;
@@ -484,9 +465,8 @@ print_choices (type, field_num, stream, val_type)
case 'R':
{
LONGEST L, U;
- if (! ada_scan_number (name, p + 1, &L, &p)
- || name[p] != 'T'
- || ! ada_scan_number (name, p + 1, &U, &p))
+ if (!ada_scan_number (name, p + 1, &L, &p)
+ || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
goto Huh;
ada_print_scalar (val_type, L, stream);
fprintf_filtered (stream, " .. ");
@@ -515,13 +495,9 @@ Huh:
immediately outside the variant part. */
static void
-print_variant_clauses (type, field_num, outer_type, stream, show, level)
- struct type *type;
- int field_num;
- struct type *outer_type;
- struct ui_file *stream;
- int show;
- int level;
+print_variant_clauses (struct type *type, int field_num,
+ struct type *outer_type, struct ui_file *stream,
+ int show, int level)
{
int i;
struct type *var_type;
@@ -533,7 +509,7 @@ print_variant_clauses (type, field_num, outer_type, stream, show, level)
if (TYPE_CODE (var_type) == TYPE_CODE_PTR)
{
var_type = TYPE_TARGET_TYPE (var_type);
- if (TYPE_FLAGS (var_type) & TYPE_FLAG_STUB)
+ if (TYPE_FLAGS (var_type) & TYPE_FLAG_STUB)
{
var_type = ada_find_parallel_type (var_type, "___XVU");
if (var_type == NULL)
@@ -541,13 +517,13 @@ print_variant_clauses (type, field_num, outer_type, stream, show, level)
}
}
- for (i = 0; i < TYPE_NFIELDS (var_type); i += 1)
+ for (i = 0; i < TYPE_NFIELDS (var_type); i += 1)
{
fprintf_filtered (stream, "\n%*swhen ", level + 4, "");
print_choices (var_type, i, stream, discr_type);
fprintf_filtered (stream, " =>");
- if (print_record_field_types (TYPE_FIELD_TYPE (var_type, i),
- outer_type, stream, show, level+4) <= 0)
+ if (print_record_field_types (TYPE_FIELD_TYPE (var_type, i),
+ outer_type, stream, show, level + 4) <= 0)
fprintf_filtered (stream, " null;");
}
}
@@ -561,18 +537,14 @@ print_variant_clauses (type, field_num, outer_type, stream, show, level)
level as the fields immediately outside the variant part. */
static void
-print_variant_part (type, field_num, outer_type, stream, show, level)
- struct type *type;
- int field_num;
- struct type *outer_type;
- struct ui_file *stream;
- int show;
- int level;
+print_variant_part (struct type *type, int field_num, struct type *outer_type,
+ struct ui_file *stream, int show, int level)
{
fprintf_filtered (stream, "\n%*scase %s is", level + 4, "",
- ada_variant_discrim_name
- (TYPE_FIELD_TYPE (type, field_num)));
- print_variant_clauses (type, field_num, outer_type, stream, show, level + 4);
+ ada_variant_discrim_name
+ (TYPE_FIELD_TYPE (type, field_num)));
+ print_variant_clauses (type, field_num, outer_type, stream, show,
+ level + 4);
fprintf_filtered (stream, "\n%*send case;", level + 4, "");
}
@@ -586,12 +558,8 @@ print_variant_part (type, field_num, outer_type, stream, show, level)
end. */
static int
-print_record_field_types (type, outer_type, stream, show, level)
- struct type *type;
- struct type *outer_type;
- struct ui_file *stream;
- int show;
- int level;
+print_record_field_types (struct type *type, struct type *outer_type,
+ struct ui_file *stream, int show, int level)
{
int len, i, flds;
@@ -605,13 +573,12 @@ print_record_field_types (type, outer_type, stream, show, level)
{
QUIT;
- if (ada_is_parent_field (type, i)
- || ada_is_ignored_field (type, i))
+ if (ada_is_parent_field (type, i) || ada_is_ignored_field (type, i))
;
else if (ada_is_wrapper_field (type, i))
flds += print_record_field_types (TYPE_FIELD_TYPE (type, i), type,
stream, show, level);
- else if (ada_is_variant_part (type, i))
+ else if (ada_is_variant_part (type, i))
{
print_variant_part (type, i, outer_type, stream, show, level);
flds = 1;
@@ -635,26 +602,23 @@ print_record_field_types (type, outer_type, stream, show, level)
the number of levels of internal structure to show (see ada_print_type). */
static void
-print_record_type (type0, stream, show, level)
- struct type* type0;
- struct ui_file* stream;
- int show;
- int level;
+print_record_type (struct type *type0, struct ui_file *stream, int show,
+ int level)
{
- struct type* parent_type;
- struct type* type;
-
+ struct type *parent_type;
+ struct type *type;
+
type = type0;
if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
{
- struct type* type1 = ada_find_parallel_type (type, "___XVE");
+ struct type *type1 = ada_find_parallel_type (type, "___XVE");
if (type1 != NULL)
type = type1;
}
parent_type = ada_parent_type (type);
- if (ada_type_name (parent_type) != NULL)
- fprintf_filtered (stream, "new %s with ",
+ if (ada_type_name (parent_type) != NULL)
+ fprintf_filtered (stream, "new %s with ",
demangled_type_name (parent_type));
else if (parent_type == NULL && ada_is_tagged_type (type))
fprintf_filtered (stream, "tagged ");
@@ -669,15 +633,15 @@ print_record_type (type0, stream, show, level)
flds = 0;
if (parent_type != NULL && ada_type_name (parent_type) == NULL)
- flds += print_record_field_types (parent_type, parent_type,
+ flds += print_record_field_types (parent_type, parent_type,
stream, show, level);
flds += print_record_field_types (type, type, stream, show, level);
-
+
if (flds > 0)
fprintf_filtered (stream, "\n%*send record", level, "");
- else if (flds < 0)
+ else if (flds < 0)
fprintf_filtered (stream, " <incomplete type> end record");
- else
+ else
fprintf_filtered (stream, " null; end record");
}
}
@@ -687,47 +651,43 @@ print_record_type (type0, stream, show, level)
in case the element type itself has nested structure, and SHOW is the
number of levels of internal structure to show (see ada_print_type). */
static void
-print_unchecked_union_type (struct type* type, struct ui_file* stream,
+print_unchecked_union_type (struct type *type, struct ui_file *stream,
int show, int level)
{
fprintf_filtered (stream, "record (?) is");
if (show < 0)
fprintf_filtered (stream, " ... end record");
- else if (TYPE_NFIELDS (type) == 0)
+ else if (TYPE_NFIELDS (type) == 0)
fprintf_filtered (stream, " null; end record");
else
{
int i;
- fprintf_filtered (stream, "\n%*scase ? is",
- level+4, "");
+ fprintf_filtered (stream, "\n%*scase ? is", level + 4, "");
- for (i = 0; i < TYPE_NFIELDS (type); i += 1)
+ for (i = 0; i < TYPE_NFIELDS (type); i += 1)
{
- fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level+8, "",
- level+12, "");
+ fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level + 8, "",
+ level + 12, "");
ada_print_type (TYPE_FIELD_TYPE (type, i),
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 12);
fprintf_filtered (stream, ";");
}
- fprintf_filtered (stream, "\n%*send case;\n%*send record",
- level+4, "", level, "");
+ fprintf_filtered (stream, "\n%*send case;\n%*send record",
+ level + 4, "", level, "");
}
}
-
+
/* Print function or procedure type TYPE on STREAM. Make it a header
for function or procedure NAME if NAME is not null. */
static void
-print_func_type (type, stream, name)
- struct type *type;
- struct ui_file *stream;
- char* name;
+print_func_type (struct type *type, struct ui_file *stream, char *name)
{
int i, len = TYPE_NFIELDS (type);
@@ -736,10 +696,10 @@ print_func_type (type, stream, name)
else
fprintf_filtered (stream, "function");
- if (name != NULL && name[0] != '\0')
+ if (name != NULL && name[0] != '\0')
fprintf_filtered (stream, " %s", name);
- if (len > 0)
+ if (len > 0)
{
fprintf_filtered (stream, " (");
for (i = 0; i < len; i += 1)
@@ -749,11 +709,11 @@ print_func_type (type, stream, name)
fputs_filtered ("; ", stream);
wrap_here (" ");
}
- fprintf_filtered (stream, "a%d: ", i+1);
+ fprintf_filtered (stream, "a%d: ", i + 1);
ada_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
}
fprintf_filtered (stream, ")");
- }
+ }
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
{
@@ -777,39 +737,34 @@ print_func_type (type, stream, name)
LEVEL indicates level of recursion (for nested definitions). */
void
-ada_print_type (type0, varstring, stream, show, level)
- struct type* type0;
- char* varstring;
- struct ui_file* stream;
- int show;
- int level;
+ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
+ int show, int level)
{
enum type_code code;
int demangled_args;
- struct type* type = ada_completed_type (ada_get_base_type (type0));
- char* type_name = demangled_type_name (type);
+ struct type *type = ada_completed_type (ada_get_base_type (type0));
+ char *type_name = demangled_type_name (type);
int is_var_decl = (varstring != NULL && varstring[0] != '\0');
if (type == NULL)
{
if (is_var_decl)
fprintf_filtered (stream, "%.*s: ",
- ada_name_prefix_len(varstring),
- varstring);
+ ada_name_prefix_len (varstring), varstring);
fprintf_filtered (stream, "<null type?>");
return;
}
if (show > 0)
- CHECK_TYPEDEF (type);
+ CHECK_TYPEDEF (type);
if (is_var_decl && TYPE_CODE (type) != TYPE_CODE_FUNC)
- fprintf_filtered (stream, "%.*s: ",
- ada_name_prefix_len (varstring), varstring);
+ fprintf_filtered (stream, "%.*s: ",
+ ada_name_prefix_len (varstring), varstring);
if (type_name != NULL && show <= 0)
{
- fprintf_filtered (stream, "%.*s",
+ fprintf_filtered (stream, "%.*s",
ada_name_prefix_len (type_name), type_name);
return;
}
@@ -819,78 +774,78 @@ ada_print_type (type0, varstring, stream, show, level)
else if (ada_is_packed_array_type (type))
print_array_type (type, stream, show, level);
else
- switch (TYPE_CODE (type))
- {
- default:
- fprintf_filtered (stream, "<");
- c_print_type (type, "", stream, show, level);
- fprintf_filtered (stream, ">");
- break;
- case TYPE_CODE_PTR:
- fprintf_filtered (stream, "access ");
- ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show,
- level);
- break;
- case TYPE_CODE_REF:
- fprintf_filtered (stream, "<ref> ");
- ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show,
- level);
- break;
- case TYPE_CODE_ARRAY:
- print_array_type (type, stream, show, level);
- break;
- case TYPE_CODE_INT:
- if (ada_is_fixed_point_type (type))
- print_fixed_point_type (type, stream);
- else if (ada_is_vax_floating_type (type))
- print_vax_floating_point_type (type, stream);
- else
- {
- char* name = ada_type_name (type);
- if (! ada_is_range_type_name (name))
- fprintf_filtered (stream, "<%d-byte integer>", TYPE_LENGTH (type));
- else
- {
- fprintf_filtered (stream, "range ");
- print_range_type_named (name, stream);
- }
- }
- break;
- case TYPE_CODE_RANGE:
- if (ada_is_fixed_point_type (type))
- print_fixed_point_type (type, stream);
- else if (ada_is_vax_floating_type (type))
- print_vax_floating_point_type (type, stream);
- else if (ada_is_modular_type (type))
- fprintf_filtered (stream, "mod %ld", (long) ada_modulus (type));
- else
- {
- fprintf_filtered (stream, "range ");
- print_range (type, stream);
- }
- break;
- case TYPE_CODE_FLT:
- fprintf_filtered (stream, "<%d-byte float>", TYPE_LENGTH (type));
- break;
- case TYPE_CODE_ENUM:
- if (show < 0)
- fprintf_filtered (stream, "(...)");
- else
- print_enum_type (type, stream);
- break;
- case TYPE_CODE_STRUCT:
- if (ada_is_array_descriptor (type))
+ switch (TYPE_CODE (type))
+ {
+ default:
+ fprintf_filtered (stream, "<");
+ c_print_type (type, "", stream, show, level);
+ fprintf_filtered (stream, ">");
+ break;
+ case TYPE_CODE_PTR:
+ fprintf_filtered (stream, "access ");
+ ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level);
+ break;
+ case TYPE_CODE_REF:
+ fprintf_filtered (stream, "<ref> ");
+ ada_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level);
+ break;
+ case TYPE_CODE_ARRAY:
print_array_type (type, stream, show, level);
- else if (ada_is_bogus_array_descriptor (type))
- fprintf_filtered (stream, "array (?) of ? (<mal-formed descriptor>)");
- else
- print_record_type (type, stream, show, level);
- break;
- case TYPE_CODE_UNION:
- print_unchecked_union_type (type, stream, show, level);
- break;
- case TYPE_CODE_FUNC:
- print_func_type (type, stream, varstring);
- break;
- }
+ break;
+ case TYPE_CODE_INT:
+ if (ada_is_fixed_point_type (type))
+ print_fixed_point_type (type, stream);
+ else if (ada_is_vax_floating_type (type))
+ print_vax_floating_point_type (type, stream);
+ else
+ {
+ char *name = ada_type_name (type);
+ if (!ada_is_range_type_name (name))
+ fprintf_filtered (stream, "<%d-byte integer>",
+ TYPE_LENGTH (type));
+ else
+ {
+ fprintf_filtered (stream, "range ");
+ print_range_type_named (name, stream);
+ }
+ }
+ break;
+ case TYPE_CODE_RANGE:
+ if (ada_is_fixed_point_type (type))
+ print_fixed_point_type (type, stream);
+ else if (ada_is_vax_floating_type (type))
+ print_vax_floating_point_type (type, stream);
+ else if (ada_is_modular_type (type))
+ fprintf_filtered (stream, "mod %ld", (long) ada_modulus (type));
+ else
+ {
+ fprintf_filtered (stream, "range ");
+ print_range (type, stream);
+ }
+ break;
+ case TYPE_CODE_FLT:
+ fprintf_filtered (stream, "<%d-byte float>", TYPE_LENGTH (type));
+ break;
+ case TYPE_CODE_ENUM:
+ if (show < 0)
+ fprintf_filtered (stream, "(...)");
+ else
+ print_enum_type (type, stream);
+ break;
+ case TYPE_CODE_STRUCT:
+ if (ada_is_array_descriptor (type))
+ print_array_type (type, stream, show, level);
+ else if (ada_is_bogus_array_descriptor (type))
+ fprintf_filtered (stream,
+ "array (?) of ? (<mal-formed descriptor>)");
+ else
+ print_record_type (type, stream, show, level);
+ break;
+ case TYPE_CODE_UNION:
+ print_unchecked_union_type (type, stream, show, level);
+ break;
+ case TYPE_CODE_FUNC:
+ print_func_type (type, stream, varstring);
+ break;
+ }
}
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 6db18ebae1e..fc2db703035 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -32,9 +32,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "c-lang.h"
/* Encapsulates arguments to ada_val_print. */
-struct ada_val_print_args {
- struct type* type;
- char* valaddr0;
+struct ada_val_print_args
+{
+ struct type *type;
+ char *valaddr0;
int embedded_offset;
CORE_ADDR address;
struct ui_file *stream;
@@ -47,50 +48,48 @@ struct ada_val_print_args {
extern int inspect_it;
extern unsigned int repeat_count_threshold;
-static void print_record (struct type*, char*, struct ui_file*, int,
+static void print_record (struct type *, char *, struct ui_file *, int,
int, enum val_prettyprint);
-static int print_field_values (struct type*, char*, struct ui_file*,
+static int print_field_values (struct type *, char *, struct ui_file *,
int, int, enum val_prettyprint,
- int, struct type*, char*);
+ int, struct type *, char *);
-static int print_variant_part (struct type*, int, char*,
- struct ui_file*, int, int, enum val_prettyprint,
- int, struct type*, char*);
+static int print_variant_part (struct type *, int, char *,
+ struct ui_file *, int, int,
+ enum val_prettyprint, int, struct type *,
+ char *);
-static void
-val_print_packed_array_elements (struct type*, char *valaddr, int,
- struct ui_file*, int, int,
- enum val_prettyprint);
+static void val_print_packed_array_elements (struct type *, char *valaddr,
+ int, struct ui_file *, int, int,
+ enum val_prettyprint);
-static void adjust_type_signedness (struct type*);
+static void adjust_type_signedness (struct type *);
static int ada_val_print_stub (PTR args0);
-static int
-ada_val_print_1 (struct type*, char*, int, CORE_ADDR, struct ui_file*,
- int, int, int, enum val_prettyprint);
+static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
+ struct ui_file *, int, int, int,
+ enum val_prettyprint);
/* Make TYPE unsigned if its range of values includes no negatives. */
-static void
+static void
adjust_type_signedness (type)
- struct type* type;
+ struct type *type;
{
- if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
+ if (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
&& TYPE_LOW_BOUND (type) >= 0)
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
-}
+}
/* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
if non-standard (i.e., other than 1 for numbers, other than lower bound
of index type for enumerated type). Returns 1 if something printed,
otherwise 0. */
-static int
-print_optional_low_bound (stream, type)
- struct ui_file *stream;
- struct type *type;
+static int
+print_optional_low_bound (struct ui_file *stream, struct type *type)
{
struct type *index_type;
long low_bound;
@@ -100,27 +99,28 @@ print_optional_low_bound (stream, type)
if (index_type == NULL)
return 0;
- if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
+ if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
{
low_bound = TYPE_LOW_BOUND (index_type);
index_type = TYPE_TARGET_TYPE (index_type);
}
else
return 0;
-
- switch (TYPE_CODE (index_type)) {
- case TYPE_CODE_ENUM:
- if (low_bound == TYPE_FIELD_BITPOS (index_type, 0))
- return 0;
- break;
- case TYPE_CODE_UNDEF:
- index_type = builtin_type_long;
- /* FALL THROUGH */
- default:
- if (low_bound == 1)
- return 0;
- break;
- }
+
+ switch (TYPE_CODE (index_type))
+ {
+ case TYPE_CODE_ENUM:
+ if (low_bound == TYPE_FIELD_BITPOS (index_type, 0))
+ return 0;
+ break;
+ case TYPE_CODE_UNDEF:
+ index_type = builtin_type_long;
+ /* FALL THROUGH */
+ default:
+ if (low_bound == 1)
+ return 0;
+ break;
+ }
ada_print_scalar (index_type, (LONGEST) low_bound, stream);
fprintf_filtered (stream, " => ");
@@ -132,18 +132,13 @@ print_optional_low_bound (stream, type)
BITOFFSET from VALADDR on STREAM. Formats according to FORMAT and
separates with commas. RECURSE is the recursion (nesting) level.
If PRETTY, uses "prettier" format. TYPE must have been decoded (as
- by ada_coerce_to_simple_array). */
+ by ada_coerce_to_simple_array). */
static void
-val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
- recurse, pretty)
- struct type *type;
- char *valaddr;
- int bitoffset;
- struct ui_file *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
+val_print_packed_array_elements (struct type *type, char *valaddr,
+ int bitoffset, struct ui_file *stream,
+ int format, int recurse,
+ enum val_prettyprint pretty)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -156,8 +151,8 @@ val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
/* Number of repetitions we have detected so far. */
unsigned int reps;
unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0);
- struct value* mark = value_mark ();
-
+ struct value *mark = value_mark ();
+
elttype = TYPE_TARGET_TYPE (type);
eltlen = TYPE_LENGTH (check_typedef (elttype));
@@ -192,7 +187,7 @@ val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
wrap_here (n_spaces (2 + 2 * recurse));
i0 = i;
- v0 = ada_value_primitive_packed_val (NULL, valaddr,
+ v0 = ada_value_primitive_packed_val (NULL, valaddr,
(i0 * bitsize) / HOST_CHAR_BIT,
(i0 * bitsize) % HOST_CHAR_BIT,
bitsize, elttype);
@@ -201,12 +196,11 @@ val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
i += 1;
if (i >= len)
break;
- v1 = ada_value_primitive_packed_val (NULL, valaddr,
+ v1 = ada_value_primitive_packed_val (NULL, valaddr,
(i * bitsize) / HOST_CHAR_BIT,
(i * bitsize) % HOST_CHAR_BIT,
bitsize, elttype);
- if (memcmp (VALUE_CONTENTS (v0), VALUE_CONTENTS (v1), eltlen)
- != 0)
+ if (memcmp (VALUE_CONTENTS (v0), VALUE_CONTENTS (v1), eltlen) != 0)
break;
}
@@ -224,7 +218,7 @@ val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
int j;
for (j = i0; j < i; j += 1)
{
- if (j > i0)
+ if (j > i0)
{
if (prettyprint_arrays)
{
@@ -253,10 +247,8 @@ val_print_packed_array_elements (type, valaddr, bitoffset, stream, format,
value_free_to_mark (mark);
}
-static struct type*
-printable_val_type (type, valaddr)
- struct type* type;
- char* valaddr;
+static struct type *
+printable_val_type (struct type *type, char *valaddr)
{
return ada_to_fixed_type (ada_aligned_type (type), valaddr, 0, NULL);
}
@@ -266,11 +258,7 @@ printable_val_type (type, valaddr)
(1 or 2) of the character. */
void
-ada_emit_char (c, stream, quoter, type_len)
- int c;
- struct ui_file *stream;
- int quoter;
- int type_len;
+ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len)
{
if (type_len != 2)
type_len = 1;
@@ -285,28 +273,23 @@ ada_emit_char (c, stream, quoter, type_len)
fprintf_filtered (stream, "%c", c);
}
else
- fprintf_filtered (stream, "[\"%0*x\"]", type_len*2, c);
+ fprintf_filtered (stream, "[\"%0*x\"]", type_len * 2, c);
}
/* Character #I of STRING, given that TYPE_LEN is the size in bytes (1
or 2) of a character. */
static int
-char_at (string, i, type_len)
- char* string;
- int i;
- int type_len;
+char_at (char *string, int i, int type_len)
{
if (type_len == 1)
return string[i];
- else
- return (int) extract_unsigned_integer (string + 2*i, 2);
+ else
+ return (int) extract_unsigned_integer (string + 2 * i, 2);
}
void
-ada_printchar (c, stream)
- int c;
- struct ui_file *stream;
+ada_printchar (int c, struct ui_file *stream)
{
fputs_filtered ("'", stream);
ada_emit_char (c, stream, '\'', 1);
@@ -317,10 +300,7 @@ ada_printchar (c, stream)
form appropriate for TYPE. */
void
-ada_print_scalar (type, val, stream)
- struct type *type;
- LONGEST val;
- struct ui_file *stream;
+ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
{
unsigned int i;
unsigned len;
@@ -396,12 +376,8 @@ ada_print_scalar (type, val, stream)
*/
static void
-printstr (stream, string, length, force_ellipses, type_len)
- struct ui_file *stream;
- char *string;
- unsigned int length;
- int force_ellipses;
- int type_len;
+printstr (struct ui_file *stream, char *string, unsigned int length,
+ int force_ellipses, int type_len)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -417,7 +393,7 @@ printstr (stream, string, length, force_ellipses, type_len)
for (i = 0; i < length && things_printed < print_max; i += 1)
{
/* Position of the character we are examining
- to see whether it is repeated. */
+ to see whether it is repeated. */
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
@@ -432,8 +408,9 @@ printstr (stream, string, length, force_ellipses, type_len)
rep1 = i + 1;
reps = 1;
- while (rep1 < length &&
- char_at(string, rep1, type_len) == char_at (string, i, type_len))
+ while (rep1 < length &&
+ char_at (string, rep1, type_len) == char_at (string, i,
+ type_len))
{
rep1 += 1;
reps += 1;
@@ -450,7 +427,8 @@ printstr (stream, string, length, force_ellipses, type_len)
in_quotes = 0;
}
fputs_filtered ("'", stream);
- ada_emit_char (char_at (string, i, type_len), stream, '\'', type_len);
+ ada_emit_char (char_at (string, i, type_len), stream, '\'',
+ type_len);
fputs_filtered ("'", stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
@@ -487,12 +465,8 @@ printstr (stream, string, length, force_ellipses, type_len)
}
void
-ada_printstr (stream, string, length, force_ellipses, width)
- struct ui_file *stream;
- char *string;
- unsigned int length;
- int force_ellipses;
- int width;
+ada_printstr (struct ui_file *stream, char *string, unsigned int length,
+ int force_ellipses, int width)
{
printstr (stream, string, length, force_ellipses, width);
}
@@ -518,20 +492,13 @@ ada_printstr (stream, string, length, force_ellipses, width)
arrays.) */
int
-ada_val_print (type, valaddr0, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty)
- struct type* type;
- char* valaddr0;
- int embedded_offset;
- CORE_ADDR address;
- struct ui_file *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+ada_val_print (struct type *type, char *valaddr0, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
struct ada_val_print_args args;
- args.type = type; args.valaddr0 = valaddr0;
+ args.type = type;
+ args.valaddr0 = valaddr0;
args.embedded_offset = embedded_offset;
args.address = address;
args.stream = stream;
@@ -548,28 +515,20 @@ ada_val_print (type, valaddr0, embedded_offset, address, stream,
static int
ada_val_print_stub (PTR args0)
{
- struct ada_val_print_args* argsp = (struct ada_val_print_args*) args0;
- return ada_val_print_1 (argsp->type, argsp->valaddr0, argsp->embedded_offset,
- argsp->address, argsp->stream, argsp->format,
- argsp->deref_ref, argsp->recurse,
- argsp->pretty);
+ struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
+ return ada_val_print_1 (argsp->type, argsp->valaddr0,
+ argsp->embedded_offset, argsp->address,
+ argsp->stream, argsp->format, argsp->deref_ref,
+ argsp->recurse, argsp->pretty);
}
/* See the comment on ada_val_print. This function differs in that it
* does not catch evaluation errors (leaving that to ada_val_print). */
static int
-ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty)
- struct type* type;
- char* valaddr0;
- int embedded_offset;
- CORE_ADDR address;
- struct ui_file *stream;
- int format;
- int deref_ref;
- int recurse;
- enum val_prettyprint pretty;
+ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
+ CORE_ADDR address, struct ui_file *stream, int format,
+ int deref_ref, int recurse, enum val_prettyprint pretty)
{
unsigned int len;
int i;
@@ -577,15 +536,15 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
unsigned int eltlen;
LONGEST val;
CORE_ADDR addr;
- char* valaddr = valaddr0 + embedded_offset;
+ char *valaddr = valaddr0 + embedded_offset;
CHECK_TYPEDEF (type);
if (ada_is_array_descriptor (type) || ada_is_packed_array_type (type))
{
int retn;
- struct value* mark = value_mark ();
- struct value* val;
+ struct value *mark = value_mark ();
+ struct value *val;
val = value_from_contents_and_address (type, valaddr, address);
val = ada_coerce_to_simple_array_ptr (val);
if (val == NULL)
@@ -595,7 +554,7 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
}
else
retn = ada_val_print_1 (VALUE_TYPE (val), VALUE_CONTENTS (val), 0,
- VALUE_ADDRESS (val), stream, format,
+ VALUE_ADDRESS (val), stream, format,
deref_ref, recurse, pretty);
value_free_to_mark (mark);
return retn;
@@ -608,7 +567,7 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
switch (TYPE_CODE (type))
{
default:
- return c_val_print (type, valaddr0, embedded_offset, address, stream,
+ return c_val_print (type, valaddr0, embedded_offset, address, stream,
format, deref_ref, recurse, pretty);
case TYPE_CODE_INT:
@@ -624,26 +583,26 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
}
else if (ada_is_vax_floating_type (type))
{
- struct value* val =
+ struct value *val =
value_from_contents_and_address (type, valaddr, address);
- struct value* func = ada_vax_float_print_function (type);
+ struct value *func = ada_vax_float_print_function (type);
if (func != 0)
{
- static struct type* parray_of_char = NULL;
- struct value* printable_val;
-
- if (parray_of_char == NULL)
- parray_of_char =
- make_pointer_type
- (create_array_type
- (NULL, builtin_type_char,
- create_range_type (NULL, builtin_type_int, 0, 32)),
- NULL);
-
- printable_val =
+ static struct type *parray_of_char = NULL;
+ struct value *printable_val;
+
+ if (parray_of_char == NULL)
+ parray_of_char =
+ make_pointer_type
+ (create_array_type
+ (NULL, builtin_type_char,
+ create_range_type (NULL, builtin_type_int, 0, 32)), NULL);
+
+ printable_val =
value_ind (value_cast (parray_of_char,
- call_function_by_hand (func, 1, &val)));
-
+ call_function_by_hand (func, 1,
+ &val)));
+
fprintf_filtered (stream, "%s", VALUE_CONTENTS (printable_val));
return 0;
}
@@ -651,26 +610,26 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
}
else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
{
- struct type* target_type = TYPE_TARGET_TYPE (type);
+ struct type *target_type = TYPE_TARGET_TYPE (type);
if (TYPE_LENGTH (type) != TYPE_LENGTH (target_type))
{
/* Obscure case of range type that has different length from
- its base type. Perform a conversion, or we will get a
- nonsense value. Actually, we could use the same
- code regardless of lengths; I'm just avoiding a cast. */
- struct value* v =
- value_cast (target_type,
- value_from_contents_and_address (type, valaddr, 0));
+ its base type. Perform a conversion, or we will get a
+ nonsense value. Actually, we could use the same
+ code regardless of lengths; I'm just avoiding a cast. */
+ struct value *v = value_cast (target_type,
+ value_from_contents_and_address
+ (type, valaddr, 0));
return ada_val_print_1 (target_type, VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
else
- return ada_val_print_1 (TYPE_TARGET_TYPE (type),
+ return ada_val_print_1 (TYPE_TARGET_TYPE (type),
valaddr0, embedded_offset,
- address, stream, format, deref_ref,
+ address, stream, format, deref_ref,
recurse, pretty);
}
- else
+ else
{
format = format ? format : output_format;
if (format)
@@ -708,8 +667,8 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
}
if (i < len)
{
- const char* name = ada_enum_name (TYPE_FIELD_NAME (type, i));
- if (name[0] == '\'')
+ const char *name = ada_enum_name (TYPE_FIELD_NAME (type, i));
+ if (name[0] == '\'')
fprintf_filtered (stream, "%ld %s", (long) val, name);
else
fputs_filtered (name, stream);
@@ -719,18 +678,17 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
print_longest (stream, 'd', 0, val);
}
break;
-
+
case TYPE_CODE_UNION:
case TYPE_CODE_STRUCT:
if (ada_is_bogus_array_descriptor (type))
{
fprintf_filtered (stream, "(...?)");
return 0;
- }
+ }
else
{
- print_record (type, valaddr, stream, format,
- recurse, pretty);
+ print_record (type, valaddr, stream, format, recurse, pretty);
return 0;
}
@@ -740,21 +698,20 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
elttype = TYPE_TARGET_TYPE (type);
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
-
+
/* For an array of chars, print with string syntax. */
- if (ada_is_string_type (type)
- && (format == 0 || format == 's'))
+ if (ada_is_string_type (type) && (format == 0 || format == 's'))
{
if (prettyprint_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
/* If requested, look for the first null char and only print
- elements up to it. */
+ elements up to it. */
if (stop_print_at_null)
{
int temp_len;
-
+
/* Look for a NULL char. */
for (temp_len = 0;
temp_len < len && temp_len < print_max
@@ -762,7 +719,7 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
temp_len += 1);
len = temp_len;
}
-
+
printstr (stream, valaddr, len, 0, eltlen);
}
else
@@ -770,10 +727,9 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
len = 0;
fprintf_filtered (stream, "(");
print_optional_low_bound (stream, type);
- if (TYPE_FIELD_BITSIZE (type, 0) > 0)
+ if (TYPE_FIELD_BITSIZE (type, 0) > 0)
val_print_packed_array_elements (type, valaddr, 0, stream,
- format, recurse,
- pretty);
+ format, recurse, pretty);
else
val_print_array_elements (type, valaddr, address, stream,
format, deref_ref, recurse,
@@ -787,27 +743,27 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (addressprint)
- {
+ {
fprintf_filtered (stream, "@");
print_address_numeric
(extract_address (valaddr,
TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
if (deref_ref)
fputs_filtered (": ", stream);
- }
+ }
/* De-reference the reference */
if (deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
- LONGEST deref_val_int = (LONGEST)
- unpack_pointer (lookup_pointer_type (builtin_type_void),
+ LONGEST deref_val_int = (LONGEST)
+ unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr);
- if (deref_val_int != 0)
+ if (deref_val_int != 0)
{
- struct value* deref_val =
- ada_value_ind (value_from_longest
- (lookup_pointer_type (elttype),
+ struct value *deref_val =
+ ada_value_ind (value_from_longest
+ (lookup_pointer_type (elttype),
deref_val_int));
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val), 0,
@@ -826,28 +782,18 @@ ada_val_print_1 (type, valaddr0, embedded_offset, address, stream,
}
static int
-print_variant_part (type, field_num, valaddr,
- stream, format, recurse, pretty, comma_needed,
- outer_type, outer_valaddr)
- struct type *type;
- int field_num;
- char *valaddr;
- struct ui_file *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
- int comma_needed;
- struct type *outer_type;
- char *outer_valaddr;
+print_variant_part (struct type *type, int field_num, char *valaddr,
+ struct ui_file *stream, int format, int recurse,
+ enum val_prettyprint pretty, int comma_needed,
+ struct type *outer_type, char *outer_valaddr)
{
struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
- int which =
- ada_which_variant_applies (var_type, outer_type, outer_valaddr);
+ int which = ada_which_variant_applies (var_type, outer_type, outer_valaddr);
if (which < 0)
return 0;
else
- return print_field_values
+ return print_field_values
(TYPE_FIELD_TYPE (var_type, which),
valaddr + TYPE_FIELD_BITPOS (type, field_num) / HOST_CHAR_BIT
+ TYPE_FIELD_BITPOS (var_type, which) / HOST_CHAR_BIT,
@@ -856,26 +802,23 @@ print_variant_part (type, field_num, valaddr,
}
int
-ada_value_print (val0, stream, format, pretty)
- struct value* val0;
- struct ui_file *stream;
- int format;
- enum val_prettyprint pretty;
+ada_value_print (struct value *val0, struct ui_file *stream, int format,
+ enum val_prettyprint pretty)
{
- char* valaddr = VALUE_CONTENTS (val0);
+ char *valaddr = VALUE_CONTENTS (val0);
CORE_ADDR address = VALUE_ADDRESS (val0) + VALUE_OFFSET (val0);
- struct type* type =
+ struct type *type =
ada_to_fixed_type (VALUE_TYPE (val0), valaddr, address, NULL);
- struct value* val = value_from_contents_and_address (type, valaddr, address);
+ struct value *val =
+ value_from_contents_and_address (type, valaddr, address);
/* If it is a pointer, indicate what it points to. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR ||
- TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF)
{
/* Hack: remove (char *) for char strings. Their
- type is indicated by the quoted string anyway. */
+ type is indicated by the quoted string anyway. */
if (TYPE_CODE (type) == TYPE_CODE_PTR &&
- TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof(char) &&
+ TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof (char) &&
TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT &&
!TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
{
@@ -888,7 +831,7 @@ ada_value_print (val0, stream, format, pretty)
fprintf_filtered (stream, ") ");
}
}
- else if (ada_is_array_descriptor (type))
+ else if (ada_is_array_descriptor (type))
{
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
@@ -901,26 +844,20 @@ ada_value_print (val0, stream, format, pretty)
fprintf_filtered (stream, ") (...?)");
return 0;
}
- return (val_print (type, VALUE_CONTENTS (val), 0, address,
+ return (val_print (type, VALUE_CONTENTS (val), 0, address,
stream, format, 1, 0, pretty));
}
-
+
static void
-print_record (type, valaddr, stream, format, recurse, pretty)
- struct type *type;
- char *valaddr;
- struct ui_file *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
+print_record (struct type *type, char *valaddr, struct ui_file *stream,
+ int format, int recurse, enum val_prettyprint pretty)
{
CHECK_TYPEDEF (type);
fprintf_filtered (stream, "(");
if (print_field_values (type, valaddr, stream, format, recurse, pretty,
- 0, type, valaddr) != 0
- && pretty)
+ 0, type, valaddr) != 0 && pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -944,17 +881,10 @@ print_record (type, valaddr, stream, format, recurse, pretty)
Returns 1 if COMMA_NEEDED or any fields were printed. */
static int
-print_field_values (type, valaddr, stream, format, recurse, pretty,
- comma_needed, outer_type, outer_valaddr)
- struct type *type;
- char *valaddr;
- struct ui_file *stream;
- int format;
- int recurse;
- enum val_prettyprint pretty;
- int comma_needed;
- struct type *outer_type;
- char *outer_valaddr;
+print_field_values (struct type *type, char *valaddr, struct ui_file *stream,
+ int format, int recurse, enum val_prettyprint pretty,
+ int comma_needed, struct type *outer_type,
+ char *outer_valaddr)
{
int i, len;
@@ -963,13 +893,13 @@ print_field_values (type, valaddr, stream, format, recurse, pretty,
for (i = 0; i < len; i += 1)
{
if (ada_is_ignored_field (type, i))
- continue;
+ continue;
if (ada_is_wrapper_field (type, i))
{
- comma_needed =
+ comma_needed =
print_field_values (TYPE_FIELD_TYPE (type, i),
- valaddr
+ valaddr
+ TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
stream, format, recurse, pretty,
comma_needed, type, valaddr);
@@ -993,7 +923,7 @@ print_field_values (type, valaddr, stream, format, recurse, pretty,
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
- else
+ else
{
wrap_here (n_spaces (2 + 2 * recurse));
}
@@ -1013,7 +943,7 @@ print_field_values (type, valaddr, stream, format, recurse, pretty,
else
{
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
- fprintf_filtered (stream, "%.*s",
+ fprintf_filtered (stream, "%.*s",
ada_name_prefix_len (TYPE_FIELD_NAME (type, i)),
TYPE_FIELD_NAME (type, i));
annotate_field_name_end ();
@@ -1023,7 +953,7 @@ print_field_values (type, valaddr, stream, format, recurse, pretty,
if (TYPE_FIELD_PACKED (type, i))
{
- struct value* v;
+ struct value *v;
/* Bitfields require special handling, especially due to byte
order problems. */
@@ -1036,21 +966,21 @@ print_field_values (type, valaddr, stream, format, recurse, pretty,
{
int bit_pos = TYPE_FIELD_BITPOS (type, i);
int bit_size = TYPE_FIELD_BITSIZE (type, i);
-
+
adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
v = ada_value_primitive_packed_val (NULL, valaddr,
bit_pos / HOST_CHAR_BIT,
bit_pos % HOST_CHAR_BIT,
- bit_size,
+ bit_size,
TYPE_FIELD_TYPE (type, i));
- val_print (TYPE_FIELD_TYPE(type, i), VALUE_CONTENTS (v), 0, 0,
+ val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
}
else
- ada_val_print (TYPE_FIELD_TYPE (type, i),
- valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
- 0, 0, stream, format, 0, recurse + 1, pretty);
+ ada_val_print (TYPE_FIELD_TYPE (type, i),
+ valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
+ 0, 0, stream, format, 0, recurse + 1, pretty);
annotate_field_end ();
}
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
new file mode 100644
index 00000000000..da75f21dbd1
--- /dev/null
+++ b/gdb/aix-thread.c
@@ -0,0 +1,1707 @@
+/* Low level interface for debugging AIX 4.3+ pthreads.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+ Written by Nick Duffek <nsd@redhat.com>.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+/* This module uses the libpthdebug.a library provided by AIX 4.3+ for
+ debugging pthread applications.
+
+ Some name prefix conventions:
+ pthdb_ provided by libpthdebug.a
+ pdc_ callbacks that this module provides to libpthdebug.a
+ pd_ variables or functions interfacing with libpthdebug.a
+
+ libpthdebug peculiarities:
+
+ - pthdb_ptid_pthread() is prototyped in <sys/pthdebug.h>, but
+ it's not documented, and after several calls it stops working
+ and causes other libpthdebug functions to fail.
+
+ - pthdb_tid_pthread() doesn't always work after
+ pthdb_session_update(), but it does work after cycling through
+ all threads using pthdb_pthread().
+
+ */
+
+#include "defs.h"
+#include "gdb_assert.h"
+#include "gdbthread.h"
+#include "target.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "gdbcmd.h"
+#include "language.h" /* for local_hex_string() */
+#include "ppc-tdep.h"
+
+#include <procinfo.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <sys/reg.h>
+#include <sched.h>
+#include <sys/pthdebug.h>
+
+/* Whether to emit debugging output. */
+static int debug_aix_thread;
+
+/* In AIX 5.1, functions use pthdb_tid_t instead of tid_t. */
+#ifndef PTHDB_VERSION_3
+#define pthdb_tid_t tid_t
+#endif
+
+/* Return whether to treat PID as a debuggable thread id. */
+
+#define PD_TID(ptid) (pd_active && ptid_get_tid (ptid) != 0)
+
+/* Build a thread ptid. */
+#define BUILD_THREAD(TID, PID) ptid_build (PID, 0, TID)
+
+/* Build and lwp ptid. */
+#define BUILD_LWP(LWP, PID) MERGEPID (PID, LWP)
+
+/* pthdb_user_t value that we pass to pthdb functions. 0 causes
+ PTHDB_BAD_USER errors, so use 1. */
+
+#define PD_USER 1
+
+/* Success and failure values returned by pthdb callbacks. */
+
+#define PDC_SUCCESS PTHDB_SUCCESS
+#define PDC_FAILURE PTHDB_CALLBACK
+
+/* Private data attached to each element in GDB's thread list. */
+
+struct private_thread_info {
+ pthdb_pthread_t pdtid; /* thread's libpthdebug id */
+ pthdb_tid_t tid; /* kernel thread id */
+};
+
+/* Information about a thread of which libpthdebug is aware. */
+
+struct pd_thread {
+ pthdb_pthread_t pdtid;
+ pthread_t pthid;
+ pthdb_tid_t tid;
+};
+
+/* This module's target-specific operations, active while pd_able is true. */
+
+static struct target_ops aix_thread_ops;
+
+/* Copy of the target over which ops is pushed.
+ This is more convenient than a pointer to child_ops or core_ops,
+ because they lack current_target's default callbacks. */
+
+static struct target_ops base_target;
+
+/* Address of the function that libpthread will call when libpthdebug
+ is ready to be initialized. */
+
+static CORE_ADDR pd_brk_addr;
+
+/* Whether the current application is debuggable by pthdb. */
+
+static int pd_able = 0;
+
+/* Whether a threaded application is being debugged. */
+
+static int pd_active = 0;
+
+/* Whether the current architecture is 64-bit.
+ Only valid when pd_able is true. */
+
+static int arch64;
+
+/* Saved pointer to previous owner of target_new_objfile_hook. */
+
+static void (*target_new_objfile_chain)(struct objfile *);
+
+/* Forward declarations for pthdb callbacks. */
+
+static int pdc_symbol_addrs (pthdb_user_t, pthdb_symbol_t *, int);
+static int pdc_read_data (pthdb_user_t, void *, pthdb_addr_t, size_t);
+static int pdc_write_data (pthdb_user_t, void *, pthdb_addr_t, size_t);
+static int pdc_read_regs (pthdb_user_t user, pthdb_tid_t tid,
+ unsigned long long flags,
+ pthdb_context_t *context);
+static int pdc_write_regs (pthdb_user_t user, pthdb_tid_t tid,
+ unsigned long long flags,
+ pthdb_context_t *context);
+static int pdc_alloc (pthdb_user_t, size_t, void **);
+static int pdc_realloc (pthdb_user_t, void *, size_t, void **);
+static int pdc_dealloc (pthdb_user_t, void *);
+
+/* pthdb callbacks. */
+
+static pthdb_callbacks_t pd_callbacks = {
+ pdc_symbol_addrs,
+ pdc_read_data,
+ pdc_write_data,
+ pdc_read_regs,
+ pdc_write_regs,
+ pdc_alloc,
+ pdc_realloc,
+ pdc_dealloc,
+ NULL
+};
+
+/* Current pthdb session. */
+
+static pthdb_session_t pd_session;
+
+/* Return a printable representation of pthdebug function return
+ STATUS. */
+
+static char *
+pd_status2str (int status)
+{
+ switch (status)
+ {
+ case PTHDB_SUCCESS: return "SUCCESS";
+ case PTHDB_NOSYS: return "NOSYS";
+ case PTHDB_NOTSUP: return "NOTSUP";
+ case PTHDB_BAD_VERSION: return "BAD_VERSION";
+ case PTHDB_BAD_USER: return "BAD_USER";
+ case PTHDB_BAD_SESSION: return "BAD_SESSION";
+ case PTHDB_BAD_MODE: return "BAD_MODE";
+ case PTHDB_BAD_FLAGS: return "BAD_FLAGS";
+ case PTHDB_BAD_CALLBACK: return "BAD_CALLBACK";
+ case PTHDB_BAD_POINTER: return "BAD_POINTER";
+ case PTHDB_BAD_CMD: return "BAD_CMD";
+ case PTHDB_BAD_PTHREAD: return "BAD_PTHREAD";
+ case PTHDB_BAD_ATTR: return "BAD_ATTR";
+ case PTHDB_BAD_MUTEX: return "BAD_MUTEX";
+ case PTHDB_BAD_MUTEXATTR: return "BAD_MUTEXATTR";
+ case PTHDB_BAD_COND: return "BAD_COND";
+ case PTHDB_BAD_CONDATTR: return "BAD_CONDATTR";
+ case PTHDB_BAD_RWLOCK: return "BAD_RWLOCK";
+ case PTHDB_BAD_RWLOCKATTR: return "BAD_RWLOCKATTR";
+ case PTHDB_BAD_KEY: return "BAD_KEY";
+ case PTHDB_BAD_PTID: return "BAD_PTID";
+ case PTHDB_BAD_TID: return "BAD_TID";
+ case PTHDB_CALLBACK: return "CALLBACK";
+ case PTHDB_CONTEXT: return "CONTEXT";
+ case PTHDB_HELD: return "HELD";
+ case PTHDB_NOT_HELD: return "NOT_HELD";
+ case PTHDB_MEMORY: return "MEMORY";
+ case PTHDB_NOT_PTHREADED: return "NOT_PTHREADED";
+ case PTHDB_SYMBOL: return "SYMBOL";
+ case PTHDB_NOT_AVAIL: return "NOT_AVAIL";
+ case PTHDB_INTERNAL: return "INTERNAL";
+ default: return "UNKNOWN";
+ }
+}
+
+/* A call to ptrace(REQ, ID, ...) just returned RET. Check for
+ exceptional conditions and either return nonlocally or else return
+ 1 for success and 0 for failure. */
+
+static int
+ptrace_check (int req, int id, int ret)
+{
+ if (ret == 0 && !errno)
+ return 1;
+
+ /* According to ptrace(2), ptrace may fail with EPERM if "the
+ Identifier parameter corresponds to a kernel thread which is
+ stopped in kernel mode and whose computational state cannot be
+ read or written." This happens quite often with register reads. */
+
+ switch (req)
+ {
+ case PTT_READ_GPRS:
+ case PTT_READ_FPRS:
+ case PTT_READ_SPRS:
+ if (ret == -1 && errno == EPERM)
+ {
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "ptrace (%d, %d) = %d (errno = %d)\n",
+ req, id, ret, errno);
+ return ret == -1 ? 0 : 1;
+ }
+ break;
+ }
+ error ("aix-thread: ptrace (%d, %d) returned %d (errno = %d %s)",
+ req, id, ret, errno, safe_strerror (errno));
+ return 0; /* Not reached. */
+}
+
+/* Call ptracex (REQ, ID, ADDR, DATA, BUF). Return success. */
+
+static int
+ptrace64aix (int req, int id, long long addr, int data, int *buf)
+{
+ errno = 0;
+ return ptrace_check (req, id, ptracex (req, id, addr, data, buf));
+}
+
+/* Call ptrace (REQ, ID, ADDR, DATA, BUF). Return success. */
+
+static int
+ptrace32 (int req, int id, int *addr, int data, int *buf)
+{
+ errno = 0;
+ return ptrace_check (req, id,
+ ptrace (req, id, (int *) addr, data, buf));
+}
+
+/* If *PIDP is a composite process/thread id, convert it to a
+ process id. */
+
+static void
+pid_to_prc (ptid_t *ptidp)
+{
+ ptid_t ptid;
+
+ ptid = *ptidp;
+ if (PD_TID (ptid))
+ *ptidp = pid_to_ptid (PIDGET (ptid));
+}
+
+/* pthdb callback: for <i> from 0 to COUNT, set SYMBOLS[<i>].addr to
+ the address of SYMBOLS[<i>].name. */
+
+static int
+pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
+{
+ struct minimal_symbol *ms;
+ int i;
+ char *name;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_symbol_addrs (user = %ld, symbols = 0x%lx, count = %d)\n",
+ user, (long) symbols, count);
+
+ for (i = 0; i < count; i++)
+ {
+ name = symbols[i].name;
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ " symbols[%d].name = \"%s\"\n", i, name);
+
+ if (!*name)
+ symbols[i].addr = 0;
+ else
+ {
+ if (!(ms = lookup_minimal_symbol (name, NULL, NULL)))
+ {
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
+ return PDC_FAILURE;
+ }
+ symbols[i].addr = SYMBOL_VALUE_ADDRESS (ms);
+ }
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, " symbols[%d].addr = %s\n",
+ i, local_hex_string (symbols[i].addr));
+ }
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, " returning PDC_SUCCESS\n");
+ return PDC_SUCCESS;
+}
+
+/* Read registers call back function should be able to read the
+ context information of a debuggee kernel thread from an active
+ process or from a core file. The information should be formatted
+ in context64 form for both 32-bit and 64-bit process.
+ If successful return 0, else non-zero is returned. */
+
+static int
+pdc_read_regs (pthdb_user_t user,
+ pthdb_tid_t tid,
+ unsigned long long flags,
+ pthdb_context_t *context)
+{
+ /* This function doesn't appear to be used, so we could probably
+ just return 0 here. HOWEVER, if it is not defined, the OS will
+ complain and several thread debug functions will fail. In case
+ this is needed, I have implemented what I think it should do,
+ however this code is untested. */
+
+ uint64_t gprs64[32];
+ uint32_t gprs32[32];
+ double fprs[32];
+ struct ptxsprs sprs64;
+ struct ptsprs sprs32;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
+ (int) tid, local_hex_string (flags));
+
+ /* General-purpose registers. */
+ if (flags & PTHDB_FLAG_GPRS)
+ {
+ if (arch64)
+ {
+ if (!ptrace64aix (PTT_READ_GPRS, tid,
+ (unsigned long) gprs64, 0, NULL))
+ memset (gprs64, 0, sizeof (gprs64));
+ memcpy (context->gpr, gprs64, sizeof(gprs64));
+ }
+ else
+ {
+ if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL))
+ memset (gprs32, 0, sizeof (gprs32));
+ memcpy (context->gpr, gprs32, sizeof(gprs32));
+ }
+ }
+
+ /* Floating-point registers. */
+ if (flags & PTHDB_FLAG_FPRS)
+ {
+ if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL))
+ memset (fprs, 0, sizeof (fprs));
+ memcpy (context->fpr, fprs, sizeof(fprs));
+ }
+
+ /* Special-purpose registers. */
+ if (flags & PTHDB_FLAG_SPRS)
+ {
+ if (arch64)
+ {
+ if (!ptrace64aix (PTT_READ_SPRS, tid,
+ (unsigned long) &sprs64, 0, NULL))
+ memset (&sprs64, 0, sizeof (sprs64));
+ memcpy (&context->msr, &sprs64, sizeof(sprs64));
+ }
+ else
+ {
+ if (!ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL))
+ memset (&sprs32, 0, sizeof (sprs32));
+ memcpy (&context->msr, &sprs32, sizeof(sprs32));
+ }
+ }
+ return 0;
+}
+
+/* Write register function should be able to write requested context
+ information to specified debuggee's kernel thread id.
+ If successful return 0, else non-zero is returned. */
+
+static int
+pdc_write_regs (pthdb_user_t user,
+ pthdb_tid_t tid,
+ unsigned long long flags,
+ pthdb_context_t *context)
+{
+ /* This function doesn't appear to be used, so we could probably
+ just return 0 here. HOWEVER, if it is not defined, the OS will
+ complain and several thread debug functions will fail. In case
+ this is needed, I have implemented what I think it should do,
+ however this code is untested. */
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
+ (int) tid, local_hex_string (flags));
+
+ /* General-purpose registers. */
+ if (flags & PTHDB_FLAG_GPRS)
+ {
+ if (arch64)
+ ptrace64aix (PTT_WRITE_GPRS, tid,
+ (unsigned long) context->gpr, 0, NULL);
+ else
+ ptrace32 (PTT_WRITE_GPRS, tid, (int *) context->gpr, 0, NULL);
+ }
+
+ /* Floating-point registers. */
+ if (flags & PTHDB_FLAG_FPRS)
+ {
+ ptrace32 (PTT_WRITE_FPRS, tid, (int *) context->fpr, 0, NULL);
+ }
+
+ /* Special-purpose registers. */
+ if (flags & PTHDB_FLAG_SPRS)
+ {
+ if (arch64)
+ {
+ ptrace64aix (PTT_WRITE_SPRS, tid,
+ (unsigned long) &context->msr, 0, NULL);
+ }
+ else
+ {
+ ptrace32 (PTT_WRITE_SPRS, tid, (int *) &context->msr, 0, NULL);
+ }
+ }
+ return 0;
+}
+
+/* pthdb callback: read LEN bytes from process ADDR into BUF. */
+
+static int
+pdc_read_data (pthdb_user_t user, void *buf,
+ pthdb_addr_t addr, size_t len)
+{
+ int status, ret;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
+ user, (long) buf, local_hex_string (addr), len);
+
+ status = target_read_memory (addr, buf, len);
+ ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n",
+ status, pd_status2str (ret));
+ return ret;
+}
+
+/* pthdb callback: write LEN bytes from BUF to process ADDR. */
+
+static int
+pdc_write_data (pthdb_user_t user, void *buf,
+ pthdb_addr_t addr, size_t len)
+{
+ int status, ret;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n",
+ user, (long) buf, local_hex_string (addr), len);
+
+ status = target_write_memory (addr, buf, len);
+ ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog, " status=%d, returning %s\n", status,
+ pd_status2str (ret));
+ return ret;
+}
+
+/* pthdb callback: allocate a LEN-byte buffer and store a pointer to it
+ in BUFP. */
+
+static int
+pdc_alloc (pthdb_user_t user, size_t len, void **bufp)
+{
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
+ user, len, (long) bufp);
+ *bufp = xmalloc (len);
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ " malloc returned 0x%lx\n", (long) *bufp);
+
+ /* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never
+ be returned. */
+
+ return *bufp ? PDC_SUCCESS : PDC_FAILURE;
+}
+
+/* pthdb callback: reallocate BUF, which was allocated by the alloc or
+ realloc callback, so that it contains LEN bytes, and store a
+ pointer to the result in BUFP. */
+
+static int
+pdc_realloc (pthdb_user_t user, void *buf, size_t len, void **bufp)
+{
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_realloc (user = %ld, buf = 0x%lx, len = %ld, bufp = 0x%lx)\n",
+ user, (long) buf, len, (long) bufp);
+ *bufp = xrealloc (buf, len);
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ " realloc returned 0x%lx\n", (long) *bufp);
+ return *bufp ? PDC_SUCCESS : PDC_FAILURE;
+}
+
+/* pthdb callback: free BUF, which was allocated by the alloc or
+ realloc callback. */
+
+static int
+pdc_dealloc (pthdb_user_t user, void *buf)
+{
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "pdc_free (user = %ld, buf = 0x%lx)\n", user,
+ (long) buf);
+ xfree (buf);
+ return PDC_SUCCESS;
+}
+
+/* Return a printable representation of pthread STATE. */
+
+static char *
+state2str (pthdb_state_t state)
+{
+ switch (state)
+ {
+ case PST_IDLE: return "idle"; /* being created */
+ case PST_RUN: return "running"; /* running */
+ case PST_SLEEP: return "sleeping"; /* awaiting an event */
+ case PST_READY: return "ready"; /* runnable */
+ case PST_TERM: return "finished"; /* awaiting a join/detach */
+ default: return "unknown";
+ }
+}
+
+/* qsort() comparison function for sorting pd_thread structs by pthid. */
+
+static int
+pcmp (const void *p1v, const void *p2v)
+{
+ struct pd_thread *p1 = (struct pd_thread *) p1v;
+ struct pd_thread *p2 = (struct pd_thread *) p2v;
+ return p1->pthid < p2->pthid ? -1 : p1->pthid > p2->pthid;
+}
+
+/* iterate_over_threads() callback for counting GDB threads. */
+
+static int
+giter_count (struct thread_info *thread, void *countp)
+{
+ (*(int *) countp)++;
+ return 0;
+}
+
+/* iterate_over_threads() callback for accumulating GDB thread pids. */
+
+static int
+giter_accum (struct thread_info *thread, void *bufp)
+{
+ **(struct thread_info ***) bufp = thread;
+ (*(struct thread_info ***) bufp)++;
+ return 0;
+}
+
+/* ptid comparison function */
+
+static int
+ptid_cmp (ptid_t ptid1, ptid_t ptid2)
+{
+ int pid1, pid2;
+
+ if (ptid_get_pid (ptid1) < ptid_get_pid (ptid2))
+ return -1;
+ else if (ptid_get_pid (ptid1) > ptid_get_pid (ptid2))
+ return 1;
+ else if (ptid_get_tid (ptid1) < ptid_get_tid (ptid2))
+ return -1;
+ else if (ptid_get_tid (ptid1) > ptid_get_tid (ptid2))
+ return 1;
+ else if (ptid_get_lwp (ptid1) < ptid_get_lwp (ptid2))
+ return -1;
+ else if (ptid_get_lwp (ptid1) > ptid_get_lwp (ptid2))
+ return 1;
+ else
+ return 0;
+}
+
+/* qsort() comparison function for sorting thread_info structs by pid. */
+
+static int
+gcmp (const void *t1v, const void *t2v)
+{
+ struct thread_info *t1 = *(struct thread_info **) t1v;
+ struct thread_info *t2 = *(struct thread_info **) t2v;
+ return ptid_cmp (t1->ptid, t2->ptid);
+}
+
+/* Synchronize GDB's thread list with libpthdebug's.
+
+ There are some benefits of doing this every time the inferior stops:
+
+ - allows users to run thread-specific commands without needing to
+ run "info threads" first
+
+ - helps pthdb_tid_pthread() work properly (see "libpthdebug
+ peculiarities" at the top of this module)
+
+ - simplifies the demands placed on libpthdebug, which seems to
+ have difficulty with certain call patterns */
+
+static void
+sync_threadlists (void)
+{
+ int cmd, status, infpid;
+ int pcount, psize, pi, gcount, gi;
+ struct pd_thread *pbuf;
+ struct thread_info **gbuf, **g, *thread;
+ pthdb_pthread_t pdtid;
+ pthread_t pthid;
+ pthdb_tid_t tid;
+
+ /* Accumulate an array of libpthdebug threads sorted by pthread id. */
+
+ pcount = 0;
+ psize = 1;
+ pbuf = (struct pd_thread *) xmalloc (psize * sizeof *pbuf);
+
+ for (cmd = PTHDB_LIST_FIRST;; cmd = PTHDB_LIST_NEXT)
+ {
+ status = pthdb_pthread (pd_session, &pdtid, cmd);
+ if (status != PTHDB_SUCCESS || pdtid == PTHDB_INVALID_PTHREAD)
+ break;
+
+ status = pthdb_pthread_ptid (pd_session, pdtid, &pthid);
+ if (status != PTHDB_SUCCESS || pthid == PTHDB_INVALID_PTID)
+ continue;
+
+ if (pcount == psize)
+ {
+ psize *= 2;
+ pbuf = (struct pd_thread *) xrealloc (pbuf,
+ psize * sizeof *pbuf);
+ }
+ pbuf[pcount].pdtid = pdtid;
+ pbuf[pcount].pthid = pthid;
+ pcount++;
+ }
+
+ for (pi = 0; pi < pcount; pi++)
+ {
+ status = pthdb_pthread_tid (pd_session, pbuf[pi].pdtid, &tid);
+ if (status != PTHDB_SUCCESS)
+ tid = PTHDB_INVALID_TID;
+ pbuf[pi].tid = tid;
+ }
+
+ qsort (pbuf, pcount, sizeof *pbuf, pcmp);
+
+ /* Accumulate an array of GDB threads sorted by pid. */
+
+ gcount = 0;
+ iterate_over_threads (giter_count, &gcount);
+ g = gbuf = (struct thread_info **) xmalloc (gcount * sizeof *gbuf);
+ iterate_over_threads (giter_accum, &g);
+ qsort (gbuf, gcount, sizeof *gbuf, gcmp);
+
+ /* Apply differences between the two arrays to GDB's thread list. */
+
+ infpid = PIDGET (inferior_ptid);
+ for (pi = gi = 0; pi < pcount || gi < gcount;)
+ {
+ if (pi == pcount)
+ {
+ delete_thread (gbuf[gi]->ptid);
+ gi++;
+ }
+ else if (gi == gcount)
+ {
+ thread = add_thread (BUILD_THREAD (pbuf[pi].pthid, infpid));
+ thread->private = xmalloc (sizeof (struct private_thread_info));
+ thread->private->pdtid = pbuf[pi].pdtid;
+ thread->private->tid = pbuf[pi].tid;
+ pi++;
+ }
+ else
+ {
+ ptid_t pptid, gptid;
+ int cmp_result;
+
+ pptid = BUILD_THREAD (pbuf[pi].pthid, infpid);
+ gptid = gbuf[gi]->ptid;
+ pdtid = pbuf[pi].pdtid;
+ tid = pbuf[pi].tid;
+
+ cmp_result = ptid_cmp (pptid, gptid);
+
+ if (cmp_result == 0)
+ {
+ gbuf[gi]->private->pdtid = pdtid;
+ gbuf[gi]->private->tid = tid;
+ pi++;
+ gi++;
+ }
+ else if (cmp_result > 0)
+ {
+ delete_thread (gptid);
+ gi++;
+ }
+ else
+ {
+ thread = add_thread (pptid);
+ thread->private = xmalloc (sizeof (struct private_thread_info));
+ thread->private->pdtid = pdtid;
+ thread->private->tid = tid;
+ pi++;
+ }
+ }
+ }
+
+ xfree (pbuf);
+ xfree (gbuf);
+}
+
+/* Iterate_over_threads() callback for locating a thread whose kernel
+ thread just received a trap signal. */
+
+static int
+iter_trap (struct thread_info *thread, void *unused)
+{
+ struct thrdsinfo64 thrinf;
+ pthdb_tid_t tid;
+
+ /* getthrds(3) isn't prototyped in any AIX 4.3.3 #include file. */
+ extern int getthrds (pid_t, struct thrdsinfo64 *,
+ int, pthdb_tid_t *, int);
+
+ tid = thread->private->tid;
+ if (tid == PTHDB_INVALID_TID)
+ return 0;
+
+ if (getthrds (PIDGET (inferior_ptid), &thrinf,
+ sizeof (thrinf), &tid, 1) != 1)
+ return 0;
+
+ return thrinf.ti_cursig == SIGTRAP;
+}
+
+/* Synchronize libpthdebug's state with the inferior and with GDB,
+ generate a composite process/thread <pid> for the current thread,
+ set inferior_ptid to <pid> if SET_INFPID, and return <pid>. */
+
+static ptid_t
+pd_update (int set_infpid)
+{
+ int status;
+ ptid_t ptid;
+ struct thread_info *thread;
+
+ if (!pd_active)
+ return inferior_ptid;
+
+ status = pthdb_session_update (pd_session);
+ if (status != PTHDB_SUCCESS)
+ return inferior_ptid;
+
+ sync_threadlists ();
+
+ /* Define "current thread" as one that just received a trap signal. */
+
+ thread = iterate_over_threads (iter_trap, NULL);
+ if (!thread)
+ ptid = inferior_ptid;
+ else
+ {
+ ptid = thread->ptid;
+ if (set_infpid)
+ inferior_ptid = ptid;
+ }
+ return ptid;
+}
+
+/* Try to start debugging threads in the current process.
+ If successful and SET_INFPID, set inferior_ptid to reflect the
+ current thread. */
+
+static ptid_t
+pd_activate (int set_infpid)
+{
+ int status;
+
+ status = pthdb_session_init (PD_USER, arch64 ? PEM_64BIT : PEM_32BIT,
+ PTHDB_FLAG_REGS, &pd_callbacks,
+ &pd_session);
+ if (status != PTHDB_SUCCESS)
+ {
+ return inferior_ptid;
+ }
+ pd_active = 1;
+ return pd_update (set_infpid);
+}
+
+/* Undo the effects of pd_activate(). */
+
+static void
+pd_deactivate (void)
+{
+ if (!pd_active)
+ return;
+ pthdb_session_destroy (pd_session);
+
+ pid_to_prc (&inferior_ptid);
+ pd_active = 0;
+}
+
+/* An object file has just been loaded. Check whether the current
+ application is pthreaded, and if so, prepare for thread debugging. */
+
+static void
+pd_enable (void)
+{
+ int status;
+ char *stub_name;
+ struct minimal_symbol *ms;
+
+ /* Don't initialize twice. */
+ if (pd_able)
+ return;
+
+ /* Check application word size. */
+ arch64 = REGISTER_RAW_SIZE (0) == 8;
+
+ /* Check whether the application is pthreaded. */
+ stub_name = NULL;
+ status = pthdb_session_pthreaded (PD_USER, PTHDB_FLAG_REGS,
+ &pd_callbacks, &stub_name);
+ if ((status != PTHDB_SUCCESS &&
+ status != PTHDB_NOT_PTHREADED) || !stub_name)
+ return;
+
+ /* Set a breakpoint on the returned stub function. */
+ if (!(ms = lookup_minimal_symbol (stub_name, NULL, NULL)))
+ return;
+ pd_brk_addr = SYMBOL_VALUE_ADDRESS (ms);
+ if (!create_thread_event_breakpoint (pd_brk_addr))
+ return;
+
+ /* Prepare for thread debugging. */
+ base_target = current_target;
+ push_target (&aix_thread_ops);
+ pd_able = 1;
+
+ /* If we're debugging a core file or an attached inferior, the
+ pthread library may already have been initialized, so try to
+ activate thread debugging. */
+ pd_activate (1);
+}
+
+/* Undo the effects of pd_enable(). */
+
+static void
+pd_disable (void)
+{
+ if (!pd_able)
+ return;
+ if (pd_active)
+ pd_deactivate ();
+ pd_able = 0;
+ unpush_target (&aix_thread_ops);
+}
+
+/* target_new_objfile_hook callback.
+
+ If OBJFILE is non-null, check whether a threaded application is
+ being debugged, and if so, prepare for thread debugging.
+
+ If OBJFILE is null, stop debugging threads. */
+
+static void
+new_objfile (struct objfile *objfile)
+{
+ if (objfile)
+ pd_enable ();
+ else
+ pd_disable ();
+
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
+}
+
+/* Attach to process specified by ARGS. */
+
+static void
+aix_thread_attach (char *args, int from_tty)
+{
+ base_target.to_attach (args, from_tty);
+ pd_activate (1);
+}
+
+/* Detach from the process attached to by aix_thread_attach(). */
+
+static void
+aix_thread_detach (char *args, int from_tty)
+{
+ pd_disable ();
+ base_target.to_detach (args, from_tty);
+}
+
+/* Tell the inferior process to continue running thread PID if != -1
+ and all threads otherwise. */
+
+static void
+aix_thread_resume (ptid_t ptid, int step, enum target_signal sig)
+{
+ struct thread_info *thread;
+ pthdb_tid_t tid[2];
+
+ if (!PD_TID (ptid))
+ {
+ struct cleanup *cleanup = save_inferior_ptid ();
+ inferior_ptid = pid_to_ptid (PIDGET (inferior_ptid));
+ base_target.to_resume (ptid, step, sig);
+ do_cleanups (cleanup);
+ }
+ else
+ {
+ thread = find_thread_pid (ptid);
+ if (!thread)
+ error ("aix-thread resume: unknown pthread %ld",
+ TIDGET (ptid));
+
+ tid[0] = thread->private->tid;
+ if (tid[0] == PTHDB_INVALID_TID)
+ error ("aix-thread resume: no tid for pthread %ld",
+ TIDGET (ptid));
+ tid[1] = 0;
+
+ if (arch64)
+ ptrace64aix (PTT_CONTINUE, tid[0], 1,
+ target_signal_to_host (sig), (int *) tid);
+ else
+ ptrace32 (PTT_CONTINUE, tid[0], (int *) 1,
+ target_signal_to_host (sig), (int *) tid);
+ }
+}
+
+/* Wait for thread/process ID if != -1 or for any thread otherwise.
+ If an error occurs, return -1, else return the pid of the stopped
+ thread. */
+
+static ptid_t
+aix_thread_wait (ptid_t ptid, struct target_waitstatus *status)
+{
+ struct cleanup *cleanup = save_inferior_ptid ();
+
+ pid_to_prc (&ptid);
+
+ inferior_ptid = pid_to_ptid (PIDGET (inferior_ptid));
+ ptid = base_target.to_wait (ptid, status);
+ do_cleanups (cleanup);
+
+ if (PIDGET (ptid) == -1)
+ return pid_to_ptid (-1);
+
+ /* Check whether libpthdebug might be ready to be initialized. */
+ if (!pd_active && status->kind == TARGET_WAITKIND_STOPPED &&
+ status->value.sig == TARGET_SIGNAL_TRAP &&
+ read_pc_pid (ptid) - DECR_PC_AFTER_BREAK == pd_brk_addr)
+ return pd_activate (0);
+
+ return pd_update (0);
+}
+
+/* Record that the 64-bit general-purpose registers contain VALS. */
+
+static void
+supply_gprs64 (uint64_t *vals)
+{
+ int regno;
+
+ for (regno = 0; regno < 32; regno++)
+ supply_register (regno, (char *) (vals + regno));
+}
+
+/* Record that 32-bit register REGNO contains VAL. */
+
+static void
+supply_reg32 (int regno, uint32_t val)
+{
+ supply_register (regno, (char *) &val);
+}
+
+/* Record that the floating-point registers contain VALS. */
+
+static void
+supply_fprs (double *vals)
+{
+ int regno;
+
+ for (regno = 0; regno < 32; regno++)
+ supply_register (regno + FP0_REGNUM, (char *) (vals + regno));
+}
+
+/* Predicate to test whether given register number is a "special" register. */
+static int
+special_register_p (int regno)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ return regno == PC_REGNUM
+ || regno == tdep->ppc_ps_regnum
+ || regno == tdep->ppc_cr_regnum
+ || regno == tdep->ppc_lr_regnum
+ || regno == tdep->ppc_ctr_regnum
+ || regno == tdep->ppc_xer_regnum
+ || regno == tdep->ppc_fpscr_regnum
+ || (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum);
+}
+
+
+/* Record that the special registers contain the specified 64-bit and
+ 32-bit values. */
+
+static void
+supply_sprs64 (uint64_t iar, uint64_t msr, uint32_t cr,
+ uint64_t lr, uint64_t ctr, uint32_t xer,
+ uint32_t fpscr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ supply_register (PC_REGNUM, (char *) &iar);
+ supply_register (tdep->ppc_ps_regnum, (char *) &msr);
+ supply_register (tdep->ppc_cr_regnum, (char *) &cr);
+ supply_register (tdep->ppc_lr_regnum, (char *) &lr);
+ supply_register (tdep->ppc_ctr_regnum, (char *) &ctr);
+ supply_register (tdep->ppc_xer_regnum, (char *) &xer);
+ supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
+}
+
+/* Record that the special registers contain the specified 32-bit
+ values. */
+
+static void
+supply_sprs32 (uint32_t iar, uint32_t msr, uint32_t cr,
+ uint32_t lr, uint32_t ctr, uint32_t xer,
+ uint32_t fpscr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ supply_register (PC_REGNUM, (char *) &iar);
+ supply_register (tdep->ppc_ps_regnum, (char *) &msr);
+ supply_register (tdep->ppc_cr_regnum, (char *) &cr);
+ supply_register (tdep->ppc_lr_regnum, (char *) &lr);
+ supply_register (tdep->ppc_ctr_regnum, (char *) &ctr);
+ supply_register (tdep->ppc_xer_regnum, (char *) &xer);
+ supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
+}
+
+/* Fetch all registers from pthread PDTID, which doesn't have a kernel
+ thread.
+
+ There's no way to query a single register from a non-kernel
+ pthread, so there's no need for a single-register version of this
+ function. */
+
+static void
+fetch_regs_user_thread (pthdb_pthread_t pdtid)
+{
+ int status, i;
+ pthdb_context_t ctx;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "fetch_regs_user_thread %lx\n", (long) pdtid);
+ status = pthdb_pthread_context (pd_session, pdtid, &ctx);
+ if (status != PTHDB_SUCCESS)
+ error ("aix-thread: fetch_registers: pthdb_pthread_context returned %s",
+ pd_status2str (status));
+
+ /* General-purpose registers. */
+
+ if (arch64)
+ supply_gprs64 (ctx.gpr);
+ else
+ for (i = 0; i < 32; i++)
+ supply_reg32 (i, ctx.gpr[i]);
+
+ /* Floating-point registers. */
+
+ supply_fprs (ctx.fpr);
+
+ /* Special registers. */
+
+ if (arch64)
+ supply_sprs64 (ctx.iar, ctx.msr, ctx.cr, ctx.lr, ctx.ctr, ctx.xer,
+ ctx.fpscr);
+ else
+ supply_sprs32 (ctx.iar, ctx.msr, ctx.cr, ctx.lr, ctx.ctr, ctx.xer,
+ ctx.fpscr);
+}
+
+/* Fetch register REGNO if != -1 or all registers otherwise from
+ kernel thread TID.
+
+ AIX provides a way to query all of a kernel thread's GPRs, FPRs, or
+ SPRs, but there's no way to query individual registers within those
+ groups. Therefore, if REGNO != -1, this function fetches an entire
+ group.
+
+ Unfortunately, kernel thread register queries often fail with
+ EPERM, indicating that the thread is in kernel space. This breaks
+ backtraces of threads other than the current one. To make that
+ breakage obvious without throwing an error to top level (which is
+ bad e.g. during "info threads" output), zero registers that can't
+ be retrieved. */
+
+static void
+fetch_regs_kernel_thread (int regno, pthdb_tid_t tid)
+{
+ uint64_t gprs64[32];
+ uint32_t gprs32[32];
+ double fprs[32];
+ struct ptxsprs sprs64;
+ struct ptsprs sprs32;
+ int i;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "fetch_regs_kernel_thread tid=%lx regno=%d arch64=%d\n",
+ (long) tid, regno, arch64);
+
+ /* General-purpose registers. */
+ if (regno == -1 || regno < FP0_REGNUM)
+ {
+ if (arch64)
+ {
+ if (!ptrace64aix (PTT_READ_GPRS, tid,
+ (unsigned long) gprs64, 0, NULL))
+ memset (gprs64, 0, sizeof (gprs64));
+ supply_gprs64 (gprs64);
+ }
+ else
+ {
+ if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL))
+ memset (gprs32, 0, sizeof (gprs32));
+ for (i = 0; i < 32; i++)
+ supply_reg32 (i, gprs32[i]);
+ }
+ }
+
+ /* Floating-point registers. */
+
+ if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+ {
+ if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL))
+ memset (fprs, 0, sizeof (fprs));
+ supply_fprs (fprs);
+ }
+
+ /* Special-purpose registers. */
+
+ if (regno == -1 || special_register_p (regno))
+ {
+ if (arch64)
+ {
+ if (!ptrace64aix (PTT_READ_SPRS, tid,
+ (unsigned long) &sprs64, 0, NULL))
+ memset (&sprs64, 0, sizeof (sprs64));
+ supply_sprs64 (sprs64.pt_iar, sprs64.pt_msr, sprs64.pt_cr,
+ sprs64.pt_lr, sprs64.pt_ctr, sprs64.pt_xer,
+ sprs64.pt_fpscr);
+ }
+ else
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (!ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL))
+ memset (&sprs32, 0, sizeof (sprs32));
+ supply_sprs32 (sprs32.pt_iar, sprs32.pt_msr, sprs32.pt_cr,
+ sprs32.pt_lr, sprs32.pt_ctr, sprs32.pt_xer,
+ sprs32.pt_fpscr);
+
+ if (tdep->ppc_mq_regnum >= 0)
+ supply_register (tdep->ppc_mq_regnum, (char *) &sprs32.pt_mq);
+ }
+ }
+}
+
+/* Fetch register REGNO if != -1 or all registers otherwise in the
+ thread/process specified by inferior_ptid. */
+
+static void
+aix_thread_fetch_registers (int regno)
+{
+ struct thread_info *thread;
+ pthdb_tid_t tid;
+
+ if (!PD_TID (inferior_ptid))
+ base_target.to_fetch_registers (regno);
+ else
+ {
+ thread = find_thread_pid (inferior_ptid);
+ tid = thread->private->tid;
+
+ if (tid == PTHDB_INVALID_TID)
+ fetch_regs_user_thread (thread->private->pdtid);
+ else
+ fetch_regs_kernel_thread (regno, tid);
+ }
+}
+
+/* Store the gp registers into an array of uint32_t or uint64_t. */
+
+static void
+fill_gprs64 (uint64_t *vals)
+{
+ int regno;
+
+ for (regno = 0; regno < FP0_REGNUM; regno++)
+ if (register_cached (regno))
+ regcache_collect (regno, vals + regno);
+}
+
+static void
+fill_gprs32 (uint32_t *vals)
+{
+ int regno;
+
+ for (regno = 0; regno < FP0_REGNUM; regno++)
+ if (register_cached (regno))
+ regcache_collect (regno, vals + regno);
+}
+
+/* Store the floating point registers into a double array. */
+static void
+fill_fprs (double *vals)
+{
+ int regno;
+
+ for (regno = FP0_REGNUM; regno < FPLAST_REGNUM; regno++)
+ if (register_cached (regno))
+ regcache_collect (regno, vals + regno);
+}
+
+/* Store the special registers into the specified 64-bit and 32-bit
+ locations. */
+
+static void
+fill_sprs64 (uint64_t *iar, uint64_t *msr, uint32_t *cr,
+ uint64_t *lr, uint64_t *ctr, uint32_t *xer,
+ uint32_t *fpscr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* Verify that the size of the size of the IAR buffer is the
+ same as the raw size of the PC (in the register cache). If
+ they're not, then either GDB has been built incorrectly, or
+ there's some other kind of internal error. To be really safe,
+ we should check all of the sizes. */
+ gdb_assert (sizeof (*iar) == REGISTER_RAW_SIZE (PC_REGNUM));
+
+ if (register_cached (PC_REGNUM))
+ regcache_collect (PC_REGNUM, iar);
+ if (register_cached (tdep->ppc_ps_regnum))
+ regcache_collect (tdep->ppc_ps_regnum, msr);
+ if (register_cached (tdep->ppc_cr_regnum))
+ regcache_collect (tdep->ppc_cr_regnum, cr);
+ if (register_cached (tdep->ppc_lr_regnum))
+ regcache_collect (tdep->ppc_lr_regnum, lr);
+ if (register_cached (tdep->ppc_ctr_regnum))
+ regcache_collect (tdep->ppc_ctr_regnum, ctr);
+ if (register_cached (tdep->ppc_xer_regnum))
+ regcache_collect (tdep->ppc_xer_regnum, xer);
+ if (register_cached (tdep->ppc_fpscr_regnum))
+ regcache_collect (tdep->ppc_fpscr_regnum, fpscr);
+}
+
+static void
+fill_sprs32 (unsigned long *iar, unsigned long *msr, unsigned long *cr,
+ unsigned long *lr, unsigned long *ctr, unsigned long *xer,
+ unsigned long *fpscr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* Verify that the size of the size of the IAR buffer is the
+ same as the raw size of the PC (in the register cache). If
+ they're not, then either GDB has been built incorrectly, or
+ there's some other kind of internal error. To be really safe,
+ we should check all of the sizes.
+
+ If this assert() fails, the most likely reason is that GDB was
+ built incorrectly. In order to make use of many of the header
+ files in /usr/include/sys, GDB needs to be configured so that
+ sizeof (long) == 4). */
+ gdb_assert (sizeof (*iar) == REGISTER_RAW_SIZE (PC_REGNUM));
+
+ if (register_cached (PC_REGNUM))
+ regcache_collect (PC_REGNUM, iar);
+ if (register_cached (tdep->ppc_ps_regnum))
+ regcache_collect (tdep->ppc_ps_regnum, msr);
+ if (register_cached (tdep->ppc_cr_regnum))
+ regcache_collect (tdep->ppc_cr_regnum, cr);
+ if (register_cached (tdep->ppc_lr_regnum))
+ regcache_collect (tdep->ppc_lr_regnum, lr);
+ if (register_cached (tdep->ppc_ctr_regnum))
+ regcache_collect (tdep->ppc_ctr_regnum, ctr);
+ if (register_cached (tdep->ppc_xer_regnum))
+ regcache_collect (tdep->ppc_xer_regnum, xer);
+ if (register_cached (tdep->ppc_fpscr_regnum))
+ regcache_collect (tdep->ppc_fpscr_regnum, fpscr);
+}
+
+/* Store all registers into pthread PDTID, which doesn't have a kernel
+ thread.
+
+ It's possible to store a single register into a non-kernel pthread,
+ but I doubt it's worth the effort. */
+
+static void
+store_regs_user_thread (pthdb_pthread_t pdtid)
+{
+ int status, i;
+ pthdb_context_t ctx;
+ uint32_t int32;
+ uint64_t int64;
+ double dbl;
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "store_regs_user_thread %lx\n", (long) pdtid);
+
+ /* Retrieve the thread's current context for its non-register
+ values. */
+ status = pthdb_pthread_context (pd_session, pdtid, &ctx);
+ if (status != PTHDB_SUCCESS)
+ error ("aix-thread: store_registers: pthdb_pthread_context returned %s",
+ pd_status2str (status));
+
+ /* Collect general-purpose register values from the regcache. */
+
+ for (i = 0; i < 32; i++)
+ if (register_cached (i))
+ {
+ if (arch64)
+ {
+ regcache_collect (i, (void *) &int64);
+ ctx.gpr[i] = int64;
+ }
+ else
+ {
+ regcache_collect (i, (void *) &int32);
+ ctx.gpr[i] = int32;
+ }
+ }
+
+ /* Collect floating-point register values from the regcache. */
+ fill_fprs (ctx.fpr);
+
+ /* Special registers (always kept in ctx as 64 bits). */
+ if (arch64)
+ {
+ fill_sprs64 (&ctx.iar, &ctx.msr, &ctx.cr, &ctx.lr, &ctx.ctr, &ctx.xer,
+ &ctx.fpscr);
+ }
+ else
+ {
+ /* Problem: ctx.iar etc. are 64 bits, but raw_registers are 32.
+ Solution: use 32-bit temp variables. (The assert() in fill_sprs32()
+ will fail if the size of an unsigned long is incorrect. If this
+ happens, GDB needs to be reconfigured so that longs are 32-bits.) */
+ unsigned long tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer,
+ tmp_fpscr;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ fill_sprs32 (&tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, &tmp_ctr, &tmp_xer,
+ &tmp_fpscr);
+ if (register_cached (PC_REGNUM))
+ ctx.iar = tmp_iar;
+ if (register_cached (tdep->ppc_ps_regnum))
+ ctx.msr = tmp_msr;
+ if (register_cached (tdep->ppc_cr_regnum))
+ ctx.cr = tmp_cr;
+ if (register_cached (tdep->ppc_lr_regnum))
+ ctx.lr = tmp_lr;
+ if (register_cached (tdep->ppc_ctr_regnum))
+ ctx.ctr = tmp_ctr;
+ if (register_cached (tdep->ppc_xer_regnum))
+ ctx.xer = tmp_xer;
+ if (register_cached (tdep->ppc_xer_regnum))
+ ctx.fpscr = tmp_fpscr;
+ }
+
+ status = pthdb_pthread_setcontext (pd_session, pdtid, &ctx);
+ if (status != PTHDB_SUCCESS)
+ error ("aix-thread: store_registers: pthdb_pthread_setcontext returned %s",
+ pd_status2str (status));
+}
+
+/* Store register REGNO if != -1 or all registers otherwise into
+ kernel thread TID.
+
+ AIX provides a way to set all of a kernel thread's GPRs, FPRs, or
+ SPRs, but there's no way to set individual registers within those
+ groups. Therefore, if REGNO != -1, this function stores an entire
+ group. */
+
+static void
+store_regs_kernel_thread (int regno, pthdb_tid_t tid)
+{
+ uint64_t gprs64[32];
+ uint32_t gprs32[32];
+ double fprs[32];
+ struct ptxsprs sprs64;
+ struct ptsprs sprs32;
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (debug_aix_thread)
+ fprintf_unfiltered (gdb_stdlog,
+ "store_regs_kernel_thread tid=%lx regno=%d\n",
+ (long) tid, regno);
+
+ /* General-purpose registers. */
+ if (regno == -1 || regno < FP0_REGNUM)
+ {
+ if (arch64)
+ {
+ /* Pre-fetch: some regs may not be in the cache. */
+ ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL);
+ fill_gprs64 (gprs64);
+ ptrace64aix (PTT_WRITE_GPRS, tid, (unsigned long) gprs64, 0, NULL);
+ }
+ else
+ {
+ /* Pre-fetch: some regs may not be in the cache. */
+ ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL);
+ fill_gprs32 (gprs32);
+ ptrace32 (PTT_WRITE_GPRS, tid, gprs32, 0, NULL);
+ }
+ }
+
+ /* Floating-point registers. */
+
+ if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+ {
+ /* Pre-fetch: some regs may not be in the cache. */
+ ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL);
+ fill_fprs (fprs);
+ ptrace32 (PTT_WRITE_FPRS, tid, (int *) fprs, 0, NULL);
+ }
+
+ /* Special-purpose registers. */
+
+ if (regno == -1 || special_register_p (regno))
+ {
+ if (arch64)
+ {
+ /* Pre-fetch: some registers won't be in the cache. */
+ ptrace64aix (PTT_READ_SPRS, tid,
+ (unsigned long) &sprs64, 0, NULL);
+ fill_sprs64 (&sprs64.pt_iar, &sprs64.pt_msr, &sprs64.pt_cr,
+ &sprs64.pt_lr, &sprs64.pt_ctr, &sprs64.pt_xer,
+ &sprs64.pt_fpscr);
+ ptrace64aix (PTT_WRITE_SPRS, tid,
+ (unsigned long) &sprs64, 0, NULL);
+ }
+ else
+ {
+ /* Pre-fetch: some registers won't be in the cache. */
+ ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL);
+
+ fill_sprs32 (&sprs32.pt_iar, &sprs32.pt_msr, &sprs32.pt_cr,
+ &sprs32.pt_lr, &sprs32.pt_ctr, &sprs32.pt_xer,
+ &sprs32.pt_fpscr);
+
+ if (tdep->ppc_mq_regnum >= 0)
+ if (register_cached (tdep->ppc_mq_regnum))
+ regcache_collect (tdep->ppc_mq_regnum, &sprs32.pt_mq);
+
+ ptrace32 (PTT_WRITE_SPRS, tid, (int *) &sprs32, 0, NULL);
+ }
+ }
+}
+
+/* Store gdb's current view of the register set into the
+ thread/process specified by inferior_ptid. */
+
+static void
+aix_thread_store_registers (int regno)
+{
+ struct thread_info *thread;
+ pthdb_tid_t tid;
+
+ if (!PD_TID (inferior_ptid))
+ base_target.to_store_registers (regno);
+ else
+ {
+ thread = find_thread_pid (inferior_ptid);
+ tid = thread->private->tid;
+
+ if (tid == PTHDB_INVALID_TID)
+ store_regs_user_thread (thread->private->pdtid);
+ else
+ store_regs_kernel_thread (regno, tid);
+ }
+}
+
+/* Transfer LEN bytes of memory from GDB address MYADDR to target
+ address MEMADDR if WRITE and vice versa otherwise. */
+
+static int
+aix_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target)
+{
+ int n;
+ struct cleanup *cleanup = save_inferior_ptid ();
+
+ inferior_ptid = pid_to_ptid (PIDGET (inferior_ptid));
+ n = base_target.to_xfer_memory (memaddr, myaddr, len,
+ write, attrib, &base_target);
+ do_cleanups (cleanup);
+
+ return n;
+}
+
+/* Kill and forget about the inferior process. */
+
+static void
+aix_thread_kill (void)
+{
+ struct cleanup *cleanup = save_inferior_ptid ();
+
+ inferior_ptid = pid_to_ptid (PIDGET (inferior_ptid));
+ base_target.to_kill ();
+ do_cleanups (cleanup);
+}
+
+/* Clean up after the inferior exits. */
+
+static void
+aix_thread_mourn_inferior (void)
+{
+ pd_deactivate ();
+ base_target.to_mourn_inferior ();
+}
+
+/* Return whether thread PID is still valid. */
+
+static int
+aix_thread_thread_alive (ptid_t ptid)
+{
+ if (!PD_TID (ptid))
+ return base_target.to_thread_alive (ptid);
+
+ /* We update the thread list every time the child stops, so all
+ valid threads should be in the thread list. */
+ return in_thread_list (ptid);
+}
+
+/* Return a printable representation of composite PID for use in
+ "info threads" output. */
+
+static char *
+aix_thread_pid_to_str (ptid_t ptid)
+{
+ static char *ret = NULL;
+
+ if (!PD_TID (ptid))
+ return base_target.to_pid_to_str (ptid);
+
+ /* Free previous return value; a new one will be allocated by
+ xasprintf(). */
+ xfree (ret);
+
+ xasprintf (&ret, "Thread %ld", ptid_get_tid (ptid));
+ return ret;
+}
+
+/* Return a printable representation of extra information about
+ THREAD, for use in "info threads" output. */
+
+static char *
+aix_thread_extra_thread_info (struct thread_info *thread)
+{
+ struct ui_file *buf;
+ int status;
+ pthdb_pthread_t pdtid;
+ pthdb_tid_t tid;
+ pthdb_state_t state;
+ pthdb_suspendstate_t suspendstate;
+ pthdb_detachstate_t detachstate;
+ int cancelpend;
+ long length;
+ static char *ret = NULL;
+
+ if (!PD_TID (thread->ptid))
+ return NULL;
+
+ buf = mem_fileopen ();
+
+ pdtid = thread->private->pdtid;
+ tid = thread->private->tid;
+
+ if (tid != PTHDB_INVALID_TID)
+ fprintf_unfiltered (buf, "tid %d", tid);
+
+ status = pthdb_pthread_state (pd_session, pdtid, &state);
+ if (status != PTHDB_SUCCESS)
+ state = PST_NOTSUP;
+ fprintf_unfiltered (buf, ", %s", state2str (state));
+
+ status = pthdb_pthread_suspendstate (pd_session, pdtid,
+ &suspendstate);
+ if (status == PTHDB_SUCCESS && suspendstate == PSS_SUSPENDED)
+ fprintf_unfiltered (buf, ", suspended");
+
+ status = pthdb_pthread_detachstate (pd_session, pdtid,
+ &detachstate);
+ if (status == PTHDB_SUCCESS && detachstate == PDS_DETACHED)
+ fprintf_unfiltered (buf, ", detached");
+
+ pthdb_pthread_cancelpend (pd_session, pdtid, &cancelpend);
+ if (status == PTHDB_SUCCESS && cancelpend)
+ fprintf_unfiltered (buf, ", cancel pending");
+
+ ui_file_write (buf, "", 1);
+
+ xfree (ret); /* Free old buffer. */
+
+ ret = ui_file_xstrdup (buf, &length);
+ ui_file_delete (buf);
+
+ return ret;
+}
+
+/* Initialize target aix_thread_ops. */
+
+static void
+init_aix_thread_ops (void)
+{
+ aix_thread_ops.to_shortname = "aix-threads";
+ aix_thread_ops.to_longname = "AIX pthread support";
+ aix_thread_ops.to_doc = "AIX pthread support";
+
+ aix_thread_ops.to_attach = aix_thread_attach;
+ aix_thread_ops.to_detach = aix_thread_detach;
+ aix_thread_ops.to_resume = aix_thread_resume;
+ aix_thread_ops.to_wait = aix_thread_wait;
+ aix_thread_ops.to_fetch_registers = aix_thread_fetch_registers;
+ aix_thread_ops.to_store_registers = aix_thread_store_registers;
+ aix_thread_ops.to_xfer_memory = aix_thread_xfer_memory;
+ /* No need for aix_thread_ops.to_create_inferior, because we activate thread
+ debugging when the inferior reaches pd_brk_addr. */
+ aix_thread_ops.to_kill = aix_thread_kill;
+ aix_thread_ops.to_mourn_inferior = aix_thread_mourn_inferior;
+ aix_thread_ops.to_thread_alive = aix_thread_thread_alive;
+ aix_thread_ops.to_pid_to_str = aix_thread_pid_to_str;
+ aix_thread_ops.to_extra_thread_info = aix_thread_extra_thread_info;
+ aix_thread_ops.to_stratum = thread_stratum;
+ aix_thread_ops.to_magic = OPS_MAGIC;
+}
+
+/* Module startup initialization function, automagically called by
+ init.c. */
+
+void
+_initialize_aix_thread (void)
+{
+ init_aix_thread_ops ();
+ add_target (&aix_thread_ops);
+
+ /* Notice when object files get loaded and unloaded. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = new_objfile;
+
+ add_show_from_set (add_set_cmd ("aix-thread", no_class, var_zinteger,
+ (char *) &debug_aix_thread,
+ "Set debugging of AIX thread module.\n"
+ "Enables printf debugging output.\n",
+ &setdebuglist),
+ &showdebuglist);
+}
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index 12320519ae8..ece5e2694f2 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -58,6 +58,10 @@ alpha_osf1_init_abi (struct gdbarch_info info,
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
+ /* The next/step support via procfs on OSF1 is broken when running
+ on multi-processor machines. We need to use software single stepping
+ instead. */
+ set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index efafcc90078..7018d39773e 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -53,9 +53,8 @@ static gdbarch_register_convert_to_virtual_ftype
alpha_register_convert_to_virtual;
static gdbarch_register_convert_to_raw_ftype alpha_register_convert_to_raw;
static gdbarch_store_struct_return_ftype alpha_store_struct_return;
-static gdbarch_extract_return_value_ftype alpha_extract_return_value;
-static gdbarch_store_return_value_ftype alpha_store_return_value;
-static gdbarch_extract_struct_value_address_ftype
+static gdbarch_deprecated_extract_return_value_ftype alpha_extract_return_value;
+static gdbarch_deprecated_extract_struct_value_address_ftype
alpha_extract_struct_value_address;
static gdbarch_use_struct_convention_ftype alpha_use_struct_convention;
@@ -65,7 +64,6 @@ static gdbarch_frame_args_address_ftype alpha_frame_args_address;
static gdbarch_frame_locals_address_ftype alpha_frame_locals_address;
static gdbarch_skip_prologue_ftype alpha_skip_prologue;
-static gdbarch_get_saved_register_ftype alpha_get_saved_register;
static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call;
static gdbarch_frame_chain_ftype alpha_frame_chain;
static gdbarch_frame_saved_pc_ftype alpha_frame_saved_pc;
@@ -277,7 +275,7 @@ push_sigtramp_desc (CORE_ADDR low_addr)
}
-static char *
+static const char *
alpha_register_name (int regno)
{
static char *register_names[] =
@@ -501,54 +499,6 @@ alpha_frame_saved_pc (struct frame_info *frame)
return read_next_frame_reg (frame, pcreg);
}
-static void
-alpha_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
-{
- CORE_ADDR addr;
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-
static CORE_ADDR
alpha_saved_pc_after_call (struct frame_info *frame)
{
@@ -649,11 +599,13 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
struct frame_info *next_frame)
{
CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
+ CORE_ADDR vfp = sp;
CORE_ADDR cur_pc;
int frame_size;
int has_frame_reg = 0;
unsigned long reg_mask = 0;
int pcreg = -1;
+ int regno;
if (start_pc == 0)
return NULL;
@@ -678,7 +630,12 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
if ((word & 0xffff0000) == 0x23de0000) /* lda $sp,n($sp) */
{
if (word & 0x8000)
- frame_size += (-word) & 0xffff;
+ {
+ /* Consider only the first stack allocation instruction
+ to contain the static size of the frame. */
+ if (frame_size == 0)
+ frame_size += (-word) & 0xffff;
+ }
else
/* Exit loop if a positive stack adjustment is found, which
usually means that the stack cleanup code in the function
@@ -690,7 +647,16 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
{
int reg = (word & 0x03e00000) >> 21;
reg_mask |= 1 << reg;
- temp_saved_regs[reg] = sp + (short) word;
+
+ /* Do not compute the address where the register was saved yet,
+ because we don't know yet if the offset will need to be
+ relative to $sp or $fp (we can not compute the address relative
+ to $sp if $sp is updated during the execution of the current
+ subroutine, for instance when doing some alloca). So just store
+ the offset for the moment, and compute the address later
+ when we know whether this frame has a frame pointer or not.
+ */
+ temp_saved_regs[reg] = (short) word;
/* Starting with OSF/1-3.2C, the system libraries are shipped
without local symbols, but they still contain procedure
@@ -719,8 +685,15 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
}
else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */
pcreg = (word >> 16) & 0x1f;
- else if (word == 0x47de040f) /* bis sp,sp fp */
- has_frame_reg = 1;
+ else if (word == 0x47de040f || word == 0x47fe040f) /* bis sp,sp fp */
+ {
+ /* ??? I am not sure what instruction is 0x47fe040f, and I
+ am suspecting that there was a typo and should have been
+ 0x47fe040f. I'm keeping it in the test above until further
+ investigation */
+ has_frame_reg = 1;
+ vfp = read_next_frame_reg (next_frame, ALPHA_GCC_FP_REGNUM);
+ }
}
if (pcreg == -1)
{
@@ -759,6 +732,18 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
PROC_FRAME_REG (&temp_proc_desc) = ALPHA_GCC_FP_REGNUM;
else
PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
+
+ /* At this point, we know which of the Stack Pointer or the Frame Pointer
+ to use as the reference address to compute the saved registers address.
+ But in both cases, the processing above has set vfp to this reference
+ address, so just need to increment the offset of each saved register
+ by this address. */
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ if (reg_mask & 1 << regno)
+ temp_saved_regs[regno] += vfp;
+ }
+
PROC_FRAME_OFFSET (&temp_proc_desc) = frame_size;
PROC_REG_MASK (&temp_proc_desc) = reg_mask;
PROC_PC_REG (&temp_proc_desc) = (pcreg == -1) ? ALPHA_RA_REGNUM : pcreg;
@@ -1869,14 +1854,13 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs);
- set_gdbarch_get_saved_register (gdbarch, alpha_get_saved_register);
set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention);
- set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, alpha_extract_return_value);
set_gdbarch_store_struct_return (gdbarch, alpha_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, alpha_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
+ set_gdbarch_deprecated_store_return_value (gdbarch, alpha_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
alpha_extract_struct_value_address);
/* Settings for calling functions in the inferior. */
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index cab7721a440..5c44915237e 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -1,737 +1,738 @@
-/* ARC target-dependent stuff.
- Copyright 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "floatformat.h"
-#include "symtab.h"
-#include "gdbcmd.h"
-#include "regcache.h"
-
-/* Local functions */
-
-static int arc_set_cpu_type (char *str);
-
-/* Current CPU, set with the "set cpu" command. */
-static int arc_bfd_mach_type;
-char *arc_cpu_type;
-char *tmp_arc_cpu_type;
-
-/* Table of cpu names. */
-struct
- {
- char *name;
- int value;
- }
-arc_cpu_type_table[] =
-{
- { "arc5", bfd_mach_arc_5 },
- { "arc6", bfd_mach_arc_6 },
- { "arc7", bfd_mach_arc_7 },
- { "arc8", bfd_mach_arc_8 },
- { NULL, 0 }
-};
-
-/* Used by simulator. */
-int display_pipeline_p;
-int cpu_timer;
-/* This one must have the same type as used in the emulator.
- It's currently an enum so this should be ok for now. */
-int debug_pipeline_p;
-
-#define ARC_CALL_SAVED_REG(r) ((r) >= 16 && (r) < 24)
-
-#define OPMASK 0xf8000000
-
-/* Instruction field accessor macros.
- See the Programmer's Reference Manual. */
-#define X_OP(i) (((i) >> 27) & 0x1f)
-#define X_A(i) (((i) >> 21) & 0x3f)
-#define X_B(i) (((i) >> 15) & 0x3f)
-#define X_C(i) (((i) >> 9) & 0x3f)
-#define X_D(i) ((((i) & 0x1ff) ^ 0x100) - 0x100)
-#define X_L(i) (((((i) >> 5) & 0x3ffffc) ^ 0x200000) - 0x200000)
-#define X_N(i) (((i) >> 5) & 3)
-#define X_Q(i) ((i) & 0x1f)
-
-/* Return non-zero if X is a short immediate data indicator. */
-#define SHIMM_P(x) ((x) == 61 || (x) == 63)
-
-/* Return non-zero if X is a "long" (32 bit) immediate data indicator. */
-#define LIMM_P(x) ((x) == 62)
-
-/* Build a simple instruction. */
-#define BUILD_INSN(op, a, b, c, d) \
- ((((op) & 31) << 27) \
- | (((a) & 63) << 21) \
- | (((b) & 63) << 15) \
- | (((c) & 63) << 9) \
- | ((d) & 511))
-
-/* Codestream stuff. */
-static void codestream_read (unsigned int *, int);
-static void codestream_seek (CORE_ADDR);
-static unsigned int codestream_fill (int);
-
-#define CODESTREAM_BUFSIZ 16
-static CORE_ADDR codestream_next_addr;
-static CORE_ADDR codestream_addr;
-/* FIXME assumes sizeof (int) == 32? */
-static unsigned int codestream_buf[CODESTREAM_BUFSIZ];
-static int codestream_off;
-static int codestream_cnt;
-
-#define codestream_tell() \
- (codestream_addr + codestream_off * sizeof (codestream_buf[0]))
-#define codestream_peek() \
- (codestream_cnt == 0 \
- ? codestream_fill (1) \
- : codestream_buf[codestream_off])
-#define codestream_get() \
- (codestream_cnt-- == 0 \
- ? codestream_fill (0) \
- : codestream_buf[codestream_off++])
-
-static unsigned int
-codestream_fill (int peek_flag)
-{
- codestream_addr = codestream_next_addr;
- codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]);
- codestream_off = 0;
- codestream_cnt = CODESTREAM_BUFSIZ;
- read_memory (codestream_addr, (char *) codestream_buf,
- CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]));
- /* FIXME: check return code? */
-
-
- /* Handle byte order differences -> convert to host byte ordering. */
- {
- int i;
- for (i = 0; i < CODESTREAM_BUFSIZ; i++)
- codestream_buf[i] =
- extract_unsigned_integer (&codestream_buf[i],
- sizeof (codestream_buf[i]));
- }
-
- if (peek_flag)
- return codestream_peek ();
- else
- return codestream_get ();
-}
-
-static void
-codestream_seek (CORE_ADDR place)
-{
- codestream_next_addr = place / CODESTREAM_BUFSIZ;
- codestream_next_addr *= CODESTREAM_BUFSIZ;
- codestream_cnt = 0;
- codestream_fill (1);
- while (codestream_tell () != place)
- codestream_get ();
-}
-
-/* This function is currently unused but leave in for now. */
-
-static void
-codestream_read (unsigned int *buf, int count)
-{
- unsigned int *p;
- int i;
- p = buf;
- for (i = 0; i < count; i++)
- *p++ = codestream_get ();
-}
-
-/* Set up prologue scanning and return the first insn. */
-
-static unsigned int
-setup_prologue_scan (CORE_ADDR pc)
-{
- unsigned int insn;
-
- codestream_seek (pc);
- insn = codestream_get ();
-
- return insn;
-}
-
-/*
- * Find & return amount a local space allocated, and advance codestream to
- * first register push (if any).
- * If entry sequence doesn't make sense, return -1, and leave
- * codestream pointer random.
- */
-
-static long
-arc_get_frame_setup (CORE_ADDR pc)
-{
- unsigned int insn;
- /* Size of frame or -1 if unrecognizable prologue. */
- int frame_size = -1;
- /* An initial "sub sp,sp,N" may or may not be for a stdarg fn. */
- int maybe_stdarg_decr = -1;
-
- insn = setup_prologue_scan (pc);
-
- /* The authority for what appears here is the home-grown ABI.
- The most recent version is 1.2. */
-
- /* First insn may be "sub sp,sp,N" if stdarg fn. */
- if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
- == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0))
- {
- maybe_stdarg_decr = X_D (insn);
- insn = codestream_get ();
- }
-
- if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */
- == BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4))
- {
- insn = codestream_get ();
- /* Frame may not be necessary, even though blink is saved.
- At least this is something we recognize. */
- frame_size = 0;
- }
-
- if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */
- == BUILD_INSN (2, 0, SP_REGNUM, FP_REGNUM, 0))
- {
- insn = codestream_get ();
- if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
- != BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0))
- return -1;
-
- /* Check for stack adjustment sub sp,sp,N. */
- insn = codestream_peek ();
- if ((insn & BUILD_INSN (-1, -1, -1, 0, 0))
- == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, 0, 0))
- {
- if (LIMM_P (X_C (insn)))
- frame_size = codestream_get ();
- else if (SHIMM_P (X_C (insn)))
- frame_size = X_D (insn);
- else
- return -1;
- if (frame_size < 0)
- return -1;
-
- codestream_get ();
-
- /* This sequence is used to get the address of the return
- buffer for a function that returns a structure. */
- insn = codestream_peek ();
- if ((insn & OPMASK) == 0x60000000)
- codestream_get ();
- }
- /* Frameless fn. */
- else
- {
- frame_size = 0;
- }
- }
-
- /* If we found a "sub sp,sp,N" and nothing else, it may or may not be a
- stdarg fn. The stdarg decrement is not treated as part of the frame size,
- so we have a dilemma: what do we return? For now, if we get a
- "sub sp,sp,N" and nothing else assume this isn't a stdarg fn. One way
- to fix this completely would be to add a bit to the function descriptor
- that says the function is a stdarg function. */
-
- if (frame_size < 0 && maybe_stdarg_decr > 0)
- return maybe_stdarg_decr;
- return frame_size;
-}
-
-/* Given a pc value, skip it forward past the function prologue by
- disassembling instructions that appear to be a prologue.
-
- If FRAMELESS_P is set, we are only testing to see if the function
- is frameless. If it is a frameless function, return PC unchanged.
- This allows a quicker answer. */
-
-CORE_ADDR
-arc_skip_prologue (CORE_ADDR pc, int frameless_p)
-{
- unsigned int insn;
- int i, frame_size;
-
- if ((frame_size = arc_get_frame_setup (pc)) < 0)
- return (pc);
-
- if (frameless_p)
- return frame_size == 0 ? pc : codestream_tell ();
-
- /* Skip over register saves. */
- for (i = 0; i < 8; i++)
- {
- insn = codestream_peek ();
- if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
- != BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
- break; /* not st insn */
- if (!ARC_CALL_SAVED_REG (X_C (insn)))
- break;
- codestream_get ();
- }
-
- return codestream_tell ();
-}
-
-/* Is the prologue at PC frameless? */
-
-int
-arc_prologue_frameless_p (CORE_ADDR pc)
-{
- return (pc == arc_skip_prologue (pc, 1));
-}
-
-/* Return the return address for a frame.
- This is used to implement FRAME_SAVED_PC.
- This is taken from frameless_look_for_prologue. */
-
-CORE_ADDR
-arc_frame_saved_pc (struct frame_info *frame)
-{
- CORE_ADDR func_start;
- unsigned int insn;
-
- func_start = get_pc_function_start (frame->pc) + FUNCTION_START_OFFSET;
- if (func_start == 0)
- {
- /* Best guess. */
- return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4));
- }
-
- /* The authority for what appears here is the home-grown ABI.
- The most recent version is 1.2. */
-
- insn = setup_prologue_scan (func_start);
-
- /* First insn may be "sub sp,sp,N" if stdarg fn. */
- if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
- == BUILD_INSN (10, SP_REGNUM, SP_REGNUM, SHIMM_REGNUM, 0))
- insn = codestream_get ();
-
- /* If the next insn is "st blink,[sp,4]" we can get blink from there.
- Otherwise this is a leaf function and we can use blink. Note that
- this still allows for the case where a leaf function saves/clobbers/
- restores blink. */
-
- if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st blink,[sp,4] */
- != BUILD_INSN (2, 0, SP_REGNUM, BLINK_REGNUM, 4))
- return ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM));
- else
- return ARC_PC_TO_REAL_ADDRESS (read_memory_integer (FRAME_FP (frame) + 4, 4));
-}
-
-/*
- * Parse the first few instructions of the function to see
- * what registers were stored.
- *
- * The startup sequence can be at the start of the function.
- * 'st blink,[sp+4], st fp,[sp], mov fp,sp'
- *
- * Local space is allocated just below by sub sp,sp,nnn.
- * Next, the registers used by this function are stored (as offsets from sp).
- */
-
-void
-frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp)
-{
- long locals;
- unsigned int insn;
- CORE_ADDR dummy_bottom;
- CORE_ADDR adr;
- int i, regnum, offset;
-
- memset (fsrp, 0, sizeof *fsrp);
-
- /* If frame is the end of a dummy, compute where the beginning would be. */
- dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
-
- /* Check if the PC is in the stack, in a dummy frame. */
- if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
- {
- /* all regs were saved by push_call_dummy () */
- adr = fip->frame;
- for (i = 0; i < NUM_REGS; i++)
- {
- adr -= REGISTER_RAW_SIZE (i);
- fsrp->regs[i] = adr;
- }
- return;
- }
-
- locals = arc_get_frame_setup (get_pc_function_start (fip->pc));
-
- if (locals >= 0)
- {
- /* Set `adr' to the value of `sp'. */
- adr = fip->frame - locals;
- for (i = 0; i < 8; i++)
- {
- insn = codestream_get ();
- if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
- != BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
- break;
- regnum = X_C (insn);
- offset = X_D (insn);
- fsrp->regs[regnum] = adr + offset;
- }
- }
-
- fsrp->regs[PC_REGNUM] = fip->frame + 4;
- fsrp->regs[FP_REGNUM] = fip->frame;
-}
-
-void
-arc_push_dummy_frame (void)
-{
- CORE_ADDR sp = read_register (SP_REGNUM);
- int regnum;
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- read_register_gen (PC_REGNUM, regbuf);
- write_memory (sp + 4, regbuf, REGISTER_SIZE);
- read_register_gen (FP_REGNUM, regbuf);
- write_memory (sp, regbuf, REGISTER_SIZE);
- write_register (FP_REGNUM, sp);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- read_register_gen (regnum, regbuf);
- sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
- }
- sp += (2 * REGISTER_SIZE);
- write_register (SP_REGNUM, sp);
-}
-
-void
-arc_pop_frame (void)
-{
- struct frame_info *frame = get_current_frame ();
- CORE_ADDR fp;
- int regnum;
- struct frame_saved_regs fsr;
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- fp = FRAME_FP (frame);
- get_frame_saved_regs (frame, &fsr);
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- CORE_ADDR adr;
- adr = fsr.regs[regnum];
- if (adr)
- {
- read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
- write_register_bytes (REGISTER_BYTE (regnum), regbuf,
- REGISTER_RAW_SIZE (regnum));
- }
- }
- write_register (FP_REGNUM, read_memory_integer (fp, 4));
- write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
- write_register (SP_REGNUM, fp + 8);
- flush_cached_frames ();
-}
-
-/* Simulate single-step. */
-
-typedef enum
-{
- NORMAL4, /* a normal 4 byte insn */
- NORMAL8, /* a normal 8 byte insn */
- BRANCH4, /* a 4 byte branch insn, including ones without delay slots */
- BRANCH8, /* an 8 byte branch insn, including ones with delay slots */
-}
-insn_type;
-
-/* Return the type of INSN and store in TARGET the destination address of a
- branch if this is one. */
-/* ??? Need to verify all cases are properly handled. */
-
-static insn_type
-get_insn_type (unsigned long insn, CORE_ADDR pc, CORE_ADDR *target)
-{
- unsigned long limm;
-
- switch (insn >> 27)
- {
- case 0:
- case 1:
- case 2: /* load/store insns */
- if (LIMM_P (X_A (insn))
- || LIMM_P (X_B (insn))
- || LIMM_P (X_C (insn)))
- return NORMAL8;
- return NORMAL4;
- case 4:
- case 5:
- case 6: /* branch insns */
- *target = pc + 4 + X_L (insn);
- /* ??? It isn't clear that this is always the right answer.
- The problem occurs when the next insn is an 8 byte insn. If the
- branch is conditional there's no worry as there shouldn't be an 8
- byte insn following. The programmer may be cheating if s/he knows
- the branch will never be taken, but we don't deal with that.
- Note that the programmer is also allowed to play games by putting
- an insn with long immediate data in the delay slot and then duplicate
- the long immediate data at the branch target. Ugh! */
- if (X_N (insn) == 0)
- return BRANCH4;
- return BRANCH8;
- case 7: /* jump insns */
- if (LIMM_P (X_B (insn)))
- {
- limm = read_memory_integer (pc + 4, 4);
- *target = ARC_PC_TO_REAL_ADDRESS (limm);
- return BRANCH8;
- }
- if (SHIMM_P (X_B (insn)))
- *target = ARC_PC_TO_REAL_ADDRESS (X_D (insn));
- else
- *target = ARC_PC_TO_REAL_ADDRESS (read_register (X_B (insn)));
- if (X_Q (insn) == 0 && X_N (insn) == 0)
- return BRANCH4;
- return BRANCH8;
- default: /* arithmetic insns, etc. */
- if (LIMM_P (X_A (insn))
- || LIMM_P (X_B (insn))
- || LIMM_P (X_C (insn)))
- return NORMAL8;
- return NORMAL4;
- }
-}
-
-/* single_step() is called just before we want to resume the inferior, if we
- want to single-step it but there is no hardware or kernel single-step
- support. We find all the possible targets of the coming instruction and
- breakpoint them.
-
- single_step is also called just after the inferior stops. If we had
- set up a simulated single-step, we undo our damage. */
-
-void
-arc_software_single_step (enum target_signal ignore, /* sig but we don't need it */
- int insert_breakpoints_p)
-{
- static CORE_ADDR next_pc, target;
- static int brktrg_p;
- typedef char binsn_quantum[BREAKPOINT_MAX];
- static binsn_quantum break_mem[2];
-
- if (insert_breakpoints_p)
- {
- insn_type type;
- CORE_ADDR pc;
- unsigned long insn;
-
- pc = read_register (PC_REGNUM);
- insn = read_memory_integer (pc, 4);
- type = get_insn_type (insn, pc, &target);
-
- /* Always set a breakpoint for the insn after the branch. */
- next_pc = pc + ((type == NORMAL8 || type == BRANCH8) ? 8 : 4);
- target_insert_breakpoint (next_pc, break_mem[0]);
-
- brktrg_p = 0;
-
- if ((type == BRANCH4 || type == BRANCH8)
- /* Watch out for branches to the following location.
- We just stored a breakpoint there and another call to
- target_insert_breakpoint will think the real insn is the
- breakpoint we just stored there. */
- && target != next_pc)
- {
- brktrg_p = 1;
- target_insert_breakpoint (target, break_mem[1]);
- }
-
- }
- else
- {
- /* Remove breakpoints. */
- target_remove_breakpoint (next_pc, break_mem[0]);
-
- if (brktrg_p)
- target_remove_breakpoint (target, break_mem[1]);
-
- /* Fix the pc. */
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_pc (stop_pc);
- }
-}
-
-/* Because of Multi-arch, GET_LONGJMP_TARGET is always defined. So test
- for a definition of JB_PC. */
-#ifdef JB_PC
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
- This routine returns true on success. */
-
-int
-get_longjmp_target (CORE_ADDR *pc)
-{
- char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
- CORE_ADDR sp, jb_addr;
-
- sp = read_register (SP_REGNUM);
-
- if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
- buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
- return 0;
-
- jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-
- if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
- return 0;
-
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-
- return 1;
-}
-#endif /* GET_LONGJMP_TARGET */
-
-/* Disassemble one instruction. */
-
-static int
-arc_print_insn (bfd_vma vma, disassemble_info *info)
-{
- static int current_mach;
- static int current_endian;
- static disassembler_ftype current_disasm;
-
- if (current_disasm == NULL
- || arc_bfd_mach_type != current_mach
- || TARGET_BYTE_ORDER != current_endian)
- {
- current_mach = arc_bfd_mach_type;
- current_endian = TARGET_BYTE_ORDER;
- current_disasm = arc_get_disassembler (NULL);
- }
-
- return (*current_disasm) (vma, info);
-}
-
-/* Command to set cpu type. */
-
-void
-arc_set_cpu_type_command (char *args, int from_tty)
-{
- int i;
-
- if (tmp_arc_cpu_type == NULL || *tmp_arc_cpu_type == '\0')
- {
- printf_unfiltered ("The known ARC cpu types are as follows:\n");
- for (i = 0; arc_cpu_type_table[i].name != NULL; ++i)
- printf_unfiltered ("%s\n", arc_cpu_type_table[i].name);
-
- /* Restore the value. */
- tmp_arc_cpu_type = xstrdup (arc_cpu_type);
-
- return;
- }
-
- if (!arc_set_cpu_type (tmp_arc_cpu_type))
- {
- error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);
- /* Restore its value. */
- tmp_arc_cpu_type = xstrdup (arc_cpu_type);
- }
-}
-
-static void
-arc_show_cpu_type_command (char *args, int from_tty)
-{
-}
-
-/* Modify the actual cpu type.
- Result is a boolean indicating success. */
-
-static int
-arc_set_cpu_type (char *str)
-{
- int i, j;
-
- if (str == NULL)
- return 0;
-
- for (i = 0; arc_cpu_type_table[i].name != NULL; ++i)
- {
- if (strcasecmp (str, arc_cpu_type_table[i].name) == 0)
- {
- arc_cpu_type = str;
- arc_bfd_mach_type = arc_cpu_type_table[i].value;
- return 1;
- }
- }
-
- return 0;
-}
-
-void
-_initialize_arc_tdep (void)
-{
- struct cmd_list_element *c;
-
- c = add_set_cmd ("cpu", class_support, var_string_noescape,
- (char *) &tmp_arc_cpu_type,
- "Set the type of ARC cpu in use.\n\
-This command has two purposes. In a multi-cpu system it lets one\n\
-change the cpu being debugged. It also gives one access to\n\
-cpu-type-specific registers and recognize cpu-type-specific instructions.\
-",
- &setlist);
- set_cmd_cfunc (c, arc_set_cpu_type_command);
- c = add_show_from_set (c, &showlist);
- set_cmd_cfunc (c, arc_show_cpu_type_command);
-
- /* We have to use xstrdup() here because the `set' command frees it
- before setting a new value. */
- tmp_arc_cpu_type = xstrdup (DEFAULT_ARC_CPU_TYPE);
- arc_set_cpu_type (tmp_arc_cpu_type);
-
- c = add_set_cmd ("displaypipeline", class_support, var_zinteger,
- (char *) &display_pipeline_p,
- "Set pipeline display (simulator only).\n\
-When enabled, the state of the pipeline after each cycle is displayed.",
- &setlist);
- c = add_show_from_set (c, &showlist);
-
- c = add_set_cmd ("debugpipeline", class_support, var_zinteger,
- (char *) &debug_pipeline_p,
- "Set pipeline debug display (simulator only).\n\
-When enabled, debugging information about the pipeline is displayed.",
- &setlist);
- c = add_show_from_set (c, &showlist);
-
- c = add_set_cmd ("cputimer", class_support, var_zinteger,
- (char *) &cpu_timer,
- "Set maximum cycle count (simulator only).\n\
-Control will return to gdb if the timer expires.\n\
-A negative value disables the timer.",
- &setlist);
- c = add_show_from_set (c, &showlist);
-
- tm_print_insn = arc_print_insn;
-}
+// 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 bde89a8fa8e..ecdecaf9a1a 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -29,7 +29,6 @@
#else
/* Just include everything in sight so that the every old definition
of macro is visible. */
-#include "gdb_string.h"
#include "symtab.h"
#include "frame.h"
#include "inferior.h"
@@ -40,8 +39,10 @@
#include "target.h"
#include "annotate.h"
#endif
+#include "gdb_string.h"
#include "regcache.h"
#include "gdb_assert.h"
+#include "sim-regno.h"
#include "version.h"
@@ -90,6 +91,46 @@ legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
return NULL;
}
+/* Implementation of extract return value that grubs around in the
+ register cache. */
+void
+legacy_extract_return_value (struct type *type, struct regcache *regcache,
+ void *valbuf)
+{
+ char *registers = deprecated_grub_regcache_for_registers (regcache);
+ bfd_byte *buf = valbuf;
+ DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, buf);
+}
+
+/* Implementation of store return value that grubs the register cache.
+ Takes a local copy of the buffer to avoid const problems. */
+void
+legacy_store_return_value (struct type *type, struct regcache *regcache,
+ const void *buf)
+{
+ bfd_byte *b = alloca (TYPE_LENGTH (type));
+ gdb_assert (regcache == current_regcache);
+ memcpy (b, buf, TYPE_LENGTH (type));
+ DEPRECATED_STORE_RETURN_VALUE (type, b);
+}
+
+
+int
+legacy_register_sim_regno (int regnum)
+{
+ /* Only makes sense to supply raw registers. */
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS);
+ /* NOTE: cagney/2002-05-13: The old code did it this way and it is
+ suspected that some GDB/SIM combinations may rely on this
+ behavour. The default should be one2one_register_sim_regno
+ (below). */
+ if (REGISTER_NAME (regnum) != NULL
+ && REGISTER_NAME (regnum)[0] != '\0')
+ return regnum;
+ else
+ return LEGACY_SIM_REGNO_IGNORE;
+}
+
int
generic_frameless_function_invocation_not (struct frame_info *fi)
{
@@ -115,12 +156,18 @@ generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
}
int
+generic_in_solib_return_trampoline (CORE_ADDR pc, char *name)
+{
+ return 0;
+}
+
+int
generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
return 0;
}
-char *
+const char *
legacy_register_name (int i)
{
#ifdef REGISTER_NAMES
@@ -223,19 +270,6 @@ default_double_format (struct gdbarch *gdbarch)
}
}
-void
-default_print_float_info (void)
-{
-#ifdef FLOAT_INFO
-#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
-#error "FLOAT_INFO defined in multi-arch"
-#endif
- FLOAT_INFO;
-#else
- printf_filtered ("No floating point info available for this processor.\n");
-#endif
-}
-
/* Misc helper functions for targets. */
int
@@ -267,13 +301,6 @@ generic_cannot_extract_struct_value_address (char *dummy)
return 0;
}
-int
-default_register_sim_regno (int num)
-{
- return num;
-}
-
-
CORE_ADDR
core_addr_identity (CORE_ADDR addr)
{
@@ -422,6 +449,23 @@ generic_register_size (int regnum)
(name && STREQ ("_sigtramp", name))
#endif
#endif
+
+/* Assume all registers are adjacent. */
+
+int
+generic_register_byte (int regnum)
+{
+ int byte;
+ int i;
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
+ byte = 0;
+ for (i = 0; i < regnum; i++)
+ {
+ byte += TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
+ }
+ return byte;
+}
+
int
legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 594a83209a3..91aa2f89f5c 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -39,6 +39,13 @@ extern gdbarch_frame_num_args_ftype frame_num_args_unknown;
targets that don't yet implement their own breakpoint_from_pc(). */
extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc;
+/* Implementation of extract return value that grubs around in the
+ register cache. */
+extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
+
+/* Implementation of store return value that grubs the register cache. */
+extern gdbarch_store_return_value_ftype legacy_store_return_value;
+
/* Frameless functions not identifable. */
extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
@@ -48,7 +55,7 @@ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_in
extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
/* Map onto old REGISTER_NAMES. */
-extern char *legacy_register_name (int i);
+extern const char *legacy_register_name (int i);
/* Accessor for old global function pointer for disassembly. */
extern int legacy_print_insn (bfd_vma vma, disassemble_info *info);
@@ -94,11 +101,6 @@ extern void set_architecture_from_arch_mach (enum bfd_architecture, unsigned lon
extern int (*target_architecture_hook) (const struct bfd_arch_info *);
-
-/* Default raw->sim register re-numbering - does nothing. */
-
-extern int default_register_sim_regno (int reg_nr);
-
/* Identity function on a CORE_ADDR. Just returns its parameter. */
extern CORE_ADDR core_addr_identity (CORE_ADDR addr);
@@ -145,15 +147,18 @@ extern CORE_ADDR generic_skip_trampoline_code (CORE_ADDR pc);
extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name);
-extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern int generic_in_solib_return_trampoline (CORE_ADDR pc, char *name);
-extern void default_print_float_info (void);
+extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
/* Assume that the world is sane, a registers raw and virtual size
both match its type. */
extern int generic_register_size (int regnum);
+/* Assume that the world is sane, the registers are all adjacent. */
+extern int generic_register_byte (int regnum);
+
/* Prop up old targets that use various IN_SIGTRAMP() macros. */
extern int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name);
@@ -166,6 +171,12 @@ extern int legacy_convert_register_p (int regnum);
extern void legacy_register_to_value (int regnum, struct type *type, char *from, char *to);
extern void legacy_value_to_register (struct type *type, int regnum, char *from, char *to);
+/* For compatibility with older architectures, returns
+ (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid
+ name. */
+
+extern int legacy_register_sim_regno (int regnum);
+
/* Initialize a ``struct info''. Can't use memset(0) since some
default values are not zero. */
extern void gdbarch_info_init (struct gdbarch_info *info);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 920d27ba95f..cb930b64068 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -532,7 +532,7 @@ arm_linux_init_abi (struct gdbarch_info info,
sizeof (arm_linux_call_dummy_words));
/* The following two overrides shouldn't be needed. */
- set_gdbarch_extract_return_value (gdbarch, arm_linux_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value);
set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments);
/* Shared library handling. */
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 04fca2e44c6..b896b688650 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -36,11 +36,16 @@
#include "solib-svr4.h"
#include "arm-tdep.h"
+#include "gdb/sim-arm.h"
#include "elf-bfd.h"
#include "coff/internal.h"
#include "elf/arm.h"
+#include "gdb_assert.h"
+
+static int arm_debug;
+
/* Each OS has a different mechanism for accessing the various
registers stored in the sigcontext structure.
@@ -1407,104 +1412,125 @@ static CORE_ADDR
arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
- char *fp;
- int argnum, argreg, nstack_size;
+ CORE_ADDR fp;
+ int argnum;
+ int argreg;
+ int nstack;
+ int simd_argreg;
+ int second_pass;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
/* Walk through the list of args and determine how large a temporary
stack is required. Need to take care here as structs may be
- passed on the stack, and we have to to push them. */
- nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
- if (struct_return) /* The struct address goes in A1. */
- nstack_size += REGISTER_SIZE;
-
- /* Walk through the arguments and add their size to nstack_size. */
- for (argnum = 0; argnum < nargs; argnum++)
- {
- int len;
- struct type *arg_type;
-
- arg_type = check_typedef (VALUE_TYPE (args[argnum]));
- len = TYPE_LENGTH (arg_type);
-
- nstack_size += len;
- }
-
- /* Allocate room on the stack, and initialize our stack frame
- pointer. */
- fp = NULL;
- if (nstack_size > 0)
- {
- sp -= nstack_size;
- fp = (char *) sp;
- }
-
- /* Initialize the integer argument register pointer. */
- argreg = ARM_A1_REGNUM;
-
- /* The struct_return pointer occupies the first parameter passing
- register. */
- if (struct_return)
- write_register (argreg++, struct_addr);
-
- /* Process arguments from left to right. Store as many as allowed
- in the parameter passing registers (A1-A4), and save the rest on
- the temporary stack. */
- for (argnum = 0; argnum < nargs; argnum++)
+ passed on the stack, and we have to to push them. On the second
+ pass, do the store. */
+ nstack = 0;
+ fp = sp;
+ for (second_pass = 0; second_pass < 2; second_pass++)
{
- int len;
- char *val;
- CORE_ADDR regval;
- enum type_code typecode;
- struct type *arg_type, *target_type;
-
- arg_type = check_typedef (VALUE_TYPE (args[argnum]));
- target_type = TYPE_TARGET_TYPE (arg_type);
- len = TYPE_LENGTH (arg_type);
- typecode = TYPE_CODE (arg_type);
- val = (char *) VALUE_CONTENTS (args[argnum]);
-
-#if 1
- /* I don't know why this code was disable. The only logical use
- for a function pointer is to call that function, so setting
- the mode bit is perfectly fine. FN */
- /* If the argument is a pointer to a function, and it is a Thumb
- function, set the low bit of the pointer. */
- if (TYPE_CODE_PTR == typecode
- && NULL != target_type
- && TYPE_CODE_FUNC == TYPE_CODE (target_type))
+ /* Compute the FP using the information computed during the
+ first pass. */
+ if (second_pass)
+ fp = sp - nstack;
+
+ simd_argreg = 0;
+ argreg = ARM_A1_REGNUM;
+ nstack = 0;
+
+ /* The struct_return pointer occupies the first parameter
+ passing register. */
+ if (struct_return)
{
- CORE_ADDR regval = extract_address (val, len);
- if (arm_pc_is_thumb (regval))
- store_address (val, len, MAKE_THUMB_ADDR (regval));
+ if (second_pass)
+ {
+ if (arm_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "struct return in %s = 0x%s\n",
+ REGISTER_NAME (argreg),
+ paddr (struct_addr));
+ write_register (argreg, struct_addr);
+ }
+ argreg++;
}
-#endif
- /* Copy the argument to general registers or the stack in
- register-sized pieces. Large arguments are split between
- registers and stack. */
- while (len > 0)
- {
- int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
- if (argreg <= ARM_LAST_ARG_REGNUM)
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ int len;
+ struct type *arg_type;
+ struct type *target_type;
+ enum type_code typecode;
+ char *val;
+
+ arg_type = check_typedef (VALUE_TYPE (args[argnum]));
+ len = TYPE_LENGTH (arg_type);
+ target_type = TYPE_TARGET_TYPE (arg_type);
+ typecode = TYPE_CODE (arg_type);
+ val = VALUE_CONTENTS (args[argnum]);
+
+ /* If the argument is a pointer to a function, and it is a
+ Thumb function, create a LOCAL copy of the value and set
+ the THUMB bit in it. */
+ if (second_pass
+ && TYPE_CODE_PTR == typecode
+ && target_type != NULL
+ && TYPE_CODE_FUNC == TYPE_CODE (target_type))
{
- /* It's an argument being passed in a general register. */
- regval = extract_address (val, partial_len);
- write_register (argreg++, regval);
+ CORE_ADDR regval = extract_address (val, len);
+ if (arm_pc_is_thumb (regval))
+ {
+ val = alloca (len);
+ store_address (val, len, MAKE_THUMB_ADDR (regval));
+ }
}
- else
+
+ /* Copy the argument to general registers or the stack in
+ register-sized pieces. Large arguments are split between
+ registers and stack. */
+ while (len > 0)
{
- /* Push the arguments onto the stack. */
- write_memory ((CORE_ADDR) fp, val, REGISTER_SIZE);
- fp += REGISTER_SIZE;
+ int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
+
+ if (argreg <= ARM_LAST_ARG_REGNUM)
+ {
+ /* The argument is being passed in a general purpose
+ register. */
+ if (second_pass)
+ {
+ CORE_ADDR regval = extract_address (val,
+ partial_len);
+ if (arm_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "arg %d in %s = 0x%s\n",
+ argnum,
+ REGISTER_NAME (argreg),
+ phex (regval, REGISTER_SIZE));
+ write_register (argreg, regval);
+ }
+ argreg++;
+ }
+ else
+ {
+ if (second_pass)
+ {
+ /* Push the arguments onto the stack. */
+ if (arm_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "arg %d @ 0x%s + %d\n",
+ argnum, paddr (fp), nstack);
+ write_memory (fp + nstack, val, REGISTER_SIZE);
+ }
+ nstack += REGISTER_SIZE;
+ }
+
+ len -= partial_len;
+ val += partial_len;
}
- len -= partial_len;
- val += partial_len;
}
}
- /* Return adjusted stack pointer. */
- return sp;
+ /* Return the botom of the argument list (pointed to by fp). */
+ return fp;
}
/* Pop the current frame. So long as the frame info has been
@@ -1558,7 +1584,8 @@ print_fpu_flags (int flags)
/* Print interesting information about the floating point processor
(if present) or emulator. */
static void
-arm_print_float_info (void)
+arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
register unsigned long status = read_register (ARM_FPS_REGNUM);
int type;
@@ -1635,6 +1662,27 @@ arm_register_virtual_size (int regnum)
return STATUS_REGISTER_SIZE;
}
+/* Map GDB internal REGNUM onto the Arm simulator register numbers. */
+static int
+arm_register_sim_regno (int regnum)
+{
+ int reg = regnum;
+ gdb_assert (reg >= 0 && reg < NUM_REGS);
+
+ if (reg < NUM_GREGS)
+ return SIM_ARM_R0_REGNUM + reg;
+ reg -= NUM_GREGS;
+
+ if (reg < NUM_FREGS)
+ return SIM_ARM_FP0_REGNUM + reg;
+ reg -= NUM_FREGS;
+
+ if (reg < NUM_SREGS)
+ return SIM_ARM_FPS_REGNUM + reg;
+ reg -= NUM_SREGS;
+
+ internal_error (__FILE__, __LINE__, "Bad REGNUM %d", regnum);
+}
/* NOTE: cagney/2001-08-20: Both convert_from_extended() and
convert_to_extended() use floatformat_arm_ext_littlebyte_bigword.
@@ -2455,7 +2503,7 @@ set_disassembly_flavor_sfunc (char *args, int from_tty,
}
/* Return the ARM register name corresponding to register I. */
-static char *
+static const char *
arm_register_name (int i)
{
return arm_register_names[i];
@@ -2869,16 +2917,19 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE);
set_gdbarch_register_virtual_type (gdbarch, arm_register_type);
+ /* Internal <-> external register number maps. */
+ set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno);
+
/* Integer registers are 4 bytes. */
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_name (gdbarch, arm_register_name);
/* Returning results. */
- set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value);
- set_gdbarch_store_return_value (gdbarch, arm_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, arm_extract_return_value);
+ set_gdbarch_deprecated_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,
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
arm_extract_struct_value_address);
/* Single stepping. */
@@ -3076,4 +3127,10 @@ The valid values are:\n");
prologue_cache.saved_regs = NULL;
prologue_cache.extra_info = (struct frame_extra_info *)
xcalloc (1, sizeof (struct frame_extra_info));
+
+ /* Debugging flag. */
+ add_show_from_set (add_set_cmd ("arm", class_maintenance, var_zinteger,
+ &arm_debug, "Set arm debugging.\n\
+When non-zero, arm specific debugging is enabled.", &setdebuglist),
+ &showdebuglist);
}
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 71c7796443f..b24533223c6 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -31,6 +31,7 @@
#include "symfile.h"
#include "arch-utils.h"
#include "regcache.h"
+#include "gdb_string.h"
/* AVR Background:
@@ -158,7 +159,7 @@ struct gdbarch_tdep
/* Lookup the name of a register given it's number. */
-static char *
+static const char *
avr_register_name (int regnum)
{
static char *register_names[] = {
@@ -995,7 +996,14 @@ avr_skip_prologue (CORE_ADDR pc)
{
sal = find_pc_line (func_addr, 0);
- if (sal.line != 0 && sal.end < func_end)
+ /* troth/2002-08-05: For some very simple functions, gcc doesn't
+ generate a prologue and the sal.end ends up being the 2-byte ``ret''
+ instruction at the end of the function, but func_end ends up being
+ the address of the first instruction of the _next_ function. By
+ adjusting func_end by 2 bytes, we can catch these functions and not
+ return sal.end if it is the ``ret'' instruction. */
+
+ if (sal.line != 0 && sal.end < (func_end-2))
return sal.end;
}
@@ -1230,18 +1238,18 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
- set_gdbarch_extract_return_value (gdbarch, avr_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, avr_extract_return_value);
set_gdbarch_push_arguments (gdbarch, avr_push_arguments);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
/* set_gdbarch_push_return_address (gdbarch, avr_push_return_address); */
set_gdbarch_pop_frame (gdbarch, avr_pop_frame);
- set_gdbarch_store_return_value (gdbarch, avr_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, avr_store_return_value);
set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return);
- set_gdbarch_extract_struct_value_address (gdbarch,
- avr_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address
+ (gdbarch, avr_extract_struct_value_address);
set_gdbarch_frame_init_saved_regs (gdbarch, avr_scan_prologue);
set_gdbarch_init_extra_frame_info (gdbarch, avr_init_extra_frame_info);
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 9451837b97e..c36c76ddf10 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -27,6 +27,7 @@
#include "ax.h"
#include "value.h"
+#include "gdb_string.h"
static void grow_expr (struct agent_expr *x, int n);
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 73b86e8cf53..5a310f3ee6d 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -22,13 +22,57 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bcache.h"
#include "gdb_string.h" /* For memcpy declaration */
#include <stddef.h>
#include <stdlib.h>
+/* The type used to hold a single bcache string. The user data is
+ stored in d.data. Since it can be any type, it needs to have the
+ same alignment as the most strict alignment of any type on the host
+ machine. I don't know of any really correct way to do this in
+ stock ANSI C, so just do it the same way obstack.h does. */
+
+struct bstring
+{
+ struct bstring *next;
+ size_t length;
+
+ union
+ {
+ char data[1];
+ double dummy;
+ }
+ d;
+};
+
+
+/* The structure for a bcache itself. The bcache is initialized, in
+ bcache_xmalloc(), by filling it with zeros and then setting the
+ corresponding obstack's malloc() and free() methods. */
+
+struct bcache
+{
+ /* All the bstrings are allocated here. */
+ struct obstack cache;
+
+ /* How many hash buckets we're using. */
+ unsigned int num_buckets;
+
+ /* Hash buckets. This table is allocated using malloc, so when we
+ grow the table we can return the old table to the system. */
+ struct bstring **bucket;
+
+ /* Statistics. */
+ unsigned long unique_count; /* number of unique strings */
+ long total_count; /* total number of strings cached, including dups */
+ long unique_size; /* size of unique strings, in bytes */
+ long total_size; /* total number of bytes cached, including dups */
+ long structure_size; /* total size of bcache, including infrastructure */
+};
+
/* The old hash function was stolen from SDBM. This is what DB 3.0 uses now,
* and is better than the old one.
*/
@@ -166,19 +210,26 @@ bcache (const void *addr, int length, struct bcache *bcache)
}
-/* Freeing bcaches. */
+/* Allocating and freeing bcaches. */
+
+struct bcache *
+bcache_xmalloc (void)
+{
+ /* Allocate the bcache pre-zeroed. */
+ struct bcache *b = XCALLOC (1, struct bcache);
+ obstack_specify_allocation (&b->cache, 0, 0, xmalloc, xfree);
+ return b;
+}
/* Free all the storage associated with BCACHE. */
void
-free_bcache (struct bcache *bcache)
+bcache_xfree (struct bcache *bcache)
{
+ if (bcache == NULL)
+ return;
obstack_free (&bcache->cache, 0);
- if (bcache->bucket)
- xfree (bcache->bucket);
-
- /* This isn't necessary, but at least the bcache is always in a
- consistent state. */
- memset (bcache, 0, sizeof (*bcache));
+ xfree (bcache->bucket);
+ xfree (bcache);
}
@@ -291,3 +342,9 @@ print_bcache_statistics (struct bcache *c, char *type)
printf_filtered (" Maximum hash chain length: %3d\n", max_chain_length);
printf_filtered ("\n");
}
+
+int
+bcache_memory_used (struct bcache *bcache)
+{
+ return obstack_memory_used (&bcache->cache);
+}
diff --git a/gdb/bcache.h b/gdb/bcache.h
index 2b03ead5a34..61fbbe6c591 100644
--- a/gdb/bcache.h
+++ b/gdb/bcache.h
@@ -1,7 +1,8 @@
/* Include file cached obstack implementation.
Written by Fred Fish <fnf@cygnus.com>
Rewritten by Jim Blandy <jimb@cygnus.com>
- Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -63,68 +64,27 @@
any chance of sharing its space with future duplicates. */
-/* The type used to hold a single bcache string. The user data is
- stored in d.data. Since it can be any type, it needs to have the
- same alignment as the most strict alignment of any type on the host
- machine. I don't know of any really correct way to do this in
- stock ANSI C, so just do it the same way obstack.h does.
-
- It would be nicer to have this stuff hidden away in bcache.c, but
- struct objstack contains a struct bcache directly --- not a pointer
- to one --- and then the memory-mapped stuff makes this a real pain.
- We don't strictly need to expose struct bstring, but it's better to
- have it all in one place. */
-
-struct bstring {
- struct bstring *next;
- size_t length;
-
- union
- {
- char data[1];
- double dummy;
- }
- d;
-};
-
-
-/* The structure for a bcache itself.
- To initialize a bcache, just fill it with zeros. */
-struct bcache {
- /* All the bstrings are allocated here. */
- struct obstack cache;
-
- /* How many hash buckets we're using. */
- unsigned int num_buckets;
-
- /* Hash buckets. This table is allocated using malloc, so when we
- grow the table we can return the old table to the system. */
- struct bstring **bucket;
-
- /* Statistics. */
- unsigned long unique_count; /* number of unique strings */
- long total_count; /* total number of strings cached, including dups */
- long unique_size; /* size of unique strings, in bytes */
- long total_size; /* total number of bytes cached, including dups */
- long structure_size; /* total size of bcache, including infrastructure */
-};
-
+struct bcache;
/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
extern void *bcache (const void *addr, int length, struct bcache *bcache);
-/* Free all the storage that BCACHE refers to. The result is a valid,
- but empty, bcache. This does not free BCACHE itself, since that
- might be part of some larger object. */
-extern void free_bcache (struct bcache *bcache);
+/* Free all the storage used by BCACHE. */
+extern void bcache_xfree (struct bcache *bcache);
+
+/* Create a new bcache object. */
+extern struct bcache *bcache_xmalloc (void);
/* Print statistics on BCACHE's memory usage and efficacity at
eliminating duplication. TYPE should be a string describing the
kind of data BCACHE holds. Statistics are printed using
`printf_filtered' and its ilk. */
extern void print_bcache_statistics (struct bcache *bcache, char *type);
+extern int bcache_memory_used (struct bcache *bcache);
+
/* The hash function */
extern unsigned long hash(const void *addr, int length);
+
#endif /* BCACHE_H */
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 706d0283cf1..b2c5d0eabe9 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -34,9 +34,28 @@
#include "inferior.h" /* for read_pc */
#include "annotate.h"
#include "regcache.h"
+#include "gdb_assert.h"
/* Prototypes for exported functions. */
+static void generic_call_dummy_register_unwind (struct frame_info *frame,
+ void **cache,
+ int regnum,
+ int *optimized,
+ enum lval_type *lval,
+ CORE_ADDR *addrp,
+ int *realnum,
+ void *raw_buffer);
+static void frame_saved_regs_register_unwind (struct frame_info *frame,
+ void **cache,
+ int regnum,
+ int *optimized,
+ enum lval_type *lval,
+ CORE_ADDR *addrp,
+ int *realnum,
+ void *buffer);
+
+
void _initialize_blockframe (void);
/* A default FRAME_CHAIN_VALID, in the form that is suitable for most
@@ -208,6 +227,27 @@ set_current_frame (struct frame_info *frame)
current_frame = frame;
}
+
+/* Using the PC, select a mechanism for unwinding a frame returning
+ the previous frame. The register unwind function should, on
+ demand, initialize the ->context object. */
+
+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 = generic_call_dummy_register_unwind;
+ else
+ *unwind = frame_saved_regs_register_unwind;
+}
+
/* Create an arbitrary (i.e. address specified by user) or innermost frame.
Always returns a non-NULL value. */
@@ -232,6 +272,9 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
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);
+
return fi;
}
@@ -371,6 +414,15 @@ get_prev_frame (struct frame_info *next_frame)
start go curfluy than have an abort called from main not show
main. */
address = 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 (address, next_frame))
return 0;
}
@@ -456,6 +508,12 @@ get_prev_frame (struct frame_info *next_frame)
}
}
+ /* Initialize the code used to unwind the frame PREV based on the PC
+ (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))
@@ -470,6 +528,26 @@ get_frame_pc (struct frame_info *frame)
return frame->pc;
}
+/* return the address of the PC for the given FRAME, ie the current PC value
+ if FRAME is the innermost frame, or the address adjusted to point to the
+ call instruction if not. */
+
+CORE_ADDR
+frame_address_in_block (struct frame_info *frame)
+{
+ CORE_ADDR pc = frame->pc;
+
+ /* If we are not in the innermost frame, and we are not interrupted
+ by a signal, frame->pc points to the instruction following the
+ call. As a consequence, we need to get the address of the previous
+ 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)
+ --pc;
+
+ return pc;
+}
#ifdef FRAME_FIND_SAVED_REGS
/* XXX - deprecated. This is a compatibility function for targets
@@ -518,17 +596,7 @@ get_frame_saved_regs (struct frame_info *frame,
struct block *
get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
{
- CORE_ADDR pc;
-
- pc = frame->pc;
- if (frame->next != 0 && frame->next->signal_handler_caller == 0)
- /* We are not in the innermost frame and we were not interrupted
- by a signal. We need to subtract one to get the correct block,
- in case the call instruction was the last instruction of the block.
- If there are any machines on which the saved pc does not point to
- after the call insn, we probably want to make frame->pc point after
- the call insn anyway. */
- --pc;
+ const CORE_ADDR pc = frame_address_in_block (frame);
if (addr_in_block)
*addr_in_block = pc;
@@ -564,6 +632,8 @@ get_pc_function_start (CORE_ADDR pc)
else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL)
{
fstart = SYMBOL_VALUE_ADDRESS (msymbol);
+ if (!find_pc_section (fstart))
+ return 0;
}
else
{
@@ -739,9 +809,9 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
mapped_pc = overlay_mapped_address (pc, section);
- if (mapped_pc >= cache_pc_function_low &&
- mapped_pc < cache_pc_function_high &&
- section == cache_pc_function_section)
+ if (mapped_pc >= cache_pc_function_low
+ && mapped_pc < cache_pc_function_high
+ && section == cache_pc_function_section)
goto return_cached_value;
/* If sigtramp is in the u area, it counts as a function (especially
@@ -847,7 +917,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
for (i = 1; SYMBOL_NAME (msymbol + i) != NULL; i++)
{
if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol)
- && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
+ && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
break;
}
@@ -859,7 +929,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
So the end address is the end of the section. */
cache_pc_function_high = osect->endaddr;
-return_cached_value:
+ return_cached_value:
if (address)
{
@@ -878,8 +948,8 @@ return_cached_value:
{
/* Because the high address is actually beyond the end of
the function (and therefore possibly beyond the end of
- the overlay), we must actually convert (high - 1)
- and then add one to that. */
+ the overlay), we must actually convert (high - 1) and
+ then add one to that. */
*endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
section);
@@ -891,7 +961,7 @@ return_cached_value:
return 1;
}
-/* Backward compatibility, no section argument */
+/* Backward compatibility, no section argument. */
int
find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
@@ -912,6 +982,7 @@ block_innermost_frame (struct block *block)
struct frame_info *frame;
register CORE_ADDR start;
register CORE_ADDR end;
+ CORE_ADDR calling_pc;
if (block == NULL)
return NULL;
@@ -925,7 +996,8 @@ block_innermost_frame (struct block *block)
frame = get_prev_frame (frame);
if (frame == NULL)
return NULL;
- if (frame->pc >= start && frame->pc < end)
+ calling_pc = frame_address_in_block (frame);
+ if (calling_pc >= start && calling_pc < end)
return frame;
}
}
@@ -1069,7 +1141,7 @@ struct dummy_frame
CORE_ADDR fp;
CORE_ADDR sp;
CORE_ADDR top;
- char *registers;
+ struct regcache *regcache;
/* Address range of the call dummy code. Look for PC in the range
[LO..HI) (after allowing for DECR_PC_AFTER_BREAK). */
@@ -1086,7 +1158,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
to call this function after the PC has been adjusted. */
-char *
+static struct regcache *
generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
struct dummy_frame *dummyframe;
@@ -1098,11 +1170,20 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
|| fp == dummyframe->sp
|| fp == dummyframe->top))
/* The frame in question lies between the saved fp and sp, inclusive */
- return dummyframe->registers;
+ return dummyframe->regcache;
return 0;
}
+char *
+deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+{
+ struct regcache *regcache = generic_find_dummy_frame (pc, fp);
+ if (regcache == NULL)
+ return NULL;
+ return deprecated_grub_regcache_for_registers (regcache);
+}
+
/* Function: pc_in_call_dummy (pc, sp, fp)
Return true if the PC falls in a dummy frame created by gdb for an
@@ -1131,11 +1212,23 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
CORE_ADDR
generic_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
{
- char *dummy_regs = generic_find_dummy_frame (pc, fp);
+ struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
if (dummy_regs)
- return extract_address (&dummy_regs[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno));
+ {
+ /* NOTE: cagney/2002-08-12: Replaced a call to
+ regcache_raw_read_as_address() with a call to
+ regcache_cooked_read_unsigned(). The old, ...as_address
+ function was eventually calling extract_unsigned_integer (via
+ extract_address) to unpack the registers value. The below is
+ doing an unsigned extract so that it is functionally
+ equivalent. The read needs to be cooked as, otherwise, it
+ will never correctly return the value of a register in the
+ [NUM_REGS .. NUM_REGS+NUM_PSEUDO_REGS) range. */
+ ULONGEST val;
+ regcache_cooked_read_unsigned (dummy_regs, regno, &val);
+ return val;
+ }
else
return 0;
}
@@ -1162,7 +1255,7 @@ generic_push_dummy_frame (void)
if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
{
dummy_frame_stack = dummy_frame->next;
- xfree (dummy_frame->registers);
+ regcache_xfree (dummy_frame->regcache);
xfree (dummy_frame);
dummy_frame = dummy_frame_stack;
}
@@ -1170,13 +1263,13 @@ generic_push_dummy_frame (void)
dummy_frame = dummy_frame->next;
dummy_frame = xmalloc (sizeof (struct dummy_frame));
- dummy_frame->registers = xmalloc (REGISTER_BYTES);
+ dummy_frame->regcache = regcache_xmalloc (current_gdbarch);
dummy_frame->pc = read_pc ();
dummy_frame->sp = read_sp ();
dummy_frame->top = dummy_frame->sp;
dummy_frame->fp = fp;
- read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
+ regcache_cpy (dummy_frame->regcache, current_regcache);
dummy_frame->next = dummy_frame_stack;
dummy_frame_stack = dummy_frame;
}
@@ -1224,10 +1317,10 @@ generic_pop_dummy_frame (void)
if (!dummy_frame)
error ("Can't pop dummy frame!");
dummy_frame_stack = dummy_frame->next;
- write_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
+ regcache_cpy (current_regcache, dummy_frame->regcache);
flush_cached_frames ();
- xfree (dummy_frame->registers);
+ regcache_xfree (dummy_frame->regcache);
xfree (dummy_frame);
}
@@ -1249,7 +1342,8 @@ generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
int
generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
{
- if (PC_IN_CALL_DUMMY ((fi)->pc, fp, fp))
+ if (USE_GENERIC_DUMMY_FRAMES
+ && PC_IN_CALL_DUMMY ((fi)->pc, 0, 0))
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
return (fp != 0
@@ -1269,6 +1363,147 @@ generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
return;
}
+/* Given a call-dummy dummy-frame, return the registers. Here the
+ register value is taken from the local copy of the register buffer. */
+
+static void
+generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
+ int regnum, int *optimized,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnum, void *bufferp)
+{
+ gdb_assert (frame != NULL);
+ gdb_assert (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame));
+
+ /* Describe the register's location. Generic dummy frames always
+ have the register value in an ``expression''. */
+ *optimized = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnum = -1;
+
+ /* If needed, find and return the value of the register. */
+ if (bufferp != NULL)
+ {
+ struct regcache *registers;
+#if 1
+ /* Get the address of the register buffer that contains all the
+ saved registers for this dummy frame. Cache that address. */
+ registers = (*cache);
+ if (registers == NULL)
+ {
+ registers = generic_find_dummy_frame (frame->pc, frame->frame);
+ (*cache) = registers;
+ }
+#else
+ /* Get the address of the register buffer that contains the
+ saved registers and then extract the value from that. */
+ registers = generic_find_dummy_frame (frame->pc, frame->frame);
+#endif
+ gdb_assert (registers != NULL);
+ /* Return the actual value. */
+ /* Use the regcache_cooked_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_cooked_read (registers, regnum, bufferp);
+ }
+}
+
+/* Return the register saved in the simplistic ``saved_regs'' cache.
+ If the value isn't here AND a value is needed, try the next inner
+ most frame. */
+
+static void
+frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ /* There is always a frame at this point. And THIS is the frame
+ we're interested in. */
+ gdb_assert (frame != NULL);
+ /* 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)));
+
+ /* Load the saved_regs register cache. */
+ if (frame->saved_regs == NULL)
+ FRAME_INIT_SAVED_REGS (frame);
+
+ if (frame->saved_regs != NULL
+ && frame->saved_regs[regnum] != 0)
+ {
+ if (regnum == SP_REGNUM)
+ {
+ /* SP register treated specially. */
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = -1;
+ if (bufferp != NULL)
+ store_address (bufferp, REGISTER_RAW_SIZE (regnum),
+ frame->saved_regs[regnum]);
+ }
+ else
+ {
+ /* Any other register is saved in memory, fetch it but cache
+ a local copy of its value. */
+ *optimizedp = 0;
+ *lvalp = lval_memory;
+ *addrp = frame->saved_regs[regnum];
+ *realnump = -1;
+ if (bufferp != NULL)
+ {
+#if 1
+ /* Save each register value, as it is read in, in a
+ frame based cache. */
+ void **regs = (*cache);
+ if (regs == NULL)
+ {
+ int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS)
+ * sizeof (void *));
+ regs = frame_obstack_alloc (sizeof_cache);
+ memset (regs, 0, sizeof_cache);
+ (*cache) = regs;
+ }
+ if (regs[regnum] == NULL)
+ {
+ regs[regnum]
+ = frame_obstack_alloc (REGISTER_RAW_SIZE (regnum));
+ read_memory (frame->saved_regs[regnum], regs[regnum],
+ REGISTER_RAW_SIZE (regnum));
+ }
+ memcpy (bufferp, regs[regnum], REGISTER_RAW_SIZE (regnum));
+#else
+ /* Read the value in from memory. */
+ read_memory (frame->saved_regs[regnum], bufferp,
+ REGISTER_RAW_SIZE (regnum));
+#endif
+ }
+ }
+ return;
+ }
+
+ /* No luck, assume this and the next frame have the same register
+ value. If a value is needed, pass the request on down the chain;
+ otherwise just return an indication that the value is in the same
+ register as the next frame. */
+ if (bufferp == NULL)
+ {
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ }
+ else
+ {
+ frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp,
+ realnump, bufferp);
+ }
+}
+
/* Function: get_saved_register
Find register number REGNUM relative to FRAME and put its (raw,
target format) contents in *RAW_BUFFER.
@@ -1320,10 +1555,13 @@ generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
- memcpy (raw_buffer,
- generic_find_dummy_frame (frame->pc, frame->frame) +
- REGISTER_BYTE (regnum),
- REGISTER_RAW_SIZE (regnum));
+ /* FIXME: cagney/2002-06-26: This should be via the
+ gdbarch_register_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_raw_read (generic_find_dummy_frame (frame->pc,
+ frame->frame),
+ regnum, raw_buffer);
return;
}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6f604f1961a..0f498af9957 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -553,6 +553,7 @@ condition_command (char *arg, int from_tty)
error ("Junk at end of expression");
}
breakpoints_changed ();
+ breakpoint_modify_event (b->number);
return;
}
@@ -592,6 +593,7 @@ commands_command (char *arg, int from_tty)
free_command_lines (&b->commands);
b->commands = l;
breakpoints_changed ();
+ breakpoint_modify_event (b->number);
return;
}
error ("No breakpoint number %d.", bnum);
@@ -713,10 +715,22 @@ insert_breakpoints (void)
int return_val = 0; /* return success code. */
int val = 0;
int disabled_breaks = 0;
+ int hw_breakpoint_error = 0;
+ int process_warning = 0;
static char message1[] = "Error inserting catchpoint %d:\n";
static char message[sizeof (message1) + 30];
+#ifdef ONE_PROCESS_WRITETEXT
+ process_warning = 1;
+#endif
+
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
+
+ /* Explicitly mark the warning -- this will only be printed if
+ there was an error. */
+ fprintf_unfiltered (tmp_error_stream, "Warning:\n");
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -774,8 +788,9 @@ insert_breakpoints (void)
/* Set a software (trap) breakpoint at the LMA. */
val = target_insert_breakpoint (addr, b->shadow_contents);
if (val != 0)
- warning ("overlay breakpoint %d failed: in ROM?",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Overlay breakpoint %d failed: in ROM?",
+ b->number);
}
}
/* Shall we set a breakpoint at the VMA? */
@@ -808,22 +823,34 @@ insert_breakpoints (void)
b->enable_state = bp_shlib_disabled;
if (!disabled_breaks)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- warning ("Temporarily disabling shared library breakpoints:");
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d.\n", b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Temporarily disabling shared library breakpoints:\n");
}
disabled_breaks = 1;
- warning ("breakpoint #%d ", b->number);
+ fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number);
}
else
#endif
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
-#ifdef ONE_PROCESS_WRITETEXT
- warning ("The same program may be running in another process.");
-#endif
- memory_error (val, b->address); /* which bombs us out */
+ process_warning = 1;
+ if (b->type == bp_hardware_breakpoint)
+ {
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d.\n",
+ b->number);
+ }
+ else
+ {
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
+ fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
+ print_address_numeric (b->address, 1, tmp_error_stream);
+ fprintf_filtered (tmp_error_stream, ": %s.\n",
+ safe_strerror (val));
+ }
+
}
}
else
@@ -850,9 +877,13 @@ insert_breakpoints (void)
if (val)
{
/* Couldn't set breakpoint for some reason */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\n",
+ b->number);
+ fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
+ print_address_numeric (b->address, 1, tmp_error_stream);
+ fprintf_filtered (tmp_error_stream, ": %s.\n",
+ safe_strerror (val));
b->enable_state = bp_disabled;
}
else
@@ -874,9 +905,9 @@ insert_breakpoints (void)
if (val == -1)
{
/* something went wrong */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\n",
+ b->number);
b->enable_state = bp_disabled;
}
}
@@ -909,13 +940,7 @@ insert_breakpoints (void)
else
{
struct frame_info *fi;
-
- /* There might be no current frame at this moment if we are
- resuming from a step over a breakpoint.
- Set up current frame before trying to find the watchpoint
- frame. */
- get_current_frame ();
- fi = find_frame_addr_in_frame_chain (b->watchpoint_frame);
+ fi = frame_find_by_id (b->watchpoint_frame);
within_current_scope = (fi != NULL);
if (within_current_scope)
select_frame (fi);
@@ -959,7 +984,7 @@ insert_breakpoints (void)
addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
len = TYPE_LENGTH (VALUE_TYPE (v));
- type = hw_write;
+ type = hw_write;
if (b->type == bp_read_watchpoint)
type = hw_read;
else if (b->type == bp_access_watchpoint)
@@ -984,9 +1009,11 @@ insert_breakpoints (void)
value chain brings us here. */
if (!b->inserted)
{
+ process_warning = 1;
remove_breakpoint (b, mark_uninserted);
- warning ("Could not insert hardware watchpoint %d.",
- b->number);
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware watchpoint %d.\n", b->number);
val = -1;
}
}
@@ -1033,8 +1060,7 @@ insert_breakpoints (void)
}
if (val < 0)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d.", b->number);
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number);
}
else
b->inserted = 1;
@@ -1043,11 +1069,26 @@ insert_breakpoints (void)
return_val = val; /* remember failure */
}
}
+
+ if (return_val)
+ {
+ /* If a hardware breakpoint or watchpoint was inserted, add a
+ message about possibly exhausted resources. */
+ if (hw_breakpoint_error)
+ {
+ fprintf_unfiltered (tmp_error_stream, "Could not insert hardware breakpoints:\n"
+ "You may have requested too many hardware breakpoints/watchpoints.\n");
+ }
+
+ if (process_warning)
+ fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.");
+ target_terminal_ours_for_output ();
+ error_stream (tmp_error_stream);
+ }
return return_val;
}
-
int
remove_breakpoints (void)
{
@@ -2320,7 +2361,7 @@ watchpoint_check (PTR p)
any chance of handling watchpoints on local variables, we'll need
the frame chain (so we can determine if we're in scope). */
reinit_frame_cache ();
- fr = find_frame_addr_in_frame_chain (b->watchpoint_frame);
+ fr = frame_find_by_id (b->watchpoint_frame);
within_current_scope = (fr != NULL);
/* in_function_epilogue_p() returns a non-zero value if we're still
in the function but the stack frame has already been invalidated.
@@ -2394,7 +2435,7 @@ which its expression is valid.\n");
/* Get a bpstat associated with having just stopped at address *PC
and frame address CORE_ADDRESS. Update *PC to point at the
- breakpoint (if we hit a breakpoint). NOT_A_BREAKPOINT is nonzero
+ breakpoint (if we hit a breakpoint). NOT_A_SW_BREAKPOINT is nonzero
if this is known to not be a real breakpoint (it could still be a
watchpoint, though). */
@@ -2413,7 +2454,7 @@ which its expression is valid.\n");
commands, FIXME??? fields. */
bpstat
-bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
+bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
{
register struct breakpoint *b, *temp;
CORE_ADDR bp_addr;
@@ -2427,14 +2468,13 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
"Error evaluating expression for watchpoint %d\n";
char message[sizeof (message1) + 30 /* slop */ ];
- /* Get the address where the breakpoint would have been.
- The "not_a_breakpoint" argument is meant to distinguish
- between a breakpoint trap event and a trace/singlestep
- trap event. For a trace/singlestep trap event, we would
- not want to subtract DECR_PC_AFTER_BREAK from the PC. */
+ /* Get the address where the breakpoint would have been. The
+ "not_a_sw_breakpoint" argument is meant to distinguish between a
+ breakpoint trap event and a trace/singlestep trap event. For a
+ trace/singlestep trap event, we would not want to subtract
+ DECR_PC_AFTER_BREAK from the PC. */
- bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ?
- 0 : DECR_PC_AFTER_BREAK);
+ bp_addr = *pc - (not_a_sw_breakpoint ? 0 : DECR_PC_AFTER_BREAK);
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -5321,10 +5361,12 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
if (frame)
{
prev_frame = get_prev_frame (frame);
- b->watchpoint_frame = frame->frame;
+ get_frame_id (frame, &b->watchpoint_frame);
}
else
- b->watchpoint_frame = (CORE_ADDR) 0;
+ {
+ memset (&b->watchpoint_frame, 0, sizeof (b->watchpoint_frame));
+ }
/* If the expression is "local", then set up a "watchpoint scope"
breakpoint at the point where we've left the scope of the watchpoint
@@ -5334,16 +5376,8 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
if (prev_frame)
{
struct breakpoint *scope_breakpoint;
- struct symtab_and_line scope_sal;
-
- INIT_SAL (&scope_sal); /* initialize to zeroes */
- scope_sal.pc = get_frame_pc (prev_frame);
- scope_sal.section = find_pc_overlay (scope_sal.pc);
-
- scope_breakpoint = set_raw_breakpoint (scope_sal,
- bp_watchpoint_scope);
- set_breakpoint_count (breakpoint_count + 1);
- scope_breakpoint->number = breakpoint_count;
+ scope_breakpoint = create_internal_breakpoint (get_frame_pc (prev_frame),
+ bp_watchpoint_scope);
scope_breakpoint->enable_state = bp_enabled;
@@ -6692,11 +6726,32 @@ delete_breakpoint (struct breakpoint *bpt)
else
val = target_insert_breakpoint (b->address, b->shadow_contents);
+ /* If there was an error in the insert, print a message, then stop execution. */
if (val != 0)
{
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
+
+
+ if (b->type == bp_hardware_breakpoint)
+ {
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d.\n"
+ "You may have requested too many hardware breakpoints.\n",
+ b->number);
+ }
+ else
+ {
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
+ fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
+ print_address_numeric (b->address, 1, tmp_error_stream);
+ fprintf_filtered (tmp_error_stream, ": %s.\n",
+ safe_strerror (val));
+ }
+
+ fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.");
target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- memory_error (val, b->address); /* which bombs us out */
+ error_stream(tmp_error_stream);
}
else
b->inserted = 1;
@@ -6771,6 +6826,8 @@ delete_command (char *arg, int from_tty)
{
struct breakpoint *b, *temp;
+ dont_repeat ();
+
if (arg == 0)
{
int breaks_to_delete = 0;
@@ -7075,18 +7132,20 @@ set_ignore_count (int bptnum, int count, int from_tty)
if (b->number == bptnum)
{
b->ignore_count = count;
- if (!from_tty)
- return;
- else if (count == 0)
- printf_filtered ("Will stop next time breakpoint %d is reached.",
- bptnum);
- else if (count == 1)
- printf_filtered ("Will ignore next crossing of breakpoint %d.",
- bptnum);
- else
- printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
- count, bptnum);
+ if (from_tty)
+ {
+ if (count == 0)
+ printf_filtered ("Will stop next time breakpoint %d is reached.",
+ bptnum);
+ else if (count == 1)
+ printf_filtered ("Will ignore next crossing of breakpoint %d.",
+ bptnum);
+ else
+ printf_filtered ("Will ignore next %d crossings of breakpoint %d.",
+ count, bptnum);
+ }
breakpoints_changed ();
+ breakpoint_modify_event (b->number);
return;
}
@@ -7123,8 +7182,8 @@ ignore_command (char *args, int from_tty)
set_ignore_count (num,
longest_to_int (value_as_long (parse_and_eval (p))),
from_tty);
- printf_filtered ("\n");
- breakpoints_changed ();
+ if (from_tty)
+ printf_filtered ("\n");
}
/* Call FUNCTION on each of the breakpoints
@@ -7266,12 +7325,7 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
if (bpt->exp_valid_block != NULL)
{
struct frame_info *fr =
-
- /* Ensure that we have the current frame. Else, this
- next query may pessimistically be answered as, "No,
- not within current scope". */
- get_current_frame ();
- fr = find_frame_addr_in_frame_chain (bpt->watchpoint_frame);
+ fr = frame_find_by_id (bpt->watchpoint_frame);
if (fr == NULL)
{
printf_filtered ("\
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 3a58aad2487..226703b5938 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -270,10 +270,10 @@ struct breakpoint
it the watchpoint_scope breakpoint or something like that. FIXME). */
struct breakpoint *related_breakpoint;
- /* Holds the frame address which identifies the frame this watchpoint
- should be evaluated in, or NULL if the watchpoint should be evaluated
- on the outermost frame. */
- CORE_ADDR watchpoint_frame;
+ /* Holds the frame address which identifies the frame this
+ watchpoint should be evaluated in, or `null' if the watchpoint
+ should be evaluated on the outermost frame. */
+ struct frame_id watchpoint_frame;
/* Thread number for thread-specific breakpoint, or -1 if don't care */
int thread;
@@ -322,7 +322,7 @@ extern void bpstat_clear (bpstat *);
is part of the bpstat is copied as well. */
extern bpstat bpstat_copy (bpstat);
-extern bpstat bpstat_stop_status (CORE_ADDR *, int);
+extern bpstat bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint);
/* This bpstat_what stuff tells wait_for_inferior what to do with a
breakpoint (a challenging task). */
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 5078935fefe..b1962dffeae 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -28,7 +28,7 @@
#include "defs.h"
#include "bfd.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "symtab.h"
#include "symfile.h" /* Needed for "struct complaint" */
#include "objfiles.h"
@@ -40,6 +40,7 @@
#include "bcache.h"
#include "filenames.h" /* For DOSish file names */
#include "macrotab.h"
+#include "demangle.h" /* Needed by SYMBOL_INIT_DEMANGLED_NAME. */
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
@@ -243,17 +244,49 @@ finish_block (struct symbol *symbol, struct pending **listhead,
/* EMPTY */ ;
}
- block = (struct block *) obstack_alloc (&objfile->symbol_obstack,
- (sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
-
/* Copy the symbols into the block. */
- BLOCK_NSYMS (block) = i;
- for (next = *listhead; next; next = next->next)
+ if (symbol)
+ {
+ block = (struct block *)
+ obstack_alloc (&objfile->symbol_obstack,
+ (sizeof (struct block) +
+ ((i - 1) * sizeof (struct symbol *))));
+ BLOCK_NSYMS (block) = i;
+ for (next = *listhead; next; next = next->next)
+ for (j = next->nsyms - 1; j >= 0; j--)
+ {
+ BLOCK_SYM (block, --i) = next->symbol[j];
+ }
+ }
+ else
{
- for (j = next->nsyms - 1; j >= 0; j--)
+ int htab_size = BLOCK_HASHTABLE_SIZE (i);
+
+ block = (struct block *)
+ obstack_alloc (&objfile->symbol_obstack,
+ (sizeof (struct block) +
+ ((htab_size - 1) * sizeof (struct symbol *))));
+ for (j = 0; j < htab_size; j++)
+ {
+ BLOCK_BUCKET (block, j) = 0;
+ }
+ BLOCK_BUCKETS (block) = htab_size;
+ for (next = *listhead; next; next = next->next)
{
- BLOCK_SYM (block, --i) = next->symbol[j];
+ for (j = next->nsyms - 1; j >= 0; j--)
+ {
+ struct symbol *sym;
+ unsigned int hash_index;
+ const char *name = SYMBOL_DEMANGLED_NAME (next->symbol[j]);
+ if (name == NULL)
+ name = SYMBOL_NAME (next->symbol[j]);
+ hash_index = msymbol_hash_iw (name);
+ hash_index = hash_index % BLOCK_BUCKETS (block);
+ sym = BLOCK_BUCKET (block, hash_index);
+ BLOCK_BUCKET (block, hash_index) = next->symbol[j];
+ next->symbol[j]->hash_next = sym;
+ }
}
}
@@ -271,6 +304,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
struct type *ftype = SYMBOL_TYPE (symbol);
SYMBOL_BLOCK_VALUE (symbol) = block;
BLOCK_FUNCTION (block) = symbol;
+ BLOCK_HASHTABLE (block) = 0;
if (TYPE_NFIELDS (ftype) <= 0)
{
@@ -352,6 +386,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
else
{
BLOCK_FUNCTION (block) = NULL;
+ BLOCK_HASHTABLE (block) = 1;
}
/* Now "free" the links of the list, and empty the list. */
@@ -451,11 +486,11 @@ record_pending_block (struct objfile *objfile, struct block *block,
}
}
-/* Note that this is only used in this file and in dstread.c, which
- should be fixed to not need direct access to this function. When
- that is done, it can be made static again. */
+/* OBSOLETE Note that this is only used in this file and in dstread.c, which */
+/* OBSOLETE should be fixed to not need direct access to this function. When */
+/* OBSOLETE that is done, it can be made static again. */
-struct blockvector *
+static struct blockvector *
make_blockvector (struct objfile *objfile)
{
register struct pending_block *next;
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index d023aa3e855..8a252cb2b4c 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -277,11 +277,11 @@ extern int hashname (char *name);
extern void free_pending_blocks (void);
-/* FIXME: Note that this is used only in buildsym.c and dstread.c,
- which should be fixed to not need direct access to
- make_blockvector. */
+/* OBSOLETE FIXME: Note that this is used only in buildsym.c and dstread.c, */
+/* OBSOLETE which should be fixed to not need direct access to */
+/* OBSOLETE make_blockvector. */
-extern struct blockvector *make_blockvector (struct objfile *objfile);
+/* OBSOLETE extern struct blockvector *make_blockvector (struct objfile *objfile); */
/* FIXME: Note that this is used only in buildsym.c and dstread.c,
which should be fixed to not need direct access to
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index f555518ea00..ea5083646e0 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -100,9 +100,11 @@ extern int hp_som_som_object_present;
#define yycheck c_yycheck
#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
int yyparse (void);
static int yylex (void);
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 09a2e6a968a..9ee92ad8b8c 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -415,14 +415,14 @@ scan_macro_expansion (char *expansion)
int
-scanning_macro_expansion ()
+scanning_macro_expansion (void)
{
return macro_original_text != 0;
}
void
-finished_macro_expansion ()
+finished_macro_expansion (void)
{
/* There'd better be something to pop back to, and we better have
saved a pointer to the start of the expanded text. */
@@ -461,7 +461,7 @@ null_macro_lookup (const char *name, void *baton)
static int
-c_preprocess_and_parse ()
+c_preprocess_and_parse (void)
{
/* Set up a lookup function for the macro expander. */
struct macro_scope *scope = 0;
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 430d5674f24..bede1948211 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -21,7 +21,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
@@ -41,7 +41,7 @@
/* Flag indicating target was compiled by HP compiler */
extern int hp_som_som_object_present;
-static void cp_type_print_method_args (struct type ** args, char *prefix,
+static void cp_type_print_method_args (struct type *mtype, char *prefix,
char *varstring, int staticp,
struct ui_file *stream);
@@ -147,40 +147,40 @@ cp_type_print_derivation_info (struct ui_file *stream, struct type *type)
fputs_filtered (" ", stream);
}
}
+
/* Print the C++ method arguments ARGS to the file STREAM. */
static void
-cp_type_print_method_args (struct type **args, char *prefix, char *varstring,
+cp_type_print_method_args (struct type *mtype, char *prefix, char *varstring,
int staticp, struct ui_file *stream)
{
+ struct field *args = TYPE_FIELDS (mtype);
+ int nargs = TYPE_NFIELDS (mtype);
+ int varargs = TYPE_VARARGS (mtype);
int i;
fprintf_symbol_filtered (stream, prefix, language_cplus, DMGL_ANSI);
fprintf_symbol_filtered (stream, varstring, language_cplus, DMGL_ANSI);
fputs_filtered ("(", stream);
- if (args && args[!staticp] && TYPE_CODE (args[!staticp]) != TYPE_CODE_VOID)
+
+ /* Skip the class variable. */
+ i = staticp ? 0 : 1;
+ if (nargs > i)
{
- i = !staticp; /* skip the class variable */
- while (1)
+ while (i < nargs)
{
- type_print (args[i++], "", stream, 0);
- if (!args[i])
- {
- fprintf_filtered (stream, " ...");
- break;
- }
- else if (TYPE_CODE (args[i]) != TYPE_CODE_VOID)
- {
- fprintf_filtered (stream, ", ");
- }
- else
- break;
+ type_print (args[i++].type, "", stream, 0);
+
+ if (i == nargs && varargs)
+ fprintf_filtered (stream, ", ...");
+ else if (i < nargs)
+ fprintf_filtered (stream, ", ");
}
}
+ else if (varargs)
+ fprintf_filtered (stream, "...");
else if (current_language->la_language == language_cplus)
- {
- fprintf_filtered (stream, "void");
- }
+ fprintf_filtered (stream, "void");
fprintf_filtered (stream, ")");
}
@@ -336,39 +336,31 @@ static void
c_type_print_args (struct type *type, struct ui_file *stream)
{
int i;
- struct type **args;
+ struct field *args;
fprintf_filtered (stream, "(");
- args = TYPE_ARG_TYPES (type);
+ args = TYPE_FIELDS (type);
if (args != NULL)
{
- if (args[1] == NULL)
- {
- fprintf_filtered (stream, "...");
- }
- else if ((TYPE_CODE (args[1]) == TYPE_CODE_VOID) &&
- (current_language->la_language == language_cplus))
- {
- fprintf_filtered (stream, "void");
- }
- else
+ int i;
+
+ /* FIXME drow/2002-05-31: Always skips the first argument,
+ should we be checking for static members? */
+
+ for (i = 1; i < TYPE_NFIELDS (type); i++)
{
- for (i = 1;
- args[i] != NULL && TYPE_CODE (args[i]) != TYPE_CODE_VOID;
- i++)
+ c_print_type (args[i].type, "", stream, -1, 0);
+ if (i != TYPE_NFIELDS (type))
{
- c_print_type (args[i], "", stream, -1, 0);
- if (args[i + 1] == NULL)
- {
- fprintf_filtered (stream, "...");
- }
- else if (TYPE_CODE (args[i + 1]) != TYPE_CODE_VOID)
- {
- fprintf_filtered (stream, ",");
- wrap_here (" ");
- }
+ fprintf_filtered (stream, ",");
+ wrap_here (" ");
}
}
+ if (TYPE_VARARGS (type))
+ fprintf_filtered (stream, "...");
+ else if (i == 1
+ && (current_language->la_language == language_cplus))
+ fprintf_filtered (stream, "void");
}
else if (current_language->la_language == language_cplus)
{
@@ -1010,10 +1002,15 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show,
Let's try to reconstruct the function signature from
the symbol information */
if (!TYPE_FN_FIELD_STUB (f, j))
- cp_type_print_method_args (TYPE_FN_FIELD_ARGS (f, j), "",
- method_name,
- TYPE_FN_FIELD_STATIC_P (f, j),
- stream);
+ {
+ int staticp = TYPE_FN_FIELD_STATIC_P (f, j);
+ struct type *mtype = TYPE_FN_FIELD_TYPE (f, j);
+ cp_type_print_method_args (mtype,
+ "",
+ method_name,
+ staticp,
+ stream);
+ }
else
fprintf_filtered (stream, "<badly mangled name '%s'>",
mangled_name);
diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c
index e96a6f8e5f8..d588ec28cf8 100644
--- a/gdb/ch-exp.c
+++ b/gdb/ch-exp.c
@@ -1,2233 +1,2233 @@
-/* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*-
- Copyright 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Parse a Chill expression from text in a string,
- and return the result as a struct expression pointer.
- That structure contains arithmetic operations in reverse polish,
- with constants represented by operations that are followed by special data.
- See expression.h for the details of the format.
- What is important here is that it can be built up sequentially
- during the process of parsing; the lower levels of the tree always
- come first in the result.
-
- Note that the language accepted by this parser is more liberal
- than the one accepted by an actual Chill compiler. For example, the
- language rule that a simple name string can not be one of the reserved
- simple name strings is not enforced (e.g "case" is not treated as a
- reserved name). Another example is that Chill is a strongly typed
- language, and certain expressions that violate the type constraints
- may still be evaluated if gdb can do so in a meaningful manner, while
- such expressions would be rejected by the compiler. The reason for
- this more liberal behavior is the philosophy that the debugger
- is intended to be a tool that is used by the programmer when things
- go wrong, and as such, it should provide as few artificial barriers
- to it's use as possible. If it can do something meaningful, even
- something that violates language contraints that are enforced by the
- compiler, it should do so without complaint.
-
- */
-
-#include "defs.h"
-#include "gdb_string.h"
-#include <ctype.h>
-#include "expression.h"
-#include "language.h"
-#include "value.h"
-#include "parser-defs.h"
-#include "ch-lang.h"
-#include "bfd.h" /* Required by objfiles.h. */
-#include "symfile.h" /* Required by objfiles.h. */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
-
-#ifdef __GNUC__
-#define INLINE __inline__
-#endif
-
-typedef union
-
- {
- LONGEST lval;
- ULONGEST ulval;
- struct
- {
- LONGEST val;
- struct type *type;
- }
- typed_val;
- double dval;
- struct symbol *sym;
- struct type *tval;
- struct stoken sval;
- struct ttype tsym;
- struct symtoken ssym;
- }
-YYSTYPE;
-
-enum ch_terminal
- {
- END_TOKEN = 0,
- /* '\001' ... '\xff' come first. */
- OPEN_PAREN = '(',
- TOKEN_NOT_READ = 999,
- INTEGER_LITERAL,
- BOOLEAN_LITERAL,
- CHARACTER_LITERAL,
- FLOAT_LITERAL,
- GENERAL_PROCEDURE_NAME,
- LOCATION_NAME,
- EMPTINESS_LITERAL,
- CHARACTER_STRING_LITERAL,
- BIT_STRING_LITERAL,
- TYPENAME,
- DOT_FIELD_NAME, /* '.' followed by <field name> */
- CASE,
- OF,
- ESAC,
- LOGIOR,
- ORIF,
- LOGXOR,
- LOGAND,
- ANDIF,
- NOTEQUAL,
- GEQ,
- LEQ,
- IN,
- SLASH_SLASH,
- MOD,
- REM,
- NOT,
- POINTER,
- RECEIVE,
- UP,
- IF,
- THEN,
- ELSE,
- FI,
- ELSIF,
- ILLEGAL_TOKEN,
- NUM,
- PRED,
- SUCC,
- ABS,
- CARD,
- MAX_TOKEN,
- MIN_TOKEN,
- ADDR_TOKEN,
- SIZE,
- UPPER,
- LOWER,
- LENGTH,
- ARRAY,
- GDB_VARIABLE,
- GDB_ASSIGNMENT
- };
-
-/* Forward declarations. */
-
-static void write_lower_upper_value (enum exp_opcode, struct type *);
-static enum ch_terminal match_bitstring_literal (void);
-static enum ch_terminal match_integer_literal (void);
-static enum ch_terminal match_character_literal (void);
-static enum ch_terminal match_string_literal (void);
-static enum ch_terminal match_float_literal (void);
-static int decode_integer_literal (LONGEST *, char **);
-static int decode_integer_value (int, char **, LONGEST *);
-static char *match_simple_name_string (void);
-static void growbuf_by_size (int);
-static void parse_case_label (void);
-static void parse_untyped_expr (void);
-static void parse_if_expression (void);
-static void parse_if_expression_body (void);
-static void parse_else_alternative (void);
-static void parse_then_alternative (void);
-static void parse_expr (void);
-static void parse_operand0 (void);
-static void parse_operand1 (void);
-static void parse_operand2 (void);
-static void parse_operand3 (void);
-static void parse_operand4 (void);
-static void parse_operand5 (void);
-static void parse_operand6 (void);
-static void parse_primval (void);
-static void parse_tuple (struct type *);
-static void parse_opt_element_list (struct type *);
-static void parse_tuple_element (struct type *);
-static void parse_named_record_element (void);
-static void parse_call (void);
-static struct type *parse_mode_or_normal_call (void);
-#if 0
-static struct type *parse_mode_call (void);
-#endif
-static void parse_unary_call (void);
-static int parse_opt_untyped_expr (void);
-static int expect (enum ch_terminal, char *);
-static enum ch_terminal ch_lex (void);
-INLINE static enum ch_terminal PEEK_TOKEN (void);
-static enum ch_terminal peek_token_ (int);
-static void forward_token_ (void);
-static void require (enum ch_terminal);
-static int check_token (enum ch_terminal);
-
-#define MAX_LOOK_AHEAD 2
-static enum ch_terminal terminal_buffer[MAX_LOOK_AHEAD + 1] =
-{
- TOKEN_NOT_READ, TOKEN_NOT_READ, TOKEN_NOT_READ};
-static YYSTYPE yylval;
-static YYSTYPE val_buffer[MAX_LOOK_AHEAD + 1];
-
-/*int current_token, lookahead_token; */
-
-INLINE static enum ch_terminal
-PEEK_TOKEN (void)
-{
- if (terminal_buffer[0] == TOKEN_NOT_READ)
- {
- terminal_buffer[0] = ch_lex ();
- val_buffer[0] = yylval;
- }
- return terminal_buffer[0];
-}
-#define PEEK_LVAL() val_buffer[0]
-#define PEEK_TOKEN1() peek_token_(1)
-#define PEEK_TOKEN2() peek_token_(2)
-static enum ch_terminal
-peek_token_ (int i)
-{
- if (i > MAX_LOOK_AHEAD)
- internal_error (__FILE__, __LINE__,
- "too much lookahead");
- if (terminal_buffer[i] == TOKEN_NOT_READ)
- {
- terminal_buffer[i] = ch_lex ();
- val_buffer[i] = yylval;
- }
- return terminal_buffer[i];
-}
-
-#if 0
-
-static void
-pushback_token (enum ch_terminal code, YYSTYPE node)
-{
- int i;
- if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
- internal_error (__FILE__, __LINE__,
- "cannot pushback token");
- for (i = MAX_LOOK_AHEAD; i > 0; i--)
- {
- terminal_buffer[i] = terminal_buffer[i - 1];
- val_buffer[i] = val_buffer[i - 1];
- }
- terminal_buffer[0] = code;
- val_buffer[0] = node;
-}
-
-#endif
-
-static void
-forward_token_ (void)
-{
- int i;
- for (i = 0; i < MAX_LOOK_AHEAD; i++)
- {
- terminal_buffer[i] = terminal_buffer[i + 1];
- val_buffer[i] = val_buffer[i + 1];
- }
- terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ;
-}
-#define FORWARD_TOKEN() forward_token_()
-
-/* Skip the next token.
- if it isn't TOKEN, the parser is broken. */
-
-static void
-require (enum ch_terminal token)
-{
- if (PEEK_TOKEN () != token)
- {
- internal_error (__FILE__, __LINE__,
- "expected token %d", (int) token);
- }
- FORWARD_TOKEN ();
-}
-
-static int
-check_token (enum ch_terminal token)
-{
- if (PEEK_TOKEN () != token)
- return 0;
- FORWARD_TOKEN ();
- return 1;
-}
-
-/* return 0 if expected token was not found,
- else return 1.
- */
-static int
-expect (enum ch_terminal token, char *message)
-{
- if (PEEK_TOKEN () != token)
- {
- if (message)
- error (message);
- else if (token < 256)
- error ("syntax error - expected a '%c' here \"%s\"", token, lexptr);
- else
- error ("syntax error");
- return 0;
- }
- else
- FORWARD_TOKEN ();
- return 1;
-}
-
-#if 0
-/* Parse a name string. If ALLOW_ALL is 1, ALL is allowed as a postfix. */
-
-static tree
-parse_opt_name_string (int allow_all)
-{
- int token = PEEK_TOKEN ();
- tree name;
- if (token != NAME)
- {
- if (token == ALL && allow_all)
- {
- FORWARD_TOKEN ();
- return ALL_POSTFIX;
- }
- return NULL_TREE;
- }
- name = PEEK_LVAL ();
- for (;;)
- {
- FORWARD_TOKEN ();
- token = PEEK_TOKEN ();
- if (token != '!')
- return name;
- FORWARD_TOKEN ();
- token = PEEK_TOKEN ();
- if (token == ALL && allow_all)
- return get_identifier3 (IDENTIFIER_POINTER (name), "!", "*");
- if (token != NAME)
- {
- if (pass == 1)
- error ("'%s!' is not followed by an identifier",
- IDENTIFIER_POINTER (name));
- return name;
- }
- name = get_identifier3 (IDENTIFIER_POINTER (name),
- "!", IDENTIFIER_POINTER (PEEK_LVAL ()));
- }
-}
-
-static tree
-parse_simple_name_string (void)
-{
- int token = PEEK_TOKEN ();
- tree name;
- if (token != NAME)
- {
- error ("expected a name here");
- return error_mark_node;
- }
- name = PEEK_LVAL ();
- FORWARD_TOKEN ();
- return name;
-}
-
-static tree
-parse_name_string (void)
-{
- tree name = parse_opt_name_string (0);
- if (name)
- return name;
- if (pass == 1)
- error ("expected a name string here");
- return error_mark_node;
-}
-
-/* Matches: <name_string>
- Returns if pass 1: the identifier.
- Returns if pass 2: a decl or value for identifier. */
-
-static tree
-parse_name (void)
-{
- tree name = parse_name_string ();
- if (pass == 1 || ignoring)
- return name;
- else
- {
- tree decl = lookup_name (name);
- if (decl == NULL_TREE)
- {
- error ("`%s' undeclared", IDENTIFIER_POINTER (name));
- return error_mark_node;
- }
- else if (TREE_CODE (TREE_TYPE (decl)) == ERROR_MARK)
- return error_mark_node;
- else if (TREE_CODE (decl) == CONST_DECL)
- return DECL_INITIAL (decl);
- else if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE)
- return convert_from_reference (decl);
- else
- return decl;
- }
-}
-#endif
-
-#if 0
-static void
-pushback_paren_expr (tree expr)
-{
- if (pass == 1 && !ignoring)
- expr = build1 (PAREN_EXPR, NULL_TREE, expr);
- pushback_token (EXPR, expr);
-}
-#endif
-
-/* Matches: <case label> */
-
-static void
-parse_case_label (void)
-{
- if (check_token (ELSE))
- error ("ELSE in tuples labels not implemented");
- /* Does not handle the case of a mode name. FIXME */
- parse_expr ();
- if (check_token (':'))
- {
- parse_expr ();
- write_exp_elt_opcode (BINOP_RANGE);
- }
-}
-
-static int
-parse_opt_untyped_expr (void)
-{
- switch (PEEK_TOKEN ())
- {
- case ',':
- case ':':
- case ')':
- return 0;
- default:
- parse_untyped_expr ();
- return 1;
- }
-}
-
-static void
-parse_unary_call (void)
-{
- FORWARD_TOKEN ();
- expect ('(', NULL);
- parse_expr ();
- expect (')', NULL);
-}
-
-/* Parse NAME '(' MODENAME ')'. */
-
-#if 0
-
-static struct type *
-parse_mode_call (void)
-{
- struct type *type;
- FORWARD_TOKEN ();
- expect ('(', NULL);
- if (PEEK_TOKEN () != TYPENAME)
- error ("expect MODENAME here `%s'", lexptr);
- type = PEEK_LVAL ().tsym.type;
- FORWARD_TOKEN ();
- expect (')', NULL);
- return type;
-}
-
-#endif
-
-static struct type *
-parse_mode_or_normal_call (void)
-{
- struct type *type;
- FORWARD_TOKEN ();
- expect ('(', NULL);
- if (PEEK_TOKEN () == TYPENAME)
- {
- type = PEEK_LVAL ().tsym.type;
- FORWARD_TOKEN ();
- }
- else
- {
- parse_expr ();
- type = NULL;
- }
- expect (')', NULL);
- return type;
-}
-
-/* Parse something that looks like a function call.
- Assume we have parsed the function, and are at the '('. */
-
-static void
-parse_call (void)
-{
- int arg_count;
- require ('(');
- /* This is to save the value of arglist_len
- being accumulated for each dimension. */
- start_arglist ();
- if (parse_opt_untyped_expr ())
- {
- int tok = PEEK_TOKEN ();
- arglist_len = 1;
- if (tok == UP || tok == ':')
- {
- FORWARD_TOKEN ();
- parse_expr ();
- expect (')', "expected ')' to terminate slice");
- end_arglist ();
- write_exp_elt_opcode (tok == UP ? TERNOP_SLICE_COUNT
- : TERNOP_SLICE);
- return;
- }
- while (check_token (','))
- {
- parse_untyped_expr ();
- arglist_len++;
- }
- }
- else
- arglist_len = 0;
- expect (')', NULL);
- arg_count = end_arglist ();
- write_exp_elt_opcode (MULTI_SUBSCRIPT);
- write_exp_elt_longcst (arg_count);
- write_exp_elt_opcode (MULTI_SUBSCRIPT);
-}
-
-static void
-parse_named_record_element (void)
-{
- struct stoken label;
- char buf[256];
-
- label = PEEK_LVAL ().sval;
- sprintf (buf, "expected a field name here `%s'", lexptr);
- expect (DOT_FIELD_NAME, buf);
- if (check_token (','))
- parse_named_record_element ();
- else if (check_token (':'))
- parse_expr ();
- else
- error ("syntax error near `%s' in named record tuple element", lexptr);
- write_exp_elt_opcode (OP_LABELED);
- write_exp_string (label);
- write_exp_elt_opcode (OP_LABELED);
-}
-
-/* Returns one or more TREE_LIST nodes, in reverse order. */
-
-static void
-parse_tuple_element (struct type *type)
-{
- if (PEEK_TOKEN () == DOT_FIELD_NAME)
- {
- /* Parse a labelled structure tuple. */
- parse_named_record_element ();
- return;
- }
-
- if (check_token ('('))
- {
- if (check_token ('*'))
- {
- expect (')', "missing ')' after '*' case label list");
- if (type)
- {
- if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
- {
- /* do this as a range from low to high */
- struct type *range_type = TYPE_FIELD_TYPE (type, 0);
- LONGEST low_bound, high_bound;
- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
- error ("cannot determine bounds for (*)");
- /* lower bound */
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (range_type);
- write_exp_elt_longcst (low_bound);
- write_exp_elt_opcode (OP_LONG);
- /* upper bound */
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (range_type);
- write_exp_elt_longcst (high_bound);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_opcode (BINOP_RANGE);
- }
- else
- error ("(*) in invalid context");
- }
- else
- error ("(*) only possible with modename in front of tuple (mode[..])");
- }
- else
- {
- parse_case_label ();
- while (check_token (','))
- {
- parse_case_label ();
- write_exp_elt_opcode (BINOP_COMMA);
- }
- expect (')', NULL);
- }
- }
- else
- parse_untyped_expr ();
- if (check_token (':'))
- {
- /* A powerset range or a labeled Array. */
- parse_untyped_expr ();
- write_exp_elt_opcode (BINOP_RANGE);
- }
-}
-
-/* Matches: a COMMA-separated list of tuple elements.
- Returns a list (of TREE_LIST nodes). */
-static void
-parse_opt_element_list (struct type *type)
-{
- arglist_len = 0;
- if (PEEK_TOKEN () == ']')
- return;
- for (;;)
- {
- parse_tuple_element (type);
- arglist_len++;
- if (PEEK_TOKEN () == ']')
- break;
- if (!check_token (','))
- error ("bad syntax in tuple");
- }
-}
-
-/* Parses: '[' elements ']'
- If modename is non-NULL it prefixed the tuple. */
-
-static void
-parse_tuple (struct type *mode)
-{
- struct type *type;
- if (mode)
- type = check_typedef (mode);
- else
- type = 0;
- require ('[');
- start_arglist ();
- parse_opt_element_list (type);
- expect (']', "missing ']' after tuple");
- write_exp_elt_opcode (OP_ARRAY);
- write_exp_elt_longcst ((LONGEST) 0);
- write_exp_elt_longcst ((LONGEST) end_arglist () - 1);
- write_exp_elt_opcode (OP_ARRAY);
- if (type)
- {
- if (TYPE_CODE (type) != TYPE_CODE_ARRAY
- && TYPE_CODE (type) != TYPE_CODE_STRUCT
- && TYPE_CODE (type) != TYPE_CODE_SET)
- error ("invalid tuple mode");
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (mode);
- write_exp_elt_opcode (UNOP_CAST);
- }
-}
-
-static void
-parse_primval (void)
-{
- struct type *type;
- enum exp_opcode op;
- char *op_name;
- switch (PEEK_TOKEN ())
- {
- case INTEGER_LITERAL:
- case CHARACTER_LITERAL:
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (PEEK_LVAL ().typed_val.type);
- write_exp_elt_longcst (PEEK_LVAL ().typed_val.val);
- write_exp_elt_opcode (OP_LONG);
- FORWARD_TOKEN ();
- break;
- case BOOLEAN_LITERAL:
- write_exp_elt_opcode (OP_BOOL);
- write_exp_elt_longcst ((LONGEST) PEEK_LVAL ().ulval);
- write_exp_elt_opcode (OP_BOOL);
- FORWARD_TOKEN ();
- break;
- case FLOAT_LITERAL:
- write_exp_elt_opcode (OP_DOUBLE);
- write_exp_elt_type (builtin_type_double);
- write_exp_elt_dblcst (PEEK_LVAL ().dval);
- write_exp_elt_opcode (OP_DOUBLE);
- FORWARD_TOKEN ();
- break;
- case EMPTINESS_LITERAL:
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (lookup_pointer_type (builtin_type_void));
- write_exp_elt_longcst (0);
- write_exp_elt_opcode (OP_LONG);
- FORWARD_TOKEN ();
- break;
- case CHARACTER_STRING_LITERAL:
- write_exp_elt_opcode (OP_STRING);
- write_exp_string (PEEK_LVAL ().sval);
- write_exp_elt_opcode (OP_STRING);
- FORWARD_TOKEN ();
- break;
- case BIT_STRING_LITERAL:
- write_exp_elt_opcode (OP_BITSTRING);
- write_exp_bitstring (PEEK_LVAL ().sval);
- write_exp_elt_opcode (OP_BITSTRING);
- FORWARD_TOKEN ();
- break;
- case ARRAY:
- FORWARD_TOKEN ();
- /* This is pseudo-Chill, similar to C's '(TYPE[])EXPR'
- which casts to an artificial array. */
- expect ('(', NULL);
- expect (')', NULL);
- if (PEEK_TOKEN () != TYPENAME)
- error ("missing MODENAME after ARRAY()");
- type = PEEK_LVAL ().tsym.type;
- FORWARD_TOKEN ();
- expect ('(', NULL);
- parse_expr ();
- expect (')', "missing right parenthesis");
- type = create_array_type ((struct type *) NULL, type,
- create_range_type ((struct type *) NULL,
- builtin_type_int, 0, 0));
- TYPE_ARRAY_UPPER_BOUND_TYPE (type) = BOUND_CANNOT_BE_DETERMINED;
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (type);
- write_exp_elt_opcode (UNOP_CAST);
- break;
-#if 0
- case CONST:
- case EXPR:
- val = PEEK_LVAL ();
- FORWARD_TOKEN ();
- break;
-#endif
- case '(':
- FORWARD_TOKEN ();
- parse_expr ();
- expect (')', "missing right parenthesis");
- break;
- case '[':
- parse_tuple (NULL);
- break;
- case GENERAL_PROCEDURE_NAME:
- case LOCATION_NAME:
- write_exp_elt_opcode (OP_VAR_VALUE);
- write_exp_elt_block (NULL);
- write_exp_elt_sym (PEEK_LVAL ().ssym.sym);
- write_exp_elt_opcode (OP_VAR_VALUE);
- FORWARD_TOKEN ();
- break;
- case GDB_VARIABLE: /* gdb specific */
- FORWARD_TOKEN ();
- break;
- case NUM:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (builtin_type_int);
- write_exp_elt_opcode (UNOP_CAST);
- break;
- case CARD:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_CARD);
- break;
- case MAX_TOKEN:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_CHMAX);
- break;
- case MIN_TOKEN:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_CHMIN);
- break;
- case PRED:
- op_name = "PRED";
- goto unimplemented_unary_builtin;
- case SUCC:
- op_name = "SUCC";
- goto unimplemented_unary_builtin;
- case ABS:
- op_name = "ABS";
- goto unimplemented_unary_builtin;
- unimplemented_unary_builtin:
- parse_unary_call ();
- error ("not implemented: %s builtin function", op_name);
- break;
- case ADDR_TOKEN:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_ADDR);
- break;
- case SIZE:
- type = parse_mode_or_normal_call ();
- if (type)
- {
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (builtin_type_int);
- CHECK_TYPEDEF (type);
- write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (type));
- write_exp_elt_opcode (OP_LONG);
- }
- else
- write_exp_elt_opcode (UNOP_SIZEOF);
- break;
- case LOWER:
- op = UNOP_LOWER;
- goto lower_upper;
- case UPPER:
- op = UNOP_UPPER;
- goto lower_upper;
- lower_upper:
- type = parse_mode_or_normal_call ();
- write_lower_upper_value (op, type);
- break;
- case LENGTH:
- parse_unary_call ();
- write_exp_elt_opcode (UNOP_LENGTH);
- break;
- case TYPENAME:
- type = PEEK_LVAL ().tsym.type;
- FORWARD_TOKEN ();
- switch (PEEK_TOKEN ())
- {
- case '[':
- parse_tuple (type);
- break;
- case '(':
- FORWARD_TOKEN ();
- parse_expr ();
- expect (')', "missing right parenthesis");
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (type);
- write_exp_elt_opcode (UNOP_CAST);
- break;
- default:
- error ("typename in invalid context");
- }
- break;
-
- default:
- error ("invalid expression syntax at `%s'", lexptr);
- }
- for (;;)
- {
- switch (PEEK_TOKEN ())
- {
- case DOT_FIELD_NAME:
- write_exp_elt_opcode (STRUCTOP_STRUCT);
- write_exp_string (PEEK_LVAL ().sval);
- write_exp_elt_opcode (STRUCTOP_STRUCT);
- FORWARD_TOKEN ();
- continue;
- case POINTER:
- FORWARD_TOKEN ();
- if (PEEK_TOKEN () == TYPENAME)
- {
- type = PEEK_LVAL ().tsym.type;
- write_exp_elt_opcode (UNOP_CAST);
- write_exp_elt_type (lookup_pointer_type (type));
- write_exp_elt_opcode (UNOP_CAST);
- FORWARD_TOKEN ();
- }
- write_exp_elt_opcode (UNOP_IND);
- continue;
- case OPEN_PAREN:
- parse_call ();
- continue;
- case CHARACTER_STRING_LITERAL:
- case CHARACTER_LITERAL:
- case BIT_STRING_LITERAL:
- /* Handle string repetition. (See comment in parse_operand5.) */
- parse_primval ();
- write_exp_elt_opcode (MULTI_SUBSCRIPT);
- write_exp_elt_longcst (1);
- write_exp_elt_opcode (MULTI_SUBSCRIPT);
- continue;
- case END_TOKEN:
- case TOKEN_NOT_READ:
- case INTEGER_LITERAL:
- case BOOLEAN_LITERAL:
- case FLOAT_LITERAL:
- case GENERAL_PROCEDURE_NAME:
- case LOCATION_NAME:
- case EMPTINESS_LITERAL:
- case TYPENAME:
- case CASE:
- case OF:
- case ESAC:
- case LOGIOR:
- case ORIF:
- case LOGXOR:
- case LOGAND:
- case ANDIF:
- case NOTEQUAL:
- case GEQ:
- case LEQ:
- case IN:
- case SLASH_SLASH:
- case MOD:
- case REM:
- case NOT:
- case RECEIVE:
- case UP:
- case IF:
- case THEN:
- case ELSE:
- case FI:
- case ELSIF:
- case ILLEGAL_TOKEN:
- case NUM:
- case PRED:
- case SUCC:
- case ABS:
- case CARD:
- case MAX_TOKEN:
- case MIN_TOKEN:
- case ADDR_TOKEN:
- case SIZE:
- case UPPER:
- case LOWER:
- case LENGTH:
- case ARRAY:
- case GDB_VARIABLE:
- case GDB_ASSIGNMENT:
- break;
- }
- break;
- }
- return;
-}
-
-static void
-parse_operand6 (void)
-{
- if (check_token (RECEIVE))
- {
- parse_primval ();
- error ("not implemented: RECEIVE expression");
- }
- else if (check_token (POINTER))
- {
- parse_primval ();
- write_exp_elt_opcode (UNOP_ADDR);
- }
- else
- parse_primval ();
-}
-
-static void
-parse_operand5 (void)
-{
- enum exp_opcode op;
- /* We are supposed to be looking for a <string repetition operator>,
- but in general we can't distinguish that from a parenthesized
- expression. This is especially difficult if we allow the
- string operand to be a constant expression (as requested by
- some users), and not just a string literal.
- Consider: LPRN expr RPRN LPRN expr RPRN
- Is that a function call or string repetition?
- Instead, we handle string repetition in parse_primval,
- and build_generalized_call. */
- switch (PEEK_TOKEN ())
- {
- case NOT:
- op = UNOP_LOGICAL_NOT;
- break;
- case '-':
- op = UNOP_NEG;
- break;
- default:
- op = OP_NULL;
- }
- if (op != OP_NULL)
- FORWARD_TOKEN ();
- parse_operand6 ();
- if (op != OP_NULL)
- write_exp_elt_opcode (op);
-}
-
-static void
-parse_operand4 (void)
-{
- enum exp_opcode op;
- parse_operand5 ();
- for (;;)
- {
- switch (PEEK_TOKEN ())
- {
- case '*':
- op = BINOP_MUL;
- break;
- case '/':
- op = BINOP_DIV;
- break;
- case MOD:
- op = BINOP_MOD;
- break;
- case REM:
- op = BINOP_REM;
- break;
- default:
- return;
- }
- FORWARD_TOKEN ();
- parse_operand5 ();
- write_exp_elt_opcode (op);
- }
-}
-
-static void
-parse_operand3 (void)
-{
- enum exp_opcode op;
- parse_operand4 ();
- for (;;)
- {
- switch (PEEK_TOKEN ())
- {
- case '+':
- op = BINOP_ADD;
- break;
- case '-':
- op = BINOP_SUB;
- break;
- case SLASH_SLASH:
- op = BINOP_CONCAT;
- break;
- default:
- return;
- }
- FORWARD_TOKEN ();
- parse_operand4 ();
- write_exp_elt_opcode (op);
- }
-}
-
-static void
-parse_operand2 (void)
-{
- enum exp_opcode op;
- parse_operand3 ();
- for (;;)
- {
- if (check_token (IN))
- {
- parse_operand3 ();
- write_exp_elt_opcode (BINOP_IN);
- }
- else
- {
- switch (PEEK_TOKEN ())
- {
- case '>':
- op = BINOP_GTR;
- break;
- case GEQ:
- op = BINOP_GEQ;
- break;
- case '<':
- op = BINOP_LESS;
- break;
- case LEQ:
- op = BINOP_LEQ;
- break;
- case '=':
- op = BINOP_EQUAL;
- break;
- case NOTEQUAL:
- op = BINOP_NOTEQUAL;
- break;
- default:
- return;
- }
- FORWARD_TOKEN ();
- parse_operand3 ();
- write_exp_elt_opcode (op);
- }
- }
-}
-
-static void
-parse_operand1 (void)
-{
- enum exp_opcode op;
- parse_operand2 ();
- for (;;)
- {
- switch (PEEK_TOKEN ())
- {
- case LOGAND:
- op = BINOP_BITWISE_AND;
- break;
- case ANDIF:
- op = BINOP_LOGICAL_AND;
- break;
- default:
- return;
- }
- FORWARD_TOKEN ();
- parse_operand2 ();
- write_exp_elt_opcode (op);
- }
-}
-
-static void
-parse_operand0 (void)
-{
- enum exp_opcode op;
- parse_operand1 ();
- for (;;)
- {
- switch (PEEK_TOKEN ())
- {
- case LOGIOR:
- op = BINOP_BITWISE_IOR;
- break;
- case LOGXOR:
- op = BINOP_BITWISE_XOR;
- break;
- case ORIF:
- op = BINOP_LOGICAL_OR;
- break;
- default:
- return;
- }
- FORWARD_TOKEN ();
- parse_operand1 ();
- write_exp_elt_opcode (op);
- }
-}
-
-static void
-parse_expr (void)
-{
- parse_operand0 ();
- if (check_token (GDB_ASSIGNMENT))
- {
- parse_expr ();
- write_exp_elt_opcode (BINOP_ASSIGN);
- }
-}
-
-static void
-parse_then_alternative (void)
-{
- expect (THEN, "missing 'THEN' in 'IF' expression");
- parse_expr ();
-}
-
-static void
-parse_else_alternative (void)
-{
- if (check_token (ELSIF))
- parse_if_expression_body ();
- else if (check_token (ELSE))
- parse_expr ();
- else
- error ("missing ELSE/ELSIF in IF expression");
-}
-
-/* Matches: <boolean expression> <then alternative> <else alternative> */
-
-static void
-parse_if_expression_body (void)
-{
- parse_expr ();
- parse_then_alternative ();
- parse_else_alternative ();
- write_exp_elt_opcode (TERNOP_COND);
-}
-
-static void
-parse_if_expression (void)
-{
- require (IF);
- parse_if_expression_body ();
- expect (FI, "missing 'FI' at end of conditional expression");
-}
-
-/* An <untyped_expr> is a superset of <expr>. It also includes
- <conditional expressions> and untyped <tuples>, whose types
- are not given by their constituents. Hence, these are only
- allowed in certain contexts that expect a certain type.
- You should call convert() to fix up the <untyped_expr>. */
-
-static void
-parse_untyped_expr (void)
-{
- switch (PEEK_TOKEN ())
- {
- case IF:
- parse_if_expression ();
- return;
- case CASE:
- error ("not implemented: CASE expression");
- case '(':
- switch (PEEK_TOKEN1 ())
- {
- case IF:
- case CASE:
- goto skip_lprn;
- case '[':
- skip_lprn:
- FORWARD_TOKEN ();
- parse_untyped_expr ();
- expect (')', "missing ')'");
- return;
- default:;
- /* fall through */
- }
- default:
- parse_operand0 ();
- }
-}
-
-int
-chill_parse (void)
-{
- terminal_buffer[0] = TOKEN_NOT_READ;
- if (PEEK_TOKEN () == TYPENAME && PEEK_TOKEN1 () == END_TOKEN)
- {
- write_exp_elt_opcode (OP_TYPE);
- write_exp_elt_type (PEEK_LVAL ().tsym.type);
- write_exp_elt_opcode (OP_TYPE);
- FORWARD_TOKEN ();
- }
- else
- parse_expr ();
- if (terminal_buffer[0] != END_TOKEN)
- {
- if (comma_terminates && terminal_buffer[0] == ',')
- lexptr--; /* Put the comma back. */
- else
- error ("Junk after end of expression.");
- }
- return 0;
-}
-
-
-/* Implementation of a dynamically expandable buffer for processing input
- characters acquired through lexptr and building a value to return in
- yylval. */
-
-static char *tempbuf; /* Current buffer contents */
-static int tempbufsize; /* Size of allocated buffer */
-static int tempbufindex; /* Current index into buffer */
-
-#define GROWBY_MIN_SIZE 64 /* Minimum amount to grow buffer by */
-
-#define CHECKBUF(size) \
- do { \
- if (tempbufindex + (size) >= tempbufsize) \
- { \
- growbuf_by_size (size); \
- } \
- } while (0);
-
-/* Grow the static temp buffer if necessary, including allocating the first one
- on demand. */
-
-static void
-growbuf_by_size (int count)
-{
- int growby;
-
- growby = max (count, GROWBY_MIN_SIZE);
- tempbufsize += growby;
- if (tempbuf == NULL)
- {
- tempbuf = (char *) xmalloc (tempbufsize);
- }
- else
- {
- tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
- }
-}
-
-/* Try to consume a simple name string token. If successful, returns
- a pointer to a nullbyte terminated copy of the name that can be used
- in symbol table lookups. If not successful, returns NULL. */
-
-static char *
-match_simple_name_string (void)
-{
- char *tokptr = lexptr;
-
- if (isalpha (*tokptr) || *tokptr == '_')
- {
- char *result;
- do
- {
- tokptr++;
- }
- while (isalnum (*tokptr) || (*tokptr == '_'));
- yylval.sval.ptr = lexptr;
- yylval.sval.length = tokptr - lexptr;
- lexptr = tokptr;
- result = copy_name (yylval.sval);
- return result;
- }
- return (NULL);
-}
-
-/* Start looking for a value composed of valid digits as set by the base
- in use. Note that '_' characters are valid anywhere, in any quantity,
- and are simply ignored. Since we must find at least one valid digit,
- or reject this token as an integer literal, we keep track of how many
- digits we have encountered. */
-
-static int
-decode_integer_value (int base, char **tokptrptr, LONGEST *ivalptr)
-{
- char *tokptr = *tokptrptr;
- int temp;
- int digits = 0;
-
- while (*tokptr != '\0')
- {
- temp = *tokptr;
- if (isupper (temp))
- temp = tolower (temp);
- tokptr++;
- switch (temp)
- {
- case '_':
- continue;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- temp -= '0';
- break;
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- temp -= 'a';
- temp += 10;
- break;
- default:
- temp = base;
- break;
- }
- if (temp < base)
- {
- digits++;
- *ivalptr *= base;
- *ivalptr += temp;
- }
- else
- {
- /* Found something not in domain for current base. */
- tokptr--; /* Unconsume what gave us indigestion. */
- break;
- }
- }
-
- /* If we didn't find any digits, then we don't have a valid integer
- value, so reject the entire token. Otherwise, update the lexical
- scan pointer, and return non-zero for success. */
-
- if (digits == 0)
- {
- return (0);
- }
- else
- {
- *tokptrptr = tokptr;
- return (1);
- }
-}
-
-static int
-decode_integer_literal (LONGEST *valptr, char **tokptrptr)
-{
- char *tokptr = *tokptrptr;
- int base = 0;
- LONGEST ival = 0;
- int explicit_base = 0;
-
- /* Look for an explicit base specifier, which is optional. */
-
- switch (*tokptr)
- {
- case 'd':
- case 'D':
- explicit_base++;
- base = 10;
- tokptr++;
- break;
- case 'b':
- case 'B':
- explicit_base++;
- base = 2;
- tokptr++;
- break;
- case 'h':
- case 'H':
- explicit_base++;
- base = 16;
- tokptr++;
- break;
- case 'o':
- case 'O':
- explicit_base++;
- base = 8;
- tokptr++;
- break;
- default:
- base = 10;
- break;
- }
-
- /* If we found an explicit base ensure that the character after the
- explicit base is a single quote. */
-
- if (explicit_base && (*tokptr++ != '\''))
- {
- return (0);
- }
-
- /* Attempt to decode whatever follows as an integer value in the
- indicated base, updating the token pointer in the process and
- computing the value into ival. Also, if we have an explicit
- base, then the next character must not be a single quote, or we
- have a bitstring literal, so reject the entire token in this case.
- Otherwise, update the lexical scan pointer, and return non-zero
- for success. */
-
- if (!decode_integer_value (base, &tokptr, &ival))
- {
- return (0);
- }
- else if (explicit_base && (*tokptr == '\''))
- {
- return (0);
- }
- else
- {
- *valptr = ival;
- *tokptrptr = tokptr;
- return (1);
- }
-}
-
-/* If it wasn't for the fact that floating point values can contain '_'
- characters, we could just let strtod do all the hard work by letting it
- try to consume as much of the current token buffer as possible and
- find a legal conversion. Unfortunately we need to filter out the '_'
- characters before calling strtod, which we do by copying the other
- legal chars to a local buffer to be converted. However since we also
- need to keep track of where the last unconsumed character in the input
- buffer is, we have transfer only as many characters as may compose a
- legal floating point value. */
-
-static enum ch_terminal
-match_float_literal (void)
-{
- char *tokptr = lexptr;
- char *buf;
- char *copy;
- double dval;
- extern double strtod ();
-
- /* Make local buffer in which to build the string to convert. This is
- required because underscores are valid in chill floating point numbers
- but not in the string passed to strtod to convert. The string will be
- no longer than our input string. */
-
- copy = buf = (char *) alloca (strlen (tokptr) + 1);
-
- /* Transfer all leading digits to the conversion buffer, discarding any
- underscores. */
-
- while (isdigit (*tokptr) || *tokptr == '_')
- {
- if (*tokptr != '_')
- {
- *copy++ = *tokptr;
- }
- tokptr++;
- }
-
- /* Now accept either a '.', or one of [eEdD]. Dot is legal regardless
- of whether we found any leading digits, and we simply accept it and
- continue on to look for the fractional part and/or exponent. One of
- [eEdD] is legal only if we have seen digits, and means that there
- is no fractional part. If we find neither of these, then this is
- not a floating point number, so return failure. */
-
- switch (*tokptr++)
- {
- case '.':
- /* Accept and then look for fractional part and/or exponent. */
- *copy++ = '.';
- break;
-
- case 'e':
- case 'E':
- case 'd':
- case 'D':
- if (copy == buf)
- {
- return (0);
- }
- *copy++ = 'e';
- goto collect_exponent;
- break;
-
- default:
- return (0);
- break;
- }
-
- /* We found a '.', copy any fractional digits to the conversion buffer, up
- to the first nondigit, non-underscore character. */
-
- while (isdigit (*tokptr) || *tokptr == '_')
- {
- if (*tokptr != '_')
- {
- *copy++ = *tokptr;
- }
- tokptr++;
- }
-
- /* Look for an exponent, which must start with one of [eEdD]. If none
- is found, jump directly to trying to convert what we have collected
- so far. */
-
- switch (*tokptr)
- {
- case 'e':
- case 'E':
- case 'd':
- case 'D':
- *copy++ = 'e';
- tokptr++;
- break;
- default:
- goto convert_float;
- break;
- }
-
- /* Accept an optional '-' or '+' following one of [eEdD]. */
-
-collect_exponent:
- if (*tokptr == '+' || *tokptr == '-')
- {
- *copy++ = *tokptr++;
- }
-
- /* Now copy an exponent into the conversion buffer. Note that at the
- moment underscores are *not* allowed in exponents. */
-
- while (isdigit (*tokptr))
- {
- *copy++ = *tokptr++;
- }
-
- /* If we transfered any chars to the conversion buffer, try to interpret its
- contents as a floating point value. If any characters remain, then we
- must not have a valid floating point string. */
-
-convert_float:
- *copy = '\0';
- if (copy != buf)
- {
- dval = strtod (buf, &copy);
- if (*copy == '\0')
- {
- yylval.dval = dval;
- lexptr = tokptr;
- return (FLOAT_LITERAL);
- }
- }
- return (0);
-}
-
-/* Recognize a string literal. A string literal is a sequence
- of characters enclosed in matching single or double quotes, except that
- a single character inside single quotes is a character literal, which
- we reject as a string literal. To embed the terminator character inside
- a string, it is simply doubled (I.E. "this""is""one""string") */
-
-static enum ch_terminal
-match_string_literal (void)
-{
- char *tokptr = lexptr;
- int in_ctrlseq = 0;
- LONGEST ival;
-
- for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
- {
- CHECKBUF (1);
- tryagain:;
- if (in_ctrlseq)
- {
- /* skip possible whitespaces */
- while ((*tokptr == ' ' || *tokptr == '\t') && *tokptr)
- tokptr++;
- if (*tokptr == ')')
- {
- in_ctrlseq = 0;
- tokptr++;
- goto tryagain;
- }
- else if (*tokptr != ',')
- error ("Invalid control sequence");
- tokptr++;
- /* skip possible whitespaces */
- while ((*tokptr == ' ' || *tokptr == '\t') && *tokptr)
- tokptr++;
- if (!decode_integer_literal (&ival, &tokptr))
- error ("Invalid control sequence");
- tokptr--;
- }
- else if (*tokptr == *lexptr)
- {
- if (*(tokptr + 1) == *lexptr)
- {
- ival = *tokptr++;
- }
- else
- {
- break;
- }
- }
- else if (*tokptr == '^')
- {
- if (*(tokptr + 1) == '(')
- {
- in_ctrlseq = 1;
- tokptr += 2;
- if (!decode_integer_literal (&ival, &tokptr))
- error ("Invalid control sequence");
- tokptr--;
- }
- else if (*(tokptr + 1) == '^')
- ival = *tokptr++;
- else
- error ("Invalid control sequence");
- }
- else
- ival = *tokptr;
- tempbuf[tempbufindex++] = ival;
- }
- if (in_ctrlseq)
- error ("Invalid control sequence");
-
- if (*tokptr == '\0' /* no terminator */
- || (tempbufindex == 1 && *tokptr == '\'')) /* char literal */
- {
- return (0);
- }
- else
- {
- tempbuf[tempbufindex] = '\0';
- yylval.sval.ptr = tempbuf;
- yylval.sval.length = tempbufindex;
- lexptr = ++tokptr;
- return (CHARACTER_STRING_LITERAL);
- }
-}
-
-/* Recognize a character literal. A character literal is single character
- or a control sequence, enclosed in single quotes. A control sequence
- is a comma separated list of one or more integer literals, enclosed
- in parenthesis and introduced with a circumflex character.
-
- EX: 'a' '^(7)' '^(7,8)'
-
- As a GNU chill extension, the syntax C'xx' is also recognized as a
- character literal, where xx is a hex value for the character.
-
- Note that more than a single character, enclosed in single quotes, is
- a string literal.
-
- Returns CHARACTER_LITERAL if a match is found.
- */
-
-static enum ch_terminal
-match_character_literal (void)
-{
- char *tokptr = lexptr;
- LONGEST ival = 0;
-
- if ((*tokptr == 'c' || *tokptr == 'C') && (*(tokptr + 1) == '\''))
- {
- /* We have a GNU chill extension form, so skip the leading "C'",
- decode the hex value, and then ensure that we have a trailing
- single quote character. */
- tokptr += 2;
- if (!decode_integer_value (16, &tokptr, &ival) || (*tokptr != '\''))
- {
- return (0);
- }
- tokptr++;
- }
- else if (*tokptr == '\'')
- {
- tokptr++;
-
- /* Determine which form we have, either a control sequence or the
- single character form. */
-
- if (*tokptr == '^')
- {
- if (*(tokptr + 1) == '(')
- {
- /* Match and decode a control sequence. Return zero if we don't
- find a valid integer literal, or if the next unconsumed character
- after the integer literal is not the trailing ')'. */
- tokptr += 2;
- if (!decode_integer_literal (&ival, &tokptr) || (*tokptr++ != ')'))
- {
- return (0);
- }
- }
- else if (*(tokptr + 1) == '^')
- {
- ival = *tokptr;
- tokptr += 2;
- }
- else
- /* fail */
- error ("Invalid control sequence");
- }
- else if (*tokptr == '\'')
- {
- /* this must be duplicated */
- ival = *tokptr;
- tokptr += 2;
- }
- else
- {
- ival = *tokptr++;
- }
-
- /* The trailing quote has not yet been consumed. If we don't find
- it, then we have no match. */
-
- if (*tokptr++ != '\'')
- {
- return (0);
- }
- }
- else
- {
- /* Not a character literal. */
- return (0);
- }
- yylval.typed_val.val = ival;
- yylval.typed_val.type = builtin_type_chill_char;
- lexptr = tokptr;
- return (CHARACTER_LITERAL);
-}
-
-/* Recognize an integer literal, as specified in Z.200 sec 5.2.4.2.
- Note that according to 5.2.4.2, a single "_" is also a valid integer
- literal, however GNU-chill requires there to be at least one "digit"
- in any integer literal. */
-
-static enum ch_terminal
-match_integer_literal (void)
-{
- char *tokptr = lexptr;
- LONGEST ival;
-
- if (!decode_integer_literal (&ival, &tokptr))
- {
- return (0);
- }
- else
- {
- yylval.typed_val.val = ival;
-#if defined(CC_HAS_LONG_LONG)
- if (ival > (LONGEST) 2147483647U || ival < -(LONGEST) 2147483648U)
- yylval.typed_val.type = builtin_type_long_long;
- else
-#endif
- yylval.typed_val.type = builtin_type_int;
- lexptr = tokptr;
- return (INTEGER_LITERAL);
- }
-}
-
-/* Recognize a bit-string literal, as specified in Z.200 sec 5.2.4.8
- Note that according to 5.2.4.8, a single "_" is also a valid bit-string
- literal, however GNU-chill requires there to be at least one "digit"
- in any bit-string literal. */
-
-static enum ch_terminal
-match_bitstring_literal (void)
-{
- register char *tokptr = lexptr;
- int bitoffset = 0;
- int bitcount = 0;
- int bits_per_char;
- int digit;
-
- tempbufindex = 0;
- CHECKBUF (1);
- tempbuf[0] = 0;
-
- /* Look for the required explicit base specifier. */
-
- switch (*tokptr++)
- {
- case 'b':
- case 'B':
- bits_per_char = 1;
- break;
- case 'o':
- case 'O':
- bits_per_char = 3;
- break;
- case 'h':
- case 'H':
- bits_per_char = 4;
- break;
- default:
- return (0);
- break;
- }
-
- /* Ensure that the character after the explicit base is a single quote. */
-
- if (*tokptr++ != '\'')
- {
- return (0);
- }
-
- while (*tokptr != '\0' && *tokptr != '\'')
- {
- digit = *tokptr;
- if (isupper (digit))
- digit = tolower (digit);
- tokptr++;
- switch (digit)
- {
- case '_':
- continue;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- digit -= '0';
- break;
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- digit -= 'a';
- digit += 10;
- break;
- default:
- /* this is not a bitstring literal, probably an integer */
- return 0;
- }
- if (digit >= 1 << bits_per_char)
- {
- /* Found something not in domain for current base. */
- error ("Too-large digit in bitstring or integer.");
- }
- else
- {
- /* Extract bits from digit, packing them into the bitstring byte. */
- int k = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? bits_per_char - 1 : 0;
- for (; TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k >= 0 : k < bits_per_char;
- TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k-- : k++)
- {
- bitcount++;
- if (digit & (1 << k))
- {
- tempbuf[tempbufindex] |=
- (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- ? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
- : (1 << bitoffset);
- }
- bitoffset++;
- if (bitoffset == HOST_CHAR_BIT)
- {
- bitoffset = 0;
- tempbufindex++;
- CHECKBUF (1);
- tempbuf[tempbufindex] = 0;
- }
- }
- }
- }
-
- /* Verify that we consumed everything up to the trailing single quote,
- and that we found some bits (IE not just underbars). */
-
- if (*tokptr++ != '\'')
- {
- return (0);
- }
- else
- {
- yylval.sval.ptr = tempbuf;
- yylval.sval.length = bitcount;
- lexptr = tokptr;
- return (BIT_STRING_LITERAL);
- }
-}
-
-struct token
-{
- char *operator;
- int token;
-};
-
-static const struct token idtokentab[] =
-{
- {"array", ARRAY},
- {"length", LENGTH},
- {"lower", LOWER},
- {"upper", UPPER},
- {"andif", ANDIF},
- {"pred", PRED},
- {"succ", SUCC},
- {"card", CARD},
- {"size", SIZE},
- {"orif", ORIF},
- {"num", NUM},
- {"abs", ABS},
- {"max", MAX_TOKEN},
- {"min", MIN_TOKEN},
- {"mod", MOD},
- {"rem", REM},
- {"not", NOT},
- {"xor", LOGXOR},
- {"and", LOGAND},
- {"in", IN},
- {"or", LOGIOR},
- {"up", UP},
- {"addr", ADDR_TOKEN},
- {"null", EMPTINESS_LITERAL}
-};
-
-static const struct token tokentab2[] =
-{
- {":=", GDB_ASSIGNMENT},
- {"//", SLASH_SLASH},
- {"->", POINTER},
- {"/=", NOTEQUAL},
- {"<=", LEQ},
- {">=", GEQ}
-};
-
-/* Read one token, getting characters through lexptr. */
-/* This is where we will check to make sure that the language and the
- operators used are compatible. */
-
-static enum ch_terminal
-ch_lex (void)
-{
- unsigned int i;
- enum ch_terminal token;
- char *inputname;
- struct symbol *sym;
-
- /* Skip over any leading whitespace. */
- while (isspace (*lexptr))
- {
- lexptr++;
- }
- /* Look for special single character cases which can't be the first
- character of some other multicharacter token. */
- switch (*lexptr)
- {
- case '\0':
- return END_TOKEN;
- case ',':
- case '=':
- case ';':
- case '!':
- case '+':
- case '*':
- case '(':
- case ')':
- case '[':
- case ']':
- return (*lexptr++);
- }
- /* Look for characters which start a particular kind of multicharacter
- token, such as a character literal, register name, convenience
- variable name, string literal, etc. */
- switch (*lexptr)
- {
- case '\'':
- case '\"':
- /* First try to match a string literal, which is any
- sequence of characters enclosed in matching single or double
- quotes, except that a single character inside single quotes
- is a character literal, so we have to catch that case also. */
- token = match_string_literal ();
- if (token != 0)
- {
- return (token);
- }
- if (*lexptr == '\'')
- {
- token = match_character_literal ();
- if (token != 0)
- {
- return (token);
- }
- }
- break;
- case 'C':
- case 'c':
- token = match_character_literal ();
- if (token != 0)
- {
- return (token);
- }
- break;
- case '$':
- yylval.sval.ptr = lexptr;
- do
- {
- lexptr++;
- }
- while (isalnum (*lexptr) || *lexptr == '_' || *lexptr == '$');
- yylval.sval.length = lexptr - yylval.sval.ptr;
- write_dollar_variable (yylval.sval);
- return GDB_VARIABLE;
- break;
- }
- /* See if it is a special token of length 2. */
- for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
- {
- if (STREQN (lexptr, tokentab2[i].operator, 2))
- {
- lexptr += 2;
- return (tokentab2[i].token);
- }
- }
- /* Look for single character cases which which could be the first
- character of some other multicharacter token, but aren't, or we
- would already have found it. */
- switch (*lexptr)
- {
- case '-':
- case ':':
- case '/':
- case '<':
- case '>':
- return (*lexptr++);
- }
- /* Look for a float literal before looking for an integer literal, so
- we match as much of the input stream as possible. */
- token = match_float_literal ();
- if (token != 0)
- {
- return (token);
- }
- token = match_bitstring_literal ();
- if (token != 0)
- {
- return (token);
- }
- token = match_integer_literal ();
- if (token != 0)
- {
- return (token);
- }
-
- /* Try to match a simple name string, and if a match is found, then
- further classify what sort of name it is and return an appropriate
- token. Note that attempting to match a simple name string consumes
- the token from lexptr, so we can't back out if we later find that
- we can't classify what sort of name it is. */
-
- inputname = match_simple_name_string ();
-
- if (inputname != NULL)
- {
- char *simplename = (char *) alloca (strlen (inputname) + 1);
-
- char *dptr = simplename, *sptr = inputname;
- for (; *sptr; sptr++)
- *dptr++ = isupper (*sptr) ? tolower (*sptr) : *sptr;
- *dptr = '\0';
-
- /* See if it is a reserved identifier. */
- for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
- {
- if (STREQ (simplename, idtokentab[i].operator))
- {
- return (idtokentab[i].token);
- }
- }
-
- /* Look for other special tokens. */
- if (STREQ (simplename, "true"))
- {
- yylval.ulval = 1;
- return (BOOLEAN_LITERAL);
- }
- if (STREQ (simplename, "false"))
- {
- yylval.ulval = 0;
- return (BOOLEAN_LITERAL);
- }
-
- sym = lookup_symbol (inputname, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL);
- if (sym == NULL && strcmp (inputname, simplename) != 0)
- {
- sym = lookup_symbol (simplename, expression_context_block,
- VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL);
- }
- if (sym != NULL)
- {
- yylval.ssym.stoken.ptr = NULL;
- yylval.ssym.stoken.length = 0;
- yylval.ssym.sym = sym;
- yylval.ssym.is_a_field_of_this = 0; /* FIXME, C++'ism */
- switch (SYMBOL_CLASS (sym))
- {
- case LOC_BLOCK:
- /* Found a procedure name. */
- return (GENERAL_PROCEDURE_NAME);
- case LOC_STATIC:
- /* Found a global or local static variable. */
- return (LOCATION_NAME);
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG:
- case LOC_BASEREG_ARG:
- if (innermost_block == NULL
- || contained_in (block_found, innermost_block))
- {
- innermost_block = block_found;
- }
- return (LOCATION_NAME);
- break;
- case LOC_CONST:
- case LOC_LABEL:
- return (LOCATION_NAME);
- break;
- case LOC_TYPEDEF:
- yylval.tsym.type = SYMBOL_TYPE (sym);
- return TYPENAME;
- case LOC_UNDEF:
- case LOC_CONST_BYTES:
- case LOC_OPTIMIZED_OUT:
- error ("Symbol \"%s\" names no location.", inputname);
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "unhandled SYMBOL_CLASS in ch_lex()");
- break;
- }
- }
- else if (!have_full_symbols () && !have_partial_symbols ())
- {
- error ("No symbol table is loaded. Use the \"file\" command.");
- }
- else
- {
- error ("No symbol \"%s\" in current context.", inputname);
- }
- }
-
- /* Catch single character tokens which are not part of some
- longer token. */
-
- switch (*lexptr)
- {
- case '.': /* Not float for example. */
- lexptr++;
- while (isspace (*lexptr))
- lexptr++;
- inputname = match_simple_name_string ();
- if (!inputname)
- return '.';
- return DOT_FIELD_NAME;
- }
-
- return (ILLEGAL_TOKEN);
-}
-
-static void
-write_lower_upper_value (enum exp_opcode opcode, /* Either UNOP_LOWER or UNOP_UPPER */
- struct type *type)
-{
- if (type == NULL)
- write_exp_elt_opcode (opcode);
- else
- {
- struct type *result_type;
- LONGEST val = type_lower_upper (opcode, type, &result_type);
- write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (result_type);
- write_exp_elt_longcst (val);
- write_exp_elt_opcode (OP_LONG);
- }
-}
-
-void
-chill_error (char *msg)
-{
- /* Never used. */
-}
+// 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 <ctype.h>
+// 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 <field name> */
+// 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: <name_string>
+// 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: <case label> */
+// 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 <string repetition operator>,
+// 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: <boolean expression> <then alternative> <else alternative> */
+// 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 <untyped_expr> is a superset of <expr>. It also includes
+// OBSOLETE <conditional expressions> and untyped <tuples>, 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 <untyped_expr>. */
+// 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, &copy);
+// 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
index b46dce01454..50b446e3dd5 100644
--- a/gdb/ch-lang.c
+++ b/gdb/ch-lang.c
@@ -1,663 +1,663 @@
-/* Chill language support routines for GDB, the GNU debugger.
- Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "value.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "ch-lang.h"
-#include "valprint.h"
-
-extern void _initialize_chill_language (void);
-
-static struct value *evaluate_subexp_chill (struct type *, struct expression *,
- int *, enum noside);
-
-static struct value *value_chill_max_min (enum exp_opcode, struct value *);
-
-static struct value *value_chill_card (struct value *);
-
-static struct value *value_chill_length (struct value *);
-
-static struct type *chill_create_fundamental_type (struct objfile *, int);
-
-static void chill_printstr (struct ui_file * stream, char *string,
- unsigned int length, int width,
- int force_ellipses);
-
-static void chill_printchar (int, struct ui_file *);
-
-/* For now, Chill uses a simple mangling algorithm whereby you simply
- discard everything after the occurance of two successive CPLUS_MARKER
- characters to derive the demangled form. */
-
-char *
-chill_demangle (const char *mangled)
-{
- const char *joiner = NULL;
- char *demangled;
- const char *cp = mangled;
-
- while (*cp)
- {
- if (is_cplus_marker (*cp))
- {
- joiner = cp;
- break;
- }
- cp++;
- }
- if (joiner != NULL && *(joiner + 1) == *joiner)
- {
- demangled = savestring (mangled, joiner - mangled);
- }
- else
- {
- demangled = NULL;
- }
- return (demangled);
-}
-
-static void
-chill_printchar (register int c, struct ui_file *stream)
-{
- c &= 0xFF; /* Avoid sign bit follies */
-
- if (PRINT_LITERAL_FORM (c))
- {
- if (c == '\'' || c == '^')
- fprintf_filtered (stream, "'%c%c'", c, c);
- else
- fprintf_filtered (stream, "'%c'", c);
- }
- else
- {
- fprintf_filtered (stream, "'^(%u)'", (unsigned int) c);
- }
-}
-
-/* Print the character string STRING, printing at most LENGTH characters.
- Printing stops early if the number hits print_max; repeat counts
- are printed as appropriate. Print ellipses at the end if we
- had to stop before printing LENGTH characters, or if FORCE_ELLIPSES.
- Note that gdb maintains the length of strings without counting the
- terminating null byte, while chill strings are typically written with
- an explicit null byte. So we always assume an implied null byte
- until gdb is able to maintain non-null terminated strings as well
- as null terminated strings (FIXME).
- */
-
-static void
-chill_printstr (struct ui_file *stream, char *string, unsigned int length,
- int width, int force_ellipses)
-{
- register unsigned int i;
- unsigned int things_printed = 0;
- int in_literal_form = 0;
- int in_control_form = 0;
- int need_slashslash = 0;
- unsigned int c;
-
- if (length == 0)
- {
- fputs_filtered ("\"\"", stream);
- return;
- }
-
- for (i = 0; i < length && things_printed < print_max; ++i)
- {
- /* Position of the character we are examining
- to see whether it is repeated. */
- unsigned int rep1;
- /* Number of repetitions we have detected so far. */
- unsigned int reps;
-
- QUIT;
-
- if (need_slashslash)
- {
- fputs_filtered ("//", stream);
- need_slashslash = 0;
- }
-
- rep1 = i + 1;
- reps = 1;
- while (rep1 < length && string[rep1] == string[i])
- {
- ++rep1;
- ++reps;
- }
-
- c = string[i];
- if (reps > repeat_count_threshold)
- {
- if (in_control_form || in_literal_form)
- {
- if (in_control_form)
- fputs_filtered (")", stream);
- fputs_filtered ("\"//", stream);
- in_control_form = in_literal_form = 0;
- }
- chill_printchar (c, stream);
- fprintf_filtered (stream, "<repeats %u times>", reps);
- i = rep1 - 1;
- things_printed += repeat_count_threshold;
- need_slashslash = 1;
- }
- else
- {
- if (!in_literal_form && !in_control_form)
- fputs_filtered ("\"", stream);
- if (PRINT_LITERAL_FORM (c))
- {
- if (!in_literal_form)
- {
- if (in_control_form)
- {
- fputs_filtered (")", stream);
- in_control_form = 0;
- }
- in_literal_form = 1;
- }
- fprintf_filtered (stream, "%c", c);
- if (c == '"' || c == '^')
- /* duplicate this one as must be done at input */
- fprintf_filtered (stream, "%c", c);
- }
- else
- {
- if (!in_control_form)
- {
- if (in_literal_form)
- {
- in_literal_form = 0;
- }
- fputs_filtered ("^(", stream);
- in_control_form = 1;
- }
- else
- fprintf_filtered (stream, ",");
- c = c & 0xff;
- fprintf_filtered (stream, "%u", (unsigned int) c);
- }
- ++things_printed;
- }
- }
-
- /* Terminate the quotes if necessary. */
- if (in_control_form)
- {
- fputs_filtered (")", stream);
- }
- if (in_literal_form || in_control_form)
- {
- fputs_filtered ("\"", stream);
- }
- if (force_ellipses || (i < length))
- {
- fputs_filtered ("...", stream);
- }
-}
-
-static struct type *
-chill_create_fundamental_type (struct objfile *objfile, int typeid)
-{
- register struct type *type = NULL;
-
- switch (typeid)
- {
- default:
- /* FIXME: For now, if we are asked to produce a type not in this
- language, create the equivalent of a C integer type with the
- name "<?type?>". When all the dust settles from the type
- reconstruction work, this should probably become an error. */
- type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
- warning ("internal error: no chill fundamental type %d", typeid);
- break;
- case FT_VOID:
- /* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
- typedefs, unrelated to anything directly in the code being compiled,
- that have some FT_VOID types. Just fake it for now. */
- type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
- break;
- case FT_BOOLEAN:
- type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
- break;
- case FT_CHAR:
- type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
- break;
- case FT_SIGNED_CHAR:
- type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
- break;
- case FT_UNSIGNED_CHAR:
- type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
- break;
- case FT_SHORT: /* Chill ints are 2 bytes */
- type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
- break;
- case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
- type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
- break;
- case FT_INTEGER: /* FIXME? */
- case FT_SIGNED_INTEGER: /* FIXME? */
- case FT_LONG: /* Chill longs are 4 bytes */
- case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
- type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
- break;
- case FT_UNSIGNED_INTEGER: /* FIXME? */
- case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
- type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
- break;
- case FT_FLOAT:
- type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
- break;
- case FT_DBL_PREC_FLOAT:
- type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
- break;
- }
- return (type);
-}
-
-
-/* Table of operators and their precedences for printing expressions. */
-
-static const struct op_print chill_op_print_tab[] =
-{
- {"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
- {"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
- {"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
- {"MOD", BINOP_MOD, PREC_MUL, 0},
- {"REM", BINOP_REM, PREC_MUL, 0},
- {"SIZE", UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
- {"LOWER", UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
- {"UPPER", UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
- {"CARD", UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
- {"MAX", UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
- {"MIN", UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
- {":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
- {"=", BINOP_EQUAL, PREC_EQUAL, 0},
- {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
- {"<=", BINOP_LEQ, PREC_ORDER, 0},
- {">=", BINOP_GEQ, PREC_ORDER, 0},
- {">", BINOP_GTR, PREC_ORDER, 0},
- {"<", BINOP_LESS, PREC_ORDER, 0},
- {"+", BINOP_ADD, PREC_ADD, 0},
- {"-", BINOP_SUB, PREC_ADD, 0},
- {"*", BINOP_MUL, PREC_MUL, 0},
- {"/", BINOP_DIV, PREC_MUL, 0},
- {"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
- {"-", UNOP_NEG, PREC_PREFIX, 0},
- {"->", UNOP_IND, PREC_SUFFIX, 1},
- {"->", UNOP_ADDR, PREC_PREFIX, 0},
- {":", BINOP_RANGE, PREC_ASSIGN, 0},
- {NULL, 0, 0, 0}
-};
-
-/* The built-in types of Chill. */
-
-struct type *builtin_type_chill_bool;
-struct type *builtin_type_chill_char;
-struct type *builtin_type_chill_long;
-struct type *builtin_type_chill_ulong;
-struct type *builtin_type_chill_real;
-
-struct type **const (chill_builtin_types[]) =
-{
- &builtin_type_chill_bool,
- &builtin_type_chill_char,
- &builtin_type_chill_long,
- &builtin_type_chill_ulong,
- &builtin_type_chill_real,
- 0
-};
-
-/* Calculate LOWER or UPPER of TYPE.
- Returns the result as an integer.
- *RESULT_TYPE is the appropriate type for the result. */
-
-LONGEST
-type_lower_upper (enum exp_opcode op, /* Either UNOP_LOWER or UNOP_UPPER */
- struct type *type, struct type **result_type)
-{
- LONGEST low, high;
- *result_type = type;
- CHECK_TYPEDEF (type);
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_STRUCT:
- *result_type = builtin_type_int;
- if (chill_varying_type (type))
- return type_lower_upper (op, TYPE_FIELD_TYPE (type, 1), result_type);
- break;
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_BITSTRING:
- case TYPE_CODE_STRING:
- type = TYPE_FIELD_TYPE (type, 0); /* Get index type */
-
- /* ... fall through ... */
- case TYPE_CODE_RANGE:
- *result_type = TYPE_TARGET_TYPE (type);
- return op == UNOP_LOWER ? TYPE_LOW_BOUND (type) : TYPE_HIGH_BOUND (type);
-
- case TYPE_CODE_ENUM:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_INT:
- case TYPE_CODE_CHAR:
- if (get_discrete_bounds (type, &low, &high) >= 0)
- {
- *result_type = type;
- return op == UNOP_LOWER ? low : high;
- }
- break;
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_PTR:
- case TYPE_CODE_UNION:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_SET:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_MEMBER:
- case TYPE_CODE_METHOD:
- case TYPE_CODE_REF:
- case TYPE_CODE_COMPLEX:
- default:
- break;
- }
- error ("unknown mode for LOWER/UPPER builtin");
-}
-
-static struct value *
-value_chill_length (struct value *val)
-{
- LONGEST tmp;
- struct type *type = VALUE_TYPE (val);
- struct type *ttype;
- CHECK_TYPEDEF (type);
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_BITSTRING:
- case TYPE_CODE_STRING:
- tmp = type_lower_upper (UNOP_UPPER, type, &ttype)
- - type_lower_upper (UNOP_LOWER, type, &ttype) + 1;
- break;
- case TYPE_CODE_STRUCT:
- if (chill_varying_type (type))
- {
- tmp = unpack_long (TYPE_FIELD_TYPE (type, 0), VALUE_CONTENTS (val));
- break;
- }
- /* ... else fall through ... */
- default:
- error ("bad argument to LENGTH builtin");
- }
- return value_from_longest (builtin_type_int, tmp);
-}
-
-static struct value *
-value_chill_card (struct value *val)
-{
- LONGEST tmp = 0;
- struct type *type = VALUE_TYPE (val);
- CHECK_TYPEDEF (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_SET)
- {
- struct type *range_type = TYPE_INDEX_TYPE (type);
- LONGEST lower_bound, upper_bound;
- int i;
-
- get_discrete_bounds (range_type, &lower_bound, &upper_bound);
- for (i = lower_bound; i <= upper_bound; i++)
- if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
- tmp++;
- }
- else
- error ("bad argument to CARD builtin");
-
- return value_from_longest (builtin_type_int, tmp);
-}
-
-static struct value *
-value_chill_max_min (enum exp_opcode op, struct value *val)
-{
- LONGEST tmp = 0;
- struct type *type = VALUE_TYPE (val);
- struct type *elttype;
- CHECK_TYPEDEF (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_SET)
- {
- LONGEST lower_bound, upper_bound;
- int i, empty = 1;
-
- elttype = TYPE_INDEX_TYPE (type);
- CHECK_TYPEDEF (elttype);
- get_discrete_bounds (elttype, &lower_bound, &upper_bound);
-
- if (op == UNOP_CHMAX)
- {
- for (i = upper_bound; i >= lower_bound; i--)
- {
- if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
- {
- tmp = i;
- empty = 0;
- break;
- }
- }
- }
- else
- {
- for (i = lower_bound; i <= upper_bound; i++)
- {
- if (value_bit_index (type, VALUE_CONTENTS (val), i) > 0)
- {
- tmp = i;
- empty = 0;
- break;
- }
- }
- }
- if (empty)
- error ("%s for empty powerset", op == UNOP_CHMAX ? "MAX" : "MIN");
- }
- else
- error ("bad argument to %s builtin", op == UNOP_CHMAX ? "MAX" : "MIN");
-
- return value_from_longest (TYPE_CODE (elttype) == TYPE_CODE_RANGE
- ? TYPE_TARGET_TYPE (elttype)
- : elttype,
- tmp);
-}
-
-static struct value *
-evaluate_subexp_chill (struct type *expect_type,
- register struct expression *exp, register int *pos,
- enum noside noside)
-{
- int pc = *pos;
- struct type *type;
- int tem, nargs;
- struct value *arg1;
- struct value **argvec;
- enum exp_opcode op = exp->elts[*pos].opcode;
- switch (op)
- {
- case MULTI_SUBSCRIPT:
- if (noside == EVAL_SKIP)
- break;
- (*pos) += 3;
- nargs = longest_to_int (exp->elts[pc + 1].longconst);
- arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
- type = check_typedef (VALUE_TYPE (arg1));
-
- if (nargs == 1 && TYPE_CODE (type) == TYPE_CODE_INT)
- {
- /* Looks like string repetition. */
- struct value *string = evaluate_subexp_with_coercion (exp, pos,
- noside);
- return value_concat (arg1, string);
- }
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_PTR:
- type = check_typedef (TYPE_TARGET_TYPE (type));
- if (!type || TYPE_CODE (type) != TYPE_CODE_FUNC)
- error ("reference value used as function");
- /* ... fall through ... */
- case TYPE_CODE_FUNC:
- /* It's a function call. */
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
- break;
-
- /* Allocate arg vector, including space for the function to be
- called in argvec[0] and a terminating NULL */
- argvec = (struct value **) alloca (sizeof (struct value *)
- * (nargs + 2));
- argvec[0] = arg1;
- tem = 1;
- for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
- {
- argvec[tem]
- = evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem - 1),
- exp, pos, noside);
- }
- for (; tem <= nargs; tem++)
- argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
- argvec[tem] = 0; /* signal end of arglist */
-
- return call_function_by_hand (argvec[0], nargs, argvec + 1);
- default:
- break;
- }
-
- while (nargs-- > 0)
- {
- struct value *index = evaluate_subexp_with_coercion (exp, pos,
- noside);
- arg1 = value_subscript (arg1, index);
- }
- return (arg1);
-
- case UNOP_LOWER:
- case UNOP_UPPER:
- (*pos)++;
- if (noside == EVAL_SKIP)
- {
- (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, EVAL_SKIP);
- goto nosideret;
- }
- arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos,
- EVAL_AVOID_SIDE_EFFECTS);
- tem = type_lower_upper (op, VALUE_TYPE (arg1), &type);
- return value_from_longest (type, tem);
-
- case UNOP_LENGTH:
- (*pos)++;
- arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
- return value_chill_length (arg1);
-
- case UNOP_CARD:
- (*pos)++;
- arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
- return value_chill_card (arg1);
-
- case UNOP_CHMAX:
- case UNOP_CHMIN:
- (*pos)++;
- arg1 = (*exp->language_defn->evaluate_exp) (NULL_TYPE, exp, pos, noside);
- return value_chill_max_min (op, arg1);
-
- case BINOP_COMMA:
- error ("',' operator used in invalid context");
-
- default:
- break;
- }
-
- return evaluate_subexp_standard (expect_type, exp, pos, noside);
-nosideret:
- return value_from_longest (builtin_type_long, (LONGEST) 1);
-}
-
-const struct language_defn chill_language_defn =
-{
- "chill",
- language_chill,
- chill_builtin_types,
- range_check_on,
- type_check_on,
- case_sensitive_on,
- chill_parse, /* parser */
- chill_error, /* parser error function */
- evaluate_subexp_chill,
- chill_printchar, /* print a character constant */
- chill_printstr, /* function to print a string constant */
- NULL, /* Function to print a single char */
- chill_create_fundamental_type, /* Create fundamental type in this language */
- chill_print_type, /* Print a type using appropriate syntax */
- chill_val_print, /* Print a value using appropriate syntax */
- chill_value_print, /* Print a top-levl value */
- {"", "B'", "", ""}, /* Binary format info */
- {"O'%lo", "O'", "o", ""}, /* Octal format info */
- {"D'%ld", "D'", "d", ""}, /* Decimal format info */
- {"H'%lx", "H'", "x", ""}, /* Hex format info */
- chill_op_print_tab, /* expression operators for printing */
- 0, /* arrays are first-class (not c-style) */
- 0, /* String lower bound */
- &builtin_type_chill_char, /* Type of string elements */
- LANG_MAGIC
-};
-
-/* Initialization for Chill */
-
-void
-_initialize_chill_language (void)
-{
- builtin_type_chill_bool =
- init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "BOOL", (struct objfile *) NULL);
- builtin_type_chill_char =
- init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "CHAR", (struct objfile *) NULL);
- builtin_type_chill_long =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- 0,
- "LONG", (struct objfile *) NULL);
- builtin_type_chill_ulong =
- init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
- TYPE_FLAG_UNSIGNED,
- "ULONG", (struct objfile *) NULL);
- builtin_type_chill_real =
- init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
- 0,
- "LONG_REAL", (struct objfile *) NULL);
-
- add_language (&chill_language_defn);
-}
+// 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, "<repeats %u times>", 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 "<?type?>". 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, "<?type?>", 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, "<?VOID?>", 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
index b55e2dd075c..d4e53569428 100644
--- a/gdb/ch-lang.h
+++ b/gdb/ch-lang.h
@@ -1,41 +1,41 @@
-/* Chill language support definitions for GDB, the GNU debugger.
- Copyright 1992, 1994, 1996, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Forward decls for prototypes */
-struct value;
-
-extern int chill_parse (void); /* Defined in ch-exp.y */
-
-extern void chill_error (char *); /* Defined in ch-exp.y */
-
-/* Defined in ch-typeprint.c */
-extern void chill_print_type (struct type *, char *, struct ui_file *, int,
- int);
-
-extern int chill_val_print (struct type *, char *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
-
-extern int chill_value_print (struct value *, struct ui_file *,
- int, enum val_prettyprint);
-
-extern LONGEST
-type_lower_upper (enum exp_opcode, struct type *, struct type **);
+// 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
index 011bd125d2a..32590f81ecf 100644
--- a/gdb/ch-typeprint.c
+++ b/gdb/ch-typeprint.c
@@ -1,340 +1,340 @@
-/* Support for printing Chill types for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "obstack.h"
-#include "bfd.h" /* Binary File Description */
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "language.h"
-#include "ch-lang.h"
-#include "typeprint.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-
-static void chill_type_print_base (struct type *, struct ui_file *, int, int);
-
-void
-chill_print_type (struct type *type, char *varstring, struct ui_file *stream,
- int show, int level)
-{
- if (varstring != NULL && *varstring != '\0')
- {
- fputs_filtered (varstring, stream);
- fputs_filtered (" ", stream);
- }
- chill_type_print_base (type, stream, show, level);
-}
-
-/* Print the name of the type (or the ultimate pointer target,
- function value or array element).
-
- SHOW nonzero means don't print this type as just its name;
- show its real definition even if it has a name.
- SHOW zero means print just typename or tag if there is one
- SHOW negative means abbreviate structure elements.
- SHOW is decremented for printing of structure elements.
-
- LEVEL is the depth to indent by.
- We increase it for some recursive calls. */
-
-static void
-chill_type_print_base (struct type *type, struct ui_file *stream, int show,
- int level)
-{
- register int len;
- register int i;
- struct type *index_type;
- struct type *range_type;
- LONGEST low_bound;
- LONGEST high_bound;
-
- QUIT;
-
- wrap_here (" ");
- if (type == NULL)
- {
- fputs_filtered ("<type unknown>", stream);
- return;
- }
-
- /* When SHOW is zero or less, and there is a valid type name, then always
- just print the type name directly from the type. */
-
- if ((show <= 0) && (TYPE_NAME (type) != NULL))
- {
- fputs_filtered (TYPE_NAME (type), stream);
- return;
- }
-
- if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
- CHECK_TYPEDEF (type);
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_TYPEDEF:
- chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
- break;
- case TYPE_CODE_PTR:
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
- {
- fprintf_filtered (stream,
- TYPE_NAME (type) ? TYPE_NAME (type) : "PTR");
- break;
- }
- fprintf_filtered (stream, "REF ");
- chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
- break;
-
- case TYPE_CODE_BOOL:
- /* FIXME: we should probably just print the TYPE_NAME, in case
- anyone ever fixes the compiler to give us the real names
- in the presence of the chill equivalent of typedef (assuming
- there is one). */
- fprintf_filtered (stream,
- TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL");
- break;
-
- case TYPE_CODE_ARRAY:
- fputs_filtered ("ARRAY (", stream);
- range_type = TYPE_FIELD_TYPE (type, 0);
- if (TYPE_CODE (range_type) != TYPE_CODE_RANGE)
- chill_print_type (range_type, "", stream, 0, level);
- else
- {
- index_type = TYPE_TARGET_TYPE (range_type);
- low_bound = TYPE_FIELD_BITPOS (range_type, 0);
- high_bound = TYPE_FIELD_BITPOS (range_type, 1);
- print_type_scalar (index_type, low_bound, stream);
- fputs_filtered (":", stream);
- print_type_scalar (index_type, high_bound, stream);
- }
- fputs_filtered (") ", stream);
- chill_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, level);
- break;
-
- case TYPE_CODE_BITSTRING:
- fprintf_filtered (stream, "BOOLS (%d)",
- TYPE_FIELD_BITPOS (TYPE_FIELD_TYPE (type, 0), 1) + 1);
- break;
-
- case TYPE_CODE_SET:
- fputs_filtered ("POWERSET ", stream);
- chill_print_type (TYPE_INDEX_TYPE (type), "", stream,
- show - 1, level);
- break;
-
- case TYPE_CODE_STRING:
- range_type = TYPE_FIELD_TYPE (type, 0);
- index_type = TYPE_TARGET_TYPE (range_type);
- high_bound = TYPE_FIELD_BITPOS (range_type, 1);
- fputs_filtered ("CHARS (", stream);
- print_type_scalar (index_type, high_bound + 1, stream);
- fputs_filtered (")", stream);
- break;
-
- case TYPE_CODE_MEMBER:
- fprintf_filtered (stream, "MEMBER ");
- chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
- break;
- case TYPE_CODE_REF:
- fprintf_filtered (stream, "/*LOC*/ ");
- chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
- break;
- case TYPE_CODE_FUNC:
- fprintf_filtered (stream, "PROC (");
- len = TYPE_NFIELDS (type);
- for (i = 0; i < len; i++)
- {
- struct type *param_type = TYPE_FIELD_TYPE (type, i);
- if (i > 0)
- {
- fputs_filtered (", ", stream);
- wrap_here (" ");
- }
- if (TYPE_CODE (param_type) == TYPE_CODE_REF)
- {
- chill_type_print_base (TYPE_TARGET_TYPE (param_type),
- stream, 0, level);
- fputs_filtered (" LOC", stream);
- }
- else
- chill_type_print_base (param_type, stream, show, level);
- }
- fprintf_filtered (stream, ")");
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
- {
- fputs_filtered (" RETURNS (", stream);
- chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
- fputs_filtered (")", stream);
- }
- break;
-
- case TYPE_CODE_STRUCT:
- if (chill_varying_type (type))
- {
- chill_type_print_base (TYPE_FIELD_TYPE (type, 1),
- stream, 0, level);
- fputs_filtered (" VARYING", stream);
- }
- else
- {
- fprintf_filtered (stream, "STRUCT ");
-
- fprintf_filtered (stream, "(\n");
- if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
- {
- if (TYPE_STUB (type))
- {
- fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
- }
- else
- {
- fprintfi_filtered (level + 4, stream, "<no data fields>\n");
- }
- }
- else
- {
- len = TYPE_NFIELDS (type);
- for (i = TYPE_N_BASECLASSES (type); i < len; i++)
- {
- struct type *field_type = TYPE_FIELD_TYPE (type, i);
- QUIT;
- print_spaces_filtered (level + 4, stream);
- if (TYPE_CODE (field_type) == TYPE_CODE_UNION)
- {
- int j; /* variant number */
- fputs_filtered ("CASE OF\n", stream);
- for (j = 0; j < TYPE_NFIELDS (field_type); j++)
- {
- int k; /* variant field index */
- struct type *variant_type
- = TYPE_FIELD_TYPE (field_type, j);
- int var_len = TYPE_NFIELDS (variant_type);
- print_spaces_filtered (level + 4, stream);
- if (strcmp (TYPE_FIELD_NAME (field_type, j),
- "else") == 0)
- fputs_filtered ("ELSE\n", stream);
- else
- fputs_filtered (":\n", stream);
- if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT)
- error ("variant record confusion");
- for (k = 0; k < var_len; k++)
- {
- print_spaces_filtered (level + 8, stream);
- chill_print_type (TYPE_FIELD_TYPE (variant_type, k),
- TYPE_FIELD_NAME (variant_type, k),
- stream, show - 1, level + 8);
- if (k < (var_len - 1))
- fputs_filtered (",", stream);
- fputs_filtered ("\n", stream);
- }
- }
- print_spaces_filtered (level + 4, stream);
- fputs_filtered ("ESAC", stream);
- }
- else
- chill_print_type (field_type,
- TYPE_FIELD_NAME (type, i),
- stream, show - 1, level + 4);
- if (i < (len - 1))
- {
- fputs_filtered (",", stream);
- }
- fputs_filtered ("\n", stream);
- }
- }
- fprintfi_filtered (level, stream, ")");
- }
- break;
-
- case TYPE_CODE_RANGE:
- {
- struct type *target = TYPE_TARGET_TYPE (type);
- if (target && TYPE_NAME (target))
- fputs_filtered (TYPE_NAME (target), stream);
- else
- fputs_filtered ("RANGE", stream);
- if (target == NULL)
- target = builtin_type_long;
- fputs_filtered (" (", stream);
- print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
- fputs_filtered (":", stream);
- print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
- fputs_filtered (")", stream);
- }
- break;
-
- case TYPE_CODE_ENUM:
- {
- register int lastval = 0;
- fprintf_filtered (stream, "SET (");
- len = TYPE_NFIELDS (type);
- for (i = 0; i < len; i++)
- {
- QUIT;
- if (i)
- fprintf_filtered (stream, ", ");
- wrap_here (" ");
- fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
- if (lastval != TYPE_FIELD_BITPOS (type, i))
- {
- fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
- lastval = TYPE_FIELD_BITPOS (type, i);
- }
- lastval++;
- }
- fprintf_filtered (stream, ")");
- }
- break;
-
- case TYPE_CODE_VOID:
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_UNION:
- case TYPE_CODE_METHOD:
- error ("missing language support in chill_type_print_base");
- break;
-
- default:
-
- /* Handle types not explicitly handled by the other cases,
- such as fundamental types. For these, just print whatever
- the type name is, as recorded in the type itself. If there
- is no type name, then complain. */
-
- if (TYPE_NAME (type) != NULL)
- {
- fputs_filtered (TYPE_NAME (type), stream);
- }
- else
- {
- error ("Unrecognized type code (%d) in symbol table.",
- TYPE_CODE (type));
- }
- break;
- }
-}
+// 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 <errno.h>
+// 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 ("<type unknown>", 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, "<incomplete type>\n");
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE {
+// OBSOLETE fprintfi_filtered (level + 4, stream, "<no data fields>\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
index 44b1c534311..f2a35b3b54b 100644
--- a/gdb/ch-valprint.c
+++ b/gdb/ch-valprint.c
@@ -1,605 +1,605 @@
-/* Support for printing Chill values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "obstack.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "valprint.h"
-#include "expression.h"
-#include "value.h"
-#include "language.h"
-#include "demangle.h"
-#include "c-lang.h" /* For c_val_print */
-#include "typeprint.h"
-#include "ch-lang.h"
-#include "annotate.h"
-
-static void chill_print_value_fields (struct type *, char *,
- struct ui_file *, int, int,
- enum val_prettyprint, struct type **);
-
-static void chill_print_type_scalar (struct type *, LONGEST,
- struct ui_file *);
-
-static void chill_val_print_array_elements (struct type *, char *,
- CORE_ADDR, struct ui_file *,
- int, int, int,
- enum val_prettyprint);
-
-
-/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
- Used to print data from type structures in a specified type. For example,
- array bounds may be characters or booleans in some languages, and this
- allows the ranges to be printed in their "natural" form rather than as
- decimal integer values. */
-
-static void
-chill_print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
-{
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_RANGE:
- if (TYPE_TARGET_TYPE (type))
- {
- chill_print_type_scalar (TYPE_TARGET_TYPE (type), val, stream);
- return;
- }
- break;
- case TYPE_CODE_UNDEF:
- case TYPE_CODE_PTR:
- case TYPE_CODE_ARRAY:
- case TYPE_CODE_STRUCT:
- case TYPE_CODE_UNION:
- case TYPE_CODE_ENUM:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_INT:
- case TYPE_CODE_FLT:
- case TYPE_CODE_VOID:
- case TYPE_CODE_SET:
- case TYPE_CODE_STRING:
- case TYPE_CODE_BITSTRING:
- case TYPE_CODE_ERROR:
- case TYPE_CODE_MEMBER:
- case TYPE_CODE_METHOD:
- case TYPE_CODE_REF:
- case TYPE_CODE_CHAR:
- case TYPE_CODE_BOOL:
- case TYPE_CODE_COMPLEX:
- case TYPE_CODE_TYPEDEF:
- default:
- break;
- }
- print_type_scalar (type, val, stream);
-}
-
-/* Print the elements of an array.
- Similar to val_print_array_elements, but prints
- element indexes (in Chill syntax). */
-
-static void
-chill_val_print_array_elements (struct type *type, char *valaddr,
- CORE_ADDR address, struct ui_file *stream,
- int format, int deref_ref, int recurse,
- enum val_prettyprint pretty)
-{
- unsigned int i = 0;
- unsigned int things_printed = 0;
- unsigned len;
- struct type *elttype;
- struct type *range_type = TYPE_FIELD_TYPE (type, 0);
- struct type *index_type = TYPE_TARGET_TYPE (range_type);
- unsigned eltlen;
- /* Position of the array element we are examining to see
- whether it is repeated. */
- unsigned int rep1;
- /* Number of repetitions we have detected so far. */
- unsigned int reps;
- LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0);
-
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
- eltlen = TYPE_LENGTH (elttype);
- len = TYPE_LENGTH (type) / eltlen;
-
- annotate_array_section_begin (i, elttype);
-
- for (; i < len && things_printed < print_max; i++)
- {
- if (i != 0)
- {
- if (prettyprint_arrays)
- {
- fprintf_filtered (stream, ",\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- else
- {
- fprintf_filtered (stream, ", ");
- }
- }
- wrap_here (n_spaces (2 + 2 * recurse));
-
- rep1 = i + 1;
- reps = 1;
- while ((rep1 < len) &&
- !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
- {
- ++reps;
- ++rep1;
- }
-
- fputs_filtered ("(", stream);
- chill_print_type_scalar (index_type, low_bound + i, stream);
- if (reps > 1)
- {
- fputs_filtered (":", stream);
- chill_print_type_scalar (index_type, low_bound + i + reps - 1,
- stream);
- fputs_filtered ("): ", stream);
- val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
- deref_ref, recurse + 1, pretty);
-
- i = rep1 - 1;
- things_printed += 1;
- }
- else
- {
- fputs_filtered ("): ", stream);
- val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
- deref_ref, recurse + 1, pretty);
- annotate_elt ();
- things_printed++;
- }
- }
- annotate_array_section_end ();
- if (i < len)
- {
- fprintf_filtered (stream, "...");
- }
-}
-
-/* Print data of type TYPE located at VALADDR (within GDB), which came from
- the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
-
- If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
-
-int
-chill_val_print (struct type *type, char *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
-{
- LONGEST val;
- unsigned int i = 0; /* Number of characters printed. */
- struct type *elttype;
- CORE_ADDR addr;
-
- CHECK_TYPEDEF (type);
-
- switch (TYPE_CODE (type))
- {
- case TYPE_CODE_ARRAY:
- if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
- {
- if (prettyprint_arrays)
- {
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- fprintf_filtered (stream, "[");
- chill_val_print_array_elements (type, valaddr, address, stream,
- format, deref_ref, recurse, pretty);
- fprintf_filtered (stream, "]");
- }
- else
- {
- error ("unimplemented in chill_val_print; unspecified array length");
- }
- break;
-
- case TYPE_CODE_INT:
- format = format ? format : output_format;
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- }
- else
- {
- val_print_type_code_int (type, valaddr, stream);
- }
- break;
-
- case TYPE_CODE_CHAR:
- format = format ? format : output_format;
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- }
- else
- {
- LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr),
- stream);
- }
- break;
-
- case TYPE_CODE_FLT:
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- }
- else
- {
- print_floating (valaddr, type, stream);
- }
- break;
-
- case TYPE_CODE_BOOL:
- format = format ? format : output_format;
- if (format)
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- }
- else
- {
- /* FIXME: Why is this using builtin_type_chill_bool not type? */
- val = unpack_long (builtin_type_chill_bool, valaddr);
- fprintf_filtered (stream, val ? "TRUE" : "FALSE");
- }
- break;
-
- case TYPE_CODE_UNDEF:
- /* This happens (without TYPE_FLAG_STUB set) on systems which don't use
- dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
- and no complete type for struct foo in that file. */
- fprintf_filtered (stream, "<incomplete type>");
- break;
-
- case TYPE_CODE_PTR:
- if (format && format != 's')
- {
- print_scalar_formatted (valaddr, type, format, 0, stream);
- break;
- }
- addr = unpack_pointer (type, valaddr);
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
-
- /* We assume a NULL pointer is all zeros ... */
- if (addr == 0)
- {
- fputs_filtered ("NULL", stream);
- return 0;
- }
-
- if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
- {
- /* Try to print what function it points to. */
- print_address_demangle (addr, stream, demangle);
- /* Return value is irrelevant except for string pointers. */
- return (0);
- }
- if (addressprint && format != 's')
- {
- print_address_numeric (addr, 1, stream);
- }
-
- /* For a pointer to char or unsigned char, also print the string
- pointed to, unless pointer is null. */
- if (TYPE_LENGTH (elttype) == 1
- && TYPE_CODE (elttype) == TYPE_CODE_CHAR
- && (format == 0 || format == 's')
- && addr != 0
- && /* If print_max is UINT_MAX, the alloca below will fail.
- In that case don't try to print the string. */
- print_max < UINT_MAX)
- i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
-
- /* Return number of characters printed, plus one for the
- terminating null if we have "reached the end". */
- return (i + (print_max && i != print_max));
- break;
-
- case TYPE_CODE_STRING:
- i = TYPE_LENGTH (type);
- LA_PRINT_STRING (stream, valaddr, i, 1, 0);
- /* Return number of characters printed, plus one for the terminating
- null if we have "reached the end". */
- return (i + (print_max && i != print_max));
- break;
-
- case TYPE_CODE_BITSTRING:
- case TYPE_CODE_SET:
- elttype = TYPE_INDEX_TYPE (type);
- CHECK_TYPEDEF (elttype);
- if (TYPE_STUB (elttype))
- {
- fprintf_filtered (stream, "<incomplete type>");
- gdb_flush (stream);
- break;
- }
- {
- struct type *range = elttype;
- LONGEST low_bound, high_bound;
- int i;
- int is_bitstring = TYPE_CODE (type) == TYPE_CODE_BITSTRING;
- int need_comma = 0;
-
- if (is_bitstring)
- fputs_filtered ("B'", stream);
- else
- fputs_filtered ("[", stream);
-
- i = get_discrete_bounds (range, &low_bound, &high_bound);
- maybe_bad_bstring:
- if (i < 0)
- {
- fputs_filtered ("<error value>", stream);
- goto done;
- }
-
- for (i = low_bound; i <= high_bound; i++)
- {
- int element = value_bit_index (type, valaddr, i);
- if (element < 0)
- {
- i = element;
- goto maybe_bad_bstring;
- }
- if (is_bitstring)
- fprintf_filtered (stream, "%d", element);
- else if (element)
- {
- if (need_comma)
- fputs_filtered (", ", stream);
- chill_print_type_scalar (range, (LONGEST) i, stream);
- need_comma = 1;
-
- /* Look for a continuous range of true elements. */
- if (i + 1 <= high_bound && value_bit_index (type, valaddr, ++i))
- {
- int j = i; /* j is the upper bound so far of the range */
- fputs_filtered (":", stream);
- while (i + 1 <= high_bound
- && value_bit_index (type, valaddr, ++i))
- j = i;
- chill_print_type_scalar (range, (LONGEST) j, stream);
- }
- }
- }
- done:
- if (is_bitstring)
- fputs_filtered ("'", stream);
- else
- fputs_filtered ("]", stream);
- }
- break;
-
- case TYPE_CODE_STRUCT:
- if (chill_varying_type (type))
- {
- struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 1));
- long length = unpack_long (TYPE_FIELD_TYPE (type, 0), valaddr);
- char *data_addr = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8;
-
- switch (TYPE_CODE (inner))
- {
- case TYPE_CODE_STRING:
- if (length > TYPE_LENGTH (type) - 2)
- {
- fprintf_filtered (stream,
- "<dynamic length %ld > static length %d> *invalid*",
- length, TYPE_LENGTH (type));
-
- /* Don't print the string; doing so might produce a
- segfault. */
- return length;
- }
- LA_PRINT_STRING (stream, data_addr, length, 1, 0);
- return length;
- default:
- break;
- }
- }
- chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
- 0);
- break;
-
- case TYPE_CODE_REF:
- if (addressprint)
- {
- fprintf_filtered (stream, "LOC(");
- print_address_numeric
- (extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT),
- 1,
- stream);
- fprintf_filtered (stream, ")");
- if (deref_ref)
- fputs_filtered (": ", stream);
- }
- /* De-reference the reference. */
- if (deref_ref)
- {
- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF)
- {
- struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr),
- NULL);
- val_print (VALUE_TYPE (deref_val),
- VALUE_CONTENTS (deref_val),
- 0,
- VALUE_ADDRESS (deref_val), stream, format,
- deref_ref, recurse + 1, pretty);
- }
- else
- fputs_filtered ("???", stream);
- }
- break;
-
- case TYPE_CODE_ENUM:
- c_val_print (type, valaddr, 0, address, stream, format,
- deref_ref, recurse, pretty);
- break;
-
- case TYPE_CODE_RANGE:
- if (TYPE_TARGET_TYPE (type))
- chill_val_print (TYPE_TARGET_TYPE (type), valaddr, 0, address, stream,
- format, deref_ref, recurse, pretty);
- break;
-
- case TYPE_CODE_MEMBER:
- case TYPE_CODE_UNION:
- case TYPE_CODE_FUNC:
- case TYPE_CODE_VOID:
- case TYPE_CODE_ERROR:
- default:
- /* Let's defer printing to the C printer, rather than
- print an error message. FIXME! */
- c_val_print (type, valaddr, 0, address, stream, format,
- deref_ref, recurse, pretty);
- }
- gdb_flush (stream);
- return (0);
-}
-
-/* Mutually recursive subroutines of cplus_print_value and c_val_print to
- print out a structure's fields: cp_print_value_fields and cplus_print_value.
-
- TYPE, VALADDR, STREAM, RECURSE, and PRETTY have the
- same meanings as in cplus_print_value and c_val_print.
-
- DONT_PRINT is an array of baseclass types that we
- should not print, or zero if called from top level. */
-
-static void
-chill_print_value_fields (struct type *type, char *valaddr,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty, struct type **dont_print)
-{
- int i, len;
- int fields_seen = 0;
-
- CHECK_TYPEDEF (type);
-
- fprintf_filtered (stream, "[");
- len = TYPE_NFIELDS (type);
- if (len == 0)
- {
- fprintf_filtered (stream, "<No data fields>");
- }
- else
- {
- for (i = 0; i < len; i++)
- {
- if (fields_seen)
- {
- fprintf_filtered (stream, ", ");
- }
- fields_seen = 1;
- if (pretty)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- else
- {
- wrap_here (n_spaces (2 + 2 * recurse));
- }
- fputs_filtered (".", stream);
- fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
- language_chill, DMGL_NO_OPTS);
- fputs_filtered (": ", stream);
- if (TYPE_FIELD_PACKED (type, i))
- {
- struct value *v;
-
- /* Bitfields require special handling, especially due to byte
- order problems. */
- v = value_from_longest (TYPE_FIELD_TYPE (type, i),
- unpack_field_as_long (type, valaddr, i));
-
- chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
- stream, format, 0, recurse + 1, pretty);
- }
- else
- {
- chill_val_print (TYPE_FIELD_TYPE (type, i),
- valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
- 0, stream, format, 0, recurse + 1, pretty);
- }
- }
- if (pretty)
- {
- fprintf_filtered (stream, "\n");
- print_spaces_filtered (2 * recurse, stream);
- }
- }
- fprintf_filtered (stream, "]");
-}
-
-int
-chill_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
-{
- struct type *type = VALUE_TYPE (val);
- struct type *real_type = check_typedef (type);
-
- /* If it is a pointer, indicate what it points to.
-
- Print type also if it is a reference. */
-
- if (TYPE_CODE (real_type) == TYPE_CODE_PTR ||
- TYPE_CODE (real_type) == TYPE_CODE_REF)
- {
- char *valaddr = VALUE_CONTENTS (val);
- CORE_ADDR addr = unpack_pointer (type, valaddr);
- if (TYPE_CODE (type) != TYPE_CODE_PTR || addr != 0)
- {
- int i;
- char *name = TYPE_NAME (type);
- if (name)
- fputs_filtered (name, stream);
- else if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
- fputs_filtered ("PTR", stream);
- else
- {
- fprintf_filtered (stream, "(");
- type_print (type, "", stream, -1);
- fprintf_filtered (stream, ")");
- }
- fprintf_filtered (stream, "(");
- i = val_print (type, valaddr, 0, VALUE_ADDRESS (val),
- stream, format, 1, 0, pretty);
- fprintf_filtered (stream, ")");
- return i;
- }
- }
- return (val_print (type, VALUE_CONTENTS (val), 0,
- VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
-}
+// 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, "<incomplete type>");
+// 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, "<incomplete type>");
+// 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 ("<error value>", 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 "<dynamic length %ld > 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, "<No data fields>");
+// 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 bcd9a42e1b5..799e1f464d6 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -24,6 +24,7 @@
#include "target.h" /* For baud_rate, remote_debug and remote_timeout */
#include "gdb_wait.h" /* For shell escape implementation */
#include "gdb_regex.h" /* Used by apropos_command */
+#include "gdb_string.h"
#include "filenames.h" /* for DOSish file names */
#include "ui-out.h"
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 3f510ac87d1..bce0c2d3f41 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -22,6 +22,7 @@
#include "symtab.h"
#include <ctype.h>
#include "gdb_regex.h"
+#include "gdb_string.h"
#include "ui-out.h"
@@ -53,8 +54,7 @@ do_cfunc (struct cmd_list_element *c, char *args, int from_tty)
}
void
-set_cmd_cfunc (struct cmd_list_element *cmd,
- void (*cfunc) (char *args, int from_tty))
+set_cmd_cfunc (struct cmd_list_element *cmd, cmd_cfunc_ftype *cfunc)
{
if (cfunc == NULL)
cmd->func = NULL;
@@ -70,9 +70,7 @@ do_sfunc (struct cmd_list_element *c, char *args, int from_tty)
}
void
-set_cmd_sfunc (struct cmd_list_element *cmd,
- void (*sfunc) (char *args, int from_tty,
- struct cmd_list_element * c))
+set_cmd_sfunc (struct cmd_list_element *cmd, cmd_sfunc_ftype *sfunc)
{
if (sfunc == NULL)
cmd->func = NULL;
@@ -328,6 +326,61 @@ add_set_or_show_cmd (char *name,
return c;
}
+/* Add element named NAME to both the command SET_LIST and SHOW_LIST.
+ CLASS is as in add_cmd. VAR_TYPE is the kind of thing we are
+ setting. VAR is address of the variable being controlled by this
+ command. SET_FUNC and SHOW_FUNC are the callback functions (if
+ non-NULL). SET_DOC and SHOW_DOC are the documentation strings.
+ SET_RESULT and SHOW_RESULT, if not NULL, are set to the resulting
+ command structures. */
+
+void
+add_setshow_cmd_full (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list,
+ struct cmd_list_element **set_result,
+ struct cmd_list_element **show_result)
+{
+ struct cmd_list_element *set;
+ struct cmd_list_element *show;
+ set = add_set_or_show_cmd (name, set_cmd, class, var_type, var,
+ set_doc, set_list);
+ if (set_func != NULL)
+ set_cmd_sfunc (set, set_func);
+ show = add_set_or_show_cmd (name, show_cmd, class, var_type, var,
+ show_doc, show_list);
+ if (show_func != NULL)
+ set_cmd_sfunc (show, show_func);
+
+ if (set_result != NULL)
+ *set_result = set;
+ if (show_result != NULL)
+ *show_result = show;
+}
+
+/* Add element named NAME to both the command SET_LIST and SHOW_LIST.
+ CLASS is as in add_cmd. VAR_TYPE is the kind of thing we are
+ setting. VAR is address of the variable being controlled by this
+ command. SET_FUNC and SHOW_FUNC are the callback functions (if
+ non-NULL). SET_DOC and SHOW_DOC are the documentation strings. */
+
+void
+add_setshow_cmd (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
+{
+ add_setshow_cmd_full (name, class, var_type, var, set_doc, show_doc,
+ set_func, show_func, set_list, show_list,
+ NULL, NULL);
+}
struct cmd_list_element *
add_set_cmd (char *name,
@@ -363,49 +416,57 @@ add_set_enum_cmd (char *name,
return c;
}
-/* Add element named NAME to command list LIST (the list for set
- or some sublist thereof).
- CLASS is as in add_cmd.
- VAR is address of the variable which will contain the value.
- DOC is the documentation string. */
-struct cmd_list_element *
-add_set_auto_boolean_cmd (char *name,
- enum command_class class,
- enum cmd_auto_boolean *var,
- char *doc,
- struct cmd_list_element **list)
+/* Add an auto-boolean command named NAME to both the set and show
+ command list lists. CLASS is as in add_cmd. VAR is address of the
+ variable which will contain the value. DOC is the documentation
+ string. FUNC is the corresponding callback. */
+void
+add_setshow_auto_boolean_cmd (char *name,
+ enum command_class class,
+ enum auto_boolean *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
{
static const char *auto_boolean_enums[] = { "on", "off", "auto", NULL };
struct cmd_list_element *c;
- c = add_set_cmd (name, class, var_auto_boolean, var, doc, list);
+ add_setshow_cmd_full (name, class, var_auto_boolean, var,
+ set_doc, show_doc, set_func, show_func,
+ set_list, show_list,
+ &c, NULL);
c->enums = auto_boolean_enums;
- return c;
}
-/* Add element named NAME to command list LIST (the list for set
- or some sublist thereof).
- CLASS is as in add_cmd.
- VAR is address of the variable which will contain the value.
- DOC is the documentation string. */
-struct cmd_list_element *
-add_set_boolean_cmd (char *name,
- enum command_class class,
- int *var,
- char *doc,
- struct cmd_list_element **list)
+/* Add element named NAME to both the set and show command LISTs (the
+ list for set/show or some sublist thereof). CLASS is as in
+ add_cmd. VAR is address of the variable which will contain the
+ value. SET_DOC and SHOW_DOR are the documentation strings. */
+void
+add_setshow_boolean_cmd (char *name,
+ enum command_class class,
+ int *var, char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
{
static const char *boolean_enums[] = { "on", "off", NULL };
struct cmd_list_element *c;
- c = add_set_cmd (name, class, var_boolean, var, doc, list);
+ add_setshow_cmd_full (name, class, var_boolean, var,
+ set_doc, show_doc,
+ set_func, show_func,
+ set_list, show_list,
+ &c, NULL);
c->enums = boolean_enums;
- return c;
}
/* Where SETCMD has already been added, add the corresponding show
command to LIST and return a pointer to the added command (not
necessarily the head of LIST). */
/* NOTE: cagney/2002-03-17: The original version of add_show_from_set
- used memcpy() to clone `set' into `show'. This ment that in
+ used memcpy() to clone `set' into `show'. This meant that in
addition to all the needed fields (var, name, et.al.) some
unnecessary fields were copied (namely the callback function). The
function explictly copies relevant fields. For a `set' and `show'
@@ -1445,3 +1506,23 @@ complete_on_enum (const char *enumlist[],
return matchlist;
}
+
+/* check function pointer */
+int
+cmd_func_p (struct cmd_list_element *cmd)
+{
+ return (cmd->func != NULL);
+}
+
+
+/* call the command function */
+void
+cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
+{
+ if (cmd_func_p (cmd))
+ (*cmd->func) (cmd, args, from_tty);
+ else
+ error ("Invalid command");
+}
+
+
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 72436f04657..e8563ff5c59 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -69,12 +69,11 @@ struct cmd_list_element
to one of the below. */
union
{
- /* If type is not_set_cmd, call it like this: */
- void (*cfunc) (char *args, int from_tty);
-
- /* If type is set_cmd or show_cmd, first set the variables, and
- then call this. */
- void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c);
+ /* If type is not_set_cmd, call it like this: */
+ cmd_cfunc_ftype *cfunc;
+ /* If type is set_cmd or show_cmd, first set the variables,
+ and then call this: */
+ cmd_sfunc_ftype *sfunc;
}
function;
@@ -294,18 +293,6 @@ extern struct cmd_list_element *add_set_enum_cmd (char *name,
char *doc,
struct cmd_list_element **list);
-extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
- enum command_class class,
- enum cmd_auto_boolean *var,
- char *doc,
- struct cmd_list_element **list);
-
-extern struct cmd_list_element *add_set_boolean_cmd (char *name,
- enum command_class class,
- int *var,
- char *doc,
- struct cmd_list_element **list);
-
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 36c1d2db2be..a648093dd47 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -360,61 +360,61 @@ dump_filetype (char *cmd, char *mode, char *filetype)
static void
dump_srec_memory (char *args, int from_tty)
{
- dump_memory_to_file (args, "w", "srec");
+ dump_memory_to_file (args, FOPEN_WB, "srec");
}
static void
dump_srec_value (char *args, int from_tty)
{
- dump_value_to_file (args, "w", "srec");
+ dump_value_to_file (args, FOPEN_WB, "srec");
}
static void
dump_ihex_memory (char *args, int from_tty)
{
- dump_memory_to_file (args, "w", "ihex");
+ dump_memory_to_file (args, FOPEN_WB, "ihex");
}
static void
dump_ihex_value (char *args, int from_tty)
{
- dump_value_to_file (args, "w", "ihex");
+ dump_value_to_file (args, FOPEN_WB, "ihex");
}
static void
dump_tekhex_memory (char *args, int from_tty)
{
- dump_memory_to_file (args, "w", "tekhex");
+ dump_memory_to_file (args, FOPEN_WB, "tekhex");
}
static void
dump_tekhex_value (char *args, int from_tty)
{
- dump_value_to_file (args, "w", "tekhex");
+ dump_value_to_file (args, FOPEN_WB, "tekhex");
}
static void
dump_binary_memory (char *args, int from_tty)
{
- dump_memory_to_file (args, "w", "binary");
+ dump_memory_to_file (args, FOPEN_WB, "binary");
}
static void
dump_binary_value (char *args, int from_tty)
{
- dump_value_to_file (args, "w", "binary");
+ dump_value_to_file (args, FOPEN_WB, "binary");
}
static void
append_binary_memory (char *args, int from_tty)
{
- dump_memory_to_file (args, "a", "binary");
+ dump_memory_to_file (args, FOPEN_AB, "binary");
}
static void
append_binary_value (char *args, int from_tty)
{
- dump_value_to_file (args, "a", "binary");
+ dump_value_to_file (args, FOPEN_AB, "binary");
}
struct dump_context
@@ -442,7 +442,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
c->completer = filename_completer;
d = XMALLOC (struct dump_context);
d->func = func;
- d->mode = "w";
+ d->mode = FOPEN_WB;
set_cmd_context (c, d);
c->func = call_dump_func;
@@ -450,7 +450,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
c->completer = filename_completer;
d = XMALLOC (struct dump_context);
d->func = func;
- d->mode = "a";
+ d->mode = FOPEN_AB;
set_cmd_context (c, d);
c->func = call_dump_func;
@@ -547,7 +547,7 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args)
static void
restore_binary_file (char *filename, struct callback_data *data)
{
- FILE *file = fopen_with_cleanup (filename, "r");
+ FILE *file = fopen_with_cleanup (filename, FOPEN_RB);
int status;
char *buf;
long len;
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
deleted file mode 100644
index db6649286c2..00000000000
--- a/gdb/cli/cli-interp.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* CLI Definitions for GDB
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "interps.h"
-#include "wrapper.h"
-#include "event-top.h"
-#include "ui-out.h"
-#include "cli-out.h"
-
-/* Prototypes for the CLI Interpreter functions */
-
-int cli_interpreter_init (void *data);
-int cli_interpreter_resume (void *data);
-int cli_interpreter_do_one_event (void *data);
-int cli_interpreter_suspend (void *data);
-int cli_interpreter_delete (void *data);
-int cli_interpreter_exec (void *data, char *command_str);
-int cli_interpreter_display_prompt (void *data, char *new_prompt);
-
-/* These are the ui_out and the interpreter for the console interpreter. */
-struct ui_out *cli_uiout;
-struct gdb_interpreter *cli_interp;
-
-/* These implement the cli out interpreter: */
-
-int
-cli_interpreter_init (void *data)
-{
- return 1;
-}
-
-int
-cli_interpreter_resume (void *data)
-{
- /*sync_execution = 1;*/
- gdb_setup_readline ();
- return 1;
-}
-
-int
-cli_interpreter_do_one_event (void *data)
-{
- return 1;
-}
-
-int
-cli_interpreter_suspend (void *data)
-{
- gdb_disable_readline ();
- return 1;
-}
-
-int
-cli_interpreter_delete (void *data)
-{
- return 1;
-}
-
-int
-cli_interpreter_display_prompt (void *data, char *new_prompt)
-{
- if (gdb_interpreter_is_quiet (NULL))
- {
- return 1;
- }
- else
- {
- return 0;
- }
-}
-
-int
-cli_interpreter_exec (void *data, char *command_str)
-{
- return gdb_execute_command (uiout, command_str, 0);
-}
-
-/* standard gdb initialization hook */
-void
-_initialize_cli_interp (void)
-{
- struct gdb_interpreter_procs procs = {
- cli_interpreter_init, /* init_proc */
- cli_interpreter_resume, /* resume_proc */
- cli_interpreter_do_one_event, /* do_one_event_proc */
- cli_interpreter_suspend, /* suspend_proc */
- cli_interpreter_delete, /* delete_proc */
- cli_interpreter_exec, /* exec_proc */
- cli_interpreter_display_prompt /* prompt_proc */
- };
-
- cli_uiout = cli_out_new (gdb_stdout);
- cli_interp = gdb_new_interpreter (GDB_INTERPRETER_CONSOLE, NULL, cli_uiout,
- &procs);
- gdb_add_interpreter (cli_interp);
-}
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index fc3261c7ade..9aac6e6aaae 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -27,6 +27,7 @@
#include <ctype.h>
#include "ui-out.h"
+#include "gdb_string.h"
#include "top.h"
#include "cli/cli-cmds.h"
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index f967b0c3eba..44b0b4ec460 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -20,9 +20,7 @@
#include "defs.h"
#include "value.h"
#include <ctype.h>
-#if 0
#include "gdb_string.h"
-#endif
#include "ui-out.h"
@@ -34,9 +32,8 @@
static int parse_binary_operation (char *);
-static enum cmd_auto_boolean parse_auto_binary_operation (const char *arg);
-static enum cmd_auto_boolean
+static enum auto_boolean
parse_auto_binary_operation (const char *arg)
{
if (arg != NULL && *arg != '\0')
@@ -48,18 +45,18 @@ parse_auto_binary_operation (const char *arg)
|| strncmp (arg, "1", length) == 0
|| strncmp (arg, "yes", length) == 0
|| strncmp (arg, "enable", length) == 0)
- return CMD_AUTO_BOOLEAN_TRUE;
+ return AUTO_BOOLEAN_TRUE;
else if (strncmp (arg, "off", length) == 0
|| strncmp (arg, "0", length) == 0
|| strncmp (arg, "no", length) == 0
|| strncmp (arg, "disable", length) == 0)
- return CMD_AUTO_BOOLEAN_FALSE;
+ return AUTO_BOOLEAN_FALSE;
else if (strncmp (arg, "auto", length) == 0
|| (strncmp (arg, "-1", length) == 0 && length > 1))
- return CMD_AUTO_BOOLEAN_AUTO;
+ return AUTO_BOOLEAN_AUTO;
}
error ("\"on\", \"off\" or \"auto\" expected.");
- return CMD_AUTO_BOOLEAN_AUTO; /* pacify GCC */
+ return AUTO_BOOLEAN_AUTO; /* pacify GCC */
}
static int
@@ -167,7 +164,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
*(int *) c->var = parse_binary_operation (arg);
break;
case var_auto_boolean:
- *(enum cmd_auto_boolean *) c->var = parse_auto_binary_operation (arg);
+ *(enum auto_boolean *) c->var = parse_auto_binary_operation (arg);
break;
case var_uinteger:
if (arg == NULL)
@@ -296,15 +293,15 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
fputs_filtered (*(int *) c->var ? "on" : "off", stb->stream);
break;
case var_auto_boolean:
- switch (*(enum cmd_auto_boolean*) c->var)
+ switch (*(enum auto_boolean*) c->var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
fputs_filtered ("on", stb->stream);
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
fputs_filtered ("off", stb->stream);
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
fputs_filtered ("auto", stb->stream);
break;
default:
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 84b3761cf55..d794a7d382a 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -28,7 +28,7 @@
#include "breakpoint.h"
#include "bfd.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "gdb_string.h"
#include <ctype.h>
@@ -593,16 +593,34 @@ coff_symfile_read (struct objfile *objfile, int mainline)
/* End of warning */
- /* Read the line number table, all at once. */
info->min_lineno_offset = 0;
info->max_lineno_offset = 0;
- bfd_map_over_sections (abfd, find_linenos, (void *) info);
- make_cleanup (free_linetab_cleanup, 0 /*ignore*/);
- val = init_lineno (abfd, info->min_lineno_offset,
- info->max_lineno_offset - info->min_lineno_offset);
- if (val < 0)
- error ("\"%s\": error reading line numbers\n", name);
+ /* Only read line number information if we have symbols.
+
+ On Windows NT, some of the system's DLL's have sections with
+ PointerToLinenumbers fields that are non-zero, but point at
+ random places within the image file. (In the case I found,
+ KERNEL32.DLL's .text section has a line number info pointer that
+ points into the middle of the string `lib\\i386\kernel32.dll'.)
+
+ However, these DLL's also have no symbols. The line number
+ tables are meaningless without symbols. And in fact, GDB never
+ uses the line number information unless there are symbols. So we
+ can avoid spurious error messages (and maybe run a little
+ faster!) by not even reading the line number table unless we have
+ symbols. */
+ if (num_symbols > 0)
+ {
+ /* Read the line number table, all at once. */
+ bfd_map_over_sections (abfd, find_linenos, (void *) info);
+
+ make_cleanup (free_linetab_cleanup, 0 /*ignore*/);
+ val = init_lineno (abfd, info->min_lineno_offset,
+ info->max_lineno_offset - info->min_lineno_offset);
+ if (val < 0)
+ error ("\"%s\": error reading line numbers\n", name);
+ }
/* Now read the string table, all at once. */
@@ -1409,13 +1427,12 @@ patch_opaque_types (struct symtab *s)
/* Go through the per-file symbols only */
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
- for (i = BLOCK_NSYMS (b) - 1; i >= 0; i--)
+ ALL_BLOCK_SYMBOLS (b, i, real_sym)
{
/* Find completed typedefs to use to fix opaque ones.
Remove syms from the chain when their types are stored,
but search the whole chain, as there may be several syms
from different files with the same name. */
- real_sym = BLOCK_SYM (b, i);
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF &&
SYMBOL_NAMESPACE (real_sym) == VAR_NAMESPACE &&
TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR &&
diff --git a/gdb/command.h b/gdb/command.h
index db7a7402584..96c99abcaba 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -51,14 +51,6 @@ typedef enum cmd_types
}
cmd_types;
-/* Reasonable values for an AUTO_BOOLEAN variable. */
-enum cmd_auto_boolean
-{
- CMD_AUTO_BOOLEAN_TRUE,
- CMD_AUTO_BOOLEAN_FALSE,
- CMD_AUTO_BOOLEAN_AUTO
-};
-
/* Types of "set" or "show" command. */
typedef enum var_types
{
@@ -67,9 +59,9 @@ typedef enum var_types
var_boolean,
/* "on" / "true" / "enable" or "off" / "false" / "disable" or
- "auto. *VAR is an ``enum cmd_auto_boolean''. NOTE: In general
- a custom show command will need to be implemented - one that
- for "auto" prints both the "auto" and the current auto-selected
+ "auto. *VAR is an ``enum auto_boolean''. NOTE: In general a
+ custom show command will need to be implemented - one that for
+ "auto" prints both the "auto" and the current auto-selected
value. */
var_auto_boolean,
@@ -132,12 +124,14 @@ extern struct cmd_list_element *add_abbrev_prefix_cmd (char *,
/* Set the commands corresponding callback. */
+typedef void cmd_cfunc_ftype (char *args, int from_tty);
extern void set_cmd_cfunc (struct cmd_list_element *cmd,
- void (*cfunc) (char *args, int from_tty));
+ cmd_cfunc_ftype *cfunc);
+typedef void cmd_sfunc_ftype (char *args, int from_tty,
+ struct cmd_list_element *c);
extern void set_cmd_sfunc (struct cmd_list_element *cmd,
- void (*sfunc) (char *args, int from_tty,
- struct cmd_list_element * c));
+ cmd_sfunc_ftype *sfunc);
extern void set_cmd_completer (struct cmd_list_element *cmd,
char **(*completer) (char *text, char *word));
@@ -216,6 +210,26 @@ extern void help_list (struct cmd_list_element *, char *,
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
+extern void add_setshow_cmd (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
+extern void add_setshow_cmd_full (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list,
+ struct cmd_list_element **set_result,
+ struct cmd_list_element **show_result);
+
extern struct cmd_list_element *add_set_cmd (char *name, enum
command_class class,
var_types var_type, void *var,
@@ -229,17 +243,24 @@ extern struct cmd_list_element *add_set_enum_cmd (char *name,
char *doc,
struct cmd_list_element **list);
-extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
- enum command_class class,
- enum cmd_auto_boolean *var,
- char *doc,
- struct cmd_list_element **list);
-
-extern struct cmd_list_element *add_set_boolean_cmd (char *name,
- enum command_class class,
- int *var,
- char *doc,
- struct cmd_list_element **list);
+extern void add_setshow_auto_boolean_cmd (char *name,
+ enum command_class class,
+ enum auto_boolean *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
+extern void add_setshow_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *set_doc,
+ char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
@@ -259,4 +280,10 @@ extern void dont_repeat (void);
extern void not_just_help_class_command (char *, int);
+/* check function pointer */
+extern int cmd_func_p (struct cmd_list_element *cmd);
+
+/* call the command function */
+extern void cmd_func (struct cmd_list_element *cmd, char *args, int from_tty);
+
#endif /* !defined (COMMAND_H) */
diff --git a/gdb/config.in b/gdb/config.in
index 750a8aea949..8c1c7bf356e 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if on AIX 3.
System headers sometimes define this.
@@ -41,6 +41,9 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
@@ -364,6 +367,9 @@
/* Define if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
+/* Define if you have the <sys/proc.h> header file. */
+#undef HAVE_SYS_PROC_H
+
/* Define if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H
@@ -439,6 +445,9 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
+/* Name of this package. */
+#undef PACKAGE
+
/* Define if sigsetjmp is available. */
#undef HAVE_SIGSETJMP
diff --git a/gdb/config/alpha/alpha.mt b/gdb/config/alpha/alpha.mt
new file mode 100644
index 00000000000..dfff657cbcc
--- /dev/null
+++ b/gdb/config/alpha/alpha.mt
@@ -0,0 +1,2 @@
+TDEPFILES= alpha-tdep.o
+TM_FILE= tm-alpha.h
diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h
index c59b88cb21e..990ccb45d97 100644
--- a/gdb/config/alpha/nm-linux.h
+++ b/gdb/config/alpha/nm-linux.h
@@ -23,7 +23,7 @@
#ifndef NM_LINUX_H
#define NM_LINUX_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* ptrace register ``addresses'' are absolute. */
diff --git a/gdb/config/alpha/tm-alphalinux.h b/gdb/config/alpha/tm-alphalinux.h
index 27ff45722af..4858b90eba2 100644
--- a/gdb/config/alpha/tm-alphalinux.h
+++ b/gdb/config/alpha/tm-alphalinux.h
@@ -40,6 +40,6 @@ extern LONGEST alpha_linux_sigtramp_offset (CORE_ADDR);
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
-#include "tm-linux.h"
+#include "config/tm-linux.h"
#endif /* TM_LINUXALPHA_H */
diff --git a/gdb/config/arc/arc.mt b/gdb/config/arc/arc.mt
index 8ee8c3d0619..3ed7410136f 100644
--- a/gdb/config/arc/arc.mt
+++ b/gdb/config/arc/arc.mt
@@ -1,3 +1,3 @@
-# Target: ARC processor
-TDEPFILES = arc-tdep.o
-TM_FILE = tm-arc.h
+# 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
index cbdcf41e0e9..1c7c74f7a9e 100644
--- a/gdb/config/arc/tm-arc.h
+++ b/gdb/config/arc/tm-arc.h
@@ -1,336 +1,336 @@
-/* Parameters for target machine ARC, for GDB, the GNU debugger.
- Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "regcache.h"
-
-/* Used by arc-tdep.c to set the default cpu type. */
-#define DEFAULT_ARC_CPU_TYPE "base"
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0))
-extern CORE_ADDR arc_skip_prologue (CORE_ADDR, int);
-
-#define PROLOGUE_FRAMELESS_P(pc) arc_prologue_frameless_p(pc)
-extern int arc_prologue_frameless_p (CORE_ADDR);
-
-/* Sequence of bytes for breakpoint instruction.
- ??? The current value is "sr -1,[-1]" and is for the simulator only.
- The simulator watches for this and does the right thing.
- The hardware version will have to associate with each breakpoint
- the sequence "flag 1; nop; nop; nop". IE: The breakpoint insn will not
- be a fixed set of bits but instead will be a branch to a semi-random
- address. Presumably this will be cleaned up for "second silicon". */
-#define BIG_BREAKPOINT { 0x12, 0x1f, 0xff, 0xff }
-#define LITTLE_BREAKPOINT { 0xff, 0xff, 0x1f, 0x12 }
-
-/* Given the exposed pipeline, there isn't any one correct value.
- However, this value must be 4. GDB can't handle any other value (other than
- zero). See for example infrun.c:
- "prev_pc != stop_pc - DECR_PC_AFTER_BREAK" */
-/* FIXME */
-#define DECR_PC_AFTER_BREAK 8
-
-/* We don't have a reliable single step facility.
- ??? We do have a cycle single step facility, but that won't work. */
-#define SOFTWARE_SINGLE_STEP_P() 1
-extern void arc_software_single_step (enum target_signal, int);
-#define SOFTWARE_SINGLE_STEP(sig,bp_p) arc_software_single_step (sig, bp_p)
-
-/* FIXME: Need to set STEP_SKIPS_DELAY. */
-
-/* Given a pc value as defined by the hardware, return the real address.
- Remember that on the ARC blink contains that status register which
- includes PC + flags (so we have to mask out the flags). */
-#define ARC_PC_TO_REAL_ADDRESS(pc) (((pc) & 0xffffff) << 2)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function
- executes some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (ARC_PC_TO_REAL_ADDRESS (read_register (BLINK_REGNUM)))
-
-/* Stack grows upward */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-#define REGISTER_SIZE 4
-
-/* Number of machine registers */
-#define NUM_REGS 92
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
-{ \
- /* 0 */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- /* 16 */ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
- /* 24 */ "r24", "r25", "r26", "fp", "sp", "ilink1", "ilink2", "blink", \
- /* 32 */ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
- /* 40 */ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \
- /* 48 */ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
- /* 56 */ "r56", "mlo", "mmid", "mhi", "lp_count", \
- /* 61 */ "status", "sema", "lp_start", "lp_end", "identity", "debug", \
- /* 67 */ "aux10", "aux11", "aux12", "aux13", "aux14", \
- /* 72 */ "aux15", "aux16", "aux17", "aux18", "aux19", \
- /* 77 */ "aux1a", "aux1b", "aux1c", "aux1d", "aux1e", \
- /* 82 */ "aux1f", "aux20", "aux21", "aux22", \
- /* 86 */ "aux30", "aux31", "aux32", "aux33", "aux40", \
- /* 91 */ "pc" \
-}
-
-/* Register numbers of various important registers (used to index
- into arrays of register names and register values). */
-
-#define R0_REGNUM 0 /* First local register */
-#define R59_REGNUM 59 /* Last local register */
-#define FP_REGNUM 27 /* Contains address of executing stack frame */
-#define SP_REGNUM 28 /* stack pointer */
-#define BLINK_REGNUM 31 /* link register */
-#define STA_REGNUM 61 /* processor status word */
-#define PC_REGNUM 91 /* instruction pointer */
-#define AUX_BEG_REGNUM 61 /* aux reg begins */
-#define AUX_END_REGNUM 90 /* aux reg ends, pc not real aux reg */
-
-/* Fake registers used to mark immediate data. */
-#define SHIMM_FLAG_REGNUM 61
-#define LIMM_REGNUM 62
-#define SHIMM_REGNUM 63
-
-#define AUX_REG_MAP \
-{ \
- { 0, 1, 2, 3, 4, 5, \
- 16, -1, -1, -1, -1, \
- -1, -1, -1, -1, -1, \
- -1, -1, -1, -1, 30, \
- -1, 32, 33, -1, \
- 48, 49, 50, 51, 64, \
- 0 \
- }, \
- { 0, 1, 2, 3, 4, 5, \
- 16, -1, -1, -1, -1, \
- -1, -1, -1, -1, -1, \
- -1, -1, -1, -1, 30, \
- 31, 32, 33, -1, \
- -1, -1, -1, -1, -1, \
- 0 \
- }, \
- { 0, 1, 2, 3, 4, 5, \
- 16, 17, 18, 19, 20, \
- 21, 22, 23, 24, 25, \
- 26, 27, 28, 29, 30, \
- 31, 32, 33, 34, \
- -1, -1, -1, -1, -1, \
- 0 \
- } \
-}
-
-#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS * 4)
-
-/* Index within `registers' of the first byte of the space for register N. */
-#define REGISTER_BYTE(N) (4*(N))
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-#define REGISTER_RAW_SIZE(N) 4
-
-/* Number of bytes of storage in the program's representation for register N. */
-#define REGISTER_VIRTUAL_SIZE(N) 4
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
-
-
-/* Macros for understanding function return values... */
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On arc, a structure is always retunred with pointer in r0. */
-
-#define USE_STRUCT_CONVENTION(gcc_p, type) 1
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
- type is 0.
- */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy(VALBUF, REGBUF+REGISTER_BYTE(R0_REGNUM), TYPE_LENGTH (TYPE))
-
-/* If USE_STRUCT_CONVENTION produces a 1,
- extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (error("Don't know where large structure is returned on arc"), 0)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format, for "value returning" functions.
- For 'return' command: not (yet) implemented for arc. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- error ("Returning values from functions is not implemented in arc gdb")
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- error ("Returning values from functions is not implemented in arc gdb")
-
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR arg_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- ((fi)->fsr = 0, (fi)->arg_pointer = -1)
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-/* On the arc, we get the chain pointer by reading the PFP saved
- on the stack. */
-/* The PFP and RPC is in fp and fp+4. */
-
-#define FRAME_CHAIN(thisframe) \
- (read_memory_integer (FRAME_FP (thisframe), 4))
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller. */
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
-
-/* An expression that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI))
-
-/* Where is the PC for a specific frame.
- A leaf function may never save blink, so we have to check for that here. */
-
-#define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame))
-struct frame_info; /* in case frame.h not included yet */
-CORE_ADDR arc_frame_saved_pc (struct frame_info *);
-
-/* If the argument is on the stack, it will be here.
- We cache this value in the frame info if we've already looked it up. */
-/* ??? Is the arg_pointer check necessary? */
-
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->arg_pointer != -1) ? (fi)->arg_pointer : (fi)->frame)
-
-/* This is the same except it should return 0 when
- it does not really know where the args are, rather than guessing.
- This value is not cached since it is only used infrequently. */
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set NUMARGS to the number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Produce the positions of the saved registers in a stack frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
- frame_find_saved_regs (frame_info_addr, &sr)
-extern void frame_find_saved_regs (); /* See arc-tdep.c */
-
-
-/* Things needed for making calls to functions in the inferior process */
-void arc_push_dummy_frame (void);
-#define PUSH_DUMMY_FRAME \
- arc_push_dummy_frame ()
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-void arc_pop_frame (void);
-#define POP_FRAME \
- arc_pop_frame ()
-
-/* This sequence of words is the instructions bl xxxx, flag 1 */
-#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }
-#define CALL_DUMMY_LENGTH 8
-
-/* Start execution at beginning of dummy */
-#define CALL_DUMMY_START_OFFSET 0
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at 'dummyname'. */
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ \
- int from, to, delta, loc; \
- loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH); \
- from = loc + 4; \
- to = (int)(fun); \
- delta = (to - from) >> 2; \
- *((char *)(dummyname) + 1) = (delta & 0x1); \
- *((char *)(dummyname) + 2) = ((delta >> 1) & 0xff); \
- *((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \
- *((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \
-}
+// 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/arm/nm-linux.h b/gdb/config/arm/nm-linux.h
index 2a0ebb3804b..7e0156db43c 100644
--- a/gdb/config/arm/nm-linux.h
+++ b/gdb/config/arm/nm-linux.h
@@ -21,7 +21,7 @@
#ifndef NM_ARMLINUX_H
#define NM_ARMLINUX_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* ptrace register ``addresses'' are absolute. */
diff --git a/gdb/config/arm/tm-linux.h b/gdb/config/arm/tm-linux.h
index 6a0d0e42c96..bbf566d2d83 100644
--- a/gdb/config/arm/tm-linux.h
+++ b/gdb/config/arm/tm-linux.h
@@ -28,7 +28,7 @@
/* Include the common ARM target definitions. */
#include "arm/tm-arm.h"
-#include "tm-linux.h"
+#include "config/tm-linux.h"
/* Use target-specific function to define link map offsets. */
extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
diff --git a/gdb/config/arm/xm-nbsd.h b/gdb/config/arm/xm-nbsd.h
index c5348d39629..d3f76a7dd01 100644
--- a/gdb/config/arm/xm-nbsd.h
+++ b/gdb/config/arm/xm-nbsd.h
@@ -19,4 +19,4 @@
Boston, MA 02111-1307, USA. */
/* Get generic NetBSD host definitions. */
-#include "xm-nbsd.h"
+#include "config/xm-nbsd.h"
diff --git a/gdb/config/d30v/d30v.mt b/gdb/config/d30v/d30v.mt
index da0af2fd2eb..49bd83b6047 100644
--- a/gdb/config/d30v/d30v.mt
+++ b/gdb/config/d30v/d30v.mt
@@ -1,5 +1,5 @@
-# Target: Mitsubishi D30V processor
-TDEPFILES= d30v-tdep.o
-TM_FILE= tm-d30v.h
-SIM_OBS= remote-sim.o
-SIM= ../sim/d30v/libsim.a
+# 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
index 7a14e39132c..3e1ea3f7389 100644
--- a/gdb/config/d30v/tm-d30v.h
+++ b/gdb/config/d30v/tm-d30v.h
@@ -1,323 +1,323 @@
-/* Target-specific definition for the Mitsubishi D30V
- Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_D30V_H
-#define TM_D30V_H
-
-#include "regcache.h"
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* these are the addresses the D30V-EVA board maps data */
-/* and instruction memory to. */
-
-#define DMEM_START 0x20000000
-#define IMEM_START 0x00000000 /* was 0x10000000 */
-#define STACK_START 0x20007ffe
-
-/* Forward decls for prototypes */
-struct frame_info;
-struct frame_saved_regs;
-struct type;
-struct value;
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-extern CORE_ADDR d30v_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(ip) (d30v_skip_prologue (ip))
-
-
-/* Stack grows downward. */
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* for a breakpoint, use "dbt || nop" */
-#define BREAKPOINT {0x00, 0xb0, 0x00, 0x00,\
- 0x00, 0xf0, 0x00, 0x00}
-
-/* If your kernel resets the pc after the trap happens you may need to
- define this before including this file. */
-#define DECR_PC_AFTER_BREAK 0
-
-#define REGISTER_NAMES \
-{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
- "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \
- "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
- "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \
- "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
- "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", \
- "spi", "spu", \
- "psw", "bpsw", "pc", "bpc", "dpsw", "dpc", "cr6", "rpt_c", \
- "rpt_s", "rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "eit_vb",\
- "int_s", "int_m", "a0", "a1" \
- }
-
-#define NUM_REGS 86
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define R0_REGNUM 0
-#define FP_REGNUM 61
-#define LR_REGNUM 62
-#define SP_REGNUM 63
-#define SPI_REGNUM 64 /* Interrupt stack pointer */
-#define SPU_REGNUM 65 /* User stack pointer */
-#define CREGS_START 66
-
-#define PSW_REGNUM (CREGS_START + 0) /* psw, bpsw, or dpsw??? */
-#define PSW_SM (((unsigned long)0x80000000) >> 0) /* Stack mode: 0/SPI */
- /* 1/SPU */
-#define PSW_EA (((unsigned long)0x80000000) >> 2) /* Execution status */
-#define PSW_DB (((unsigned long)0x80000000) >> 3) /* Debug mode */
-#define PSW_DS (((unsigned long)0x80000000) >> 4) /* Debug EIT status */
-#define PSW_IE (((unsigned long)0x80000000) >> 5) /* Interrupt enable */
-#define PSW_RP (((unsigned long)0x80000000) >> 6) /* Repeat enable */
-#define PSW_MD (((unsigned long)0x80000000) >> 7) /* Modulo enable */
-#define PSW_F0 (((unsigned long)0x80000000) >> 17) /* F0 flag */
-#define PSW_F1 (((unsigned long)0x80000000) >> 19) /* F1 flag */
-#define PSW_F2 (((unsigned long)0x80000000) >> 21) /* F2 flag */
-#define PSW_F3 (((unsigned long)0x80000000) >> 23) /* F3 flag */
-#define PSW_S (((unsigned long)0x80000000) >> 25) /* Saturation flag */
-#define PSW_V (((unsigned long)0x80000000) >> 27) /* Overflow flag */
-#define PSW_VA (((unsigned long)0x80000000) >> 29) /* Accum. overflow */
-#define PSW_C (((unsigned long)0x80000000) >> 31) /* Carry/Borrow flag */
-
-#define BPSW_REGNUM (CREGS_START + 1) /* Backup PSW (on interrupt) */
-#define PC_REGNUM (CREGS_START + 2) /* pc, bpc, or dpc??? */
-#define BPC_REGNUM (CREGS_START + 3) /* Backup PC (on interrupt) */
-#define DPSW_REGNUM (CREGS_START + 4) /* Backup PSW (on debug trap) */
-#define DPC_REGNUM (CREGS_START + 5) /* Backup PC (on debug trap) */
-#define RPT_C_REGNUM (CREGS_START + 7) /* Loop count */
-#define RPT_S_REGNUM (CREGS_START + 8) /* Loop start address */
-#define RPT_E_REGNUM (CREGS_START + 9) /* Loop end address */
-#define MOD_S_REGNUM (CREGS_START + 10)
-#define MOD_E_REGNUM (CREGS_START + 11)
-#define IBA_REGNUM (CREGS_START + 14) /* Instruction break address */
-#define EIT_VB_REGNUM (CREGS_START + 15) /* Vector base address */
-#define INT_S_REGNUM (CREGS_START + 16) /* Interrupt status */
-#define INT_M_REGNUM (CREGS_START + 17) /* Interrupt mask */
-#define A0_REGNUM 84
-#define A1_REGNUM 85
-
-/* Say how much memory is needed to store a copy of the register set */
-#define REGISTER_BYTES ((NUM_REGS - 2) * 4 + 2 * 8)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) \
-( ((N) >= A0_REGNUM) ? ( ((N) - A0_REGNUM) * 8 + A0_REGNUM * 4 ) : ((N) * 4) )
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 4 )
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
-( ((N) < A0_REGNUM ) ? builtin_type_long : builtin_type_long_long)
-
-/* Writing to r0 is a noop (not an error or exception or anything like
- that, however). */
-
-#define CANNOT_STORE_REGISTER(regno) ((regno) == R0_REGNUM)
-
-void d30v_do_registers_info (int regnum, int fpregs);
-
-#define DO_REGISTERS_INFO d30v_do_registers_info
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- We store structs through a pointer passed in R2 */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (2, (ADDR)); }
-
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format.
-
- Things always get returned in R2/R3 */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE(2), VALBUF, TYPE_LENGTH (TYPE))
-
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (((CORE_ADDR *)(REGBUF))[2])
-
-
-/* Define other aspects of the stack frame.
- we keep a copy of the worked out return pc lying around, since it
- is a useful bit of info */
-
-#define EXTRA_FRAME_INFO \
- CORE_ADDR return_pc; \
- CORE_ADDR dummy; \
- int frameless; \
- int size;
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- d30v_init_extra_frame_info(fromleaf, fi)
-
-extern void d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi);
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (frameless_look_for_prologue (FI))
-
-CORE_ADDR d30v_frame_chain (struct frame_info *frame);
-#define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME)
-extern int d30v_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe)
-#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
-#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-void d30v_init_frame_pc (int fromleaf, struct frame_info *prev);
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) d30v_init_frame_pc(fromleaf, prev)
-#define INIT_FRAME_PC(fromleaf, prev) /* nada */
-
-/* Immediately after a function call, return the saved pc. We can't */
-/* use frame->return_pc beause that is determined by reading R62 off the */
-/* stack and that may not be written yet. */
-
-#define SAVED_PC_AFTER_CALL(frame) (read_register(LR_REGNUM))
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-/* We can't tell how many args there are */
-
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- d30v_frame_find_saved_regs(frame_info, &(frame_saved_regs))
-
-extern void d30v_frame_find_saved_regs (struct frame_info *,
- struct frame_saved_regs *);
-
-/* DUMMY FRAMES. Need these to support inferior function calls.
- They work like this on D30V:
- First we set a breakpoint at 0 or __start.
- Then we push all the registers onto the stack.
- Then put the function arguments in the proper registers and set r13
- to our breakpoint address.
- Finally call the function directly.
- When it hits the breakpoint, clear the break point and pop the old
- register contents off the stack. */
-
-#define CALL_DUMMY { 0 }
-#define PUSH_DUMMY_FRAME
-#define CALL_DUMMY_START_OFFSET 0
-#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
-#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
-
-extern CORE_ADDR d30v_call_dummy_address (void);
-#define CALL_DUMMY_ADDRESS() d30v_call_dummy_address()
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-sp = d30v_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
-
-#define PC_IN_CALL_DUMMY(pc, sp, frame_address) ( pc == IMEM_START + 4 )
-
-extern CORE_ADDR d30v_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR,
- int, struct value **,
- struct type *, int);
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- (d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
-extern CORE_ADDR d30v_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
-
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
-d30v_extract_return_value(TYPE, REGBUF, VALBUF)
-extern void d30v_extract_return_value (struct type *, char *, char *);
-
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-#define POP_FRAME d30v_pop_frame();
-extern void d30v_pop_frame (void);
-
-#define REGISTER_SIZE 4
-
-/* Need to handle SP special, as we need to select between spu and spi. */
-#if 0 /* XXX until the simulator is fixed */
-#define TARGET_READ_SP() ((read_register (PSW_REGNUM) & PSW_SM) \
- ? read_register (SPU_REGNUM) \
- : read_register (SPI_REGNUM))
-
-#define TARGET_WRITE_SP(val) ((read_register (PSW_REGNUM) & PSW_SM) \
- ? write_register (SPU_REGNUM, (val)) \
- : write_register (SPI_REGNUM, (val)))
-#endif
-
-#define STACK_ALIGN(len) (((len) + 7 ) & ~7)
-
-/* Turn this on to cause remote-sim.c to use sim_set/clear_breakpoint. */
-
-#define SIM_HAS_BREAKPOINTS
-
-#endif /* TM_D30V_H */
+/* 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/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index e5368446db5..47e5483d643 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -10,13 +10,24 @@
@V@/bfd/cpu-m68hc12.c @V@/bfd/cm68hc12.c
@V@/bfd/efi-app-ia32.c @V@/bfd/efi-ia32-app.c
@V@/bfd/efi-app-ia64.c @V@/bfd/efi-ia64-app.c
-@V@/bfd/elf32-i370.c @V@/bfd/elf32-i7.c
+@V@/bfd/elf32-fr30.c @V@/bfd/elf32f30.c
+@V@/bfd/elf32-frv.c @V@/bfd/elf32fv.c
+@V@/bfd/elf32-i370.c @V@/bfd/e32i370.c
+@V@/bfd/elf32-i386.c @V@/bfd/e32i86.c
+@V@/bfd/elf32-i386qnx.c @V@/bfd/e32i86q.c
@V@/bfd/elf32-m68hc11.c @V@/bfd/em68hc11.c
@V@/bfd/elf32-m68hc12.c @V@/bfd/em68hc12.c
@V@/bfd/elf32-m68k.c @V@/bfd/em68k.c
-@V@/bfd/elf32-sh-lin.c @V@/bfd/elf32shlin.c
-@V@/bfd/elf32-sh-nbsd.c @V@/bfd/elf32shnb.c
-@V@/bfd/elf32-sh64.c @V@/bfd/elf32sh64.c
+@V@/bfd/elf32-ppc.c @V@/bfd/e32ppc.c
+@V@/bfd/elf32-ppcqnx.c @V@/bfd/e32ppcq.c
+@V@/bfd/elf32-sh.c @V@/bfd/e32sh.c
+@V@/bfd/elf32-shqnx.c @V@/bfd/e32shq.c
+@V@/bfd/elf32-sh-lin.c @V@/bfd/e32shlin.c
+@V@/bfd/elf32-sh-nbsd.c @V@/bfd/e32shn.c
+@V@/bfd/elf32-sh64.c @V@/bfd/e32sh64.c
+@V@/bfd/elf32-sh64-nbsd.c @V@/bfd/e32sh64n.c
+@V@/bfd/elf64-sh64.c @V@/bfd/e64sh64.c
+@V@/bfd/elf64-sh64-nbsd.c @V@/bfd/e64sh64n.c
@V@/dejagnu/baseboards/mn10200-cygmon.exp @V@/dejagnu/baseboards/mn10200cygmon.exp
@V@/dejagnu/baseboards/mn10200-sim.exp @V@/dejagnu/baseboards/mn10200sim.exp
@V@/dejagnu/baseboards/mn10300-cygmon.exp @V@/dejagnu/baseboards/mn10300cygmon.exp
@@ -131,9 +142,13 @@
@V@/gdb/mipsnbsd-nat.c @V@/gdb/mipsnbnat.c
@V@/gdb/mipsnbsd-tdep.c @V@/gdb/mipsnbtdep.c
@V@/gdb/nindy-share/b.out.h @V@/gdb/nindy-share/b_out.h
+@V@/gdb/ns32knbsd-nat.c @V@/gdb/ns32nb-nat.c
+@V@/gdb/ns32knbsd-tdep.c @V@/gdb/ns32nb-tdep.c
@V@/gdb/osf-share/cma_stack_int.h @V@/gdb/osf-share/cma_stkint.h
@V@/gdb/p-exp.tab.c @V@/gdb/p-exp_tab.c
@V@/gdb/ppc-linux-tdep.c @V@/gdb/ppc-linx-tdep.c
+@V@/gdb/ppcnbsd-nat.c @V@/gdb/ppcnb-nat.c
+@V@/gdb/ppcnbsd-tdep.c @V@/gdb/ppcnb-tdep.c
@V@/gdb/regformats/reg-i386-linux.dat @V@/gdb/regformats/r-i386-lnx.dat
@V@/gdb/regformats/reg-s390x.dat @V@/gdb/regformats/r-s390x.dat
@V@/gdb/remote-adapt.c @V@/gdb/rmt-adapt.c
@@ -160,7 +175,13 @@
@V@/gdb/remote-vxsparc.c @V@/gdb/rmt-vxsparc.c
@V@/gdb/sparclet-rom.c @V@/gdb/splet-rom.c
@V@/gdb/sparclet-stub.c @V@/gdb/splet-stub.c
+@V@/gdb/sparcnbsd-nat.c @V@/gdb/spnb-nat.c
+@V@/gdb/sparcnbsd-tdep.c @V@/gdb/spnb-tdep.c
@V@/gdb/testsuite/.gdbinit @V@/gdb/testsuite/gdb.ini
+@V@/gdb/testsuite/gdb.arch/altivec-abi.c @V@/gdb/testsuite/gdb.arch/av-abi.c
+@V@/gdb/testsuite/gdb.arch/altivec-abi.exp @V@/gdb/testsuite/gdb.arch/av-abi.exp
+@V@/gdb/testsuite/gdb.arch/altivec-regs.c @V@/gdb/testsuite/gdb.arch/av-regs.c
+@V@/gdb/testsuite/gdb.arch/altivec-regs.exp @V@/gdb/testsuite/gdb.arch/av-regs.exp
@V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c
@V@/gdb/testsuite/gdb.c++ @V@/gdb/testsuite/gdb.cxx
@V@/gdb/testsuite/gdb.c++/Makefile.in @V@/gdb/testsuite/gdb.cxx/Makefile.in
diff --git a/gdb/config/fr30/fr30.mt b/gdb/config/fr30/fr30.mt
index fac307ea01c..b7029700f21 100644
--- a/gdb/config/fr30/fr30.mt
+++ b/gdb/config/fr30/fr30.mt
@@ -1,5 +1,5 @@
-# Target: Fujitsu FR30 processor
-TDEPFILES= fr30-tdep.o
-TM_FILE= tm-fr30.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/fr30/libsim.a
+# 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
index 22ddd046a8e..7a583379e8d 100644
--- a/gdb/config/fr30/tm-fr30.h
+++ b/gdb/config/fr30/tm-fr30.h
@@ -1,233 +1,233 @@
-/* Parameters for execution on a Fujitsu FR30 processor.
- Copyright 1999, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "regcache.h"
-
-#define FR30_GENREGS 16
-#define FR30_DEDICATEDREGS 8
-#define FR30_REGSIZE 4 /* bytes */
-
-#define NUM_REGS (FR30_GENREGS + FR30_DEDICATEDREGS)
-#define REGISTER_BYTES ((FR30_GENREGS + FR30_DEDICATEDREGS)*FR30_REGSIZE)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-#define REGISTER_BYTE(N) ((N) * FR30_REGSIZE)
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#define REGISTER_NAMES \
-{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
- "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
- "pc", "ps", "tbr", "rp", "ssp", "usp", "mdh", "mdl" }
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-#define FUNCTION_START_OFFSET 0
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-#define R0_REGNUM 0
-#define R1_REGNUM 1
-#define R2_REGNUM 2
-#define R3_REGNUM 3
-#define R4_REGNUM 4
-#define R5_REGNUM 5
-#define R6_REGNUM 6
-#define R7_REGNUM 7
-#define R8_REGNUM 8
-#define R9_REGNUM 9
-#define R10_REGNUM 10
-#define R11_REGNUM 11
-#define R12_REGNUM 12
-#define R13_REGNUM 13
-#define FP_REGNUM 14 /* Frame pointer */
-#define SP_REGNUM 15 /* Stack pointer */
-#define PC_REGNUM 16 /* Program counter */
-#define RP_REGNUM 19 /* Return pointer */
-
-#define FIRST_ARGREG R4_REGNUM /* first arg (or struct ret val addr) */
-#define LAST_ARGREG R7_REGNUM /* fourth (or third arg) */
-#define RETVAL_REG R4_REGNUM /* return vaue */
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-#define REGISTER_SIZE FR30_REGSIZE
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-#define REGISTER_RAW_SIZE(N) FR30_REGSIZE
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE FR30_REGSIZE
-
-extern void fr30_pop_frame (void);
-#define POP_FRAME fr30_pop_frame()
-
-#define USE_GENERIC_DUMMY_FRAMES 1
-#define CALL_DUMMY {0}
-#define CALL_DUMMY_START_OFFSET (0)
-#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
-#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
-#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
-#define CALL_DUMMY_ADDRESS() entry_point_address ()
-#define PUSH_RETURN_ADDRESS(PC, SP) (write_register(RP_REGNUM, CALL_DUMMY_ADDRESS()), SP)
-#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
-
-/* Number of bytes at start of arglist that are not really args. */
-#define FRAME_ARGS_SKIP 0
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy (VALBUF, REGBUF + REGISTER_BYTE(RETVAL_REG) + \
- (TYPE_LENGTH(TYPE) < 4 ? 4 - TYPE_LENGTH(TYPE) : 0), TYPE_LENGTH (TYPE))
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- extract_address (REGBUF + REGISTER_BYTE (RETVAL_REG), \
- REGISTER_RAW_SIZE (RETVAL_REG))
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (RETVAL_REG, (ADDR)); }
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Forward decls for prototypes */
-struct frame_info;
-struct frame_saved_regs;
-struct type;
-struct value;
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs fsr; \
- int framesize; \
- int frameoffset; \
- int framereg;
-
-extern CORE_ADDR fr30_frame_chain (struct frame_info *fi);
-#define FRAME_CHAIN(fi) fr30_frame_chain (fi)
-
-extern CORE_ADDR fr30_frame_saved_pc (struct frame_info *);
-#define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi))
-
-#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
-
-extern CORE_ADDR fr30_skip_prologue (CORE_ADDR pc);
-#define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc))
-
-/* Write into appropriate registers a function return value of type
- TYPE, given in virtual format. VALBUF is in the target byte order;
- it's typically the VALUE_CONTENTS of some struct value, and those
- are in the target's byte order. */
-extern void fr30_store_return_value (struct type *type, char *valbuf);
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- (fr30_store_return_value ((TYPE), (VALBUF)))
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-#define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
-
-/* Use INT #BREAKPOINT_INTNUM instruction for breakpoint */
-#define FR30_BREAKOP 0x1f /* opcode, type D instruction */
-#define BREAKPOINT_INTNUM 9 /* one of the reserved traps */
-#define BREAKPOINT {FR30_BREAKOP, BREAKPOINT_INTNUM}
-
-/* Define this for Wingdb */
-#define TARGET_FR30
-
-/* Define other aspects of the stack frame. */
-
-/* An expression that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. */
-extern int fr30_frameless_function_invocation (struct frame_info *frame);
-#define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
-
-extern void fr30_init_extra_frame_info (struct frame_info *fi);
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
-
-#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
-
-extern CORE_ADDR
-fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr);
-#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
- (fr30_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)
-
-/* Fujitsu's ABI requires all structs to be passed using a pointer.
- That is obviously not very efficient, so I am leaving the definitions
- to make gdb work with GCC style struct passing, in case we decide
- to go for better performance, rather than for compatibility with
- Fujitsu (just change STRUCT_ALWAYS_BY_ADDR to 0) */
-
-#define STRUCT_ALWAYS_BY_ADDR 1
-
-#if(STRUCT_ALWAYS_BY_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) 1
-#else
-/* more standard GCC (optimized) */
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) \
- ((TYPE_LENGTH(type) > 4) && (TYPE_LENGTH(type) & 0x3))
-#endif
-/* alway return struct by value by input pointer */
-#define USE_STRUCT_CONVENTION(GCC_P, TYPE) 1
-
-/* The stack should always be aligned on a four-word boundary. */
-#define STACK_ALIGN(len) (((len) + 3) & ~3)
-
-/* I think the comment about this in value_arg_coerce is wrong; this
- should be true on any system where you can rely on the prototyping
- information. When this is true, value_arg_coerce will promote
- floats to doubles iff the function is not prototyped. */
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
+// 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/frv/frv.mt b/gdb/config/frv/frv.mt
new file mode 100644
index 00000000000..07fc4e7dd65
--- /dev/null
+++ b/gdb/config/frv/frv.mt
@@ -0,0 +1,5 @@
+# Target: Fujitsu FRV processor
+TDEPFILES= frv-tdep.o
+TM_FILE= tm-frv.h
+#SIM_OBS = remote-sim.o
+#SIM = ../sim/frv/libsim.a
diff --git a/gdb/config/frv/tm-frv.h b/gdb/config/frv/tm-frv.h
new file mode 100644
index 00000000000..40a2480325f
--- /dev/null
+++ b/gdb/config/frv/tm-frv.h
@@ -0,0 +1,62 @@
+/* Target definitions for the Fujitsu FR-V, for GDB, the GNU Debugger.
+ Copyright 2000 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This target uses an architecture vector for most architecture methods. */
+
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
+
+#define TARGET_HW_BREAK_LIMIT 4
+#define TARGET_HW_WATCH_LIMIT 4
+
+#define TARGET_HAS_HARDWARE_WATCHPOINTS
+
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
+ frv_check_watch_resources (type, cnt, ot)
+extern int frv_check_watch_resources (int type, int cnt, int ot);
+
+/* When a hardware watchpoint fires off the PC will be left at the
+ instruction which caused the watchpoint. It will be necessary for
+ GDB to step over the watchpoint. */
+
+/*#define HAVE_STEPPABLE_WATCHPOINT 1*/
+
+#define STOPPED_BY_WATCHPOINT(W) \
+ ((W).kind == TARGET_WAITKIND_STOPPED \
+ && (W).value.sig == TARGET_SIGNAL_TRAP \
+ && (frv_stopped_data_address() != ((CORE_ADDR)0)))
+extern CORE_ADDR frv_stopped_data_address(void);
+
+/* Use these macros for watchpoint insertion/deletion. */
+#define target_insert_watchpoint(addr, len, type) \
+ remote_insert_watchpoint (addr, len, type)
+#define target_remove_watchpoint(addr, len, type) \
+ remote_remove_watchpoint (addr, len, type)
+#define target_insert_hw_breakpoint(addr, shadow) \
+ remote_insert_hw_breakpoint (addr, 1)
+#define target_remove_hw_breakpoint(addr, shadow) \
+ remote_remove_hw_breakpoint (addr, 1)
+#define target_stopped_data_address() frv_stopped_data_address()
+
+/* These declarations should be in remote.h, no? */
+extern int remote_insert_watchpoint (CORE_ADDR addr, int len, int type);
+extern int remote_remove_watchpoint (CORE_ADDR addr, int len, int type);
+extern int remote_insert_hw_breakpoint (CORE_ADDR addr, int len);
+extern int remote_remove_hw_breakpoint (CORE_ADDR addr, int len);
diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h
index 08c8cbd808a..3020e4d27c8 100644
--- a/gdb/config/h8300/tm-h8300.h
+++ b/gdb/config/h8300/tm-h8300.h
@@ -166,7 +166,7 @@ extern char **h8300_register_names;
/* FIXME: Won't work with both h8/300's. */
extern void h8300_extract_return_value (struct type *, char *, char *);
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
h8300_extract_return_value (TYPE, (char *)(REGBUF), (char *)(VALBUF))
/* Write into appropriate registers a function return value
@@ -175,7 +175,7 @@ extern void h8300_extract_return_value (struct type *, char *, char *);
/* FIXME: Won't work with both h8/300's. */
extern void h8300_store_return_value (struct type *, char *);
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
h8300_store_return_value(TYPE, (char *) (VALBUF))
/* struct passing and returning stuff */
@@ -188,7 +188,7 @@ extern void h8300_store_return_value (struct type *, char *);
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
extract_address (REGBUF + REGISTER_BYTE (0), \
REGISTER_RAW_SIZE (0))
@@ -311,4 +311,4 @@ extern void h8300_pop_frame (void);
/* override the standard 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_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
+ generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index fae6704c637..30acdbe05bf 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -162,20 +162,20 @@ extern struct type *h8500_register_virtual_type (int regno);
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
memcpy (VALBUF, (char *)(REGBUF), TYPE_LENGTH(TYPE))
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
/* Define other aspects of the stack frame. */
diff --git a/gdb/config/i386/i386aix.mh b/gdb/config/i386/i386aix.mh
index af88729a45c..df571bf09b2 100644
--- a/gdb/config/i386/i386aix.mh
+++ b/gdb/config/i386/i386aix.mh
@@ -1,9 +1,9 @@
-# Host: IBM PS/2 (i386) running AIX PS/2
-
-XM_FILE= xm-i386aix.h
-
-NAT_FILE= nm-i386aix.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o i386aix-nat.o
-
-# Use gcc. Only coff output can be debugged
-CC=gcc
+# 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
index 12e0e1fc79a..57d124d5234 100644
--- a/gdb/config/i386/i386aix.mt
+++ b/gdb/config/i386/i386aix.mt
@@ -1,7 +1,7 @@
-# This port, for aix ps/2 (i386), will allow you to debug the coff
-# output generated gcc-2.3.3 + gas. It will not understand IBM's
-# proprietary debug info.
-#
-# Target: IBM PS/2 (i386) running AIX PS/2
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386aix.h
+# 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/i386aout.mt b/gdb/config/i386/i386aout.mt
index 1c94ba5216c..2a33369b462 100644
--- a/gdb/config/i386/i386aout.mt
+++ b/gdb/config/i386/i386aout.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 with a.out
-TDEPFILES= i386-tdep.o
-TM_FILE= tm-i386v.h
+TDEPFILES= i386-tdep.o i387-tdep.o
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu.mh
index da444a587b6..c2eb7af96ea 100644
--- a/gdb/config/i386/i386gnu.mh
+++ b/gdb/config/i386/i386gnu.mh
@@ -4,8 +4,8 @@ NATDEPFILES= i386gnu-nat.o gnu-nat.o corelow.o core-regset.o \
notify_S.o process_reply_S.o msg_reply_S.o \
msg_U.o exc_request_U.o exc_request_S.o
-XM_FILE= xm-i386gnu.h
-NAT_FILE= nm-gnu.h
+XM_FILE= xm-i386.h
+NAT_FILE= nm-i386gnu.h
MH_CFLAGS = -D_GNU_SOURCE
XM_CLIBS = -lshouldbeinlibc
diff --git a/gdb/config/i386/i386gnu.mt b/gdb/config/i386/i386gnu.mt
index e08e2a25f91..dc3edd2dbb2 100644
--- a/gdb/config/i386/i386gnu.mt
+++ b/gdb/config/i386/i386gnu.mt
@@ -1,3 +1,3 @@
-# Target: Intel 386/elf/GNU Hurd
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386gnu.h
+# Target: Intel 386 running the GNU Hurd
+TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
+TM_FILE= tm-i386v4.h
diff --git a/gdb/config/i386/i386m3.mh b/gdb/config/i386/i386m3.mh
index 41ea30c44b3..7b840e2bce0 100644
--- a/gdb/config/i386/i386m3.mh
+++ b/gdb/config/i386/i386m3.mh
@@ -1,6 +1,6 @@
-# Host: Intel 386 running Mach3
-
-NATDEPFILES= i386m3-nat.o m3-nat.o fork-child.o i387-tdep.o core-aout.o
-NAT_CLIBS= -lmachid -lnetname -lmach
-XM_FILE= xm-i386m3.h
-NAT_FILE= nm-m3.h
+# 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
index e985ae345d9..550e92e2607 100644
--- a/gdb/config/i386/i386m3.mt
+++ b/gdb/config/i386/i386m3.mt
@@ -1,3 +1,3 @@
-# Target: Intel 386 with a.out under Mach 3
-TDEPFILES= i386-tdep.o
-TM_FILE= tm-i386m3.h
+# 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
index 90dbdf4096a..4e4e097b802 100644
--- a/gdb/config/i386/i386mach.mh
+++ b/gdb/config/i386/i386mach.mh
@@ -1,9 +1,9 @@
-# Host: Intel 386 running Mach
-
-# This is for mach2, maybe, or is obsolete (and seems to have only
-# host and native, not target). Once we get the mach3 stuff working,
-# I think it can go away.
-
-XM_FILE= xm-i386mach.h
-NAT_FILE= nm-i386mach.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o i386mach-nat.o
+# 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/i386nw.mt b/gdb/config/i386/i386nw.mt
index 3109c42149e..9eafe7dcfd7 100644
--- a/gdb/config/i386/i386nw.mt
+++ b/gdb/config/i386/i386nw.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running NetWare
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386nw.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386os9k.mt b/gdb/config/i386/i386os9k.mt
index 5a8794db58f..939e9e216a3 100644
--- a/gdb/config/i386/i386os9k.mt
+++ b/gdb/config/i386/i386os9k.mt
@@ -1,3 +1,3 @@
-# Target: Intel 386 running OS9000
-TDEPFILES= i386-tdep.o remote-os9k.o
-TM_FILE= tm-i386os9k.h
+# 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/i386sco5.mt b/gdb/config/i386/i386sco5.mt
index 54dc68d16ca..ace2258a91f 100644
--- a/gdb/config/i386/i386sco5.mt
+++ b/gdb/config/i386/i386sco5.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running SCO Open Server 5
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386sco5.h
+TM_FILE= tm-i386v4.h
diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
index ec93f4a75b9..931cc132bbb 100644
--- a/gdb/config/i386/i386sol2.mh
+++ b/gdb/config/i386/i386sol2.mh
@@ -5,4 +5,5 @@ XM_CLIBS= -lsocket -lnsl
NAT_FILE= nm-i386sol2.h
NATDEPFILES= core-regset.o fork-child.o i386v4-nat.o corelow.o \
- procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o
+ procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o \
+ solib.o solib-svr4.o solib-legacy.o
diff --git a/gdb/config/i386/i386sol2.mt b/gdb/config/i386/i386sol2.mt
index 86d93a378b1..f8fabd494b7 100644
--- a/gdb/config/i386/i386sol2.mt
+++ b/gdb/config/i386/i386sol2.mt
@@ -1,3 +1,3 @@
-# Target: Intel 386 running SVR4
-TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
+# Target: Intel 386 running Solaris 2 (SVR4)
+TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o i386bsd-tdep.o
TM_FILE= tm-i386sol2.h
diff --git a/gdb/config/i386/i386v.mt b/gdb/config/i386/i386v.mt
index 7242d3e8f38..1ee53057979 100644
--- a/gdb/config/i386/i386v.mt
+++ b/gdb/config/i386/i386v.mt
@@ -1,3 +1,3 @@
# Target: Intel 386 running System V
TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v.h
+TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/nm-fbsd.h b/gdb/config/i386/nm-fbsd.h
index b7919036199..e47e9ef1a60 100644
--- a/gdb/config/i386/nm-fbsd.h
+++ b/gdb/config/i386/nm-fbsd.h
@@ -28,6 +28,10 @@
#include "i386/nm-i386.h"
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
/* Provide access to the i386 hardware debugging registers. */
#define I386_DR_LOW_SET_CONTROL(control) \
diff --git a/gdb/config/i386/nm-i386.h b/gdb/config/i386/nm-i386.h
index 500bf7b5942..eed05a476fa 100644
--- a/gdb/config/i386/nm-i386.h
+++ b/gdb/config/i386/nm-i386.h
@@ -115,6 +115,10 @@ extern int i386_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
#define DECR_PC_AFTER_HW_BREAK 0
+/* child_post_startup_inferior used to
+ reset all debug registers by calling i386_cleanup_dregs (). */
+#define CHILD_POST_STARTUP_INFERIOR
+
#endif /* I386_USE_GENERIC_WATCHPOINTS */
#endif /* NM_I386_H */
diff --git a/gdb/config/i386/nm-i386aix.h b/gdb/config/i386/nm-i386aix.h
index 4a6ffc1acfa..08f0779c36d 100644
--- a/gdb/config/i386/nm-i386aix.h
+++ b/gdb/config/i386/nm-i386aix.h
@@ -1,43 +1,43 @@
-/* Native support for i386 aix ps/2.
- Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
- * Revision: 5-May-93 00:11:35
- */
-
-#ifndef NM_I386AIX_H
-#define NM_I386AIX_H 1
-
-/* code to execute to print interesting information about the
- * floating point processor (if any)
- * No need to define if there is nothing to do.
- */
-#define FLOAT_INFO { i386_float_info (); }
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-#undef KERNEL_U_ADDR
-#define KERNEL_U_ADDR 0xf03fd000
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-#endif /* NM_I386AIX_H */
+// 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-i386bsd.h b/gdb/config/i386/nm-i386bsd.h
index 0015af2ffb0..628c648bf77 100644
--- a/gdb/config/i386/nm-i386bsd.h
+++ b/gdb/config/i386/nm-i386bsd.h
@@ -28,8 +28,6 @@
#include <machine/vmparam.h>
#define KERNEL_U_ADDR USRSTACK
-#undef FLOAT_INFO /* No float info yet */
-
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));
diff --git a/gdb/config/i386/nm-gnu.h b/gdb/config/i386/nm-i386gnu.h
index fa6d829345d..4fef763ca16 100644
--- a/gdb/config/i386/nm-gnu.h
+++ b/gdb/config/i386/nm-i386gnu.h
@@ -1,5 +1,5 @@
/* Native-dependent definitions for Intel 386 running the GNU Hurd
- Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -18,6 +18,21 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Include the generic hurd definitions. */
+#ifndef NM_I386GNU_H
+#define NM_I386GNU_H
-#include "nm-gnu.h"
+/* Include common definitions for GNU systems. */
+#include "config/nm-gnu.h"
+
+/* Thread flavors used in re-setting the T bit. */
+#define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE
+#define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT
+#define THREAD_STATE_SET_TRACED(state) \
+ ((struct i386_thread_state *) (state))->efl |= 0x100
+#define THREAD_STATE_CLEAR_TRACED(state) \
+ ((((struct i386_thread_state *) (state))->efl &= ~0x100), 1)
+
+/* We can attach and detach. */
+#define ATTACH_DETACH 1
+
+#endif /* nm-i386gnu.h */
diff --git a/gdb/config/i386/nm-i386lynx.h b/gdb/config/i386/nm-i386lynx.h
index 5d0d41de267..bc6a23410f2 100644
--- a/gdb/config/i386/nm-i386lynx.h
+++ b/gdb/config/i386/nm-i386lynx.h
@@ -21,6 +21,6 @@
#ifndef NM_I386LYNX_H
#define NM_I386LYNX_H
-#include "nm-lynx.h"
+#include "config/nm-lynx.h"
#endif /* NM_I386LYNX_H */
diff --git a/gdb/config/i386/nm-i386mach.h b/gdb/config/i386/nm-i386mach.h
index ef10a28cf8f..21f3c61a1d3 100644
--- a/gdb/config/i386/nm-i386mach.h
+++ b/gdb/config/i386/nm-i386mach.h
@@ -1,30 +1,30 @@
-/* Native definitions for Mach on an Intel 386
- Copyright 1986, 1987, 1989, 1991, 1992, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "regcache.h"
-
-/* Do implement the attach and detach commands. */
-/* #define ATTACH_DETACH 1 */
-
-/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
+// 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-i386sco.h b/gdb/config/i386/nm-i386sco.h
index b46776151b3..e3bdc2df97c 100644
--- a/gdb/config/i386/nm-i386sco.h
+++ b/gdb/config/i386/nm-i386sco.h
@@ -20,17 +20,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#if 0
-/* code to execute to print interesting information about the
- floating point processor (if any)
- No need to define if there is nothing to do.
- On the 386, unfortunately this code is host-dependent (and lives
- in the i386-xdep.c file), so we can't
- do this unless we *know* we aren't cross-debugging. FIXME.
- */
-#define FLOAT_INFO { i386_float_info (); }
-#endif /*0 */
-
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));
diff --git a/gdb/config/i386/nm-i386sco5.h b/gdb/config/i386/nm-i386sco5.h
index db2880c01ba..37a4b16d44b 100644
--- a/gdb/config/i386/nm-i386sco5.h
+++ b/gdb/config/i386/nm-i386sco5.h
@@ -1,5 +1,5 @@
-/* Native support for SCO OpenServer 5
- Copyright 1996, 1998 Free Software Foundation, Inc.
+/* Native support for SCO OpenServer 5.
+ Copyright 1996, 1998, 2002 Free Software Foundation, Inc.
Re-written by J. Kean Johnston <jkj@sco.com>.
Originally written by Robert Lipe <robertl@dgii.com>, based on
work by Ian Lance Taylor <ian@cygnus.com> and
@@ -22,17 +22,57 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef NM_I386SCO5_H
+#define NM_I386SCO5_H
+
/* Basically, its a lot like the older versions ... */
#include "i386/nm-i386sco.h"
-/* ... but it can do a lot of SVR4 type stuff too. */
+/* ... but it can do a lot of SVR4 type stuff too. */
#define SVR4_SHARED_LIBS
-#include "solib.h" /* Pick up shared library support */
+#include "solib.h" /* Pick up shared library support. */
-#define ATTACH_DETACH
+/* SCO is unlike other SVR4 systems in that it has SVR4 style shared
+ libs, with a slight twist. We expect 3 traps (2 for the exec and
+ one for the dynamic loader). After the third trap we insert the
+ shared library breakpoints, then wait for the 4th trap. */
-/* SCO does not provide <sys/ptrace.h>. infptrace.c does not
+#undef START_INFERIOR_TRAPS_EXPECTED
+#define START_INFERIOR_TRAPS_EXPECTED 3
+
+/* SCO does not provide <sys/ptrace.h>. However, infptrace.c does not
have defaults for these values. */
#define PTRACE_ATTACH 10
#define PTRACE_DETACH 11
+
+/* Return the size of the user struct. */
+
+#define KERNEL_U_SIZE kernel_u_size ()
+extern int kernel_u_size (void);
+
+/* We can attach and detach. */
+#define ATTACH_DETACH
+
+/* Hardware-assisted breakpoints and watchpoints. */
+
+/* We can also do hardware watchpoints. */
+#define TARGET_HAS_HARDWARE_WATCHPOINTS
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
+
+/* After a watchpoint trap, the PC points to the instruction which
+ caused the trap. But we can continue over it without disabling the
+ trap. */
+#define HAVE_CONTINUABLE_WATCHPOINT
+#define HAVE_STEPPABLE_WATCHPOINT
+
+#define STOPPED_BY_WATCHPOINT(W) \
+ i386_stopped_by_watchpoint (PIDGET (inferior_ptid))
+
+#define target_insert_watchpoint(addr, len, type) \
+ i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type)
+
+#define target_remove_watchpoint(addr, len, type) \
+ i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len)
+
+#endif /* nm-i386sco5.h */
diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h
index 0e6b3ef4c7f..8a51942791f 100644
--- a/gdb/config/i386/nm-i386sol2.h
+++ b/gdb/config/i386/nm-i386sol2.h
@@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints */
diff --git a/gdb/config/i386/nm-i386v.h b/gdb/config/i386/nm-i386v.h
index e7bfca4ea57..f94c5bb8b35 100644
--- a/gdb/config/i386/nm-i386v.h
+++ b/gdb/config/i386/nm-i386v.h
@@ -1,5 +1,6 @@
-/* Native support for i386.
- Copyright 1986, 1987, 1989, 1992, 1993, 1998, 2000
+/* Native support for i386 running System V (pre-SVR4).
+
+ Copyright 1986, 1987, 1989, 1992, 1993, 1998, 2000, 2002
Free Software Foundation, Inc.
Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
@@ -20,18 +21,24 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#if 0
-/* code to execute to print interesting information about the
- floating point processor (if any)
- No need to define if there is nothing to do.
- On the 386, unfortunately this code is host-dependent (and lives
- in the i386-xdep.c file), so we can't
- do this unless we *know* we aren't cross-debugging. FIXME.
- */
-#define FLOAT_INFO { i386_float_info (); }
-#endif /*0 */
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = i386_register_u_addr ((blockend),(regno));
-
-extern int i386_register_u_addr (int, int);
+#ifndef NM_I386V_H
+#define NM_I386V_H
+
+/* Support for the user struct. */
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+#define REGISTER_U_ADDR(addr, blockend, regnum) \
+ (addr) = register_u_addr ((blockend), (regnum))
+extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum);
+
+
+/* Number of traps that happen between exec'ing the shell to run an
+ inferior, and when we finally get to the inferior code. This is 2
+ on most implementations. Override here to 4. */
+
+#undef START_INFERIOR_TRAPS_EXPECTED
+#define START_INFERIOR_TRAPS_EXPECTED 4
+
+#endif /* nm-i386v.h */
diff --git a/gdb/config/i386/nm-i386v4.h b/gdb/config/i386/nm-i386v4.h
index 02d445e8bc3..356d3cba0ca 100644
--- a/gdb/config/i386/nm-i386v4.h
+++ b/gdb/config/i386/nm-i386v4.h
@@ -20,7 +20,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
/* Poll causes GDB to hang, at least under Unixware 1.1.2. */
#define LOSING_POLL
diff --git a/gdb/config/i386/nm-i386v42mp.h b/gdb/config/i386/nm-i386v42mp.h
index 72e440d0cc4..7ded36148f2 100644
--- a/gdb/config/i386/nm-i386v42mp.h
+++ b/gdb/config/i386/nm-i386v42mp.h
@@ -20,4 +20,4 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h
index 8ae3eceec98..073c3a3986e 100644
--- a/gdb/config/i386/nm-linux.h
+++ b/gdb/config/i386/nm-linux.h
@@ -27,7 +27,7 @@
#define I386_USE_GENERIC_WATCHPOINTS
#include "i386/nm-i386.h"
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* Support for the user area. */
@@ -77,6 +77,11 @@ extern int cannot_store_register (int regno);
#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno)
#define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno)
+#ifdef HAVE_PTRACE_GETFPXREGS
+/* Include register set support for the SSE registers. */
+#define FILL_FPXREGSET
+#endif
+
/* Override child_resume in `infptrace.c'. */
#define CHILD_RESUME
diff --git a/gdb/config/i386/nm-m3.h b/gdb/config/i386/nm-m3.h
index 00128cf9ce8..87d587b06c0 100644
--- a/gdb/config/i386/nm-m3.h
+++ b/gdb/config/i386/nm-m3.h
@@ -1,23 +1,23 @@
-/* Native-dependent definitions for Intel 386 running Mach 3.
- Copyright 1994 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Include the generic Mach 3 definitions. */
-
-#include "nm-m3.h"
+// 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/nm-ptx4.h b/gdb/config/i386/nm-ptx4.h
index 32b76d24256..253b1944e9c 100644
--- a/gdb/config/i386/nm-ptx4.h
+++ b/gdb/config/i386/nm-ptx4.h
@@ -22,11 +22,11 @@
#include "regcache.h"
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
#undef USE_PROC_FS
-#include "nm-symmetry.h"
+#include "i386/nm-symmetry.h"
#define PTRACE_READ_REGS(pid,regaddr) mptrace (XPT_RREGS, (pid), (regaddr), 0)
#define PTRACE_WRITE_REGS(pid,regaddr) \
diff --git a/gdb/config/i386/nm-x86-64.h b/gdb/config/i386/nm-x86-64linux.h
index 30e37310222..4430fcba5db 100644
--- a/gdb/config/i386/nm-x86-64.h
+++ b/gdb/config/i386/nm-x86-64linux.h
@@ -23,7 +23,7 @@
#ifndef NM_X86_64_H
#define NM_X86_64_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
#define I386_USE_GENERIC_WATCHPOINTS
#include "i386/nm-i386.h"
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
index d9593ceb846..ec22fcb67a7 100644
--- a/gdb/config/i386/obsd.mh
+++ b/gdb/config/i386/obsd.mh
@@ -3,5 +3,9 @@
XM_FILE= xm-i386.h
NAT_FILE= nm-obsd.h
-# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-sunos.o corelow.o core-aout.o i386-nat.o i386bsd-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o i386obsd-nat.o \
+ solib.o solib-sunos.o
+
+# The OpenBSD yacc generates yyname and yyrule tables that conflict at
+# link time if we define YYDEBUG to a non-zero value.
+MH_CFLAGS= -DYYDEBUG=0
diff --git a/gdb/config/i386/obsd.mt b/gdb/config/i386/obsd.mt
deleted file mode 100644
index 5c96426b96d..00000000000
--- a/gdb/config/i386/obsd.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running OpenBSD
-TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
-TM_FILE= tm-obsd.h
diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h
index 1d49133a05b..59f60f0fe3a 100644
--- a/gdb/config/i386/tm-cygwin.h
+++ b/gdb/config/i386/tm-cygwin.h
@@ -25,16 +25,9 @@
#else
#undef HAVE_SSE_REGS
#endif /* CONTEXT_EXTENDED_REGISTERS */
-#define HAVE_I387_REGS
#include "i386/tm-i386.h"
-#if 0
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
-#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0)
-extern CORE_ADDR skip_trampoline_code (CORE_ADDR pc, char *name);
-#endif
-
#define ATTACH_NO_WAIT
#define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms)
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) child_solib_loaded_library_pathname(pid)
diff --git a/gdb/config/i386/tm-fbsd.h b/gdb/config/i386/tm-fbsd.h
index 61f5de57f4a..1975a9b458b 100644
--- a/gdb/config/i386/tm-fbsd.h
+++ b/gdb/config/i386/tm-fbsd.h
@@ -21,69 +21,22 @@
#ifndef TM_FBSD_H
#define TM_FBSD_H
-#define HAVE_I387_REGS
#include "i386/tm-i386.h"
-/* FreeBSD/ELF uses stabs-in-ELF with the DWARF register numbering
- scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
- messes up the floating-point registers for a.out, but there is not
- much we can do about that. */
-
-#undef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-
-/* FreeBSD uses the old gcc convention for struct returns. */
-
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
- generic_use_struct_convention (1, type)
-
-
-/* Support for longjmp. */
-
-/* Details about jmp_buf. It's supposed to be an array of integers. */
-
-#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
-#define JB_PC 0 /* Array index of saved PC. */
-
-/* Figure out where the longjmp will land. Store the address that
- longjmp will jump to in *ADDR, and return non-zero if successful. */
-
-#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
-extern int get_longjmp_target (CORE_ADDR *addr);
-
-
-/* Support for signal handlers. */
-
-#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
-extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
/* These defines allow the recognition of sigtramps as a function name
<sigtramp>.
- FIXME: kettenis/2001-07-13: These should be added to the target
- vector and turned into functions when we go "multi-arch". */
-
-#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
-#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
-extern CORE_ADDR i386bsd_sigtramp_start;
-extern CORE_ADDR i386bsd_sigtramp_end;
-
-/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
-
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
-extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
-
-
-/* Shared library support. */
-
-#ifndef SVR4_SHARED_LIBS
-
-/* Return non-zero if we are in a shared library trampoline code stub. */
-
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- (name && !strcmp(name, "_DYNAMIC"))
+ FIXME: kettenis/2002-05-12: Of course these defines will have to go
+ if we go truly "multi-arch", but I don't know yet how to get rid of
+ them. */
-#endif /* !SVR4_SHARED_LIBS */
+#define SIGTRAMP_START(pc) i386bsd_sigtramp_start (pc)
+#define SIGTRAMP_END(pc) i386bsd_sigtramp_end (pc)
+extern CORE_ADDR i386bsd_sigtramp_start (CORE_ADDR pc);
+extern CORE_ADDR i386bsd_sigtramp_end (CORE_ADDR pc);
#endif /* TM_FBSD_H */
diff --git a/gdb/config/i386/tm-go32.h b/gdb/config/i386/tm-go32.h
index b660827bd66..85e0888ef80 100644
--- a/gdb/config/i386/tm-go32.h
+++ b/gdb/config/i386/tm-go32.h
@@ -22,47 +22,7 @@
#define TM_GO32_H
#undef HAVE_SSE_REGS /* FIXME! go32-nat.c needs to support XMMi registers */
-#define HAVE_I387_REGS
#include "i386/tm-i386.h"
-/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
- chain-pointer.
- In the case of the i386, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address.
- DJGPP doesn't have any special frames for signal handlers, they are
- just normal C functions. */
-#undef FRAME_CHAIN
-#define FRAME_CHAIN(thisframe) \
- (!inside_entry_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame, 4) :\
- 0)
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#undef FRAMELESS_FUNCTION_INVOCATION
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (frameless_look_for_prologue(FI))
-
-extern CORE_ADDR i386go32_frame_saved_pc (struct frame_info *frame);
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(FRAME) (i386go32_frame_saved_pc ((FRAME)))
-
-/* Support for longjmp. */
-
-/* Details about jmp_buf. It's supposed to be an array of integers. */
-
-#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
-#define JB_PC 8 /* Array index of saved PC inside jmp_buf. */
-
-/* Figure out where the longjmp will land. Slurp the args out of the
- stack. We expect the first arg to be a pointer to the jmp_buf
- structure from which we extract the pc (JB_PC) that we will land
- at. The pc is copied into ADDR. This routine returns true on
- success. */
-
-#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
-extern int get_longjmp_target (CORE_ADDR *addr);
-
#endif /* TM_GO32_H */
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h
index f9326fecb9a..e80b258e7d8 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/i386/tm-i386.h
@@ -24,356 +24,8 @@
#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-#include "regcache.h"
-
-/* Forward declarations for prototypes. */
-struct frame_info;
-struct frame_saved_regs;
-struct value;
-struct type;
-
-/* The format used for `long double' on almost all i386 targets is the
- i387 extended floating-point format. In fact, of all targets in the
- GCC 2.95 tree, only OSF/1 does it different, and insists on having
- a `long double' that's not `long' at all. */
-
-#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-
-/* Although the i386 extended floating-point has only 80 significant
- bits, a `long double' actually takes up 96, probably to enforce
- alignment. */
-
-#define TARGET_LONG_DOUBLE_BIT 96
-
-/* Number of traps that happen between exec'ing the shell to run an
- inferior, and when we finally get to the inferior code. This is 2
- on most implementations. */
-
-#define START_INFERIOR_TRAPS_EXPECTED 2
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions to reach some
- "real" code. */
-
-#define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc))
-
-extern int i386_skip_prologue (int);
-
-/* Immediately after a function call, return the saved pc. */
-
-#define SAVED_PC_AFTER_CALL(frame) i386_saved_pc_after_call (frame)
-extern CORE_ADDR i386_saved_pc_after_call (struct frame_info *frame);
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* Sequence of bytes for breakpoint instruction. */
-
-#define BREAKPOINT {0xcc}
-
-/* Amount PC must be decremented by after a breakpoint. This is often the
- number of bytes in BREAKPOINT but not always. */
-
-#define DECR_PC_AFTER_BREAK 1
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 4
-
-/* This register file is parameterized by two macros:
- HAVE_I387_REGS --- register file should include i387 registers
- HAVE_SSE_REGS --- register file should include SSE registers
- If HAVE_SSE_REGS is #defined, then HAVE_I387_REGS must also be #defined.
-
- However, GDB code should not test those macros with #ifdef, since
- that makes code which is annoying to multi-arch. Instead, GDB code
- should check the values of NUM_GREGS, NUM_FREGS, and NUM_SSE_REGS,
- which will eventually get mapped onto architecture vector entries.
-
- It's okay to use the macros in tm-*.h files, though, since those
- files will get completely replaced when we multi-arch anyway. */
-
-/* Number of general registers, present on every 32-bit x86 variant. */
-#define NUM_GREGS (16)
-
-/* Number of floating-point unit registers. */
-#ifdef HAVE_I387_REGS
-#define NUM_FREGS (16)
-#else
-#define NUM_FREGS (0)
-#endif
-
-/* Number of SSE registers. */
-#ifdef HAVE_SSE_REGS
-#define NUM_SSE_REGS (9)
-#else
-#define NUM_SSE_REGS (0)
-#endif
-
-/* Largest number of registers we could have in any configuration. */
-#define MAX_NUM_REGS (16 + 16 + 9)
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP_REGNUM 5 /* (ebp) Contains address of executing stack
- frame */
-#define SP_REGNUM 4 /* (usp) Contains address of top of stack */
-#define PC_REGNUM 8 /* (eip) Contains program counter */
-#define PS_REGNUM 9 /* (ps) Contains processor status */
-
-/* First FPU data register. */
-#ifdef HAVE_I387_REGS
-#define FP0_REGNUM 16
-#else
-#define FP0_REGNUM 0
-#endif
-
-/* Return the name of register REG. */
-
-#define REGISTER_NAME(reg) i386_register_name ((reg))
-extern char *i386_register_name (int reg);
-
-/* Use the "default" register numbering scheme for stabs and COFF. */
-
-#define STAB_REG_TO_REGNUM(reg) i386_stab_reg_to_regnum ((reg))
-#define SDB_REG_TO_REGNUM(reg) i386_stab_reg_to_regnum ((reg))
-extern int i386_stab_reg_to_regnum (int reg);
-
-/* Use the DWARF register numbering scheme for DWARF and DWARF 2. */
-
-#define DWARF_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-#define DWARF2_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-extern int i386_dwarf_reg_to_regnum (int reg);
-
-/* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to be
- in use on any of the supported i386 targets. */
-
-
-/* Sizes of individual register sets. These cover the entire register
- file, so summing up the sizes of those portions actually present
- yields REGISTER_BYTES. */
-#define SIZEOF_GREGS (NUM_GREGS * 4)
-#define SIZEOF_FPU_REGS (8 * 10)
-#define SIZEOF_FPU_CTRL_REGS (8 * 4)
-#define SIZEOF_SSE_REGS (8 * 16 + 4)
-
-
-/* Total amount of space needed to store our copies of the machine's register
- state, the array `registers'. */
-#ifdef HAVE_SSE_REGS
-#define REGISTER_BYTES \
- (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS)
-#else
-#ifdef HAVE_I387_REGS
-#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS)
-#else
-#define REGISTER_BYTES (SIZEOF_GREGS)
-#endif
-#endif
-
-/* Return the offset into the register array of the start of register
- number REG. */
-#define REGISTER_BYTE(reg) i386_register_byte ((reg))
-extern int i386_register_byte (int reg);
-
-/* Return the number of bytes of storage in GDB's register array
- occupied by register REG. */
-#define REGISTER_RAW_SIZE(reg) i386_register_raw_size ((reg))
-extern int i386_register_raw_size (int reg);
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE 16
-
-/* Return the size in bytes of the virtual type of register REG. */
-#define REGISTER_VIRTUAL_SIZE(reg) i386_register_virtual_size ((reg))
-extern int i386_register_virtual_size (int reg);
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE 16
-
-/* Return the GDB type object for the "standard" data type of data in
- register REGNUM. */
-
-#define REGISTER_VIRTUAL_TYPE(regnum) i386_register_virtual_type (regnum)
-extern struct type *i386_register_virtual_type (int regnum);
-
-/* Return true iff register REGNUM's virtual format is different from
- its raw format. */
-
-#define REGISTER_CONVERTIBLE(regnum) i386_register_convertible (regnum)
-extern int i386_register_convertible (int regnum);
-
-/* Convert data from raw format for register REGNUM in buffer FROM to
- virtual format with type TYPE in buffer TO. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) \
- i386_register_convert_to_virtual ((regnum), (type), (from), (to))
-extern void i386_register_convert_to_virtual (int regnum, struct type *type,
- char *from, char *to);
-
-/* Convert data from virtual format with type TYPE in buffer FROM to
- raw format for register REGNUM in buffer TO. */
-
-#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) \
- i386_register_convert_to_raw ((type), (regnum), (from), (to))
-extern void i386_register_convert_to_raw (struct type *type, int regnum,
- char *from, char *to);
-
-/* Print out the i387 floating point state. */
-#ifdef HAVE_I387_REGS
-extern void i387_float_info (void);
-#define FLOAT_INFO { i387_float_info (); }
-#endif
-
-
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- i386_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
-extern CORE_ADDR i386_push_arguments (int nargs, struct value **args,
- CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr);
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(addr, sp) \
- i386_store_struct_return ((addr), (sp))
-extern void i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) \
- i386_extract_return_value ((type), (regbuf), (valbuf))
-extern void i386_extract_return_value (struct type *type, char *regbuf,
- char *valbuf);
-
-/* Write into the appropriate registers a function return value stored
- in VALBUF of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(type, valbuf) \
- i386_store_return_value ((type), (valbuf))
-extern void i386_store_return_value (struct type *type, char *valbuf);
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR. */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) \
- i386_extract_struct_value_address ((regbuf))
-extern CORE_ADDR i386_extract_struct_value_address (char *regbuf);
-
-/* The following redefines make backtracing through sigtramp work.
- They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
- from the sigcontext structure which is pushed by the kernel on the
- user stack, along with a pointer to it. */
-
-/* Return the chain-pointer for FRAME. In the case of the i386, the
- frame's nominal address is the address of a 4-byte word containing
- the calling frame's address. */
-
-#define FRAME_CHAIN(frame) i386_frame_chain ((frame))
-extern CORE_ADDR i386_frame_chain (struct frame_info *frame);
-
-/* Determine whether the function invocation represented by FRAME does
- not have a from on the stack associated with it. If it does not,
- return non-zero, otherwise return zero. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(frame) \
- i386_frameless_function_invocation (frame)
-extern int i386_frameless_function_invocation (struct frame_info *frame);
-
-/* Return the saved program counter for FRAME. */
-
-#define FRAME_SAVED_PC(frame) i386_frame_saved_pc (frame)
-extern CORE_ADDR i386_frame_saved_pc (struct frame_info *frame);
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Return number of args passed to a frame. Can return -1, meaning no way
- to tell, which is typical now that the C compiler delays popping them. */
-
-#define FRAME_NUM_ARGS(fi) (i386_frame_num_args(fi))
-
-extern int i386_frame_num_args (struct frame_info *);
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-extern void i386_frame_init_saved_regs (struct frame_info *);
-#define FRAME_INIT_SAVED_REGS(FI) i386_frame_init_saved_regs (FI)
-
-
-
-/* Things needed for making the inferior call functions. */
-
-/* "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. */
-#define PARM_BOUNDARY 32
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME { i386_push_dummy_frame (); }
-
-extern void i386_push_dummy_frame (void);
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME { i386_pop_frame (); }
-
-extern void i386_pop_frame (void);
-
-
-/* this is
- * call 11223344 (32 bit relative)
- * int3
- */
-
-#define CALL_DUMMY { 0x223344e8, 0xcc11 }
-
-#define CALL_DUMMY_LENGTH 8
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-#define CALL_DUMMY_BREAKPOINT_OFFSET 5
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
- i386_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
-extern void i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
- int nargs, struct value **args,
- struct type *type, int gcc_p);
-
/* FIXME: kettenis/2000-06-12: These do not belong here. */
extern void print_387_control_word (unsigned int);
extern void print_387_status_word (unsigned int);
-/* Offset from SP to first arg on stack at first instruction of a function */
-
-#define SP_ARG0 (1 * 4)
-
#endif /* ifndef TM_I386_H */
diff --git a/gdb/config/i386/tm-i386aix.h b/gdb/config/i386/tm-i386aix.h
index a8f24eda035..fe114206c7c 100644
--- a/gdb/config/i386/tm-i386aix.h
+++ b/gdb/config/i386/tm-i386aix.h
@@ -1,48 +1,48 @@
-/* Macro defintions for IBM AIX PS/2 (i386).
- Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com). */
-
-#ifndef TM_I386AIX_H
-#define TM_I386AIX_H 1
-
-#include "i386/tm-i386.h"
-#include <sys/reg.h>
-
-#ifndef I386
-#define I386 1
-#endif
-
-/* AIX/i386 has FPU support. However, the native configuration (which
- is the only supported configuration) doesn't make the FPU control
- registers available. Override the appropriate symbols such that
- only the normal FPU registers are included in GDB's register array. */
-
-#undef NUM_FPREGS
-#define NUM_FPREGS (8)
-
-#undef NUM_REGS
-#define NUM_REGS (NUM_GREGS + NUM_FPREGS)
-
-#undef REGISTER_BYTES
-#define REGISTER_BYTES (SIZEOF_GREGS + SIZEOF_FPU_REGS)
-
-#endif /* TM_I386AIX_H */
+// 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 <sys/reg.h>
+// 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-i386gnu.h b/gdb/config/i386/tm-i386gnu.h
deleted file mode 100644
index 00cb5a9f100..00000000000
--- a/gdb/config/i386/tm-i386gnu.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Macro definitions for i386 running the GNU Hurd.
- Copyright 1992, 1999, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386GNU_H
-#define TM_I386GNU_H 1
-
-/* Include common definitions for GNU systems.
- FIXME: This does not belong here since this is supposed to contain
- only native-dependent information. */
-#include "nm-gnu.h"
-
-/* Thread flavors used in re-setting the T bit.
- FIXME: This is native-dependent. */
-#define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE
-#define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT
-#define THREAD_STATE_SET_TRACED(state) \
- ((struct i386_thread_state *)state)->efl |= 0x100
-#define THREAD_STATE_CLEAR_TRACED(state) \
- ((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
-
-/* We can attach and detach.
- FIXME: This is probably native-dependent too. */
-#define ATTACH_DETACH 1
-
-#define HAVE_I387_REGS
-#include "i386/tm-i386.h"
-
-/* We use stabs-in-ELF with the DWARF register numbering scheme. */
-
-#undef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-
-/* Offset to saved PC in sigcontext. */
-#define SIGCONTEXT_PC_OFFSET 68
-
-/* We need this file for the SOLIB_TRAMPOLINE stuff. */
-#include "tm-sysv4.h"
-
-#endif /* TM_I386GNU_H */
diff --git a/gdb/config/i386/tm-i386lynx.h b/gdb/config/i386/tm-i386lynx.h
index 842f9a7738d..03fe4ff8bf7 100644
--- a/gdb/config/i386/tm-i386lynx.h
+++ b/gdb/config/i386/tm-i386lynx.h
@@ -1,5 +1,5 @@
/* Macro definitions for Intel 386 running under LynxOS.
- Copyright 1993, 1995 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,14 +21,9 @@
#ifndef TM_I386LYNX_H
#define TM_I386LYNX_H
-#include "tm-lynx.h"
+#include "config/tm-lynx.h"
/* Most definitions from sysv could be used. */
#include "i386/tm-i386.h"
-#undef SAVED_PC_AFTER_CALL
-
-#define SAVED_PC_AFTER_CALL i386lynx_saved_pc_after_call
-CORE_ADDR i386lynx_saved_pc_after_call ();
-
#endif /* TM_I386LYNX_H */
diff --git a/gdb/config/i386/tm-i386m3.h b/gdb/config/i386/tm-i386m3.h
index edc301da446..cadd5cd8b6d 100644
--- a/gdb/config/i386/tm-i386m3.h
+++ b/gdb/config/i386/tm-i386m3.h
@@ -1,56 +1,56 @@
-/* Macro definitions for i386, Mach 3.0
- Copyright 1992, 1993, 1995, 1999 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Include common definitions for Mach3 systems */
-#include "nm-m3.h"
-
-/* Define offsets to access CPROC stack when it does not have
- * a kernel thread.
- */
-#define MACHINE_CPROC_SP_OFFSET 20
-#define MACHINE_CPROC_PC_OFFSET 16
-#define MACHINE_CPROC_FP_OFFSET 12
-
-/* Thread flavors used in re-setting the T bit.
- * @@ this is also bad for cross debugging.
- */
-#define TRACE_FLAVOR i386_THREAD_STATE
-#define TRACE_FLAVOR_SIZE i386_THREAD_STATE_COUNT
-#define TRACE_SET(x,state) \
- ((struct i386_thread_state *)state)->efl |= 0x100
-#define TRACE_CLEAR(x,state) \
- ((((struct i386_thread_state *)state)->efl &= ~0x100), 1)
-
-/* we can do it */
-#define ATTACH_DETACH 1
-
-/* Sigh. There should be a file for i386 but no sysv stuff in it */
-#include "i386/tm-i386.h"
-
-/* I want to test this float info code. See comment in tm-i386v.h */
-#undef FLOAT_INFO
-#define FLOAT_INFO { i386_mach3_float_info (); }
-
-/* Address of end of stack space.
- * for MACH, see <machine/vmparam.h>
- * @@@ I don't know what is in the 5 ints...
- */
-#undef STACK_END_ADDR
-#define STACK_END_ADDR (0xc0000000-sizeof(int [5]))
+// 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 <machine/vmparam.h>
+// 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
index e46ca55395b..74355a82ceb 100644
--- a/gdb/config/i386/tm-i386mk.h
+++ b/gdb/config/i386/tm-i386mk.h
@@ -1,38 +1,38 @@
-/* Macro definitions for i386, Mach 3.0, OSF 1/MK
- Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Until OSF switches to a newer Mach kernel that has
- * a different get_emul_vector() interface.
- */
-#define MK67 1
-
-#include "i386/tm-i386m3.h"
-
-/* FIMXE: kettenis/2000-03-26: On OSF 1, `long double' is equivalent
- to `double'. However, I'm not sure what is the consequence of:
-
- #define TARGET_LONG_DOUBLE_FORMAT TARGET_DOUBLE_FORMAT
- #define TARGET_LONG_DOUBLE_BIT TARGET_DOUBLE_BIT
-
- So I'll go with the current status quo instead. It looks like this
- target won't compile anyway. Perhaps it should be obsoleted? */
-
-#undef TARGET_LONG_DOUBLE_FORMAT
-#undef TARGET_LONG_DOUBLE_BIT
+// 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/tm-i386nw.h b/gdb/config/i386/tm-i386nw.h
deleted file mode 100644
index 9ede2c040e0..00000000000
--- a/gdb/config/i386/tm-i386nw.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Macro definitions for i386 running NetWare.
- Copyright 1993, 1994, 1995, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386NW_H
-#define TM_I386NW_H 1
-
-#include "i386/tm-i386.h"
-
-/* Stop backtracing when we wander into main. */
-
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
-
-/* Offsets (in target ints) into jmp_buf. Not defined in any system header
- file, so we have to step through setjmp/longjmp with a debugger and figure
- them out. */
-
-#define JB_ELEMENT_SIZE 4 /* jmp_buf[] is array of ints */
-
-#define JB_PC 6 /* Setjmp()'s return PC saved here */
-
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-extern int get_longjmp_target (CORE_ADDR *);
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-
-#endif /* ifndef TM_I386NW_H */
diff --git a/gdb/config/i386/tm-i386sco5.h b/gdb/config/i386/tm-i386sco5.h
deleted file mode 100644
index e4cb014e990..00000000000
--- a/gdb/config/i386/tm-i386sco5.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Macro definitions for GDB on an Intel i386 running SCO Open Server 5.
- Copyright 1998 Free Software Foundation, Inc.
- Written by J. Kean Johnston (jkj@sco.com).
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_I386SCO5_H
-#define TM_I386SCO5_H 1
-
-/* Pick up most of what we need from the generic i386 target include file. */
-
-#include "i386/tm-i386.h"
-
-/* Pick up more stuff from the generic SYSV and SVR4 host include files. */
-#include "i386/tm-i386v.h"
-#include "tm-sysv4.h"
-
-#define KERNEL_U_SIZE kernel_u_size()
-
-/*
- * SCO is unlike other SVR3 targets in that it has SVR4 style shared
- * libs, with a slight twist. We expect 3 traps (2 for the exec and
- * one for the dynamic loader). After the third trap we insert the
- * SOLIB breakpoints, then wait for the 4th trap.
- */
-#undef START_INFERIOR_TRAPS_EXPECTED
-#define START_INFERIOR_TRAPS_EXPECTED 3
-
-/* We can also do hardware watchpoints */
-#define TARGET_HAS_HARDWARE_WATCHPOINTS
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
-
-/* After a watchpoint trap, the PC points to the instruction which
- caused the trap. But we can continue over it without disabling the
- trap. */
-#define HAVE_CONTINUABLE_WATCHPOINT
-#define HAVE_STEPPABLE_WATCHPOINT
-
-#define STOPPED_BY_WATCHPOINT(W) \
- i386_stopped_by_watchpoint (PIDGET (inferior_ptid))
-
-#define target_insert_watchpoint(addr, len, type) \
- i386_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type)
-
-#define target_remove_watchpoint(addr, len, type) \
- i386_remove_watchpoint (PIDGET (inferior_ptid), addr, len)
-
-#endif /* ifndef TM_I386SCO5_H */
diff --git a/gdb/config/i386/tm-i386sol2.h b/gdb/config/i386/tm-i386sol2.h
index c90e0d475ae..35d63d16865 100644
--- a/gdb/config/i386/tm-i386sol2.h
+++ b/gdb/config/i386/tm-i386sol2.h
@@ -21,31 +21,8 @@
#ifndef TM_I386SOL2_H
#define TM_I386SOL2_H 1
-#define HAVE_I387_REGS
#include "i386/tm-i386v4.h"
-/* We use stabs-in-ELF with the DWARF register numbering scheme. */
-
-#undef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-
-/* If the current gcc for for this target does not produce correct
- debugging information for float parameters, both prototyped and
- unprototyped, then define this macro. This forces gdb to always
- assume that floats are passed as doubles and then converted in the
- callee. */
-
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
-
-/* Signal handler frames under Solaris 2 are recognized by a return address
- of 0xFFFFFFFF, the third parameter on the signal handler stack is
- a pointer to an ucontext. */
-#undef sigtramp_saved_pc
-#undef I386V4_SIGTRAMP_SAVED_PC
-#define SIGCONTEXT_PC_OFFSET (36 + 14 * 4)
-#undef IN_SIGTRAMP
-#define IN_SIGTRAMP(pc, name) (pc == 0xFFFFFFFF)
-
/* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
and for SunPRO 3.0, N_FUN symbols too. */
#define SOFUN_ADDRESS_MAYBE_MISSING
diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h
index 2003b96de2e..9363327fdb7 100644
--- a/gdb/config/i386/tm-i386v4.h
+++ b/gdb/config/i386/tm-i386v4.h
@@ -1,5 +1,5 @@
/* Macro definitions for GDB on an Intel i386 running SVR4.
- Copyright 1991, 1994, 1995, 1998, 1999, 2000
+ Copyright 1991, 1994, 1995, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
@@ -23,57 +23,17 @@
#ifndef TM_I386V4_H
#define TM_I386V4_H 1
-/* Pick up most of what we need from the generic i386 target include file. */
-#define HAVE_I387_REGS
+/* Pick up most of what we need from the generic i386 target include file. */
#include "i386/tm-i386.h"
-/* Pick up more stuff from the generic SVR4 host include file. */
+/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
+ in identifiers. The default in G++ is to use dots instead, for all SVR4
+ systems, so we make that our default also. FIXME: There should be some
+ way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
+ stashing it in the debugging information as part of the name of an
+ invented symbol ("gcc_cplus_marker$" for example). */
-#include "tm-sysv4.h"
-
-/* Use the alternate method of determining valid frame chains. */
-
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
-/* Offsets (in target ints) into jmp_buf. Not defined in any system header
- file, so we have to step through setjmp/longjmp with a debugger and figure
- them out. Note that <setjmp> defines _JBLEN as 10, which is the default
- if no specific machine is selected, even though we only use 6 slots. */
-
-#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */
-
-#define JB_EBX 0
-#define JB_ESI 1
-#define JB_EDI 2
-#define JB_EBP 3
-#define JB_ESP 4
-#define JB_EDX 5
-
-#define JB_PC JB_EDX /* Setjmp()'s return PC saved in EDX */
-
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-extern int get_longjmp_target (CORE_ADDR *);
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-
-/* The following redefines make backtracing through sigtramp work.
- They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp
- from the ucontext structure which is pushed by the kernel on the
- user stack. Unfortunately there are three variants of sigtramp handlers. */
-
-#define I386V4_SIGTRAMP_SAVED_PC
-#define IN_SIGTRAMP(pc, name) ((name) \
- && (STREQ ("_sigreturn", name) \
- || STREQ ("_sigacthandler", name) \
- || STREQ ("sigvechandler", name)))
-
-/* Saved Pc. Get it from ucontext if within sigtramp. */
-
-#define sigtramp_saved_pc i386v4_sigtramp_saved_pc
-extern CORE_ADDR i386v4_sigtramp_saved_pc (struct frame_info *);
+#undef CPLUS_MARKER
+#define CPLUS_MARKER '.'
#endif /* ifndef TM_I386V4_H */
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index 60c4b1e3e39..ca46cb5a40b 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -24,81 +24,13 @@
#define TM_LINUX_H
#define I386_GNULINUX_TARGET
-#define HAVE_I387_REGS
-#ifdef HAVE_PTRACE_GETFPXREGS
-#define FILL_FPXREGSET
-#define HAVE_SSE_REGS
-#endif
#include "i386/tm-i386.h"
-#include "tm-linux.h"
-
-/* Register number for the "orig_eax" pseudo-register. If this
- pseudo-register contains a value >= 0 it is interpreted as the
- system call number that the kernel is supposed to restart. */
-#define I386_LINUX_ORIG_EAX_REGNUM (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS)
-
-/* Adjust a few macros to deal with this extra register. */
-
-#undef NUM_REGS
-#define NUM_REGS (NUM_GREGS + NUM_FREGS + NUM_SSE_REGS + 1)
-
-#undef MAX_NUM_REGS
-#define MAX_NUM_REGS (16 + 16 + 9 + 1)
-
-#undef REGISTER_BYTES
-#define REGISTER_BYTES \
- (SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS + 4)
-
-#undef REGISTER_NAME
-#define REGISTER_NAME(reg) i386_linux_register_name ((reg))
-extern char *i386_linux_register_name (int reg);
-
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(reg) i386_linux_register_byte ((reg))
-extern int i386_linux_register_byte (int reg);
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(reg) i386_linux_register_raw_size ((reg))
-extern int i386_linux_register_raw_size (int reg);
-
-/* GNU/Linux ELF uses stabs-in-ELF with the DWARF register numbering
- scheme by default, so we must redefine STAB_REG_TO_REGNUM. This
- messes up the floating-point registers for a.out, but there is not
- much we can do about that. */
-#undef STAB_REG_TO_REGNUM
-#define STAB_REG_TO_REGNUM(reg) i386_dwarf_reg_to_regnum ((reg))
-
-/* Use target_specific function to define link map offsets. */
-extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
-#define SVR4_FETCH_LINK_MAP_OFFSETS() i386_linux_svr4_fetch_link_map_offsets ()
+#include "config/tm-linux.h"
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
-/* When the i386 Linux kernel calls a signal handler, the return
- address points to a bit of code on the stack. These definitions
- are used to identify this bit of code as a signal trampoline in
- order to support backtracing through calls to signal handlers. */
-
-#define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
-extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
-
-#undef FRAME_CHAIN
-#define FRAME_CHAIN(frame) i386_linux_frame_chain (frame)
-extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame);
-
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
-extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
-
-#undef SAVED_PC_AFTER_CALL
-#define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
-extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *);
-
-#define TARGET_WRITE_PC(pc, ptid) i386_linux_write_pc (pc, ptid)
-extern void i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid);
-
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
need to skip over the dynamic linker call. This function decides
@@ -110,22 +42,5 @@ extern CORE_ADDR i386_linux_skip_solib_resolver (CORE_ADDR pc);
/* N_FUN symbols in shared libaries have 0 for their values and need
to be relocated. */
#define SOFUN_ADDRESS_MAYBE_MISSING
-
-
-/* Support for longjmp. */
-
-/* Details about jmp_buf. It's supposed to be an array of integers. */
-
-#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
-#define JB_PC 5 /* Array index of saved PC. */
-
-/* Figure out where the longjmp will land. Slurp the args out of the
- stack. We expect the first arg to be a pointer to the jmp_buf
- structure from which we extract the pc (JB_PC) that we will land
- at. The pc is copied into ADDR. This routine returns true on
- success. */
-
-#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
-extern int get_longjmp_target (CORE_ADDR *addr);
#endif /* #ifndef TM_LINUX_H */
diff --git a/gdb/config/i386/tm-nbsd.h b/gdb/config/i386/tm-nbsd.h
index b4fb7542830..0d73d3a0d96 100644
--- a/gdb/config/i386/tm-nbsd.h
+++ b/gdb/config/i386/tm-nbsd.h
@@ -21,44 +21,18 @@
#ifndef TM_NBSD_H
#define TM_NBSD_H
-#define HAVE_I387_REGS
-#define HAVE_SSE_REGS
-
#include "i386/tm-i386.h"
-#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */
-#define JB_PC 0 /* Setjmp()'s return PC saved here */
-
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-extern int get_longjmp_target (CORE_ADDR *);
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-
-
-/* Support for signal handlers. */
-
-#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
-extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
-
/* These defines allow the recognition of sigtramps as a function name
<sigtramp>.
- FIXME: kettenis/2001-07-13: These should be added to the target
- vector and turned into functions when we go "multi-arch". */
-
-#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
-#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
-extern CORE_ADDR i386bsd_sigtramp_start;
-extern CORE_ADDR i386bsd_sigtramp_end;
-
-/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
+ FIXME: kettenis/2002-05-12: Of course these defines will have to go
+ if we go truly "multi-arch", but I don't know yet how to get rid of
+ them. */
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
-extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
+#define SIGTRAMP_START(pc) i386bsd_sigtramp_start (pc)
+#define SIGTRAMP_END(pc) i386bsd_sigtramp_end (pc)
+extern CORE_ADDR i386bsd_sigtramp_start (CORE_ADDR pc);
+extern CORE_ADDR i386bsd_sigtramp_end (CORE_ADDR pc);
#endif /* TM_NBSD_H */
diff --git a/gdb/config/i386/tm-nbsdaout.h b/gdb/config/i386/tm-nbsdaout.h
index 95fe2e74a5b..25325e1fe10 100644
--- a/gdb/config/i386/tm-nbsdaout.h
+++ b/gdb/config/i386/tm-nbsdaout.h
@@ -23,12 +23,4 @@
#include "i386/tm-nbsd.h"
-/* Return non-zero if we are in a shared library trampoline code stub. */
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- (name && !strcmp(name, "_DYNAMIC"))
-
-extern use_struct_convention_fn i386nbsd_aout_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
- i386nbsd_aout_use_struct_convention(gcc_p, type)
-
#endif /* TM_NBSDAOUT_H */
diff --git a/gdb/config/i386/tm-obsd.h b/gdb/config/i386/tm-obsd.h
deleted file mode 100644
index d26b03bf41d..00000000000
--- a/gdb/config/i386/tm-obsd.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Target-dependent definitions for OpenBSD/i386.
- Copyright 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef TM_OBSD_H
-#define TM_OBSD_H
-
-#define HAVE_I387_REGS
-#include "i386/tm-i386.h"
-
-/* OpenBSD uses the old gcc convention for struct returns. */
-
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
- generic_use_struct_convention (1, type)
-
-
-/* Support for longjmp. */
-
-/* Details about jmp_buf. It's supposed to be an array of integers. */
-
-#define JB_ELEMENT_SIZE 4 /* Size of elements in jmp_buf. */
-#define JB_PC 0 /* Array index of saved PC. */
-
-/* Figure out where the longjmp will land. Store the address that
- longjmp will jump to in *ADDR, and return non-zero if successful. */
-
-#define GET_LONGJMP_TARGET(addr) get_longjmp_target (addr)
-extern int get_longjmp_target (CORE_ADDR *addr);
-
-
-/* Support for signal handlers. */
-
-#define IN_SIGTRAMP(pc, name) i386bsd_in_sigtramp (pc, name)
-extern int i386bsd_in_sigtramp (CORE_ADDR pc, char *name);
-
-/* These defines allow the recognition of sigtramps as a function name
- <sigtramp>.
-
- FIXME: kettenis/2001-07-13: These should be added to the target
- vector and turned into functions when we go "multi-arch". */
-
-#define SIGTRAMP_START(pc) i386bsd_sigtramp_start
-#define SIGTRAMP_END(pc) i386bsd_sigtramp_end
-extern CORE_ADDR i386bsd_sigtramp_start;
-extern CORE_ADDR i386bsd_sigtramp_end;
-
-/* Override FRAME_SAVED_PC to enable the recognition of signal handlers. */
-
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(frame) i386bsd_frame_saved_pc (frame)
-extern CORE_ADDR i386bsd_frame_saved_pc (struct frame_info *frame);
-
-
-/* Shared library support. */
-
-/* Return non-zero if we are in a shared library trampoline code stub. */
-
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- (name && !strcmp(name, "_DYNAMIC"))
-
-#endif /* tm-obsd.h */
diff --git a/gdb/config/i386/tm-ptx.h b/gdb/config/i386/tm-ptx.h
index 2a1731a161c..8d773c8c292 100644
--- a/gdb/config/i386/tm-ptx.h
+++ b/gdb/config/i386/tm-ptx.h
@@ -32,17 +32,9 @@
#ifdef SEQUENT_PTX4
#include "i386/tm-i386v4.h"
#else /* !SEQUENT_PTX4 */
-#include "i386/tm-i386v.h"
+#include "i386/tm-i386.h"
#endif
-/* Number of traps that happen between exec'ing the shell to run an
- inferior, and when we finally get to the inferior code. This is 2
- on most implementations. Here we have to undo what tm-i386v.h gave
- us and restore the default. */
-
-#undef START_INFERIOR_TRAPS_EXPECTED
-#define START_INFERIOR_TRAPS_EXPECTED 2
-
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always (such as now). */
@@ -149,24 +141,6 @@ extern int ptx_register_u_addr (int, int);
#undef REGISTER_BYTES
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
-/* Index within `registers' of the first byte of the space for register N. */
-
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(N) \
-(((N) < ST0_REGNUM) ? ((N) * 4) : \
- ((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \
- (40 + 80 + (((N) - FP1_REGNUM) * 4)))
-
-/* Number of bytes of storage in the actual machine representation for
- register N. All registers are 4 bytes, except 387 st(0) - st(7),
- which are 80 bits each. */
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(N) \
-(((N) < ST0_REGNUM) ? 4 : \
- ((N) < FP1_REGNUM) ? 10 : \
- 4)
-
/* Largest value REGISTER_RAW_SIZE can have. */
#undef MAX_REGISTER_RAW_SIZE
@@ -220,8 +194,8 @@ extern const struct floatformat floatformat_i387_ext; /* from floatformat.h */
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#undef EXTRACT_RETURN_VALUE
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
/*
diff --git a/gdb/config/i386/tm-ptx4.h b/gdb/config/i386/tm-ptx4.h
index 1f221ba8e2b..a13d4a63a7f 100644
--- a/gdb/config/i386/tm-ptx4.h
+++ b/gdb/config/i386/tm-ptx4.h
@@ -23,4 +23,4 @@
#define SEQUENT_PTX4
-#include "tm-ptx.h"
+#include "i386/tm-ptx.h"
diff --git a/gdb/config/i386/tm-symmetry.h b/gdb/config/i386/tm-symmetry.h
index 78281819dfa..dc7c81f2fb2 100644
--- a/gdb/config/i386/tm-symmetry.h
+++ b/gdb/config/i386/tm-symmetry.h
@@ -31,10 +31,7 @@
a copy of the right include file. */
#include <machine/reg.h>
-#include "i386/tm-i386v.h"
-
-#undef START_INFERIOR_TRAPS_EXPECTED
-#define START_INFERIOR_TRAPS_EXPECTED 2
+#include "i386/tm-i386.h"
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always (such as now). */
@@ -225,30 +222,6 @@ switch (regno) { \
#undef REGISTER_BYTES
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(N) \
-(((N) < 3) ? ((N) * 4) : \
-((N) < 5) ? ((((N) - 2) * 10) + 2) : \
-((N) < 8) ? ((((N) - 5) * 4) + 32) : \
-((N) < 14) ? ((((N) - 8) * 10) + 44) : \
- ((((N) - 14) * 4) + 104))
-
-/* Number of bytes of storage in the actual machine representation
- * for register N. All registers are 4 bytes, except 387 st(0) - st(7),
- * which are 80 bits each.
- */
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(N) \
-(((N) < 3) ? 4 : \
-((N) < 5) ? 10 : \
-((N) < 8) ? 4 : \
-((N) < 14) ? 10 : \
- 4)
-
/* Nonzero if register N requires conversion
from raw format to virtual format. */
@@ -308,8 +281,8 @@ switch (regno) { \
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#undef EXTRACT_RETURN_VALUE
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
/* The following redefines make backtracing through sigtramp work.
diff --git a/gdb/config/i386/tm-vxworks.h b/gdb/config/i386/tm-vxworks.h
index 6434a6ea2f5..f9b6be453cb 100644
--- a/gdb/config/i386/tm-vxworks.h
+++ b/gdb/config/i386/tm-vxworks.h
@@ -22,7 +22,7 @@
#ifndef TM_VXWORKS_H
#define TM_VXWORKS_H
-#include "i386/tm-i386v.h"
-#include "tm-vxworks.h"
+#include "i386/tm-i386.h"
+#include "config/tm-vxworks.h"
#endif /* ifndef TM_VXWORKS_H */
diff --git a/gdb/config/sparc/tm-nbsdaout.h b/gdb/config/i386/tm-x86-64linux.h
index a62e53551ea..11eea93793a 100644
--- a/gdb/config/sparc/tm-nbsdaout.h
+++ b/gdb/config/i386/tm-x86-64linux.h
@@ -1,5 +1,8 @@
-/* Macro definitions for Sparc running under NetBSD.
- Copyright 1994, 2002 Free Software Foundation, Inc.
+/* Definitions to target GDB to GNU/Linux on x86-64.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Michal Ludvig, SuSE Labs.
This file is part of GDB.
@@ -18,13 +21,16 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef TM_NBSDAOUT_H
-#define TM_NBSDAOUT_H
+#ifndef TM_X86_64LINUX_H
+#define TM_X86_64LINUX_H
-#include "sparc/tm-nbsd.h"
+/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that
+ * link.h is available on all linux platforms. For I386 and SH3/4,
+ * we hard-code the information rather than use link.h anyway (for
+ * the benefit of cross-debugging). We may move to doing that for
+ * other architectures as well. */
-/* Return non-zero if we are in a shared library trampoline code stub. */
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- (name && !strcmp(name, "_DYNAMIC"))
+#define SVR4_SHARED_LIBS
+#include "solib.h" /* Support for shared libraries. */
-#endif /* TM_NBSDAOUT_H */
+#endif /* #ifndef TM_X86_64LINUX_H */
diff --git a/gdb/config/i386/x86-64linux.mh b/gdb/config/i386/x86-64linux.mh
index bc79f3f235c..7c221ebd807 100644
--- a/gdb/config/i386/x86-64linux.mh
+++ b/gdb/config/i386/x86-64linux.mh
@@ -2,7 +2,7 @@
XM_FILE= xm-i386.h
-NAT_FILE= nm-x86-64.h
+NAT_FILE= nm-x86-64linux.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
core-aout.o i386-nat.o x86-64-linux-nat.o \
proc-service.o thread-db.o lin-lwp.o \
diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt
index 85f1972531d..7d0c491943a 100644
--- a/gdb/config/i386/x86-64linux.mt
+++ b/gdb/config/i386/x86-64linux.mt
@@ -1,3 +1,7 @@
# Target: AMD x86-64 running GNU/Linux
-TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o i387-tdep.o dwarf2cfi.o \
+TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o dwarf2cfi.o \
solib.o solib-svr4.o solib-legacy.o
+
+GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM
+
+TM_FILE=tm-x86-64linux.h
diff --git a/gdb/config/i386/xm-i386aix.h b/gdb/config/i386/xm-i386aix.h
index 842eadf0632..03cb86cb1cc 100644
--- a/gdb/config/i386/xm-i386aix.h
+++ b/gdb/config/i386/xm-i386aix.h
@@ -1,29 +1,29 @@
-/* Macro defintions for AIX PS/2 (i386)
- Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com)
- * Revision: 23-Oct-92 17:42:49
- */
-
-#include "i386/xm-i386v.h"
-
-#undef HAVE_TERMIO
-#define HAVE_SGTTY
+// 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
index f25b3891210..da4421551b5 100644
--- a/gdb/config/i386/xm-i386m3.h
+++ b/gdb/config/i386/xm-i386m3.h
@@ -1,33 +1,33 @@
-/* Definitions to make GDB run on Mach 3 on an Intel 386
- Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Do implement the attach and detach commands. */
-#define ATTACH_DETACH 1
-
-/* Not needeed */
-#define KERNEL_U_ADDR 0
-
-#ifndef EMULATOR_BASE
-/* For EMULATOR_BASE and EMULATOR_END.
- * OSF 1/MK has different values in some other place.
- */
-#include <machine/vmparam.h>
-#endif /* EMULATOR_BASE */
+// 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 <machine/vmparam.h>
+// OBSOLETE #endif /* EMULATOR_BASE */
diff --git a/gdb/config/i386/xm-i386mach.h b/gdb/config/i386/xm-i386mach.h
index e0a5d651376..b36c79c7162 100644
--- a/gdb/config/i386/xm-i386mach.h
+++ b/gdb/config/i386/xm-i386mach.h
@@ -1,28 +1,28 @@
-/* Definitions to make GDB run on Mach on an Intel 386
- Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1996, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
-
-/* <errno.h> only defines this if __STDC__!!! */
-extern int errno;
+// 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 /* <errno.h> 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
index cbf62710db5..4609604cf99 100644
--- a/gdb/config/i386/xm-i386mk.h
+++ b/gdb/config/i386/xm-i386mk.h
@@ -1,26 +1,26 @@
-/* Definitions to make GDB run on Mach 3 OSF 1/MK on an Intel 386
- Copyright 1992, 1993, 1998 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define HAVE_TERMIO 1
-
-#define EMULATOR_BASE 0xa0000000
-#define EMULATOR_END 0xa0040000
-
-#include "i386/xm-i386m3.h"
+// 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/i386/xm-i386v4.h b/gdb/config/i386/xm-i386v4.h
index c3241100bf7..154986c1880 100644
--- a/gdb/config/i386/xm-i386v4.h
+++ b/gdb/config/i386/xm-i386v4.h
@@ -25,4 +25,4 @@
/* Pick up more stuff from the generic SVR4 host include file. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
diff --git a/gdb/config/i386/xm-nbsd.h b/gdb/config/i386/xm-nbsd.h
index 415d0fa4ffd..4a998cde4ee 100644
--- a/gdb/config/i386/xm-nbsd.h
+++ b/gdb/config/i386/xm-nbsd.h
@@ -19,6 +19,6 @@
Boston, MA 02111-1307, USA. */
/* Get generic NetBSD host definitions. */
-#include "xm-nbsd.h"
+#include "config/xm-nbsd.h"
#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
diff --git a/gdb/config/i386/xm-ptx.h b/gdb/config/i386/xm-ptx.h
index 6dfb9d6d4e3..8987f297133 100644
--- a/gdb/config/i386/xm-ptx.h
+++ b/gdb/config/i386/xm-ptx.h
@@ -23,7 +23,7 @@
/* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
#ifdef _SEQUENT_PTX4_
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
#endif /* _SEQUENT_PTX4_ */
/* This machine doesn't have the siginterrupt call. */
diff --git a/gdb/config/i386/xm-ptx4.h b/gdb/config/i386/xm-ptx4.h
index 2f466e62d70..605941315c9 100644
--- a/gdb/config/i386/xm-ptx4.h
+++ b/gdb/config/i386/xm-ptx4.h
@@ -22,6 +22,6 @@
/* Symmetry version by Jay Vosburgh (fubar@sequent.com) */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
-#include "xm-ptx.h"
+#include "i386/xm-ptx.h"
diff --git a/gdb/config/i960/mon960.mt b/gdb/config/i960/mon960.mt
index 6cd73459f7e..c735d9474b8 100644
--- a/gdb/config/i960/mon960.mt
+++ b/gdb/config/i960/mon960.mt
@@ -1,6 +1,5 @@
-# Target: Intel 960 rom monitor
-TDEPFILES= i960-tdep.o monitor.o mon960-rom.o ttyflush.o xmodem.o dsrec.o
-TM_FILE= tm-mon960.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/i960/libsim.a
-
+# 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
index f37c1da4b7c..5ed15a8d835 100644
--- a/gdb/config/i960/nindy960.mt
+++ b/gdb/config/i960/nindy960.mt
@@ -1,3 +1,3 @@
-# Target: Intel 80960, in an embedded system under the NINDY monitor
-TDEPFILES= i960-tdep.o nindy-tdep.o remote-nindy.o nindy.o Onindy.o ttyflush.o
-TM_FILE= tm-nindy960.h
+# 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
index a62e35da7e7..91bdf91f14e 100644
--- a/gdb/config/i960/tm-i960.h
+++ b/gdb/config/i960/tm-i960.h
@@ -1,345 +1,345 @@
-/* Parameters for target machine Intel 960, for GDB, the GNU debugger.
-
- Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free
- Software Foundation, Inc.
-
- Contributed by Intel Corporation.
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Definitions to target GDB to any i960. */
-
-#ifndef I80960
-#define I80960
-#endif
-
-#include "doublest.h"
-
-/* Hook for the SYMBOL_CLASS of a parameter when decoding DBX symbol
- information. In the i960, parameters can be stored as locals or as
- args, depending on the type of the debug record.
-
- From empirical observation, gcc960 uses N_LSYM to indicate
- arguments passed in registers and then copied immediately
- to the frame, and N_PSYM to indicate arguments passed in a
- g14-relative argument block. */
-
-#define DBX_PARM_SYMBOL_CLASS(type) ((type == N_LSYM)? LOC_LOCAL_ARG: LOC_ARG)
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance ip across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(ip) (i960_skip_prologue (ip))
-extern CORE_ADDR i960_skip_prologue ();
-
-/* Immediately after a function call, return the saved ip.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function
- executes some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) (saved_pc_after_call (frame))
-extern CORE_ADDR saved_pc_after_call ();
-
-/* Stack grows upward */
-
-#define INNER_THAN(lhs,rhs) ((lhs) > (rhs))
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 4
-
-/* Number of machine registers */
-#define NUM_REGS 40
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES { \
- /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
- /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
- /* 32 */ "pcw", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
-}
-
-/* Register numbers of various important registers (used to index
- into arrays of register names and register values). */
-
-#define R0_REGNUM 0 /* First local register */
-#define SP_REGNUM 1 /* Contains address of top of stack */
-#define RIP_REGNUM 2 /* Return instruction pointer (local r2) */
-#define R15_REGNUM 15 /* Last local register */
-#define G0_REGNUM 16 /* First global register */
-#define G13_REGNUM 29 /* g13 - holds struct return address */
-#define G14_REGNUM 30 /* g14 - ptr to arg block / leafproc return address */
-#define FP_REGNUM 31 /* Contains address of executing stack frame */
-#define PCW_REGNUM 32 /* process control word */
-#define ACW_REGNUM 33 /* arithmetic control word */
-#define TCW_REGNUM 34 /* trace control word */
-#define IP_REGNUM 35 /* instruction pointer */
-#define FP0_REGNUM 36 /* First floating point register */
-
-/* Some registers have more than one name */
-
-#define PC_REGNUM IP_REGNUM /* GDB refers to ip as the Program Counter */
-#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES ((36*4) + (4*10))
-
-/* Index within `registers' of the first byte of the space for register N. */
-
-#define REGISTER_BYTE(N) ( (N) < FP0_REGNUM ? \
- (4*(N)) : ((10*(N)) - (6*FP0_REGNUM)) )
-
-/* The i960 has register windows, sort of. */
-
-extern void i960_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval);
-
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
-
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the i960, all regs are 4 bytes except for floating
- point, which are 10. NINDY only sends us 8 byte values for these,
- which is a pain, but VxWorks handles this correctly, so we must. */
-
-#define REGISTER_RAW_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 10 )
-
-/* Number of bytes of storage in the program's representation for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ( (N) < FP0_REGNUM ? 4 : 8 )
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 10
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-#include "floatformat.h"
-
-#define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-struct type *i960_register_type (int regnum);
-#define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N)
-
-/* Macros for understanding function return values... */
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On i960, a structure is returned in registers g0-g3, if it will fit.
- If it's more than 16 bytes long, g13 pointed to it on entry. */
-
-extern use_struct_convention_fn i960_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p, type) i960_use_struct_convention (gcc_p, type)
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
- type is 0.
-
- On the i960 we just take as many bytes as we need from G0 through G3. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy(VALBUF, REGBUF+REGISTER_BYTE(G0_REGNUM), TYPE_LENGTH (TYPE))
-
-/* If USE_STRUCT_CONVENTION produces a 1,
- extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one).
-
- Address of where to put structure was passed in in global
- register g13 on entry. God knows what's in g13 now. The
- (..., 0) below is to make it appear to return a value, though
- actually all it does is call error(). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (error("Don't know where large structure is returned on i960"), 0)
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format, for "value returning" functions.
-
- For 'return' command: not (yet) implemented for i960. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- error ("Returning values from functions is not implemented in i960 gdb")
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- error ("Returning values from functions is not implemented in i960 gdb")
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR arg_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- ((fi)->fsr = 0, (fi)->arg_pointer = -1)
-
-/* On the i960, we get the chain pointer by reading the PFP saved
- on the stack and clearing the status bits. */
-
-#define FRAME_CHAIN(thisframe) \
- (read_memory_integer (FRAME_FP(thisframe), 4) & ~0xf)
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type must define FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. We leave it undefined here. */
-
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-CORE_ADDR leafproc_return (CORE_ADDR ip);
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (leafproc_return ((FI)->pc) != 0)
-
-/* Note that in the i960 architecture the return pointer is saved in the
- *caller's* stack frame.
-
- Make sure to zero low-order bits because of bug in 960CA A-step part
- (instruction addresses should always be word-aligned anyway). */
-
-#define FRAME_SAVED_PC(frame) \
- ((read_memory_integer(FRAME_CHAIN(frame)+8,4)) & ~3)
-
-/* On the i960, FRAME_ARGS_ADDRESS should return the value of
- g14 as passed into the frame, if known. We need a function for this.
- We cache this value in the frame info if we've already looked it up. */
-
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->arg_pointer != -1)? (fi)->arg_pointer: frame_args_address (fi, 0))
-extern CORE_ADDR frame_args_address (); /* i960-tdep.c */
-
-/* This is the same except it should return 0 when
- it does not really know where the args are, rather than guessing.
- This value is not cached since it is only used infrequently. */
-
-#define FRAME_ARGS_ADDRESS_CORRECT(fi) (frame_args_address (fi, 1))
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Set NUMARGS to the number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Produce the positions of the saved registers in a stack frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
- frame_find_saved_regs (frame_info_addr, &sr)
-extern void frame_find_saved_regs (); /* See i960-tdep.c */
-
-/* Things needed for making calls to functions in the inferior process */
-
-/* Push an empty stack frame, to record the current ip, etc.
-
- Not (yet?) implemented for i960. */
-
-#define PUSH_DUMMY_FRAME \
-error("Function calls into the inferior process are not supported on the i960")
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-
-void i960_pop_frame (void);
-#define POP_FRAME \
- i960_pop_frame ()
-
-
-/* This sequence of words is the instructions
-
- callx 0x00000000
- fmark
- */
-
-/* #define CALL_DUMMY { 0x86003000, 0x00000000, 0x66003e00 } */
-
- /* #define CALL_DUMMY_START_OFFSET 0 *//* Start execution at beginning of dummy */
-
-/* Indicate that we don't support calling inferior child functions. */
-
-#undef CALL_DUMMY
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at 'dummyname'.
-
- Ignore arg count on i960. */
-
-/* #define FIX_CALL_DUMMY(dummyname, fun, nargs) *(((int *)dummyname)+1) = fun */
-
-#undef FIX_CALL_DUMMY
-
-
-/* Interface definitions for kernel debugger KDB */
-/* (Not relevant to i960.) */
+// 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
index 98c03b137eb..dedce0e383a 100644
--- a/gdb/config/i960/tm-mon960.h
+++ b/gdb/config/i960/tm-mon960.h
@@ -1,69 +1,69 @@
-/* Parameters for Intel 960 running MON960 monitor, for GDB, the GNU debugger.
- Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Intel Corporation and Cygnus Support.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*****************************************************************************
- * Definitions to target GDB to an i960 debugged over a serial line.
- ******************************************************************************/
-
-#include "i960/tm-i960.h"
-
-/* forward declarations */
-struct frame_info;
-
-/* redefined from tm-i960.h */
-/* Number of machine registers */
-#undef NUM_REGS
-#define NUM_REGS 40
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#undef REGISTER_NAMES
-#define REGISTER_NAMES { \
- /* 0 */ "pfp", "sp", "rip", "r3", "r4", "r5", "r6", "r7", \
- /* 8 */ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",\
- /* 16 */ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- /* 24 */ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \
- /* 32 */ "pc", "ac", "tc", "ip", "fp0", "fp1", "fp2", "fp3",\
-}
-
-/* Override the standard gdb prompt when compiled for this target. */
-
-#define DEFAULT_PROMPT "(gdb960) "
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type defines FRAME_CHAIN_VALID,
- since it differs between Nindy, Mon960 and VxWorks, the currently supported
- target types. */
-
-extern int mon960_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define FRAME_CHAIN_VALID(chain, thisframe) mon960_frame_chain_valid (chain, thisframe)
-
-/* Sequence of bytes for breakpoint instruction */
-
-#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
-
-/* Amount ip must be decremented by after a breakpoint.
- * This is often the number of bytes in BREAKPOINT but not always.
- */
-
-#define DECR_PC_AFTER_BREAK 4
+// 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
index e9cb99c9f4b..6a6dca26dc2 100644
--- a/gdb/config/i960/tm-nindy960.h
+++ b/gdb/config/i960/tm-nindy960.h
@@ -1,106 +1,106 @@
-/* Parameters for Intel 960 running NINDY monitor, for GDB, the GNU debugger.
- Copyright 1990, 1991, 1996, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Intel Corporation and Cygnus Support.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*****************************************************************************
- * Definitions to target GDB to an i960 debugged over a serial line.
- ******************************************************************************/
-
-#include "i960/tm-i960.h"
-
-/* forward declarations */
-struct frame_info;
-
-/* Override the standard gdb prompt when compiled for this target. */
-
-#define DEFAULT_PROMPT "(gdb960) "
-
-/* Additional command line options accepted by nindy gdb's, for handling
- the remote-nindy.c interface. These should really be target-specific
- rather than architecture-specific. */
-
-extern int nindy_old_protocol; /* nonzero if old NINDY serial protocol */
-extern int nindy_initial_brk; /* Send a BREAK to reset board first */
-extern char *nindy_ttyname; /* Name of serial port to talk to nindy */
-
-#define ADDITIONAL_OPTIONS \
- {"O", no_argument, &nindy_old_protocol, 1}, \
- {"brk", no_argument, &nindy_initial_brk, 1}, \
- {"ser", required_argument, 0, 1004}, /* 1004 is magic cookie for ADDL_CASES */
-
-#define ADDITIONAL_OPTION_CASES \
- case 1004: /* -ser option: remote nindy auto-start */ \
- nindy_ttyname = optarg; \
- break;
-
-#define ADDITIONAL_OPTION_HELP \
- "\
- -O Use old protocol to talk to a Nindy target\n\
- -brk Send a break to a Nindy target to reset it.\n\
- -ser SERIAL Open remote Nindy session to SERIAL port.\n\
-"
-
-/* If specified on the command line, open tty for talking to nindy,
- and download the executable file if one was specified. */
-
-extern void nindy_open (char *name, int from_tty);
-#define ADDITIONAL_OPTION_HANDLER \
- if (nindy_ttyname != NULL) \
- { \
- if (catch_command_errors (nindy_open, nindy_ttyname, \
- !batch, RETURN_MASK_ALL)) \
- { \
- if (execarg != NULL) \
- catch_command_errors (target_load, execarg, !batch, \
- RETURN_MASK_ALL); \
- } \
- }
-
-/* If configured for i960 target, we take control before main loop
- and demand that we configure for a nindy target. */
-
-#define BEFORE_MAIN_LOOP_HOOK \
- nindy_before_main_loop();
-
-extern void
- nindy_before_main_loop (); /* In remote-nindy.c */
-
-/* FRAME_CHAIN_VALID returns zero if the given frame is the outermost one
- and has no caller.
-
- On the i960, each various target system type defines FRAME_CHAIN_VALID,
- since it differs between NINDY and VxWorks, the two currently supported
- targets types. */
-
-extern int nindy_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define FRAME_CHAIN_VALID(chain, thisframe) nindy_frame_chain_valid (chain, thisframe)
-
-extern int
- nindy_frame_chain_valid (); /* See nindy-tdep.c */
-
-/* Sequence of bytes for breakpoint instruction */
-
-#define BREAKPOINT {0x00, 0x3e, 0x00, 0x66}
-
-/* Amount ip must be decremented by after a breakpoint.
- * This is often the number of bytes in BREAKPOINT but not always.
- */
-
-#define DECR_PC_AFTER_BREAK 0
+// 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
index 16fc62ac6bb..44ff627325e 100644
--- a/gdb/config/i960/tm-vx960.h
+++ b/gdb/config/i960/tm-vx960.h
@@ -1,52 +1,52 @@
-/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998, 1999
- Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "i960/tm-i960.h"
-#include "tm-vxworks.h"
-
-/* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has
- the real value. */
-#undef PC_REGNUM
-#define PC_REGNUM RIP_REGNUM
-
-/* We have more complex, useful breakpoints on the target.
- Amount ip must be decremented by after a breakpoint. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* We are guaranteed to have a zero frame pointer at bottom of stack, too. */
-
-#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
-
-/* Breakpoint patching is handled at the target end in VxWorks. */
-/* #define BREAKPOINT {0x00, 0x3e, 0x00, 0x66} */
-
-/* Number of registers in a ptrace_getregs call. */
-
-#define VX_NUM_REGS (16 + 16 + 3)
-
-/* Number of registers in a ptrace_getfpregs call. */
-
- /* @@ Can't use this -- the rdb library for the 960 target
- doesn't support setting or retrieving FP regs. KR */
-
-/* #define VX_SIZE_FPREGS (REGISTER_RAW_SIZE (FP0_REGNUM) * 4) */
+// 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
index ad3293421f7..e7f04c4aeb3 100644
--- a/gdb/config/i960/vxworks960.mt
+++ b/gdb/config/i960/vxworks960.mt
@@ -1,6 +1,6 @@
-# Target: VxWorks running on an Intel 960
-TDEPFILES= i960-tdep.o remote-vx.o remote-vx960.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-TM_FILE= tm-vx960.h
-
-# Define this for the vx-share routines, which don't see param.h.
-MT_CFLAGS= -DI80960
+# 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/ia64/ia64.mt b/gdb/config/ia64/ia64.mt
new file mode 100644
index 00000000000..c0f85a4c285
--- /dev/null
+++ b/gdb/config/ia64/ia64.mt
@@ -0,0 +1,2 @@
+TDEPFILES= ia64-tdep.o
+TM_FILE= tm-ia64.h
diff --git a/gdb/config/ia64/nm-aix.h b/gdb/config/ia64/nm-aix.h
index 3f6764c3027..8a2d66f7c28 100644
--- a/gdb/config/ia64/nm-aix.h
+++ b/gdb/config/ia64/nm-aix.h
@@ -21,7 +21,7 @@
#ifndef NM_AIX_H
#define NM_AIX_H
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
#ifndef AIX5
#define AIX5 1
diff --git a/gdb/config/ia64/nm-linux.h b/gdb/config/ia64/nm-linux.h
index 2c980c0ad9a..e00d561b6a3 100644
--- a/gdb/config/ia64/nm-linux.h
+++ b/gdb/config/ia64/nm-linux.h
@@ -22,7 +22,7 @@
#ifndef NM_LINUX_H
#define NM_LINUX_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* Note: It seems likely that we'll have to eventually define
FETCH_INFERIOR_REGISTERS. But until that time, we'll make do
diff --git a/gdb/config/ia64/tm-aix.h b/gdb/config/ia64/tm-aix.h
index 0160140c680..b59d6dd11cd 100644
--- a/gdb/config/ia64/tm-aix.h
+++ b/gdb/config/ia64/tm-aix.h
@@ -22,7 +22,7 @@
#define TM_AIX_H
#include "ia64/tm-ia64.h"
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
#define TARGET_ELF64
diff --git a/gdb/config/ia64/tm-linux.h b/gdb/config/ia64/tm-linux.h
index f716d83ae41..60517525467 100644
--- a/gdb/config/ia64/tm-linux.h
+++ b/gdb/config/ia64/tm-linux.h
@@ -24,7 +24,7 @@
#define IA64_GNULINUX_TARGET
#include "ia64/tm-ia64.h"
-#include "tm-linux.h"
+#include "config/tm-linux.h"
#define TARGET_ELF64
diff --git a/gdb/config/ia64/xm-aix.h b/gdb/config/ia64/xm-aix.h
index 6ca026d493f..ad717d5c01c 100644
--- a/gdb/config/ia64/xm-aix.h
+++ b/gdb/config/ia64/xm-aix.h
@@ -23,6 +23,6 @@
/* Pick up more stuff from the generic SVR4 host include file. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
#endif /* #ifndef XM_AIX_H */
diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h
index 75bc7b231a6..648ff01c1c8 100644
--- a/gdb/config/m32r/tm-m32r.h
+++ b/gdb/config/m32r/tm-m32r.h
@@ -137,15 +137,15 @@ extern CORE_ADDR m32r_frame_saved_pc (struct frame_info *);
/* mvs_check FRAME_SAVED_PC */
#define FRAME_SAVED_PC(fi) m32r_frame_saved_pc (fi)
-/* mvs_check EXTRACT_RETURN_VALUE */
-#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
+/* mvs_check DEPRECATED_EXTRACT_RETURN_VALUE */
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
memcpy ((VALBUF), \
(char *)(REGBUF) + REGISTER_BYTE (V0_REGNUM) + \
((TYPE_LENGTH (TYPE) > 4 ? 8 : 4) - TYPE_LENGTH (TYPE)), \
TYPE_LENGTH (TYPE))
-/* mvs_check STORE_RETURN_VALUE */
-#define STORE_RETURN_VALUE(TYPE, VALBUF) \
+/* mvs_check DEPRECATED_STORE_RETURN_VALUE */
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
write_register_bytes(REGISTER_BYTE (V0_REGNUM) + \
((TYPE_LENGTH (TYPE) > 4 ? 8:4) - TYPE_LENGTH (TYPE)),\
(VALBUF), TYPE_LENGTH (TYPE));
@@ -181,7 +181,7 @@ extern void m32r_write_sp (CORE_ADDR val);
extern use_struct_convention_fn m32r_use_struct_convention;
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) m32r_use_struct_convention (GCC_P, TYPE)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
REGISTER_RAW_SIZE (V0_REGNUM))
diff --git a/gdb/config/m68k/apollo68b.mh b/gdb/config/m68k/apollo68b.mh
index cf2770b35ad..99d034b03ec 100644
--- a/gdb/config/m68k/apollo68b.mh
+++ b/gdb/config/m68k/apollo68b.mh
@@ -1,5 +1,5 @@
-# Host: Apollo m68k, BSD mode.
-
-XM_FILE= xm-apollo68b.h
-NAT_FILE= nm-apollo68b.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o
+# 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
index 2383d3b6156..11c0c02d178 100644
--- a/gdb/config/m68k/apollo68b.mt
+++ b/gdb/config/m68k/apollo68b.mt
@@ -1,3 +1,3 @@
-# Target: Apollo m68k in BSD mode
-TDEPFILES= m68k-tdep.o dstread.o
-TM_FILE= tm-apollo68b.h
+# 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
index 6610e665f48..4ab84f074b9 100644
--- a/gdb/config/m68k/apollo68v.mh
+++ b/gdb/config/m68k/apollo68v.mh
@@ -1,10 +1,10 @@
-# Host: Apollo, System V mode (?)
-
-XM_FILE= xm-apollo68v.h
-XM_CLIBS= -lPW
-
-NAT_FILE= nm-apollo68v.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o a68v-nat.o
-
-RANLIB=echo >/dev/null
-CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_SYS_FILE
+# 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
index b0b186d671e..76aa9a562a7 100644
--- a/gdb/config/m68k/hp300bsd.mh
+++ b/gdb/config/m68k/hp300bsd.mh
@@ -1,6 +1,6 @@
-# Host: Hewlett-Packard 9000 series 300, running BSD
-
-XM_FILE= xm-hp300bsd.h
-
-NAT_FILE= nm-hp300bsd.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
+# 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
index cbcc5edb7db..c3225e9a9ae 100644
--- a/gdb/config/m68k/hp300bsd.mt
+++ b/gdb/config/m68k/hp300bsd.mt
@@ -1,3 +1,3 @@
-# Target: Hewlett-Packard 9000 series 300, running BSD
-TDEPFILES= m68k-tdep.o
-TM_FILE= tm-hp300bsd.h
+# 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
index 8ceb1872ca5..410c03cd753 100644
--- a/gdb/config/m68k/hp300hpux.mh
+++ b/gdb/config/m68k/hp300hpux.mh
@@ -1,8 +1,8 @@
-# Host: Hewlett-Packard 9000 series 300, running HPUX
-# The following is true because gcc uses a different .o file format
-# than the native HPUX compiler
-
-XM_FILE= xm-hp300hpux.h
-
-NAT_FILE= nm-hp300hpux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o hp300ux-nat.o corelow.o core-aout.o
+# 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
index 0fa801dee25..a1848af2d3d 100644
--- a/gdb/config/m68k/hp300hpux.mt
+++ b/gdb/config/m68k/hp300hpux.mt
@@ -1,8 +1,8 @@
-# Target: Hewlett-Packard 9000 series 300, running HPUX
-
-#msg Note that GDB can only read symbols from programs that were
-#msg compiled with GCC using GAS.
-#msg
-
-TDEPFILES= m68k-tdep.o
-TM_FILE= tm-hp300hpux.h
+# 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/nm-linux.h b/gdb/config/m68k/nm-linux.h
index 5c37af9ca12..26aa19768ad 100644
--- a/gdb/config/m68k/nm-linux.h
+++ b/gdb/config/m68k/nm-linux.h
@@ -21,7 +21,7 @@
#ifndef NM_LINUX_H
#define NM_LINUX_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* Return sizeof user struct to callers in less machine dependent routines */
diff --git a/gdb/config/m68k/nm-m68klynx.h b/gdb/config/m68k/nm-m68klynx.h
index 49114fc4df9..9d95d3728dd 100644
--- a/gdb/config/m68k/nm-m68klynx.h
+++ b/gdb/config/m68k/nm-m68klynx.h
@@ -21,6 +21,6 @@
#ifndef NM_M68KLYNX_H
#define NM_M68KLYNX_H
-#include "nm-lynx.h"
+#include "config/nm-lynx.h"
#endif /* NM_M68KLYNX_H */
diff --git a/gdb/config/m68k/nm-sysv4.h b/gdb/config/m68k/nm-sysv4.h
index a7d0bdd3bda..b9cb591f389 100644
--- a/gdb/config/m68k/nm-sysv4.h
+++ b/gdb/config/m68k/nm-sysv4.h
@@ -20,4 +20,4 @@
/* Include the generic SVR4 definitions. */
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
index a38baea2020..269d1346e8e 100644
--- a/gdb/config/m68k/tm-delta68.h
+++ b/gdb/config/m68k/tm-delta68.h
@@ -45,7 +45,7 @@
/* When it returns a float/double value, use fp0 in sysV68. */
/* When it returns a pointer value, use a0 in sysV68. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
&REGBUF[REGISTER_BYTE (FP0_REGNUM)], \
@@ -63,7 +63,7 @@
/* When it returns a float/double value, use fp0 in sysV68. */
/* When it returns a pointer value, use a0 in sysV68. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
@@ -91,8 +91,8 @@ extern int delta68_frame_num_args (struct frame_info *fi);
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#undef EXTRACT_STRUCT_VALUE_ADDRESS
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
+#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
(*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4))
extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
diff --git a/gdb/config/m68k/tm-linux.h b/gdb/config/m68k/tm-linux.h
index 94b2c2c3504..e2889ecff7b 100644
--- a/gdb/config/m68k/tm-linux.h
+++ b/gdb/config/m68k/tm-linux.h
@@ -36,7 +36,7 @@
function return value of type TYPE, and copy that, in virtual
format, into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
@@ -58,7 +58,7 @@
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
{ \
@@ -76,15 +76,15 @@
} \
}
-#include "tm-linux.h"
+#include "config/tm-linux.h"
#include "m68k/tm-m68k.h"
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#undef EXTRACT_STRUCT_VALUE_ADDRESS
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (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 5b23df0a0be..8b922815cf6 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -21,348 +21,13 @@
#include "regcache.h"
-/* Generic 68000 stuff, to be included by other tm-*.h files. */
-
-#define TARGET_LONG_DOUBLE_FORMAT &floatformat_m68881_ext
-
-#define TARGET_LONG_DOUBLE_BIT 96
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#if !defined(SKIP_PROLOGUE)
-#define SKIP_PROLOGUE(ip) (m68k_skip_prologue (ip))
-#endif
-extern CORE_ADDR m68k_skip_prologue (CORE_ADDR ip);
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-struct frame_info;
-struct frame_saved_regs;
-
-extern CORE_ADDR m68k_saved_pc_after_call (struct frame_info *);
-extern void m68k_find_saved_regs (struct frame_info *,
- struct frame_saved_regs *);
-
-#define SAVED_PC_AFTER_CALL(frame) \
- m68k_saved_pc_after_call(frame)
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* Stack must be kept short aligned when doing function calls. */
-
-#define STACK_ALIGN(ADDR) (((ADDR) + 1) & ~1)
-
-/* Sequence of bytes for breakpoint instruction.
- This is a TRAP instruction. The last 4 bits (0xf below) is the
- vector. Systems which don't use 0xf should define BPT_VECTOR
- themselves before including this file. */
-
-#if !defined (BPT_VECTOR)
-#define BPT_VECTOR 0xf
-#endif
-
-#if !defined (BREAKPOINT)
-#define BREAKPOINT {0x4e, (0x40 | BPT_VECTOR)}
-#endif
-
-/* We default to vector 1 for the "remote" target, but allow targets
- to override. */
-#if !defined (REMOTE_BPT_VECTOR)
-#define REMOTE_BPT_VECTOR 1
-#endif
-
-#if !defined (REMOTE_BREAKPOINT)
-#define REMOTE_BREAKPOINT {0x4e, (0x40 | REMOTE_BPT_VECTOR)}
-#endif
-
-/* If your kernel resets the pc after the trap happens you may need to
- define this before including this file. */
-
-#if !defined (DECR_PC_AFTER_BREAK)
-#define DECR_PC_AFTER_BREAK 2
-#endif
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 4
-
-#define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
-#define REGISTER_BYTES_NOFP (16*4 + 8)
-
-#ifndef NUM_REGS
-#define NUM_REGS 29
-#endif
-
-#define NUM_FREGS (NUM_REGS-24)
-
-#ifndef REGISTER_BYTES_OK
-#define REGISTER_BYTES_OK(b) \
- ((b) == REGISTER_BYTES_FP \
- || (b) == REGISTER_BYTES_NOFP)
-#endif
-
-#ifndef REGISTER_BYTES
-#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4)
-#endif
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) \
- ((N) >= FPC_REGNUM ? (((N) - FPC_REGNUM) * 4) + 168 \
- : (N) >= FP0_REGNUM ? (((N) - FP0_REGNUM) * 12) + 72 \
- : (N) * 4)
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 68000, all regs are 4 bytes
- except the floating point regs which are 12 bytes. */
-/* Note that the unsigned cast here forces the result of the
- subtraction to very high positive values if N < FP0_REGNUM */
-
-#define REGISTER_RAW_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 12 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 68000, all regs are 4 bytes
- except the floating point regs which are 12-byte long doubles. */
-
-#define REGISTER_VIRTUAL_SIZE(N) (((unsigned)(N) - FP0_REGNUM) < 8 ? 12 : 4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 12
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 12
-
-/* 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. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((unsigned) (N) >= FPC_REGNUM ? lookup_pointer_type (builtin_type_void) : \
- (unsigned) (N) >= FP0_REGNUM ? builtin_type_long_double : \
- (unsigned) (N) >= A0_REGNUM ? lookup_pointer_type (builtin_type_void) : \
- builtin_type_int)
-
-/* Initializer for an array of names of registers.
- Entries beyond the first NUM_REGS are ignored. */
-
-#define REGISTER_NAMES \
- {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \
- "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp", \
- "ps", "pc", \
- "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \
- "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags" }
+/* Generic 68000 stuff, to be included by other tm-*.h files. */
-/* 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. */
+/* D0_REGNM and A0_REGNUM must be defined here because they are
+ used by the monitor. */
#define D0_REGNUM 0
#define A0_REGNUM 8
-#define A1_REGNUM 9
-#define FP_REGNUM 14 /* Contains address of executing stack frame */
-#define SP_REGNUM 15 /* Contains address of top of stack */
-#define PS_REGNUM 16 /* Contains processor status */
-#define PC_REGNUM 17 /* Contains program counter */
-#define FP0_REGNUM 18 /* Floating point register 0 */
-#define FPC_REGNUM 26 /* 68881 control register */
-#define FPS_REGNUM 27 /* 68881 status register */
-#define FPI_REGNUM 28 /* 68881 iaddr register */
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (A1_REGNUM, (ADDR)); }
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. This is assuming that floating point values are returned
- as doubles in d0/d1. */
-
-#if !defined (EXTRACT_RETURN_VALUE)
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy ((VALBUF), \
- (char *)(REGBUF) + \
- (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
- TYPE_LENGTH(TYPE))
-#endif
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. Assumes floats are passed
- in d0/d1. */
-
-#if !defined (STORE_RETURN_VALUE)
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
-#endif
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
- chain-pointer.
- In the case of the 68000, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's address. */
-
-/* If we are chaining from sigtramp, then manufacture a sigtramp frame
- (which isn't really on the stack. I'm not sure this is right for anything
- but BSD4.3 on an hp300. */
-#define FRAME_CHAIN(thisframe) \
- (thisframe->signal_handler_caller \
- ? thisframe->frame \
- : (!inside_entry_file ((thisframe)->pc) \
- ? read_memory_integer ((thisframe)->frame, 4) \
- : 0))
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue(FI))
-
-/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
- it corresponds to some offset in /usr/include/sys/user.h or
- something like that. Using some system include file would
- have the advantage of probably being more robust in the face
- of OS upgrades, but the disadvantage of being wrong for
- cross-debugging. */
-
-#define SIG_PC_FP_OFFSET 530
-
-#define FRAME_SAVED_PC(FRAME) \
- (((FRAME)->signal_handler_caller \
- ? ((FRAME)->next \
- ? read_memory_integer ((FRAME)->next->frame + SIG_PC_FP_OFFSET, 4) \
- : read_memory_integer (read_register (SP_REGNUM) \
- + SIG_PC_FP_OFFSET - 8, 4) \
- ) \
- : read_memory_integer ((FRAME)->frame + 4, 4)) \
- )
-
-#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
-
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* We can't tell how many args there are
- now that the C compiler delays popping them. */
-#if !defined (FRAME_NUM_ARGS)
-#define FRAME_NUM_ARGS(fi) (-1)
-#endif
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 8
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#if !defined (FRAME_FIND_SAVED_REGS)
-#define FRAME_FIND_SAVED_REGS(fi,fsr) m68k_find_saved_regs ((fi), &(fsr))
-#endif /* no FIND_FRAME_SAVED_REGS. */
-
-
-/* Things needed for making the inferior call functions. */
-
-/* The CALL_DUMMY macro is the sequence of instructions, as disassembled
- by gdb itself:
-
- These instructions exist only so that m68k_find_saved_regs can parse
- them as a "prologue"; they are never executed.
-
- fmovemx fp0-fp7,sp@- 0xf227 0xe0ff
- moveml d0-a5,sp@- 0x48e7 0xfffc
- clrw sp@- 0x4267
- movew ccr,sp@- 0x42e7
-
- The arguments are pushed at this point by GDB; no code is needed in
- the dummy for this. The CALL_DUMMY_START_OFFSET gives the position
- of the following jsr instruction. That is where we start
- executing.
-
- jsr @#0x32323232 0x4eb9 0x3232 0x3232
- addal #0x69696969,sp 0xdffc 0x6969 0x6969
- trap #<your BPT_VECTOR number here> 0x4e4?
- nop 0x4e71
-
- Note this is CALL_DUMMY_LENGTH bytes (28 for the above example).
-
- The dummy frame always saves the floating-point registers, whether they
- actually exist on this target or not. */
-
-/* FIXME: Wrong to hardwire this as BPT_VECTOR when sometimes it
- should be REMOTE_BPT_VECTOR. Best way to fix it would be to define
- CALL_DUMMY_BREAKPOINT_OFFSET. */
-
-#define CALL_DUMMY {0xf227e0ff, 0x48e7fffc, 0x426742e7, 0x4eb93232, 0x3232dffc, 0x69696969, (0x4e404e71 | (BPT_VECTOR << 16))}
-#define CALL_DUMMY_LENGTH 28 /* Size of CALL_DUMMY */
-#define CALL_DUMMY_START_OFFSET 12 /* Offset to jsr instruction */
-#define CALL_DUMMY_BREAKPOINT_OFFSET (CALL_DUMMY_START_OFFSET + 12)
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME.
- We use the BFD routines to store a big-endian value of known size. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ bfd_putb32 (fun, (unsigned char *) dummyname + CALL_DUMMY_START_OFFSET + 2); \
- bfd_putb32 (nargs*4, (unsigned char *) dummyname + CALL_DUMMY_START_OFFSET + 8); }
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME { m68k_push_dummy_frame (); }
-
-extern void m68k_push_dummy_frame (void);
-
-extern void m68k_pop_frame (void);
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME { m68k_pop_frame (); }
-
-/* Offset from SP to first arg on stack at first instruction of a function */
-
-#define SP_ARG0 (1 * 4)
-
-#define TARGET_M68K
-
-/* Figure out where the longjmp will land. Slurp the args out of the stack.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-extern int m68k_get_longjmp_target (CORE_ADDR *);
diff --git a/gdb/config/m68k/tm-m68klynx.h b/gdb/config/m68k/tm-m68klynx.h
index cfc462f54a4..ed1f6f0f05e 100644
--- a/gdb/config/m68k/tm-m68klynx.h
+++ b/gdb/config/m68k/tm-m68klynx.h
@@ -21,7 +21,7 @@
#ifndef TM_M68KLYNX_H
#define TM_M68KLYNX_H
-#include "tm-lynx.h"
+#include "config/tm-lynx.h"
/* If PC-2 contains this instruction, then we know what we are in a system
call stub, and the return PC is is at SP+4, instead of SP. */
diff --git a/gdb/config/m68k/tm-m68kv4.h b/gdb/config/m68k/tm-m68kv4.h
index 18bf5a2187a..275ab62dd98 100644
--- a/gdb/config/m68k/tm-m68kv4.h
+++ b/gdb/config/m68k/tm-m68kv4.h
@@ -34,7 +34,7 @@
#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
#include "m68k/tm-m68k.h"
/* Offsets (in target ints) into jmp_buf. Not defined in any system header
diff --git a/gdb/config/m68k/tm-sun2os4.h b/gdb/config/m68k/tm-sun2os4.h
index 496c32955b3..d5fe5315267 100644
--- a/gdb/config/m68k/tm-sun2os4.h
+++ b/gdb/config/m68k/tm-sun2os4.h
@@ -18,4 +18,4 @@
Boston, MA 02111-1307, USA. */
#include "m68k/tm-sun2.h"
-#include "tm-sunos.h"
+#include "config/tm-sunos.h"
diff --git a/gdb/config/m68k/tm-sun3os4.h b/gdb/config/m68k/tm-sun3os4.h
index d4bc74fd8e7..ced43761b38 100644
--- a/gdb/config/m68k/tm-sun3os4.h
+++ b/gdb/config/m68k/tm-sun3os4.h
@@ -19,4 +19,4 @@
Boston, MA 02111-1307, USA. */
#include "m68k/tm-sun3.h"
-#include "tm-sunos.h"
+#include "config/tm-sunos.h"
diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h
index 988b4bb4b9e..ea27ac45d02 100644
--- a/gdb/config/m68k/tm-vx68.h
+++ b/gdb/config/m68k/tm-vx68.h
@@ -30,7 +30,7 @@
#define DECR_PC_AFTER_BREAK 0
#include "m68k/tm-m68k.h"
-#include "tm-vxworks.h"
+#include "config/tm-vxworks.h"
/* Takes the current frame-struct pointer and returns the chain-pointer
to get to the calling frame.
diff --git a/gdb/config/m68k/xm-m68kv4.h b/gdb/config/m68k/xm-m68kv4.h
index 11679a965eb..542cd106814 100644
--- a/gdb/config/m68k/xm-m68kv4.h
+++ b/gdb/config/m68k/xm-m68kv4.h
@@ -26,4 +26,4 @@
/* Pick up more stuff from the generic SVR4 host include file. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
diff --git a/gdb/config/m68k/xm-nbsd.h b/gdb/config/m68k/xm-nbsd.h
index c266a99e628..6c735fa1a8c 100644
--- a/gdb/config/m68k/xm-nbsd.h
+++ b/gdb/config/m68k/xm-nbsd.h
@@ -19,4 +19,4 @@
Boston, MA 02111-1307, USA. */
/* Get generic NetBSD host definitions. */
-#include "xm-nbsd.h"
+#include "config/xm-nbsd.h"
diff --git a/gdb/config/m88k/delta88.mh b/gdb/config/m88k/delta88.mh
index 13dc6c27e8d..3c079fe2409 100644
--- a/gdb/config/m88k/delta88.mh
+++ b/gdb/config/m88k/delta88.mh
@@ -1,6 +1,6 @@
-# Host: Motorola 88k running SVR3
-
-XM_FILE= xm-delta88.h
-
-NAT_FILE= nm-m88k.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o corelow.o core-aout.o
+# 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
index c8e669b687c..83d4ad1c279 100644
--- a/gdb/config/m88k/delta88.mt
+++ b/gdb/config/m88k/delta88.mt
@@ -1,3 +1,3 @@
-# Target: Motorola 88k running SVR3
-TDEPFILES= m88k-tdep.o
-TM_FILE= tm-delta88.h
+# 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
index ba3dd7b6993..bc2abc5bec9 100644
--- a/gdb/config/m88k/delta88v4.mh
+++ b/gdb/config/m88k/delta88v4.mh
@@ -1,8 +1,8 @@
-# Host: Motorola 88k running SVR4
-
-XM_FILE= xm-delta88v4.h
-
-NAT_FILE= nm-delta88v4.h
-NATDEPFILES= fork-child.o m88k-nat.o corelow.o core-regset.o \
- solib.o solib-svr4.o solib-legacy.o \
- procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
+# 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
index 7797d4b6295..c8f9df2c8d1 100644
--- a/gdb/config/m88k/delta88v4.mt
+++ b/gdb/config/m88k/delta88v4.mt
@@ -1,3 +1,3 @@
-# Target: Motorola 88k running SVR4
-TDEPFILES= m88k-tdep.o
-TM_FILE= tm-delta88v4.h
+# 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
index 5d4350bb20b..a09e7a1ee73 100644
--- a/gdb/config/m88k/m88k.mh
+++ b/gdb/config/m88k/m88k.mh
@@ -1,4 +1,4 @@
-# Host: Motorola 88000 running DGUX
-XM_FILE= xm-dgux.h
-NAT_FILE= nm-m88k.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o m88k-nat.o
+# 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
index ca3fab41165..c4068e09b11 100644
--- a/gdb/config/m88k/m88k.mt
+++ b/gdb/config/m88k/m88k.mt
@@ -1,3 +1,3 @@
-# Target: Motorola 88k Binary Compatibility Standard
-TDEPFILES= m88k-tdep.o remote-bug.o
-TM_FILE= tm-m88k.h
+# 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
index 90ee391b2b6..976cfa06b77 100644
--- a/gdb/config/m88k/nm-delta88v4.h
+++ b/gdb/config/m88k/nm-delta88v4.h
@@ -1,23 +1,23 @@
-/* Native machine description for Motorola Delta 88 box, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "m88k/nm-m88k.h"
-#include "nm-sysv4.h"
+// 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
index 4c402bd1127..6521a2ac26a 100644
--- a/gdb/config/m88k/nm-m88k.h
+++ b/gdb/config/m88k/nm-m88k.h
@@ -1,25 +1,25 @@
-/* Native support macros for m88k, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define FETCH_INFERIOR_REGISTERS
-
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- (addr) = m88k_register_u_addr ((blockend),(regno));
+// 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
index f44b1f79cff..f63fca301c1 100644
--- a/gdb/config/m88k/tm-delta88.h
+++ b/gdb/config/m88k/tm-delta88.h
@@ -1,28 +1,28 @@
-/* Target machine description for Motorola Delta 88 box, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "m88k/tm-m88k.h"
-
-#define DELTA88
-
-#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigcode", (name)))
-#define SIGTRAMP_FRAME_FIXUP(frame) (frame) += 0x20
-#define SIGTRAMP_SP_FIXUP(sp) (sp) = read_memory_integer((sp), 4)
+// 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
index 35a605d3536..e343a051aee 100644
--- a/gdb/config/m88k/tm-delta88v4.h
+++ b/gdb/config/m88k/tm-delta88v4.h
@@ -1,32 +1,32 @@
-/* Target machine description for Motorola Delta 88 box, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1998, 1999
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define DELTA88
-
-#include "m88k/tm-m88k.h"
-#include "tm-sysv4.h"
-
-/* If we don't define this, backtraces go on forever. */
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
-#define IN_SIGTRAMP(pc, name) ((name) && (STREQ ("signalhandler", (name)) \
- || STREQ("sigacthandler", (name))))
-#define SIGTRAMP_SP_FIXUP(sp) (sp) = read_memory_integer((sp)+0xcd8, 4)
+// 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
index 7405c1294f1..2f08f1ac81b 100644
--- a/gdb/config/m88k/tm-m88k.h
+++ b/gdb/config/m88k/tm-m88k.h
@@ -1,587 +1,587 @@
-/* Target machine description for generic Motorola 88000, for GDB.
-
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996,
- 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "doublest.h"
-#include "regcache.h"
-
-/* g++ support is not yet included. */
-
-/* We cache information about saved registers in the frame structure,
- to save us from having to re-scan function prologues every time
- a register in a non-current frame is accessed. */
-
-#define EXTRA_FRAME_INFO \
- struct frame_saved_regs *fsr; \
- CORE_ADDR locals_pointer; \
- CORE_ADDR args_pointer;
-
-/* Zero the frame_saved_regs pointer when the frame is initialized,
- so that FRAME_FIND_SAVED_REGS () will know to allocate and
- initialize a frame_saved_regs struct the first time it is called.
- Set the arg_pointer to -1, which is not valid; 0 and other values
- indicate real, cached values. */
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- init_extra_frame_info (fromleaf, fi)
-extern void init_extra_frame_info ();
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-extern CORE_ADDR m88k_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc))
-
-/* The m88k kernel aligns all instructions on 4-byte boundaries. The
- kernel also uses the least significant two bits for its own hocus
- pocus. When gdb receives an address from the kernel, it needs to
- preserve those right-most two bits, but gdb also needs to be careful
- to realize that those two bits are not really a part of the address
- of an instruction. Shrug. */
-
-extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR);
-#define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr)
-
-/* Immediately after a function call, return the saved pc.
- Can't always go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define SAVED_PC_AFTER_CALL(frame) \
- (ADDR_BITS_REMOVE (read_register (SRP_REGNUM)))
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
-/* Sequence of bytes for breakpoint instruction. */
-
-/* instruction 0xF000D1FF is 'tb0 0,r0,511'
- If Bit bit 0 of r0 is clear (always true),
- initiate exception processing (trap).
- */
-#define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF}
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 4
-
-/* Number of machine registers */
-
-#define GP_REGS (38)
-#define FP_REGS (32)
-#define NUM_REGS (GP_REGS + FP_REGS)
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {\
- "r0",\
- "r1",\
- "r2",\
- "r3",\
- "r4",\
- "r5",\
- "r6",\
- "r7",\
- "r8",\
- "r9",\
- "r10",\
- "r11",\
- "r12",\
- "r13",\
- "r14",\
- "r15",\
- "r16",\
- "r17",\
- "r18",\
- "r19",\
- "r20",\
- "r21",\
- "r22",\
- "r23",\
- "r24",\
- "r25",\
- "r26",\
- "r27",\
- "r28",\
- "r29",\
- "r30",\
- "r31",\
- "psr",\
- "fpsr",\
- "fpcr",\
- "sxip",\
- "snip",\
- "sfip",\
- "x0",\
- "x1",\
- "x2",\
- "x3",\
- "x4",\
- "x5",\
- "x6",\
- "x7",\
- "x8",\
- "x9",\
- "x10",\
- "x11",\
- "x12",\
- "x13",\
- "x14",\
- "x15",\
- "x16",\
- "x17",\
- "x18",\
- "x19",\
- "x20",\
- "x21",\
- "x22",\
- "x23",\
- "x24",\
- "x25",\
- "x26",\
- "x27",\
- "x28",\
- "x29",\
- "x30",\
- "x31",\
- "vbr",\
- "dmt0",\
- "dmd0",\
- "dma0",\
- "dmt1",\
- "dmd1",\
- "dma1",\
- "dmt2",\
- "dmd2",\
- "dma2",\
- "sr0",\
- "sr1",\
- "sr2",\
- "sr3",\
- "fpecr",\
- "fphs1",\
- "fpls1",\
- "fphs2",\
- "fpls2",\
- "fppt",\
- "fprh",\
- "fprl",\
- "fpit",\
- "fpsr",\
- "fpcr",\
- }
-
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define R0_REGNUM 0 /* Contains the constant zero */
-#define SRP_REGNUM 1 /* Contains subroutine return pointer */
-#define RV_REGNUM 2 /* Contains simple return values */
-#define SRA_REGNUM 12 /* Contains address of struct return values */
-#define SP_REGNUM 31 /* Contains address of top of stack */
-
-/* Instruction pointer notes...
-
- On the m88100:
-
- * cr04 = sxip. On exception, contains the excepting pc (probably).
- On rte, is ignored.
-
- * cr05 = snip. On exception, contains the NPC (next pc). On rte,
- pc is loaded from here.
-
- * cr06 = sfip. On exception, contains the NNPC (next next pc). On
- rte, the NPC is loaded from here.
-
- * lower two bits of each are flag bits. Bit 1 is V means address
- is valid. If address is not valid, bit 0 is ignored. Otherwise,
- bit 0 is E and asks for an exception to be taken if this
- instruction is executed.
-
- On the m88110:
-
- * cr04 = exip. On exception, contains the address of the excepting
- pc (always). On rte, pc is loaded from here. Bit 0, aka the D
- bit, is a flag saying that the offending instruction was in a
- branch delay slot. If set, then cr05 contains the NPC.
-
- * cr05 = enip. On exception, if the instruction pointed to by cr04
- was in a delay slot as indicated by the bit 0 of cr04, aka the D
- bit, the cr05 contains the NPC. Otherwise ignored.
-
- * cr06 is invalid */
-
-/* Note that the Harris Unix kernels emulate the m88100's behavior on
- the m88110. */
-
-#define SXIP_REGNUM 35 /* On m88100, Contains Shadow Execute
- Instruction Pointer. */
-#define SNIP_REGNUM 36 /* On m88100, Contains Shadow Next
- Instruction Pointer. */
-#define SFIP_REGNUM 37 /* On m88100, Contains Shadow Fetched
- Intruction pointer. */
-
-#define EXIP_REGNUM 35 /* On m88110, Contains Exception
- Executing Instruction Pointer. */
-#define ENIP_REGNUM 36 /* On m88110, Contains the Exception
- Next Instruction Pointer. */
-
-#define PC_REGNUM SXIP_REGNUM /* Program Counter */
-#define NPC_REGNUM SNIP_REGNUM /* Next Program Counter */
-#define M88K_NNPC_REGNUM SFIP_REGNUM /* Next Next Program Counter */
-
-
-#define PSR_REGNUM 32 /* Processor Status Register */
-#define FPSR_REGNUM 33 /* Floating Point Status Register */
-#define FPCR_REGNUM 34 /* Floating Point Control Register */
-#define XFP_REGNUM 38 /* First Extended Float Register */
-#define X0_REGNUM XFP_REGNUM /* Which also contains the constant zero */
-
-/* This is rather a confusing lie. Our m88k port using a stack pointer value
- for the frame address. Hence, the frame address and the frame pointer are
- only indirectly related. The value of this macro is the register number
- fetched by the machine "independent" portions of gdb when they want to know
- about a frame address. Thus, we lie here and claim that FP_REGNUM is
- SP_REGNUM. */
-#define FP_REGNUM SP_REGNUM /* Reg fetched to locate frame when pgm stops */
-#define ACTUAL_FP_REGNUM 30
-
-/* PSR status bit definitions. */
-
-#define PSR_MODE 0x80000000
-#define PSR_BYTE_ORDER 0x40000000
-#define PSR_SERIAL_MODE 0x20000000
-#define PSR_CARRY 0x10000000
-#define PSR_SFU_DISABLE 0x000003f0
-#define PSR_SFU1_DISABLE 0x00000008
-#define PSR_MXM 0x00000004
-#define PSR_IND 0x00000002
-#define PSR_SFRZ 0x00000001
-
-
-
-/* The following two comments come from the days prior to the m88110
- port. The m88110 handles the instruction pointers differently. I
- do not know what any m88110 kernels do as the m88110 port I'm
- working with is for an embedded system. rich@cygnus.com
- 13-sept-93. */
-
-/* BCS requires that the SXIP_REGNUM (or PC_REGNUM) contain the
- address of the next instr to be executed when a breakpoint occurs.
- Because the kernel gets the next instr (SNIP_REGNUM), the instr in
- SNIP needs to be put back into SFIP, and the instr in SXIP should
- be shifted to SNIP */
-
-/* Are you sitting down? It turns out that the 88K BCS (binary
- compatibility standard) folks originally felt that the debugger
- should be responsible for backing up the IPs, not the kernel (as is
- usually done). Well, they have reversed their decision, and in
- future releases our kernel will be handling the backing up of the
- IPs. So, eventually, we won't need to do the SHIFT_INST_REGS
- stuff. But, for now, since there are 88K systems out there that do
- need the debugger to do the IP shifting, and since there will be
- systems where the kernel does the shifting, the code is a little
- more complex than perhaps it needs to be (we still go inside
- SHIFT_INST_REGS, and if the shifting hasn't occurred then gdb goes
- ahead and shifts). */
-
-extern int target_is_m88110;
-#define SHIFT_INST_REGS() \
-if (!target_is_m88110) \
-{ \
- CORE_ADDR pc = read_register (PC_REGNUM); \
- CORE_ADDR npc = read_register (NPC_REGNUM); \
- if (pc != npc) \
- { \
- write_register (M88K_NNPC_REGNUM, npc); \
- write_register (NPC_REGNUM, pc); \
- } \
-}
-
- /* Storing the following registers is a no-op. */
-#define CANNOT_STORE_REGISTER(regno) (((regno) == R0_REGNUM) \
- || ((regno) == X0_REGNUM))
-
- /* Number of bytes of storage in the actual machine representation
- for register N. On the m88k, the general purpose registers are 4
- bytes and the 88110 extended registers are 10 bytes. */
-
-#define REGISTER_RAW_SIZE(N) ((N) < XFP_REGNUM ? 4 : 10)
-
- /* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#define REGISTER_BYTES ((GP_REGS * REGISTER_RAW_SIZE(0)) \
- + (FP_REGS * REGISTER_RAW_SIZE(XFP_REGNUM)))
-
- /* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) (((N) * REGISTER_RAW_SIZE(0)) \
- + ((N) >= XFP_REGNUM \
- ? (((N) - XFP_REGNUM) \
- * REGISTER_RAW_SIZE(XFP_REGNUM)) \
- : 0))
-
- /* Number of bytes of storage in the program's representation for
- register N. On the m88k, all registers are 4 bytes excepting the
- m88110 extended registers which are 8 byte doubles. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ((N) < XFP_REGNUM ? 4 : 8)
-
- /* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM))
-
- /* Largest value REGISTER_VIRTUAL_SIZE can have.
- Are FPS1, FPS2, FPR "virtual" regisers? */
-
-#define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM))
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-struct type *m88k_register_type (int regnum);
-#define REGISTER_VIRTUAL_TYPE(N) m88k_register_type (N)
-
-/* The 88k call/return conventions call for "small" values to be returned
- into consecutive registers starting from r2. */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- memcpy ((VALBUF), &(((char *)REGBUF)[REGISTER_BYTE(RV_REGNUM)]), TYPE_LENGTH (TYPE))
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (2*REGISTER_RAW_SIZE(0), (VALBUF), TYPE_LENGTH (TYPE))
-
-/* In COFF, if PCC says a parameter is a short or a char, do not
- change it to int (it seems the convention is to change it). */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller. */
-
-extern CORE_ADDR frame_chain ();
-extern int frame_chain_valid ();
-extern int frameless_function_invocation ();
-
-#define FRAME_CHAIN(thisframe) \
- frame_chain (thisframe)
-
-#define FRAMELESS_FUNCTION_INVOCATION(frame) \
- (frameless_function_invocation (frame))
-
-/* Define other aspects of the stack frame. */
-
-#define FRAME_SAVED_PC(FRAME) \
- frame_saved_pc (FRAME)
-extern CORE_ADDR frame_saved_pc ();
-
-#define FRAME_ARGS_ADDRESS(fi) \
- frame_args_address (fi)
-extern CORE_ADDR frame_args_address ();
-
-#define FRAME_LOCALS_ADDRESS(fi) \
- frame_locals_address (fi)
-extern CORE_ADDR frame_locals_address ();
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) (-1)
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-/* On the 88k, parameter registers get stored into the so called "homing"
- area. This *always* happens when you compiled with GCC and use -g.
- Also, (with GCC and -g) the saving of the parameter register values
- always happens right within the function prologue code, so these register
- values can generally be relied upon to be already copied into their
- respective homing slots by the time you will normally try to look at
- them (we hope).
-
- Note that homing area stack slots are always at *positive* offsets from
- the frame pointer. Thus, the homing area stack slots for the parameter
- registers (passed values) for a given function are actually part of the
- frame area of the caller. This is unusual, but it should not present
- any special problems for GDB.
-
- Note also that on the 88k, we are only interested in finding the
- registers that might have been saved in memory. This is a subset of
- the whole set of registers because the standard calling sequence allows
- the called routine to clobber many registers.
-
- We could manage to locate values for all of the so called "preserved"
- registers (some of which may get saved within any particular frame) but
- that would require decoding all of the tdesc information. That would be
- nice information for GDB to have, but it is not strictly manditory if we
- can live without the ability to look at values within (or backup to)
- previous frames.
- */
-
-struct frame_saved_regs;
-struct frame_info;
-
-void frame_find_saved_regs (struct frame_info *fi,
- struct frame_saved_regs *fsr);
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- frame_find_saved_regs (frame_info, &frame_saved_regs)
-
-
-#define POP_FRAME pop_frame ()
-extern void pop_frame ();
-
-/* Call function stuff contributed by Kevin Buettner of Motorola. */
-
-#define CALL_DUMMY_LOCATION AFTER_TEXT_END
-
-extern void m88k_push_dummy_frame ();
-#define PUSH_DUMMY_FRAME m88k_push_dummy_frame()
-
-#define CALL_DUMMY { \
-0x67ff00c0, /* 0: subu #sp,#sp,0xc0 */ \
-0x243f0004, /* 4: st #r1,#sp,0x4 */ \
-0x245f0008, /* 8: st #r2,#sp,0x8 */ \
-0x247f000c, /* c: st #r3,#sp,0xc */ \
-0x249f0010, /* 10: st #r4,#sp,0x10 */ \
-0x24bf0014, /* 14: st #r5,#sp,0x14 */ \
-0x24df0018, /* 18: st #r6,#sp,0x18 */ \
-0x24ff001c, /* 1c: st #r7,#sp,0x1c */ \
-0x251f0020, /* 20: st #r8,#sp,0x20 */ \
-0x253f0024, /* 24: st #r9,#sp,0x24 */ \
-0x255f0028, /* 28: st #r10,#sp,0x28 */ \
-0x257f002c, /* 2c: st #r11,#sp,0x2c */ \
-0x259f0030, /* 30: st #r12,#sp,0x30 */ \
-0x25bf0034, /* 34: st #r13,#sp,0x34 */ \
-0x25df0038, /* 38: st #r14,#sp,0x38 */ \
-0x25ff003c, /* 3c: st #r15,#sp,0x3c */ \
-0x261f0040, /* 40: st #r16,#sp,0x40 */ \
-0x263f0044, /* 44: st #r17,#sp,0x44 */ \
-0x265f0048, /* 48: st #r18,#sp,0x48 */ \
-0x267f004c, /* 4c: st #r19,#sp,0x4c */ \
-0x269f0050, /* 50: st #r20,#sp,0x50 */ \
-0x26bf0054, /* 54: st #r21,#sp,0x54 */ \
-0x26df0058, /* 58: st #r22,#sp,0x58 */ \
-0x26ff005c, /* 5c: st #r23,#sp,0x5c */ \
-0x271f0060, /* 60: st #r24,#sp,0x60 */ \
-0x273f0064, /* 64: st #r25,#sp,0x64 */ \
-0x275f0068, /* 68: st #r26,#sp,0x68 */ \
-0x277f006c, /* 6c: st #r27,#sp,0x6c */ \
-0x279f0070, /* 70: st #r28,#sp,0x70 */ \
-0x27bf0074, /* 74: st #r29,#sp,0x74 */ \
-0x27df0078, /* 78: st #r30,#sp,0x78 */ \
-0x63df0000, /* 7c: addu #r30,#sp,0x0 */ \
-0x145f0000, /* 80: ld #r2,#sp,0x0 */ \
-0x147f0004, /* 84: ld #r3,#sp,0x4 */ \
-0x149f0008, /* 88: ld #r4,#sp,0x8 */ \
-0x14bf000c, /* 8c: ld #r5,#sp,0xc */ \
-0x14df0010, /* 90: ld #r6,#sp,0x10 */ \
-0x14ff0014, /* 94: ld #r7,#sp,0x14 */ \
-0x151f0018, /* 98: ld #r8,#sp,0x18 */ \
-0x153f001c, /* 9c: ld #r9,#sp,0x1c */ \
-0x5c200000, /* a0: or.u #r1,#r0,0x0 */ \
-0x58210000, /* a4: or #r1,#r1,0x0 */ \
-0xf400c801, /* a8: jsr #r1 */ \
-0xf000d1ff /* ac: tb0 0x0,#r0,0x1ff */ \
-}
-
-#define CALL_DUMMY_START_OFFSET 0x80
-#define CALL_DUMMY_LENGTH 0xb0
-
-/* FIXME: byteswapping. */
-#define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) \
-{ \
- *(unsigned long *)((char *) (dummy) + 0xa0) |= \
- (((unsigned long) (fun)) >> 16); \
- *(unsigned long *)((char *) (dummy) + 0xa4) |= \
- (((unsigned long) (fun)) & 0xffff); \
-}
-
-/* Stack must be aligned on 64-bit boundaries when synthesizing
- function calls. */
-
-#define STACK_ALIGN(addr) (((addr) + 7) & -8)
-
-#define STORE_STRUCT_RETURN(addr, sp) \
- write_register (SRA_REGNUM, (addr))
-
-#define NEED_TEXT_START_END 1
-
-/* According to the MC88100 RISC Microprocessor User's Manual, section
- 6.4.3.1.2:
-
- ... can be made to return to a particular instruction by placing a
- valid instruction address in the SNIP and the next sequential
- instruction address in the SFIP (with V bits set and E bits clear).
- The rte resumes execution at the instruction pointed to by the
- SNIP, then the SFIP.
-
- The E bit is the least significant bit (bit 0). The V (valid) bit is
- bit 1. This is why we logical or 2 into the values we are writing
- below. It turns out that SXIP plays no role when returning from an
- exception so nothing special has to be done with it. We could even
- (presumably) give it a totally bogus value.
-
- -- Kevin Buettner
- */
-
-extern void m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid);
-#define TARGET_WRITE_PC(VAL, PID) m88k_target_write_pc (VAL, PID)
+// 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
index 27c8fe28d22..df2b8e6d861 100644
--- a/gdb/config/m88k/xm-delta88.h
+++ b/gdb/config/m88k/xm-delta88.h
@@ -1,44 +1,44 @@
-/* Host machine description for Motorola Delta 88 system, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#if !defined (USG)
-#define USG 1
-#endif
-
-#include <sys/param.h>
-#include <sys/time.h>
-
-#define HAVE_TERMIO
-
-/*#define USIZE 2048 */
-/*#define NBPG NBPC */
-/* Might be defined in <sys/param.h>. I suspect this define was a relic
- from before when BFD did core files. */
-/* #define UPAGES USIZE */
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
- (for m88k BCS)
- the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
-
-#define KERNEL_U_ADDR 0
+// 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 <sys/param.h>
+// OBSOLETE #include <sys/time.h>
+// OBSOLETE
+// OBSOLETE #define HAVE_TERMIO
+// OBSOLETE
+// OBSOLETE /*#define USIZE 2048 */
+// OBSOLETE /*#define NBPG NBPC */
+// OBSOLETE /* Might be defined in <sys/param.h>. 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-delta88v4.h b/gdb/config/m88k/xm-delta88v4.h
index b09a02dd335..932b9022a89 100644
--- a/gdb/config/m88k/xm-delta88v4.h
+++ b/gdb/config/m88k/xm-delta88v4.h
@@ -19,4 +19,4 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
diff --git a/gdb/config/m88k/xm-dgux.h b/gdb/config/m88k/xm-dgux.h
index b6f7f996d75..dc99f97397e 100644
--- a/gdb/config/m88k/xm-dgux.h
+++ b/gdb/config/m88k/xm-dgux.h
@@ -1,55 +1,55 @@
-/* Host-machine dependent parameters for Motorola 88000, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1998
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#if !defined (USG)
-#define USG 1
-#endif
-
-#include <sys/param.h>
-
-#ifdef __GNUC__
-#define memcpy __builtin_memcpy
-/* gcc doesn't have this, at least not gcc 1.92. */
-/* #define memset __builtin_memset */
-#define strcmp __builtin_strcmp
-#endif
-
-#define x_foff _x_x._x_offset
-#define x_fname _x_name
-#define USER ptrace_user
-#define _BSD_WAIT_FLAVOR
-
-#define HAVE_TERMIO
-
-#ifndef USIZE
-#define USIZE 2048
-#endif
-#define NBPG NBPC
-#define UPAGES USIZE
-
-/* This is the amount to subtract from u.u_ar0
- to get the offset in the core file of the register values. */
-
-/* Since registers r0 through r31 are stored directly in the struct ptrace_user,
- (for m88k BCS)
- the ptrace_user offsets are sufficient and KERNEL_U_ADDRESS can be 0 */
-
-#define KERNEL_U_ADDR 0
+// 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 <sys/param.h>
+// 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/mcore/mcore.mt b/gdb/config/mcore/mcore.mt
index ed9a9231099..01b59d16bb5 100644
--- a/gdb/config/mcore/mcore.mt
+++ b/gdb/config/mcore/mcore.mt
@@ -1,5 +1,4 @@
# Target: Motorola MCore processor
TDEPFILES= mcore-tdep.o mcore-rom.o monitor.o dsrec.o
-TM_FILE= tm-mcore.h
SIM_OBS = remote-sim.o
SIM = ../sim/mcore/libsim.a
diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h
deleted file mode 100644
index 1da21b76e64..00000000000
--- a/gdb/config/mcore/tm-mcore.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Parameters for execution on a Motorola MCore.
-
- Copyright 1995, 1999, 2000, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "regcache.h"
-#include "symtab.h" /* For namespace_enum. */
-#include "symfile.h" /* For entry_point_address(). */
-
-/* All registers are 32 bits */
-#define REGISTER_SIZE 4
-#define MAX_REGISTER_RAW_SIZE 4
-
-#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
-
-#define REGISTER_BYTE(REG) ((REG) * REGISTER_SIZE)
-#define REGISTER_VIRTUAL_SIZE(REG) 4
-#define REGISTER_RAW_SIZE(REG) 4
-
-#define MAX_REGISTER_VIRTUAL_SIZE 4
-
-#define REGISTER_BYTES (NUM_REGS * REGISTER_SIZE)
-
-extern char *mcore_register_names[];
-#define REGISTER_NAME(I) mcore_register_names[I]
-
-/* Registers. The Motorola MCore contains:
-
- 16 32-bit general purpose registers (r0-r15)
- 16 32-bit alternate file registers (ar0-ar15)
- 32 32-bit control registers (cr0-cr31)
- + 1 pc
- ------
- 65 registers */
-#define NUM_REGS 65
-#define PC_REGNUM 64
-#define SP_REGNUM 0
-#define FP_REGNUM (SP_REGNUM)
-#define PR_REGNUM 15
-#define FIRST_ARGREG 2
-#define LAST_ARGREG 7
-#define RETVAL_REGNUM 2
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-#define FUNCTION_START_OFFSET 0
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* BREAKPOINT_FROM_PC uses the program counter value to determine
- the breakpoint that should be used. */
-extern const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR *pcptr,
- int *lenptr);
-#define BREAKPOINT_FROM_PC(PCPTR, LENPTR) mcore_breakpoint_from_pc (PCPTR, LENPTR)
-
-#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
-
-#define SAVED_PC_AFTER_CALL(FRAME) read_register (PR_REGNUM)
-
-struct frame_info;
-struct type;
-struct value;
-
-extern void mcore_init_extra_frame_info (struct frame_info *fi);
-#define INIT_EXTRA_FRAME_INFO(FROMLEAF, FI) mcore_init_extra_frame_info ((FI))
-#define INIT_FRAME_PC /* Not necessary */
-#define FRAME_INIT_SAVED_REGS(FI) /* handled by init_extra_frame_info */
-
-extern CORE_ADDR mcore_frame_chain (struct frame_info *fi);
-#define FRAME_CHAIN(FI) mcore_frame_chain ((FI))
-#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid ((FP), (FI))
-
-extern CORE_ADDR mcore_frame_saved_pc (struct frame_info *);
-#define FRAME_SAVED_PC(FI) (mcore_frame_saved_pc ((FI)))
-
-/* Extracting/storing return values. */
-extern void mcore_store_return_value (struct type *type, char *valbuf);
-#define STORE_RETURN_VALUE(TYPE, VALBUF) mcore_store_return_value ((TYPE), (VALBUF))
-
-extern void mcore_extract_return_value (struct type *type, char *regbut, char *valbuf);
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- mcore_extract_return_value ((TYPE), (REGBUF), (VALBUF));
-
-#define STORE_STRUCT_RETURN(ADDR, SP) /* handled by mcore_push_arguments */
-
-extern CORE_ADDR mcore_extract_struct_value_address (char *regbuf);
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- mcore_extract_struct_value_address (REGBUF)
-
-extern CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
-#define SKIP_PROLOGUE(PC) mcore_skip_prologue (PC)
-
-#define FRAME_ARGS_SKIP 0
-extern CORE_ADDR mcore_frame_args_address (struct frame_info *fi);
-#define FRAME_ARGS_ADDRESS(FI) mcore_frame_args_address ((FI))
-extern CORE_ADDR mcore_frame_locals_address (struct frame_info *fi);
-#define FRAME_LOCALS_ADDRESS(FI) mcore_frame_locals_address ((FI))
-#define FRAME_NUM_ARGS(FI) (-1)
-
-
-extern void mcore_pop_frame (struct frame_info *fi);
-#define POP_FRAME mcore_pop_frame (get_current_frame ())
-
-#define USE_GENERIC_DUMMY_FRAMES 1
-#define CALL_DUMMY {0}
-#define CALL_DUMMY_START_OFFSET (0)
-#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
-#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
-#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
-#define CALL_DUMMY_ADDRESS() entry_point_address ()
-#define SIZEOF_CALL_DUMMY_WORDS 0
-#define SAVE_DUMMY_FRAME_TOS(SP) generic_save_dummy_frame_tos (SP)
-
-extern CORE_ADDR mcore_push_return_address (CORE_ADDR, CORE_ADDR);
-#define PUSH_RETURN_ADDRESS(PC, SP) mcore_push_return_address (PC, SP)
-
-#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
-
-extern CORE_ADDR mcore_push_arguments (int, struct value **, CORE_ADDR,
- unsigned char, CORE_ADDR);
-#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
- (SP) = mcore_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)
-
-/* MCore will never pass a sturcture by reference. It will always be split
- between registers and stack. */
-#define REG_STRUCT_HAS_ADDR(GCC_P, TYPE) 0
-
-extern use_struct_convention_fn mcore_use_struct_convention;
-#define USE_STRUCT_CONVENTION(GCC_P, TYPE) mcore_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_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
-
-/* Cons up virtual frame pointer for trace */
-extern void mcore_virtual_frame_pointer (CORE_ADDR, int *, LONGEST *);
-#define TARGET_VIRTUAL_FRAME_POINTER(PC, REGP, OFFP) \
- mcore_virtual_frame_pointer ((PC), (REGP), (OFFP))
-
-/* For PE, gcc will tell us what th real type of
- arguments are when it promotes arguments. */
-#define BELIEVE_PCC_PROMOTION 1
diff --git a/gdb/config/mips/irix5.mt b/gdb/config/mips/irix5.mt
index 5b17bcdf1dd..81e0f159eba 100644
--- a/gdb/config/mips/irix5.mt
+++ b/gdb/config/mips/irix5.mt
@@ -1,3 +1,3 @@
# Target: MIPS SGI running Irix 5
-TDEPFILES= mips-tdep.o
+TDEPFILES= mips-tdep.o mips-irix-tdep.o solib.o solib-irix.o
TM_FILE= tm-irix5.h
diff --git a/gdb/config/mips/irix6.mh b/gdb/config/mips/irix6.mh
index 99b47374906..8075f0d78cb 100644
--- a/gdb/config/mips/irix6.mh
+++ b/gdb/config/mips/irix6.mh
@@ -1,7 +1,7 @@
# Host: SGI Iris running irix 6.x
XM_FILE= xm-irix6.h
NAT_FILE= nm-irix6.h
-NATDEPFILES= fork-child.o solib.o irix5-nat.o corelow.o procfs.o \
+NATDEPFILES= fork-child.o irix5-nat.o corelow.o procfs.o \
proc-api.o proc-events.o proc-flags.o proc-why.o
XM_CLIBS=-lbsd
diff --git a/gdb/config/mips/irix6.mt b/gdb/config/mips/irix6.mt
index c5c5ccea8aa..3a5a77442ea 100644
--- a/gdb/config/mips/irix6.mt
+++ b/gdb/config/mips/irix6.mt
@@ -1,3 +1,3 @@
# Target: MIPS SGI running Irix 6.x
-TDEPFILES= mips-tdep.o
+TDEPFILES= mips-tdep.o mips-irix-tdep.o solib.o solib-irix.o
TM_FILE= tm-irix6.h
diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h
index bed3144530d..59749f66335 100644
--- a/gdb/config/mips/nm-irix5.h
+++ b/gdb/config/mips/nm-irix5.h
@@ -19,12 +19,14 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "nm-sysv4.h"
+#include "config/nm-sysv4.h"
#undef IN_SOLIB_DYNSYM_RESOLVE_CODE
#define TARGET_HAS_HARDWARE_WATCHPOINTS
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
+/* TARGET_CAN_USE_HARDWARE_WATCHPOINT is now defined to go through
+ the target vector. For Irix5, procfs_can_use_hw_watchpoint()
+ should be invoked. */
/* When a hardware watchpoint fires off the PC will be left at the
instruction which caused the watchpoint. It will be necessary for
diff --git a/gdb/config/mips/nm-linux.h b/gdb/config/mips/nm-linux.h
index c43ecd68393..426dd5523b6 100644
--- a/gdb/config/mips/nm-linux.h
+++ b/gdb/config/mips/nm-linux.h
@@ -24,7 +24,7 @@
#define MIPS_GNULINUX_TARGET
-#include "nm-linux.h"
+#include "config/nm-linux.h"
/* Return sizeof user struct to callers in less machine dependent
routines. Hard coded for cross-compilation friendliness. */
diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h
index 300e549aea1..7482a779482 100644
--- a/gdb/config/mips/tm-embed.h
+++ b/gdb/config/mips/tm-embed.h
@@ -19,9 +19,6 @@
#include "mips/tm-bigmips.h"
-#undef DEFAULT_MIPS_TYPE
-#define DEFAULT_MIPS_TYPE "r3051"
-
/* Watchpoint support */
#define TARGET_HAS_HARDWARE_WATCHPOINTS
diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h
index 49b842fb7f1..2a1af87aa15 100644
--- a/gdb/config/mips/tm-irix5.h
+++ b/gdb/config/mips/tm-irix5.h
@@ -48,21 +48,6 @@
: ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
: builtin_type_int)
-#undef MIPS_LAST_ARG_REGNUM
-#define MIPS_LAST_ARG_REGNUM 11 /* N32 uses R4 through R11 for args */
-
-/* MIPS_STACK_ARGSIZE -- how many bytes does a pushed function arg take
- up on the stack? For the n32 ABI, eight bytes are reserved for each
- register. Like MIPS_SAVED_REGSIZE but different. */
-#define MIPS_DEFAULT_STACK_ARGSIZE 8
-
-/* N32 does not reserve home space for registers used to carry
- parameters. */
-#define MIPS_REGS_HAVE_HOME_P 0
-
-/* Force N32 ABI as the default. */
-#define MIPS_DEFAULT_ABI MIPS_ABI_N32
-
#endif /* N32 */
diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h
index 2d90b2ef998..ac710a465a6 100644
--- a/gdb/config/mips/tm-irix6.h
+++ b/gdb/config/mips/tm-irix6.h
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "mips/tm-bigmips.h"
+#include "mips/tm-bigmips64.h"
/* SGI's assembler doesn't grok dollar signs in identifiers.
So we use dots instead. This item must be coordinated with G++. */
@@ -88,29 +88,6 @@
((N) - FP0_REGNUM) * sizeof(double) : \
32 * sizeof(double) + ((N) - 32) * MIPS_REGSIZE)
-#undef REGISTER_VIRTUAL_TYPE
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) ? builtin_type_double \
- : ((N) == 32 /*SR*/) ? builtin_type_uint32 \
- : ((N) >= 70 && (N) <= 89) ? builtin_type_uint32 \
- : builtin_type_int)
-
-#undef MIPS_LAST_ARG_REGNUM
-#define MIPS_LAST_ARG_REGNUM 11 /* N32 uses R4 through R11 for args */
-
-/* MIPS_STACK_ARGSIZE -- how many bytes does a pushed function arg take
- up on the stack? For the n32 ABI, eight bytes are reserved for each
- register. Like MIPS_SAVED_REGSIZE but different. */
-#define MIPS_DEFAULT_STACK_ARGSIZE 8
-
-/* N32 does not reserve home space for registers used to carry
- parameters. */
-#define MIPS_REGS_HAVE_HOME_P 0
-
-/* Force N32 ABI as the default. */
-#define MIPS_DEFAULT_ABI MIPS_ABI_N32
-
-
/* The signal handler trampoline is called _sigtramp. */
#undef IN_SIGTRAMP
#define IN_SIGTRAMP(pc, name) ((name) && STREQ ("_sigtramp", name))
@@ -137,3 +114,6 @@
/* Select the disassembler */
#undef TM_PRINT_INSN_MACH
#define TM_PRINT_INSN_MACH bfd_mach_mips8000
+
+/* Undefine those methods which have been multiarched. */
+#undef REGISTER_VIRTUAL_TYPE
diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h
index 0e9de3cbb26..60e9bee8782 100644
--- a/gdb/config/mips/tm-linux.h
+++ b/gdb/config/mips/tm-linux.h
@@ -33,15 +33,12 @@
/* GNU/Linux MIPS has __SIGRTMAX == 127. */
+#ifndef REALTIME_LO
#define REALTIME_LO 32
#define REALTIME_HI 128
+#endif
-#include "tm-linux.h"
-
-/* There's an E_MIPS_ABI_O32 flag in e_flags, but we don't use it - in
- fact, using it may violate the o32 ABI. */
-
-#define MIPS_DEFAULT_ABI MIPS_ABI_O32
+#include "config/tm-linux.h"
/* Use target_specific function to define link map offsets. */
@@ -51,8 +48,8 @@ extern struct link_map_offsets *mips_linux_svr4_fetch_link_map_offsets (void);
/* Details about jmp_buf. */
-#define JB_ELEMENT_SIZE 4
-#define JB_PC 0
+#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
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index 8403ef87153..d87c4a74981 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -38,10 +38,6 @@ struct value;
#include "coff/sym.h" /* Needed for PDR below. */
#include "coff/symconst.h"
-#if !defined (MIPS_EABI)
-#define MIPS_EABI 0
-#endif
-
/* 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)
@@ -50,31 +46,12 @@ struct value;
#define GDB_TARGET_UNMASK_DISAS_PC(addr) MAKE_MIPS16_ADDR(addr)
#endif
-/* The name of the usual type of MIPS processor that is in the target
- system. */
-
-#define DEFAULT_MIPS_TYPE "generic"
-
-/* Remove useless bits from the stack pointer. */
-
-#define TARGET_READ_SP() ADDR_BITS_REMOVE (read_register (SP_REGNUM))
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
/* 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);
#define STEP_SKIPS_DELAY_P (1)
#define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc))
-/* Are we currently handling a signal */
-
-extern int in_sigtramp (CORE_ADDR, char *);
-#define IN_SIGTRAMP(pc, name) in_sigtramp(pc, name)
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
@@ -95,11 +72,6 @@ extern int in_sigtramp (CORE_ADDR, char *);
#define NUM_REGS 90
#endif
-/* Given the register index, return the name of the corresponding
- register. */
-extern char *mips_register_name (int regnr);
-#define REGISTER_NAME(i) mips_register_name (i)
-
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
@@ -130,11 +102,6 @@ extern char *mips_register_name (int regnr);
#define ZERO_REGNUM 0 /* read-only register, always 0 */
#define V0_REGNUM 2 /* Function integer return value */
#define A0_REGNUM 4 /* Loc of first arg during a subr call */
-#if MIPS_EABI
-#define MIPS_LAST_ARG_REGNUM 11 /* EABI uses R4 through R11 for args */
-#else
-#define MIPS_LAST_ARG_REGNUM 7 /* old ABI uses R4 through R7 for args */
-#endif
#define T9_REGNUM 25 /* Contains address of callee in PIC */
#define SP_REGNUM 29 /* Contains address of top of stack */
#define RA_REGNUM 31 /* Contains return address value */
@@ -146,11 +113,6 @@ extern char *mips_register_name (int regnr);
#define PC_REGNUM 37 /* Contains program counter */
#define FP0_REGNUM 38 /* Floating point register 0 (single float) */
#define FPA0_REGNUM (FP0_REGNUM+12) /* First float argument register */
-#if MIPS_EABI /* EABI uses F12 through F19 for args */
-#define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+19)
-#else /* old ABI uses F12 through F15 for args */
-#define MIPS_LAST_FP_ARG_REGNUM (FP0_REGNUM+15)
-#endif
#define FCRCS_REGNUM 70 /* FP control/status */
#define FCRIR_REGNUM 71 /* FP implementation/revision */
#define FP_REGNUM 72 /* Pseudo register that contains true address of executing stack frame */
@@ -159,12 +121,6 @@ extern char *mips_register_name (int regnr);
#define PRID_REGNUM 89 /* Processor ID */
#define LAST_EMBED_REGNUM 89 /* Last one */
-/* Define DO_REGISTERS_INFO() to do machine-specific formatting
- of register dumps. */
-
-#define DO_REGISTERS_INFO(_regnum, fp) mips_do_registers_info(_regnum, fp)
-extern void mips_do_registers_info (int, int);
-
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
@@ -175,39 +131,6 @@ extern void mips_do_registers_info (int, int);
#define REGISTER_BYTE(N) ((N) * MIPS_REGSIZE)
-/* Covert between the RAW and VIRTUAL registers.
-
- Some MIPS (SR, FSR, FIR) have a `raw' size of MIPS_REGSIZE but are
- really 32 bit registers. This is a legacy of the 64 bit MIPS GDB
- protocol which transfers 64 bits for 32 bit registers. */
-
-extern int mips_register_convertible (int reg_nr);
-#define REGISTER_CONVERTIBLE(N) (mips_register_convertible ((N)))
-
-
-void mips_register_convert_to_virtual (int reg_nr, struct type *virtual_type,
- char *raw_buf, char *virt_buf);
-#define REGISTER_CONVERT_TO_VIRTUAL(N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF) \
- mips_register_convert_to_virtual (N,VIRTUAL_TYPE,RAW_BUF,VIRT_BUF)
-
-void mips_register_convert_to_raw (struct type *virtual_type, int reg_nr,
- char *virt_buf, char *raw_buf);
-#define REGISTER_CONVERT_TO_RAW(VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF) \
- mips_register_convert_to_raw (VIRTUAL_TYPE,N,VIRT_BUF,RAW_BUF)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#define REGISTER_VIRTUAL_SIZE(N) TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (N))
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
/* Return the GDB type object for the "standard" data type of data in
register N. */
@@ -224,155 +147,20 @@ void mips_register_convert_to_raw (struct type *virtual_type, int reg_nr,
If the target is big endian, double register values need conversion
between memory and register formats. */
-#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \
- do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
- && REGISTER_RAW_SIZE (n) == 4 \
- && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
- && TYPE_CODE(type) == TYPE_CODE_FLT \
- && TYPE_LENGTH(type) == 8) { \
- char __temp[4]; \
- memcpy (__temp, ((char *)(buffer))+4, 4); \
- memcpy (((char *)(buffer))+4, (buffer), 4); \
- memcpy (((char *)(buffer)), __temp, 4); }} while (0)
-
-#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \
- do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
- && REGISTER_RAW_SIZE (n) == 4 \
- && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
- && TYPE_CODE(type) == TYPE_CODE_FLT \
- && TYPE_LENGTH(type) == 8) { \
- char __temp[4]; \
- memcpy (__temp, ((char *)(buffer))+4, 4); \
- memcpy (((char *)(buffer))+4, (buffer), 4); \
- memcpy (((char *)(buffer)), __temp, 4); }} while (0)
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. Handled by mips_push_arguments. */
-
-#define STORE_STRUCT_RETURN(addr, sp)
-/**/
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. XXX floats */
-
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- mips_extract_return_value(TYPE, REGBUF, VALBUF)
-extern void mips_extract_return_value (struct type *, char[], char *);
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- mips_store_return_value(TYPE, VALBUF)
-extern void mips_store_return_value (struct type *, char *);
-
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-/* The address is passed in a0 upon entry to the function, but when
- the function exits, the compiler has copied the value to v0. This
- convention is specified by the System V ABI, so I think we can rely
- on it. */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- (extract_address (REGBUF + REGISTER_BYTE (V0_REGNUM), \
- REGISTER_RAW_SIZE (V0_REGNUM)))
-
-extern use_struct_convention_fn mips_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p, type) mips_use_struct_convention (gcc_p, type)
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer. */
-
-#define FRAME_CHAIN(thisframe) (CORE_ADDR) mips_frame_chain (thisframe)
-extern CORE_ADDR mips_frame_chain (struct frame_info *);
+extern void mips_register_convert_to_type (int regnum,
+ struct type *type,
+ char *buffer);
+extern void mips_register_convert_from_type (int regnum,
+ struct type *type,
+ char *buffer);
-/* Define other aspects of the stack frame. */
+#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \
+ mips_register_convert_to_type ((n), (type), (buffer))
+#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \
+ mips_register_convert_from_type ((n), (type), (buffer))
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* We handle this differently for mips, and maybe we should not */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) (mips_frame_saved_pc(FRAME))
-extern CORE_ADDR mips_frame_saved_pc (struct frame_info *);
-
-#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
-
-#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) (mips_frame_num_args(fi))
-extern int mips_frame_num_args (struct frame_info *);
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 0
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_INIT_SAVED_REGS(frame_info) \
- do { \
- if ((frame_info)->saved_regs == NULL) \
- mips_find_saved_regs (frame_info); \
- (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
- } while (0)
-extern void mips_find_saved_regs (struct frame_info *);
-
-/* Things needed for making the inferior call functions. */
-
-/* Stack must be aligned on 32-bit boundaries when synthesizing
- function calls. We don't need STACK_ALIGN, PUSH_ARGUMENTS will
- handle it. */
-
-extern CORE_ADDR mips_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- (mips_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
-
-extern CORE_ADDR mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp);
-#define PUSH_RETURN_ADDRESS(PC, SP) (mips_push_return_address ((PC), (SP)))
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME mips_push_dummy_frame()
-extern void mips_push_dummy_frame (void);
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME mips_pop_frame()
-extern void mips_pop_frame (void);
-
-#define CALL_DUMMY_START_OFFSET (0)
-
-#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
-
-/* When calling functions on Irix 5 (or any MIPS SVR4 ABI compliant
- platform), $t9 ($25) (Dest_Reg) contains the address of the callee
- (used for PIC). It doesn't hurt to do this on other systems; $t9
- will be ignored. */
-#define FIX_CALL_DUMMY(dummyname, start_sp, fun, nargs, args, rettype, gcc_p) \
- write_register(T9_REGNUM, fun)
-
-#define CALL_DUMMY_ADDRESS() (mips_call_dummy_address ())
-extern CORE_ADDR mips_call_dummy_address (void);
-
/* Special symbol found in blocks associated with routines. We can hang
mips_extra_func_info_t's off of this. */
@@ -392,10 +180,6 @@ typedef struct mips_extra_func_info
}
*mips_extra_func_info_t;
-extern void mips_init_extra_frame_info (int fromleaf, struct frame_info *);
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
- mips_init_extra_frame_info(fromleaf, fci)
-
extern void mips_print_extra_frame_info (struct frame_info *frame);
#define PRINT_EXTRA_FRAME_INFO(fi) \
mips_print_extra_frame_info (fi)
@@ -420,7 +204,6 @@ extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
#define TM_PRINT_INSN_MACH 0
-
/* These are defined in mdebugread.c and are used in mips-tdep.c */
extern CORE_ADDR sigtramp_address, sigtramp_end;
extern void fixup_sigtramp (void);
@@ -429,13 +212,7 @@ extern void fixup_sigtramp (void);
extern char *mips_read_processor_type (void);
/* Functions for dealing with MIPS16 call and return stubs. */
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) mips_in_call_stub (pc, name)
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) mips_in_return_stub (pc, name)
-#define SKIP_TRAMPOLINE_CODE(pc) mips_skip_stub (pc)
#define IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc)
-extern int mips_in_call_stub (CORE_ADDR pc, char *name);
-extern int mips_in_return_stub (CORE_ADDR pc, char *name);
-extern CORE_ADDR mips_skip_stub (CORE_ADDR pc);
extern int mips_ignore_helper (CORE_ADDR pc);
#ifndef TARGET_MIPS
@@ -456,38 +233,8 @@ typedef unsigned long t_inst; /* Integer big enough to hold an instruction */
#endif /* TM_MIPS_H */
-/* Macros for setting and testing a bit in a minimal symbol that
- marks it as 16-bit function. The MSB of the minimal symbol's
- "info" field is used for this purpose. This field is already
- being used to store the symbol size, so the assumption is
- that the symbol size cannot exceed 2^31.
-
- ELF_MAKE_MSYMBOL_SPECIAL
- tests whether an ELF symbol is "special", i.e. refers
- to a 16-bit function, and sets a "special" bit in a
- minimal symbol to mark it as a 16-bit function
- MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
- MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
- the "info" field with the "special" bit masked out
- */
-
-#define ELF_MAKE_MSYMBOL_SPECIAL(sym,msym) \
- { \
- if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16) { \
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000); \
- SYMBOL_VALUE_ADDRESS (msym) |= 1; \
- } \
- }
-
-#define MSYMBOL_IS_SPECIAL(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
-#define MSYMBOL_SIZE(msym) \
- ((long) MSYMBOL_INFO (msym) & 0x7fffffff)
-
-
/* Command to set the processor type. */
extern void mips_set_processor_type_command (char *, int);
-
/* Single step based on where the current instruction will take us. */
extern void mips_software_single_step (enum target_signal, int);
diff --git a/gdb/config/mips/tm-mips64.h b/gdb/config/mips/tm-mips64.h
index 510ad05c0bc..13e62d2acf3 100644
--- a/gdb/config/mips/tm-mips64.h
+++ b/gdb/config/mips/tm-mips64.h
@@ -34,4 +34,4 @@
#define OP_LDGPR 067 /* ld */
/* Get the basic MIPS definitions. */
-#include "tm-mips.h"
+#include "mips/tm-mips.h"
diff --git a/gdb/config/mips/tm-mipsm3.h b/gdb/config/mips/tm-mipsm3.h
index 19ae028c604..9e2f4901d7a 100644
--- a/gdb/config/mips/tm-mipsm3.h
+++ b/gdb/config/mips/tm-mipsm3.h
@@ -25,7 +25,7 @@
*/
/* Include common definitions for Mach3 systems */
-#include "nm-m3.h"
+#include "config/nm-m3.h"
/* Define offsets to access CPROC stack when it does not have
* a kernel thread.
diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h
index d1cc21ca1e8..ebf671bd54a 100644
--- a/gdb/config/mips/tm-mipsv4.h
+++ b/gdb/config/mips/tm-mipsv4.h
@@ -19,7 +19,7 @@
Boston, MA 02111-1307, USA. */
#include "mips/tm-bigmips.h"
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
/* The signal handler trampoline is called _sigtramp. */
#undef IN_SIGTRAMP
@@ -33,8 +33,5 @@
#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 40 + 35 * 4)
#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 40 + 36 * 4)
-/* Use the alternate method of determining valid frame chains. */
-#define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi)
-
/* Convert a DWARF register number to a gdb REGNUM. */
#define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)
diff --git a/gdb/config/mips/tm-nbsd.h b/gdb/config/mips/tm-nbsd.h
index fc7448665e1..143f3a43114 100644
--- a/gdb/config/mips/tm-nbsd.h
+++ b/gdb/config/mips/tm-nbsd.h
@@ -28,11 +28,6 @@
#include "mips/tm-mips.h"
#include "solib.h"
-/* There's an E_MIPS_ABI_O32 flag in e_flags, but we don't use it - in
- fact, using it may violate the o32 ABI. */
-
-#define MIPS_DEFAULT_ABI MIPS_ABI_O32
-
/* We don't want to inherit tm-mips.h's shared library trampoline code. */
#undef IN_SOLIB_CALL_TRAMPOLINE
#undef IN_SOLIB_RETURN_TRAMPOLINE
diff --git a/gdb/config/mips/tm-vxmips.h b/gdb/config/mips/tm-vxmips.h
index e4ef2b6a2bd..5475fb57259 100644
--- a/gdb/config/mips/tm-vxmips.h
+++ b/gdb/config/mips/tm-vxmips.h
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "mips/tm-mips.h"
-#include "tm-vxworks.h"
+#include "config/tm-vxworks.h"
/* FIXME: These are almost certainly wrong. */
diff --git a/gdb/config/mips/xm-irix5.h b/gdb/config/mips/xm-irix5.h
index 78c3a071e10..7d61ff059cc 100644
--- a/gdb/config/mips/xm-irix5.h
+++ b/gdb/config/mips/xm-irix5.h
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
/* Override register locations in upage for SGI machines */
#undef REGISTER_U_ADDR
diff --git a/gdb/config/mips/xm-mipsv4.h b/gdb/config/mips/xm-mipsv4.h
index 76fa5da19db..eccb2964d05 100644
--- a/gdb/config/mips/xm-mipsv4.h
+++ b/gdb/config/mips/xm-mipsv4.h
@@ -19,4 +19,4 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h
index 4402b78ba79..bd2e66c411b 100644
--- a/gdb/config/mn10200/tm-mn10200.h
+++ b/gdb/config/mn10200/tm-mn10200.h
@@ -125,7 +125,7 @@ extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *);
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
{ \
if (TYPE_LENGTH (TYPE) > 8) \
internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
@@ -144,11 +144,11 @@ extern CORE_ADDR mn10200_frame_saved_pc (struct frame_info *);
} \
}
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
extract_address (REGBUF + REGISTER_BYTE (4), \
REGISTER_RAW_SIZE (4))
-#define STORE_RETURN_VALUE(TYPE, VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
{ \
if (TYPE_LENGTH (TYPE) > 8) \
internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
@@ -197,9 +197,8 @@ extern CORE_ADDR mn10200_push_return_address (CORE_ADDR, CORE_ADDR);
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
-extern CORE_ADDR
-mn10200_push_arguments (int, struct value **, CORE_ADDR,
- unsigned char, CORE_ADDR);
+extern CORE_ADDR mn10200_push_arguments (int, struct value **, CORE_ADDR,
+ unsigned char, CORE_ADDR);
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(mn10200_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
@@ -214,7 +213,7 @@ extern use_struct_convention_fn mn10200_use_struct_convention;
/* 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_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/ns32k/xm-nbsd.h b/gdb/config/ns32k/xm-nbsd.h
index 23a0650d280..962664b70b9 100644
--- a/gdb/config/ns32k/xm-nbsd.h
+++ b/gdb/config/ns32k/xm-nbsd.h
@@ -19,4 +19,4 @@
Boston, MA 02111-1307, USA. */
/* Get generic NetBSD host definitions. */
-#include "xm-nbsd.h"
+#include "config/xm-nbsd.h"
diff --git a/gdb/config/pa/hppa.mt b/gdb/config/pa/hppa.mt
new file mode 100644
index 00000000000..be778922f34
--- /dev/null
+++ b/gdb/config/pa/hppa.mt
@@ -0,0 +1,2 @@
+TDEPFILES= hppa-tdep.o
+TM_FILE= tm-hppa.h
diff --git a/gdb/config/pa/nm-hppao.h b/gdb/config/pa/nm-hppao.h
index 11e13e7dbca..6650a4bd19a 100644
--- a/gdb/config/pa/nm-hppao.h
+++ b/gdb/config/pa/nm-hppao.h
@@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "nm-m3.h"
+#include "config/nm-m3.h"
#define U_REGS_OFFSET 0
#define KERNEL_U_ADDR 0
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 227108f49ef..6fd8c033652 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -310,7 +310,8 @@ extern void pa_do_strcat_registers_info (int, int, struct ui_file *, enum precis
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
hppa_extract_return_value (TYPE, REGBUF, VALBUF);
/* elz: decide whether the function returning a value of type type
@@ -330,27 +331,30 @@ extern use_struct_convention_fn hppa_use_struct_convention;
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+
+extern void hppa_store_return_value (struct type *type, char *valbuf);
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
hppa_store_return_value (TYPE, VALBUF);
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(*(int *)((REGBUF) + REGISTER_BYTE (28)))
/* elz: Return a large value, which is stored on the stack at addr.
- This is defined only for the hppa, at this moment.
- The above macro EXTRACT_STRUCT_VALUE_ADDRESS is not called anymore,
- because it assumes that on exit from a called function which returns
- a large structure on the stack, the address of the ret structure is
- still in register 28. Unfortunately this register is usually overwritten
- by the called function itself, on hppa. This is specified in the calling
- convention doc. As far as I know, the only way to get the return value
- is to have the caller tell us where it told the callee to put it, rather
- than have the callee tell us.
- */
+ This is defined only for the hppa, at this moment. The above macro
+ DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS is not called anymore,
+ because it assumes that on exit from a called function which
+ returns a large structure on the stack, the address of the ret
+ structure is still in register 28. Unfortunately this register is
+ usually overwritten by the called function itself, on hppa. This is
+ specified in the calling convention doc. As far as I know, the only
+ way to get the return value is to have the caller tell us where it
+ told the callee to put it, rather than have the callee tell us. */
+struct value *hppa_value_returned_from_stack (register struct type *valtype,
+ CORE_ADDR addr);
#define VALUE_RETURNED_FROM_STACK(valtype,addr) \
hppa_value_returned_from_stack (valtype, addr)
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 10fdeede69d..7e6e45a2bfb 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -221,13 +221,13 @@ call_dummy
#undef REG_STRUCT_HAS_ADDR
-#undef EXTRACT_RETURN_VALUE
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
/* RM: floats are returned in FR4R, doubles in FR4
* integral values are in r28, padded on the left
* aggregates less that 65 bits are in r28, right padded
* aggregates upto 128 bits are in r28 and r29, right padded
*/
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
memcpy ((VALBUF), \
@@ -260,8 +260,8 @@ call_dummy
(TYPE_LENGTH (value_type) > 16)
/* RM: for return command */
-#undef STORE_RETURN_VALUE
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#undef DEPRECATED_STORE_RETURN_VALUE
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
write_register_bytes \
diff --git a/gdb/config/powerpc/aix.mt b/gdb/config/powerpc/aix.mt
index 706129ae2c7..d7ba624da91 100644
--- a/gdb/config/powerpc/aix.mt
+++ b/gdb/config/powerpc/aix.mt
@@ -1,3 +1,3 @@
# Target: PowerPC running AIX
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-aix.h
diff --git a/gdb/config/powerpc/aix432.mh b/gdb/config/powerpc/aix432.mh
new file mode 100644
index 00000000000..fc74eb73026
--- /dev/null
+++ b/gdb/config/powerpc/aix432.mh
@@ -0,0 +1,19 @@
+# Host: IBM PowerPC running AIX 4.3.2+
+
+XM_FILE= xm-aix.h
+
+NAT_FILE= nm-aix.h
+NATDEPFILES= aix-thread.o 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.
+# We have no idea who our current compiler is though, so we skip it.
+# MH_CFLAGS = -bnodelcsect
+
+# gdb is too big for all of its external symbols to fit in a small TOC
+# It looks like the GNU linker doesn't understand the -bbigtoc switch.
+# This switch may be needed for some vendor compilers.
+# MH_LDFLAGS = -Wl,-bbigtoc
+
+# pthread debugging support
+NAT_CLIBS = -lpthdebug
diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh
index 0e3c2a68feb..d0a2104bd89 100644
--- a/gdb/config/powerpc/linux.mh
+++ b/gdb/config/powerpc/linux.mh
@@ -4,8 +4,8 @@ XM_FILE= xm-linux.h
XM_CLIBS=
NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
- core-regset.o ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \
+NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \
+ ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \
gcore.o
LOADLIBES = -ldl -rdynamic
diff --git a/gdb/config/powerpc/linux.mt b/gdb/config/powerpc/linux.mt
index 01160b98704..1fb6fd8b8af 100644
--- a/gdb/config/powerpc/linux.mt
+++ b/gdb/config/powerpc/linux.mt
@@ -1,5 +1,6 @@
# Target: Motorola PPC on Linux
-TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o solib-legacy.o
+TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o ppc-sysv-tdep.o solib.o \
+ solib-svr4.o solib-legacy.o corelow.o
TM_FILE= tm-linux.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/powerpc/nbsd.mh b/gdb/config/powerpc/nbsd.mh
index 9d29986d996..26ba24d9860 100644
--- a/gdb/config/powerpc/nbsd.mh
+++ b/gdb/config/powerpc/nbsd.mh
@@ -1,3 +1,3 @@
# Host: PowerPC, running NetBSD
-NATDEPFILES= fork-child.o infptrace.o inftarg.o ppcnbsd-nat.o solib-legacy.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o ppcnbsd-nat.o
NAT_FILE= nm-nbsd.h
diff --git a/gdb/config/powerpc/nbsd.mt b/gdb/config/powerpc/nbsd.mt
index cbf559b658d..d492f9d763c 100644
--- a/gdb/config/powerpc/nbsd.mt
+++ b/gdb/config/powerpc/nbsd.mt
@@ -1,5 +1,5 @@
# Target: PowerPC, running NetBSD
-TDEPFILES= rs6000-tdep.o ppcnbsd-tdep.o nbsd-tdep.o ppc-linux-tdep.o corelow.o \
+TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o ppcnbsd-tdep.o nbsd-tdep.o corelow.o \
solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
diff --git a/gdb/config/powerpc/nm-linux.h b/gdb/config/powerpc/nm-linux.h
index dee39b4efaf..6e3f3a0a5c2 100644
--- a/gdb/config/powerpc/nm-linux.h
+++ b/gdb/config/powerpc/nm-linux.h
@@ -19,7 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef NM_LINUX_H
-#include "nm-linux.h"
+#include "config/nm-linux.h"
#define NM_LINUX_H
diff --git a/gdb/config/powerpc/ppc-eabi.mt b/gdb/config/powerpc/ppc-eabi.mt
index 2d4a77fcdef..5ef8cd9befb 100644
--- a/gdb/config/powerpc/ppc-eabi.mt
+++ b/gdb/config/powerpc/ppc-eabi.mt
@@ -1,3 +1,3 @@
# Target: PowerPC running eabi
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-eabi.h
diff --git a/gdb/config/powerpc/ppc-sim.mt b/gdb/config/powerpc/ppc-sim.mt
index f2ad1f0b2c4..187bf39e8d5 100644
--- a/gdb/config/powerpc/ppc-sim.mt
+++ b/gdb/config/powerpc/ppc-sim.mt
@@ -1,5 +1,5 @@
# Target: PowerPC running eabi and including the simulator
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppc-eabi.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/powerpc/ppcle-eabi.mt b/gdb/config/powerpc/ppcle-eabi.mt
index e7480975730..ee05f163797 100644
--- a/gdb/config/powerpc/ppcle-eabi.mt
+++ b/gdb/config/powerpc/ppcle-eabi.mt
@@ -1,3 +1,3 @@
# Target: PowerPC running eabi in little endian mode
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppcle-eabi.h
diff --git a/gdb/config/powerpc/ppcle-sim.mt b/gdb/config/powerpc/ppcle-sim.mt
index 558c0dc885e..31cb9006a30 100644
--- a/gdb/config/powerpc/ppcle-sim.mt
+++ b/gdb/config/powerpc/ppcle-sim.mt
@@ -1,5 +1,5 @@
# Target: PowerPC running eabi in little endian mode under the simulator
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o ppc-bdm.o ocd.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-ppcle-eabi.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/powerpc/tm-linux.h b/gdb/config/powerpc/tm-linux.h
index 5fe8d76bce0..d69dfc1f5bf 100644
--- a/gdb/config/powerpc/tm-linux.h
+++ b/gdb/config/powerpc/tm-linux.h
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "powerpc/tm-ppc-eabi.h"
/* Avoid warning from redefinition in tm-sysv4.h (included from tm-linux.h) */
#undef SKIP_TRAMPOLINE_CODE
-#include "tm-linux.h"
+#include "config/tm-linux.h"
/* We can single step on linux */
#undef SOFTWARE_SINGLE_STEP
diff --git a/gdb/config/powerpc/tm-vxworks.h b/gdb/config/powerpc/tm-vxworks.h
index a31846a802f..69e2ddec3b0 100644
--- a/gdb/config/powerpc/tm-vxworks.h
+++ b/gdb/config/powerpc/tm-vxworks.h
@@ -23,6 +23,6 @@
#define TM_VXWORKS_H
#include "powerpc/tm-ppc-eabi.h"
-#include "tm-vxworks.h"
+#include "config/tm-vxworks.h"
#endif /* ifndef TM_VXWORKS_H */
diff --git a/gdb/config/powerpc/vxworks.mt b/gdb/config/powerpc/vxworks.mt
index ba6e17bcb1c..eca028f80aa 100644
--- a/gdb/config/powerpc/vxworks.mt
+++ b/gdb/config/powerpc/vxworks.mt
@@ -1,3 +1,3 @@
# Target: Powerpc running VxWorks
-TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-vxworks.h
diff --git a/gdb/config/powerpc/xm-aix.h b/gdb/config/powerpc/xm-aix.h
index cc986502b77..e663453f40e 100644
--- a/gdb/config/powerpc/xm-aix.h
+++ b/gdb/config/powerpc/xm-aix.h
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "xm-aix4.h"
+#include "config/xm-aix4.h"
/* This doesn't seem to be declared in any header file I can find. */
char *termdef (int, int);
diff --git a/gdb/config/romp/rtbsd.mh b/gdb/config/romp/rtbsd.mh
deleted file mode 100644
index 1efa116fa18..00000000000
--- a/gdb/config/romp/rtbsd.mh
+++ /dev/null
@@ -1,8 +0,0 @@
-# IBM RT/PC running BSD unix.
-# This file contributed at NYU, where we are using the RT to remote
-# debug an a29k running unix. No attempt, as of 7/16/91, has been made
-# to support debugging of RT executables.
-NATDEPFILES corelow.o core-aout.o infptrace.o inftarg.o fork-child.o
-MH_CFLAGS=-DHOSTING_ONLY # No debugging of RT executables
-XM_FILE= xm-rtbsd.h
-CC=gcc -traditional # hc/pcc just can't cut it.
diff --git a/gdb/config/rs6000/aix4.mt b/gdb/config/rs6000/aix4.mt
index fb9d0033fef..388c4f237d8 100644
--- a/gdb/config/rs6000/aix4.mt
+++ b/gdb/config/rs6000/aix4.mt
@@ -1,3 +1,3 @@
# Target: IBM RS/6000 running AIX4
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000-aix4.h
diff --git a/gdb/config/rs6000/nm-rs6000ly.h b/gdb/config/rs6000/nm-rs6000ly.h
index 7bc1267d266..51d12f8ac70 100644
--- a/gdb/config/rs6000/nm-rs6000ly.h
+++ b/gdb/config/rs6000/nm-rs6000ly.h
@@ -21,6 +21,6 @@
#ifndef NM_RS6000LYNX_H
#define NM_RS6000LYNX_H
-#include "nm-lynx.h"
+#include "config/nm-lynx.h"
#endif /* NM_RS6000LYNX_H */
diff --git a/gdb/config/rs6000/rs6000.mt b/gdb/config/rs6000/rs6000.mt
index 5ffcc0165a4..86b4c58b5e3 100644
--- a/gdb/config/rs6000/rs6000.mt
+++ b/gdb/config/rs6000/rs6000.mt
@@ -1,3 +1,3 @@
# Target: IBM RS/6000 running AIX
-TDEPFILES= rs6000-tdep.o xcoffread.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000.h
diff --git a/gdb/config/rs6000/rs6000lynx.mt b/gdb/config/rs6000/rs6000lynx.mt
index 69aeb60c221..89ed7a288f8 100644
--- a/gdb/config/rs6000/rs6000lynx.mt
+++ b/gdb/config/rs6000/rs6000lynx.mt
@@ -1,3 +1,3 @@
# Target: IBM RS6000 running LynxOS
-TDEPFILES= coff-solib.o rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
+TDEPFILES= coff-solib.o rs6000-tdep.o ppc-sysv-tdep.o solib.o solib-svr4.o
TM_FILE= tm-rs6000ly.h
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index 202ac7751a7..ea0c0734f30 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -81,11 +81,6 @@ extern void aix_process_linenos (void);
#define FP0_REGNUM 32 /* Floating point register 0 */
#define FPLAST_REGNUM 63 /* Last floating point register */
-/* These #defines are used to parse core files and talk to ptrace, so they
- must remain fixed. */
-#define FIRST_UISA_SP_REGNUM 64 /* first special register number */
-#define LAST_UISA_SP_REGNUM 70 /* last special register number */
-
/* Define other aspects of the stack frame. */
#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
diff --git a/gdb/config/rs6000/tm-rs6000ly.h b/gdb/config/rs6000/tm-rs6000ly.h
index ca7dc0d41ee..73ef7f06337 100644
--- a/gdb/config/rs6000/tm-rs6000ly.h
+++ b/gdb/config/rs6000/tm-rs6000ly.h
@@ -21,7 +21,7 @@
#ifndef TM_RS6000LYNX_H
#define TM_RS6000LYNX_H
-#include "tm-lynx.h"
+#include "config/tm-lynx.h"
/* Use generic RS6000 definitions. */
#include "rs6000/tm-rs6000.h"
diff --git a/gdb/config/rs6000/xm-aix4.h b/gdb/config/rs6000/xm-aix4.h
index 5f7aa778f45..4ca0abb8cf1 100644
--- a/gdb/config/rs6000/xm-aix4.h
+++ b/gdb/config/rs6000/xm-aix4.h
@@ -20,7 +20,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "xm-aix4.h"
+#include "config/xm-aix4.h"
/* AIX 4.x uses nonstandard "int *" as type of third argument to ptrace() */
diff --git a/gdb/config/sh/tm-linux.h b/gdb/config/sh/tm-linux.h
index ab1d4d86f21..e8272d02e37 100644
--- a/gdb/config/sh/tm-linux.h
+++ b/gdb/config/sh/tm-linux.h
@@ -21,7 +21,7 @@
Boston, MA 02111-1307, USA. */
/* Pull in GNU/Linux generic defs. */
-#include "tm-linux.h"
+#include "config/tm-linux.h"
/* Pull in sh-target defs */
#include "sh/tm-sh.h"
diff --git a/gdb/config/sparc/nbsdaout.mh b/gdb/config/sparc/nbsdaout.mh
index ecb69e473da..45208998124 100644
--- a/gdb/config/sparc/nbsdaout.mh
+++ b/gdb/config/sparc/nbsdaout.mh
@@ -1,6 +1,4 @@
# Host: Sun 4 or Sparcstation, running NetBSD
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \
- solib.o solib-sunos.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o sparcnbsd-nat.o solib-sunos.o
XM_FILE= xm-nbsd.h
NAT_FILE= nm-nbsdaout.h
-HOST_IPC=-DBSD_IPC
diff --git a/gdb/config/sparc/nbsdaout.mt b/gdb/config/sparc/nbsdaout.mt
deleted file mode 100644
index c603f363fb5..00000000000
--- a/gdb/config/sparc/nbsdaout.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 4 or Sparcstation, running NetBSD
-TDEPFILES= sparc-tdep.o
-TM_FILE= tm-nbsdaout.h
diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
index 8581c1b92ab..1042d91b9dd 100644
--- a/gdb/config/sparc/nbsdelf.mh
+++ b/gdb/config/sparc/nbsdelf.mh
@@ -1,6 +1,4 @@
# Host: Sun 4 or Sparcstation, running NetBSD
-NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \
- solib.o solib-svr4.o solib-legacy.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o sparcnbsd-nat.o
XM_FILE= xm-nbsd.h
NAT_FILE= nm-nbsd.h
-HOST_IPC=-DBSD_IPC
diff --git a/gdb/config/sparc/nbsdelf.mt b/gdb/config/sparc/nbsdelf.mt
deleted file mode 100644
index 5c89318bfe9..00000000000
--- a/gdb/config/sparc/nbsdelf.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Sun 4 or Sparcstation, running NetBSD
-TDEPFILES= sparc-tdep.o
-TM_FILE= tm-nbsd.h
diff --git a/gdb/config/sparc/nm-linux.h b/gdb/config/sparc/nm-linux.h
index 80ab0423cd0..a156eba0707 100644
--- a/gdb/config/sparc/nm-linux.h
+++ b/gdb/config/sparc/nm-linux.h
@@ -20,8 +20,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <nm-sysv4.h>
-#include "nm-linux.h"
+#include "config/nm-sysv4.h"
+#include "config/nm-linux.h"
#include "solib.h"
#define FETCH_INFERIOR_REGISTERS
diff --git a/gdb/config/sparc/nm-nbsd.h b/gdb/config/sparc/nm-nbsd.h
index 653be852d85..957a34ed141 100644
--- a/gdb/config/sparc/nm-nbsd.h
+++ b/gdb/config/sparc/nm-nbsd.h
@@ -1,5 +1,5 @@
/* Native-dependent definitions for Sparc running NetBSD, for GDB.
- Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1999, 2000
+ Copyright 1986, 1987, 1989, 1992, 1994, 1996, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -32,30 +32,4 @@
#define CHILD_PREPARE_TO_STORE() read_register_bytes (0, NULL, REGISTER_BYTES)
-/* Make things match up with what is expected in sparc-nat.c. */
-
-#define regs trapframe
-#define fp_status fpstate
-
-#define r_g1 tf_global[1]
-#define r_ps tf_psr
-#define r_pc tf_pc
-#define r_npc tf_npc
-#define r_y tf_y
-
-#define fpu fpstate
-#define fpu_regs fs_regs
-#define fpu_fsr fs_fsr
-#define fpu_fr fs_regs
-#define Fpu_fsr fs_fsr
-#define FPU_FSR_TYPE int
-
-#define PTRACE_GETREGS PT_GETREGS
-#define PTRACE_GETFPREGS PT_GETFPREGS
-#define PTRACE_SETREGS PT_SETREGS
-#define PTRACE_SETFPREGS PT_SETFPREGS
-
-#define GDB_GREGSET_T struct reg
-#define GDB_FPREGSET_T struct fpreg
-
#endif /* NM_NBSD_H */
diff --git a/gdb/config/sparc/nm-sparclynx.h b/gdb/config/sparc/nm-sparclynx.h
index 74304be36d3..a231ba4cce1 100644
--- a/gdb/config/sparc/nm-sparclynx.h
+++ b/gdb/config/sparc/nm-sparclynx.h
@@ -21,6 +21,6 @@
#ifndef NM_SPARCLYNX_H
#define NM_SPARCLYNX_H
-#include "nm-lynx.h"
+#include "config/nm-lynx.h"
#endif /* NM_SPARCLYNX_H */
diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h
index adc8231f8e8..f8aeda07ccc 100644
--- a/gdb/config/sparc/nm-sun4sol2.h
+++ b/gdb/config/sparc/nm-sun4sol2.h
@@ -22,7 +22,7 @@
/* Include the generic SVR4 definitions. */
-#include <nm-sysv4.h>
+#include "config/nm-sysv4.h"
/* Before storing, we need to read all the registers. */
diff --git a/gdb/config/sparc/tm-linux.h b/gdb/config/sparc/tm-linux.h
index 34d901f5f9b..31eeff9e206 100644
--- a/gdb/config/sparc/tm-linux.h
+++ b/gdb/config/sparc/tm-linux.h
@@ -29,6 +29,6 @@
#define SIGCONTEXT_PC_OFFSET 12
-#include "tm-linux.h"
+#include "config/tm-linux.h"
#endif /* TM_SPARCLINUX_H */
diff --git a/gdb/config/sparc/tm-nbsd.h b/gdb/config/sparc/tm-nbsd.h
index 289e705f0a9..bd9845029b5 100644
--- a/gdb/config/sparc/tm-nbsd.h
+++ b/gdb/config/sparc/tm-nbsd.h
@@ -1,5 +1,5 @@
/* Macro definitions for Sparc running under NetBSD.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,6 +21,9 @@
#ifndef TM_NBSD_H
#define TM_NBSD_H
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
#include "sparc/tm-sparc.h"
+#include "solib.h"
#endif /* TM_NBSD_H */
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index 8486c860831..4c07f1fc1ba 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -273,8 +273,8 @@ extern void sparc64_write_sp (CORE_ADDR);
#define TARGET_READ_FP() (sparc64_read_fp ())
#define TARGET_WRITE_SP(X) (sparc64_write_sp (X))
-#undef EXTRACT_RETURN_VALUE
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
sp64_extract_return_value(TYPE, REGBUF, VALBUF, 0)
extern void sp64_extract_return_value (struct type *, char[], char *, int);
diff --git a/gdb/config/sparc/tm-sp64linux.h b/gdb/config/sparc/tm-sp64linux.h
index 56b56208652..17bdd8a002a 100644
--- a/gdb/config/sparc/tm-sp64linux.h
+++ b/gdb/config/sparc/tm-sp64linux.h
@@ -31,6 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define GDB_PTRACE_REGS64
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
-#endif TM_SPARC_LIN64_H
+#endif /* TM_SPARC_LIN64_H */
diff --git a/gdb/config/sparc/tm-sp64sim.h b/gdb/config/sparc/tm-sp64sim.h
index c8d115cd635..bb1263b40db 100644
--- a/gdb/config/sparc/tm-sp64sim.h
+++ b/gdb/config/sparc/tm-sp64sim.h
@@ -22,7 +22,7 @@
but it's a good start. */
#include "sparc/tm-sp64.h"
-#include "tm-sunos.h"
+#include "config/tm-sunos.h"
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
comment in <machine/setjmp.h>! */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 4a5358036be..8cac2586571 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -267,7 +267,7 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE, VALBUF) \
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
sparc_store_return_value (TYPE, VALBUF)
extern void sparc_store_return_value (struct type *, char *);
@@ -275,7 +275,7 @@ extern void sparc_store_return_value (struct type *, char *);
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
sparc_extract_struct_value_address (REGBUF)
extern CORE_ADDR sparc_extract_struct_value_address (char *);
@@ -717,7 +717,7 @@ sparc32_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR);
function return value of type TYPE, and copy that, in virtual
format, into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
sparc32_extract_return_value (TYPE, REGBUF, VALBUF)
extern void sparc32_extract_return_value (struct type *, char[], char *);
diff --git a/gdb/config/sparc/tm-sparclet.h b/gdb/config/sparc/tm-sparclet.h
index cc52d5a26d5..fd25f5ba1fd 100644
--- a/gdb/config/sparc/tm-sparclet.h
+++ b/gdb/config/sparc/tm-sparclet.h
@@ -108,8 +108,8 @@ enum {
/* sparclet register numbers */
#define CCSR_REGNUM 72
-#undef EXTRACT_RETURN_VALUE
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#undef DEPRECATED_EXTRACT_RETURN_VALUE
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
{ \
memcpy ((VALBUF), \
(char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \
@@ -117,8 +117,8 @@ enum {
? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \
TYPE_LENGTH(TYPE)); \
}
-#undef STORE_RETURN_VALUE
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+#undef DEPRECATED_STORE_RETURN_VALUE
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
{ \
/* Other values are returned in register %o0. */ \
write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
diff --git a/gdb/config/sparc/tm-sparclynx.h b/gdb/config/sparc/tm-sparclynx.h
index 1a28621c065..3d196539beb 100644
--- a/gdb/config/sparc/tm-sparclynx.h
+++ b/gdb/config/sparc/tm-sparclynx.h
@@ -21,7 +21,7 @@
#ifndef TM_SPARCLYNX_H
#define TM_SPARCLYNX_H
-#include "tm-lynx.h"
+#include "config/tm-lynx.h"
/* Use generic Sparc definitions. */
#include "sparc/tm-sparc.h"
diff --git a/gdb/config/sparc/tm-sun4os4.h b/gdb/config/sparc/tm-sun4os4.h
index b561b13adc7..e080904d927 100644
--- a/gdb/config/sparc/tm-sun4os4.h
+++ b/gdb/config/sparc/tm-sun4os4.h
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "sparc/tm-sparc.h"
-#include "tm-sunos.h"
+#include "config/tm-sunos.h"
/* Redefine SKIP_TRAMPOLINE_CODE to handle PIC compiled modules
in main executables. */
diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h
index e3c59f630de..eb253b1c29f 100644
--- a/gdb/config/sparc/tm-sun4sol2.h
+++ b/gdb/config/sparc/tm-sun4sol2.h
@@ -22,7 +22,7 @@
#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
#include "sparc/tm-sparc.h"
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
/* With Sol2 it is no longer necessary to enable software single-step,
since the /proc interface can take care of it for us in hardware. */
diff --git a/gdb/config/sparc/tm-vxsparc.h b/gdb/config/sparc/tm-vxsparc.h
index b6529f75b7f..f32f70daf73 100644
--- a/gdb/config/sparc/tm-vxsparc.h
+++ b/gdb/config/sparc/tm-vxsparc.h
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "sparc/tm-spc-em.h"
-#include "tm-vxworks.h"
+#include "config/tm-vxworks.h"
/* FIXME: These are almost certainly wrong. */
diff --git a/gdb/config/sparc/xm-nbsd.h b/gdb/config/sparc/xm-nbsd.h
deleted file mode 100644
index e469aabc1b4..00000000000
--- a/gdb/config/sparc/xm-nbsd.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Parameters for execution on a Sparc running NetBSD, for GDB.
- Copyright 1994 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Get generic NetBSD host definitions. */
-#include "xm-nbsd.h"
diff --git a/gdb/config/sparc/xm-sun4sol2.h b/gdb/config/sparc/xm-sun4sol2.h
index b775f7cdba0..490962d4495 100644
--- a/gdb/config/sparc/xm-sun4sol2.h
+++ b/gdb/config/sparc/xm-sun4sol2.h
@@ -21,7 +21,7 @@
/* Pick up more stuff from the generic SVR4 host include file. */
-#include "xm-sysv4.h"
+#include "config/xm-sysv4.h"
/* These are not currently used in SVR4 (but should be, FIXME!). */
#undef DO_DEFERRED_STORES
diff --git a/gdb/config/tm-linux.h b/gdb/config/tm-linux.h
index 938987270b7..caf008a9cb1 100644
--- a/gdb/config/tm-linux.h
+++ b/gdb/config/tm-linux.h
@@ -30,7 +30,7 @@
/* We need this file for the SOLIB_TRAMPOLINE stuff. */
-#include "tm-sysv4.h"
+#include "config/tm-sysv4.h"
/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that
link.h is available on all linux platforms. For I386 and SH3/4,
diff --git a/gdb/config/vax/nm-vax.h b/gdb/config/vax/nm-vax.h
index c2baef18fa6..efebd6b8936 100644
--- a/gdb/config/vax/nm-vax.h
+++ b/gdb/config/vax/nm-vax.h
@@ -18,6 +18,8 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define AP_REGNUM 12 /* XXXJRT */
+
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ addr = blockend - 0110 + regno * 4; \
if (regno == PC_REGNUM) addr = blockend - 8; \
diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h
index 204d155ab6d..22e60a09fda 100644
--- a/gdb/config/vax/tm-vax.h
+++ b/gdb/config/vax/tm-vax.h
@@ -1,4 +1,4 @@
-/* Definitions to make GDB run on a vax under 4.2bsd.
+/* Target definitions for VAX systems for GDB.
Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
@@ -19,30 +19,13 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
-#define TARGET_UPAGES 14
-#define TARGET_NBPG 512
-#define STACK_END_ADDR (0x80000000 - (TARGET_UPAGES * TARGET_NBPG))
-
-/* On the VAX, sigtramp is in the u area. Can't check the exact
- addresses because for cross-debugging we don't have VAX include
- files around. This should be close enough. */
-#define SIGTRAMP_START(pc) STACK_END_ADDR
-#define SIGTRAMP_END(pc) 0x80000000
+#ifndef TM_VAX_H
+#define TM_VAX_H
-/* Sequence of bytes for breakpoint instruction. */
-#define BREAKPOINT {3}
-
-#define AP_REGNUM 12 /* XXXJRT */
-
-/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
-/* XXXJRT should go away */
-#define SIGCONTEXT_PC_OFFSET 12
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
/* XXXJRT not yet under gdbarch control */
#define FRAME_ARGS_ADDRESS_CORRECT(fi) vax_frame_args_address_correct ((fi))
extern CORE_ADDR vax_frame_args_address_correct (struct frame_info *);
-/* If vax pcc says CHAR or SHORT, it provides the correct address. */
-#define BELIEVE_PCC_PROMOTION 1
+#endif /* TM_VAX_H */
diff --git a/gdb/config/vax/tm-vaxbsd.h b/gdb/config/vax/tm-vaxbsd.h
new file mode 100644
index 00000000000..e24049a6ec6
--- /dev/null
+++ b/gdb/config/vax/tm-vaxbsd.h
@@ -0,0 +1,41 @@
+/* Definitions to make GDB run on a vax under 4.2bsd.
+ Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef TM_VAXBSD_H
+#define TM_VAXBSD_H
+
+#include "vax/tm-vax.h"
+
+#define TARGET_UPAGES 14
+#define TARGET_NBPG 512
+#define STACK_END_ADDR (0x80000000 - (TARGET_UPAGES * TARGET_NBPG))
+
+/* On the VAX, sigtramp is in the u area. Can't check the exact
+ addresses because for cross-debugging we don't have VAX include
+ files around. This should be close enough. */
+#define SIGTRAMP_START(pc) STACK_END_ADDR
+#define SIGTRAMP_END(pc) 0x80000000
+
+/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
+/* XXXJRT should go away */
+#define SIGCONTEXT_PC_OFFSET 12
+
+#endif /* TM_VAXBSD_H */
diff --git a/gdb/config/vax/vax.mt b/gdb/config/vax/vax.mt
index ebdf942b3d9..06ab9b2b821 100644
--- a/gdb/config/vax/vax.mt
+++ b/gdb/config/vax/vax.mt
@@ -1,3 +1,3 @@
# Target: DEC VAX running BSD or Ultrix
TDEPFILES= vax-tdep.o
-TM_FILE= tm-vax.h
+TM_FILE= tm-vaxbsd.h
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index 44058554627..eb96eda68a0 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -142,19 +142,19 @@ extern int z8k_saved_pc_after_call (struct frame_info *frame);
as doubles in d0/d1. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
memcpy(VALBUF, REGBUF + REGISTER_BYTE(2), TYPE_LENGTH(TYPE));
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) internal_error (__FILE__, __LINE__, "failed internal consistency check");
+#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
diff --git a/gdb/configure b/gdb/configure
index d8493a9f21d..9befcab3d80 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -79,6 +79,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -193,6 +194,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -363,6 +365,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -528,12 +535,16 @@ 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"
+if test -z "$sitefile"; then
+ 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
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -574,7 +585,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:578: 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"
@@ -600,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:604: 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
@@ -630,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:634: 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
@@ -681,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:685: 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
@@ -713,7 +724,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:717: 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.
@@ -724,12 +735,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 728 "configure"
+#line 739 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:733: \"$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
@@ -755,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:759: 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:764: 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
@@ -769,7 +780,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$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
@@ -788,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:792: 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
@@ -820,7 +831,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:824: 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=
@@ -835,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 <<EOF
-#line 839 "configure"
+#line 850 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:845: \"$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
:
@@ -852,13 +863,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 856 "configure"
+#line 867 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:862: \"$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
:
@@ -869,13 +880,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 873 "configure"
+#line 884 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:879: \"$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
:
@@ -900,9 +911,9 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:904: checking for AIX" >&5
+echo "configure:915: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 906 "configure"
+#line 917 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -924,7 +935,7 @@ rm -f conftest*
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:928: 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
@@ -948,7 +959,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:952: 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
@@ -965,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 <<EOF
-#line 969 "configure"
+#line 980 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1002,7 +1013,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:1006: \"$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
@@ -1073,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:1077: checking host system type" >&5
+echo "configure:1088: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1094,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:1098: checking target system type" >&5
+echo "configure:1109: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1112,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:1116: checking build system type" >&5
+echo "configure:1127: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1137,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:1141: 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
@@ -1166,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:1170: 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
@@ -1194,12 +1205,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1198: 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 <<EOF
-#line 1203 "configure"
+#line 1214 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1207,7 +1218,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1211: \"$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*
@@ -1224,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
-#line 1228 "configure"
+#line 1239 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1242,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
-#line 1246 "configure"
+#line 1257 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1263,7 +1274,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1267 "configure"
+#line 1278 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1274,7 +1285,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1278: \"$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
@@ -1298,12 +1309,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1302: 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 <<EOF
-#line 1307 "configure"
+#line 1318 "configure"
#include "confdefs.h"
int main() {
@@ -1352,7 +1363,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1356: \"$ac_compile\") 1>&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
@@ -1373,21 +1384,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1377: 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 <<EOF
-#line 1384 "configure"
+#line 1395 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1391: \"$ac_compile\") 1>&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
@@ -1413,12 +1424,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1417: 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 <<EOF
-#line 1422 "configure"
+#line 1433 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1446,12 +1457,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1450: 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 <<EOF
-#line 1455 "configure"
+#line 1466 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1481,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:1485: 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 <<EOF
-#line 1490 "configure"
+#line 1501 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1497: \"$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
@@ -1514,12 +1525,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1518: 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 <<EOF
-#line 1523 "configure"
+#line 1534 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1547,7 +1558,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1551: \"$ac_link\") 1>&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
@@ -1579,12 +1590,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1583: 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 <<EOF
-#line 1588 "configure"
+#line 1599 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1609,12 +1620,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1613: 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 <<EOF
-#line 1618 "configure"
+#line 1629 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1637,7 +1648,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1641: \"$ac_link\") 1>&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
@@ -1664,7 +1675,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1668: 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
@@ -1672,7 +1683,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1676 "configure"
+#line 1687 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1691,7 +1702,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1695: \"$ac_link\") 1>&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
@@ -1716,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:1720: 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
-#line 1725 "configure"
+#line 1736 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1730: \"$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*
@@ -1755,12 +1766,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1759: 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 <<EOF
-#line 1764 "configure"
+#line 1775 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1783,7 +1794,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1787: \"$ac_link\") 1>&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
@@ -1808,7 +1819,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1812: 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
@@ -1816,7 +1827,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1820 "configure"
+#line 1831 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1956,7 +1967,7 @@ main()
}
EOF
-if { (eval echo configure:1960: \"$ac_link\") 1>&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
@@ -1984,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:1988: 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
-#line 1993 "configure"
+#line 2004 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1998: \"$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*
@@ -2024,12 +2035,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2028: 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 <<EOF
-#line 2033 "configure"
+#line 2044 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2052,7 +2063,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2056: \"$ac_link\") 1>&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
@@ -2081,12 +2092,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2085: 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 <<EOF
-#line 2090 "configure"
+#line 2101 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2109,7 +2120,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2113: \"$ac_link\") 1>&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
@@ -2143,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:2147: 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 <<EOF
-#line 2152 "configure"
+#line 2163 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2159: \"$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
@@ -2176,7 +2187,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2180: 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"
@@ -2196,7 +2207,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2200: 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"
@@ -2215,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:2219: 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
-#line 2224 "configure"
+#line 2235 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2229: \"$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*
@@ -2242,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:2246: 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 <<EOF
-#line 2251 "configure"
+#line 2262 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2258: \"$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
@@ -2270,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:2274: 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
@@ -2278,7 +2289,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2282 "configure"
+#line 2293 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2289,7 +2300,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2293: \"$ac_link\") 1>&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
@@ -2305,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:2309: 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 <<EOF
-#line 2314 "configure"
+#line 2325 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2321: \"$ac_link\") 1>&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
@@ -2345,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:2349: 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
@@ -2379,12 +2390,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2383: 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 <<EOF
-#line 2388 "configure"
+#line 2399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2407,7 +2418,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2411: \"$ac_link\") 1>&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
@@ -2434,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:2438: 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
@@ -2470,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:2474: 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
@@ -2502,7 +2513,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2506 "configure"
+#line 2517 "configure"
#include "confdefs.h"
int main() {
@@ -2510,7 +2521,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2514: \"$ac_link\") 1>&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
@@ -2542,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:2546: 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
@@ -2576,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:2580: 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
@@ -2612,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:2616: 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
@@ -2702,7 +2713,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2706: 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
@@ -2730,17 +2741,17 @@ echo "configure:2706: 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:2734: 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
-#line 2739 "configure"
+#line 2750 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2744: \"$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*
@@ -2801,6 +2812,11 @@ fi
< $srcdir/po/POTFILES.in > po/POTFILES
fi
+cat >> confdefs.h <<\EOF
+#define PACKAGE "gdb"
+EOF
+
+
CONFIG_OBS=
@@ -2814,6 +2830,7 @@ CONFIG_CLEAN=
CONFIG_INSTALL=
CONFIG_UNINSTALL=
+SUBDIRS="doc testsuite nlm"
configdirs="doc testsuite"
# Check whether --enable-multi-ice or --disable-multi-ice was given.
@@ -2863,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:2867: 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
@@ -2904,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:2908: 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
@@ -2965,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:2969: 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
@@ -2997,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:3001: 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
@@ -3029,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:3033: 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
@@ -3064,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:3068: 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
@@ -3096,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:3100: 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
@@ -3130,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:3134: 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
@@ -3164,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:3168: 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
@@ -3215,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:3219: 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 <<EOF
-#line 3224 "configure"
+#line 3241 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3237,7 +3254,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3241: \"$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
@@ -3257,12 +3274,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3261: 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 <<EOF
-#line 3266 "configure"
+#line 3283 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3270,7 +3287,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure: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*
@@ -3287,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
-#line 3291 "configure"
+#line 3308 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3305,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
-#line 3309 "configure"
+#line 3326 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3326,7 +3343,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3330 "configure"
+#line 3347 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3337,7 +3354,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3341: \"$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
@@ -3371,7 +3388,7 @@ esac; esac
for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
- string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
+ string.h sys/procfs.h sys/proc.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
@@ -3381,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:3385: 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
-#line 3390 "configure"
+#line 3407 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3395: \"$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*
@@ -3418,12 +3435,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3422: 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 <<EOF
-#line 3427 "configure"
+#line 3444 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -3475,12 +3492,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3479: 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 <<EOF
-#line 3484 "configure"
+#line 3501 "configure"
#include "confdefs.h"
int main() {
@@ -3529,7 +3546,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3533: \"$ac_compile\") 1>&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
@@ -3550,21 +3567,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3554: 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 <<EOF
-#line 3561 "configure"
+#line 3578 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:3568: \"$ac_compile\") 1>&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
@@ -3594,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:3598: 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 <<EOF
-#line 3603 "configure"
+#line 3620 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3622,7 +3639,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3626: \"$ac_link\") 1>&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
@@ -3649,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:3653: 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 <<EOF
-#line 3658 "configure"
+#line 3675 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3665: \"$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
@@ -3682,12 +3699,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3686: 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 <<EOF
-#line 3691 "configure"
+#line 3708 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3715,7 +3732,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3719: \"$ac_link\") 1>&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
@@ -3747,12 +3764,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3751: 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 <<EOF
-#line 3756 "configure"
+#line 3773 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3777,12 +3794,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3781: 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 <<EOF
-#line 3786 "configure"
+#line 3803 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3805,7 +3822,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3809: \"$ac_link\") 1>&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
@@ -3832,7 +3849,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3836: 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
@@ -3840,7 +3857,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3844 "configure"
+#line 3861 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3859,7 +3876,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3863: \"$ac_link\") 1>&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
@@ -3881,12 +3898,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3885: 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 <<EOF
-#line 3890 "configure"
+#line 3907 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3915,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:3919: 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
-#line 3924 "configure"
+#line 3941 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3929: \"$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*
@@ -3950,18 +3967,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:3954: 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:3960: 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 <<EOF
-#line 3965 "configure"
+#line 3982 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -3984,7 +4001,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:3988: \"$ac_link\") 1>&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
@@ -4006,7 +4023,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4010 "configure"
+#line 4027 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4101,7 +4118,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4105: \"$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
@@ -4125,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:4129: 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
@@ -4133,7 +4150,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4137 "configure"
+#line 4154 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -4153,7 +4170,7 @@ main()
}
EOF
-if { (eval echo configure:4157: \"$ac_link\") 1>&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
@@ -4178,12 +4195,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:4182: 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 <<EOF
-#line 4187 "configure"
+#line 4204 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -4197,7 +4214,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4201: \"$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
@@ -4221,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:4225: 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 <<EOF
-#line 4230 "configure"
+#line 4247 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -4235,7 +4252,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:4239: \"$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
@@ -4258,19 +4275,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:4262: 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 <<EOF
-#line 4267 "configure"
+#line 4284 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:4274: \"$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
@@ -4290,19 +4307,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:4294: 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 <<EOF
-#line 4299 "configure"
+#line 4316 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:4306: \"$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
@@ -4324,19 +4341,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:4328: 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 <<EOF
-#line 4333 "configure"
+#line 4350 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:4340: \"$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
@@ -4358,19 +4375,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:4362: 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 <<EOF
-#line 4367 "configure"
+#line 4384 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:4374: \"$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
@@ -4392,12 +4409,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:4396: 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 <<EOF
-#line 4401 "configure"
+#line 4418 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4405,7 +4422,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:4409: \"$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
@@ -4427,12 +4444,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:4431: 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 <<EOF
-#line 4436 "configure"
+#line 4453 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4440,7 +4457,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:4444: \"$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
@@ -4462,7 +4479,7 @@ fi
echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:4466: 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
@@ -4470,7 +4487,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4474 "configure"
+#line 4491 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4481,7 +4498,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:4485: \"$ac_link\") 1>&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
@@ -4511,12 +4528,12 @@ fi
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4515: 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 <<EOF
-#line 4520 "configure"
+#line 4537 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4539,7 +4556,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4543: \"$ac_link\") 1>&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
@@ -4566,12 +4583,12 @@ done
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4570: 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 <<EOF
-#line 4575 "configure"
+#line 4592 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4592,7 +4609,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4596: \"$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
@@ -4613,12 +4630,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4617: 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 <<EOF
-#line 4622 "configure"
+#line 4639 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4639,7 +4656,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4643: \"$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
@@ -4660,12 +4677,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4664: 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 <<EOF
-#line 4669 "configure"
+#line 4686 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4686,7 +4703,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4690: \"$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
@@ -4707,12 +4724,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:4711: 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 <<EOF
-#line 4716 "configure"
+#line 4733 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4733,7 +4750,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:4737: \"$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
@@ -4754,12 +4771,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:4758: 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 <<EOF
-#line 4763 "configure"
+#line 4780 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4780,7 +4797,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:4784: \"$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
@@ -4801,12 +4818,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4805: 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 <<EOF
-#line 4810 "configure"
+#line 4827 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4827,7 +4844,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4831: \"$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
@@ -4848,12 +4865,12 @@ EOF
fi
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:4852: 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 <<EOF
-#line 4857 "configure"
+#line 4874 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4874,7 +4891,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:4878: \"$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
@@ -4900,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:4904: checking for HPUX save_state structure" >&5
+echo "configure:4921: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 4906 "configure"
+#line 4923 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4917,7 +4934,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 4921 "configure"
+#line 4938 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4987,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:4991: 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 <<EOF
-#line 4996 "configure"
+#line 5013 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5001,7 +5018,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5005: \"$ac_compile\") 1>&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
@@ -5023,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:5027: 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 <<EOF
-#line 5032 "configure"
+#line 5049 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5037,7 +5054,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:5041: \"$ac_compile\") 1>&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
@@ -5059,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:5063: 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 <<EOF
-#line 5068 "configure"
+#line 5085 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5073,7 +5090,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5077: \"$ac_compile\") 1>&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
@@ -5095,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:5099: 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 <<EOF
-#line 5104 "configure"
+#line 5121 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5109,7 +5126,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5113: \"$ac_compile\") 1>&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
@@ -5131,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:5135: 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 <<EOF
-#line 5140 "configure"
+#line 5157 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5145,7 +5162,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5149: \"$ac_compile\") 1>&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
@@ -5167,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:5171: 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 <<EOF
-#line 5176 "configure"
+#line 5193 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5181,7 +5198,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5185: \"$ac_compile\") 1>&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
@@ -5203,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:5207: 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 <<EOF
-#line 5212 "configure"
+#line 5229 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5217,7 +5234,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5221: \"$ac_compile\") 1>&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
@@ -5239,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:5243: 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 <<EOF
-#line 5248 "configure"
+#line 5265 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5253,7 +5270,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5257: \"$ac_compile\") 1>&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
@@ -5275,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:5279: 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 <<EOF
-#line 5284 "configure"
+#line 5301 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5289,7 +5306,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:5293: \"$ac_compile\") 1>&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
@@ -5311,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:5315: 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 <<EOF
-#line 5320 "configure"
+#line 5337 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5325,7 +5342,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:5329: \"$ac_compile\") 1>&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
@@ -5347,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:5351: 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 <<EOF
-#line 5356 "configure"
+#line 5373 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5361,7 +5378,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:5365: \"$ac_compile\") 1>&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
@@ -5383,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:5387: 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 <<EOF
-#line 5392 "configure"
+#line 5409 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5397,7 +5414,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:5401: \"$ac_compile\") 1>&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
@@ -5419,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:5423: 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 <<EOF
-#line 5428 "configure"
+#line 5445 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5433,7 +5450,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:5437: \"$ac_compile\") 1>&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
@@ -5455,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:5459: 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 <<EOF
-#line 5464 "configure"
+#line 5481 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5469,7 +5486,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:5473: \"$ac_compile\") 1>&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
@@ -5496,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:5500: 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
@@ -5504,7 +5521,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 5508 "configure"
+#line 5525 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -5514,7 +5531,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:5518: \"$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
@@ -5539,12 +5556,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5543: 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 <<EOF
-#line 5548 "configure"
+#line 5565 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -5557,7 +5574,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5561: \"$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
@@ -5581,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:5585: 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 <<EOF
-#line 5590 "configure"
+#line 5607 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:5597: \"$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
@@ -5615,12 +5632,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:5619: 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 <<EOF
-#line 5624 "configure"
+#line 5641 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -5628,7 +5645,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:5632: \"$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
@@ -5650,12 +5667,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:5654: 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 <<EOF
-#line 5659 "configure"
+#line 5676 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -5666,7 +5683,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:5670: \"$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
@@ -5688,12 +5705,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:5692: 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 <<EOF
-#line 5697 "configure"
+#line 5714 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -5701,7 +5718,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:5705: \"$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
@@ -5727,7 +5744,7 @@ EOF
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:5731: 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
@@ -5735,14 +5752,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5739 "configure"
+#line 5756 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5746: \"$ac_link\") 1>&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
@@ -5771,7 +5788,7 @@ fi
echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
-echo "configure:5775: 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
@@ -5779,7 +5796,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5783 "configure"
+#line 5800 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5790,7 +5807,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5794: \"$ac_link\") 1>&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
@@ -5809,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:5813: 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
@@ -5817,7 +5834,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5821 "configure"
+#line 5838 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5828,7 +5845,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5832: \"$ac_link\") 1>&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
@@ -5860,12 +5877,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:5864: 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 <<EOF
-#line 5869 "configure"
+#line 5886 "configure"
#include "confdefs.h"
int main() {
@@ -5875,7 +5892,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5879: \"$ac_compile\") 1>&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
@@ -5897,7 +5914,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:5901: 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
@@ -5905,7 +5922,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 5909 "configure"
+#line 5926 "configure"
#include "confdefs.h"
int main () {
@@ -5919,7 +5936,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:5923: \"$ac_link\") 1>&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
@@ -5943,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:5947: 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 <<EOF
-#line 5952 "configure"
+#line 5969 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:5959: \"$ac_compile\") 1>&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
@@ -5977,7 +5994,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:5981: 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
@@ -5985,7 +6002,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 5989 "configure"
+#line 6006 "configure"
#include "confdefs.h"
int main () {
@@ -5995,7 +6012,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:5999: \"$ac_link\") 1>&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
@@ -6019,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:6023: 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
@@ -6027,7 +6044,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 6031 "configure"
+#line 6048 "configure"
#include "confdefs.h"
int main () {
@@ -6037,7 +6054,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:6041: \"$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
@@ -6063,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:6067: 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
-#line 6072 "configure"
+#line 6089 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6077: \"$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*
@@ -6102,12 +6119,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6106: 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 <<EOF
-#line 6111 "configure"
+#line 6128 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6130,7 +6147,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6134: \"$ac_link\") 1>&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
@@ -6155,7 +6172,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6159: 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
@@ -6163,7 +6180,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6167 "configure"
+#line 6184 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6303,7 +6320,7 @@ main()
}
EOF
-if { (eval echo configure:6307: \"$ac_link\") 1>&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
@@ -6329,7 +6346,7 @@ fi
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:6333: 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
@@ -6343,14 +6360,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 6347 "configure"
+#line 6364 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6354: \"$ac_link\") 1>&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
@@ -6373,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:6377: 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
@@ -6392,7 +6409,7 @@ EOF
;;
solaris*)
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:6396: checking for Solaris thread debugging library" >&5
+echo "configure:6413: 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
@@ -6402,7 +6419,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:6406: checking for dlopen in -ldl" >&5
+echo "configure:6423: 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
@@ -6410,7 +6427,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6414 "configure"
+#line 6431 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6421,7 +6438,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6442: \"$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
@@ -6453,17 +6470,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:6457: checking for the ld -export-dynamic flag" >&5
+echo "configure:6474: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 6460 "configure"
+#line 6477 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -6482,13 +6499,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:6486: checking if <proc_service.h> is old" >&5
+echo "configure:6503: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6492 "configure"
+#line 6509 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -6499,7 +6516,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -6718,7 +6735,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:6722: checking compiler warning flags" >&5
+echo "configure:6739: 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
@@ -6728,14 +6745,14 @@ echo "configure:6722: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 6732 "configure"
+#line 6749 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -6795,12 +6812,12 @@ fi
if test $want_included_regex = false; then
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:6799: checking for GNU regex" >&5
+echo "configure:6816: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6804 "configure"
+#line 6821 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
#include <sys/types.h>
@@ -6812,7 +6829,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -6841,12 +6858,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:6845: checking for cygwin" >&5
+echo "configure:6862: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6850 "configure"
+#line 6867 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -6884,7 +6901,7 @@ if test x$gdb_cv_os_cygwin = xyes; then
else
TERM_LIB=
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:6888: checking for tgetent in -lncurses" >&5
+echo "configure:6905: 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
@@ -6892,7 +6909,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6896 "configure"
+#line 6913 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6903,7 +6920,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6924: \"$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
@@ -6922,7 +6939,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:6926: checking for tgetent in -lHcurses" >&5
+echo "configure:6943: 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
@@ -6930,7 +6947,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6934 "configure"
+#line 6951 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6941,7 +6958,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6962: \"$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
@@ -6960,7 +6977,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:6964: checking for tgetent in -ltermlib" >&5
+echo "configure:6981: 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
@@ -6968,7 +6985,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6972 "configure"
+#line 6989 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6979,7 +6996,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7000: \"$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
@@ -6998,7 +7015,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:7002: checking for tgetent in -ltermcap" >&5
+echo "configure:7019: 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
@@ -7006,7 +7023,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7010 "configure"
+#line 7027 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7017,7 +7034,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7038: \"$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
@@ -7036,7 +7053,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:7040: checking for tgetent in -lcurses" >&5
+echo "configure:7057: 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
@@ -7044,7 +7061,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7048 "configure"
+#line 7065 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7055,7 +7072,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7074,7 +7091,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:7078: checking for tgetent in -lterminfo" >&5
+echo "configure:7095: 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
@@ -7082,7 +7099,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7086 "configure"
+#line 7103 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7093,7 +7110,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7114: \"$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
@@ -7258,7 +7275,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:7262: checking for Tcl configuration" >&5
+echo "configure:7279: 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
@@ -7366,7 +7383,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:7370: checking for Tk configuration" >&5
+echo "configure:7387: 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
@@ -7475,7 +7492,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:7479: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:7496: 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"
@@ -7541,17 +7558,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:7545: checking for tclInt.h" >&5
+echo "configure:7562: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7550 "configure"
+#line 7567 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7572: \"$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*
@@ -7611,7 +7628,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:7615: checking for Tk private headers" >&5
+echo "configure:7632: 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"
@@ -7677,17 +7694,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:7681: checking for tk.h" >&5
+echo "configure:7698: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7686 "configure"
+#line 7703 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7708: \"$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*
@@ -7733,7 +7750,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7737: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:7754: 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
@@ -7756,7 +7773,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7760: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:7777: 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
@@ -7779,7 +7796,7 @@ fi
echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7783: checking for Tix private headers. srcdir=${srcdir}" >&5
+echo "configure:7800: 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
@@ -7831,7 +7848,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:7835: checking for Itcl configuration" >&5
+echo "configure:7852: 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
@@ -7934,7 +7951,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:7938: checking for Itk configuration" >&5
+echo "configure:7955: 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
@@ -8037,7 +8054,7 @@ if test "${with_tixconfig+set}" = set; then
fi
echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6
-echo "configure:8041: checking for Tix configuration" >&5
+echo "configure:8058: 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
@@ -8158,6 +8175,9 @@ fi
fi
fi
fi
+
+ SUBDIRS="${SUBDIRS} gdbtk"
+ configdirs="${configdirs} gdbtk"
fi
@@ -8180,7 +8200,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:8184: checking for X" >&5
+echo "configure:8204: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -8242,12 +8262,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 8246 "configure"
+#line 8266 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8271: \"$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*
@@ -8316,14 +8336,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8320 "configure"
+#line 8340 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:8327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8347: \"$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.
@@ -8608,7 +8628,6 @@ case "${GDB_MULTI_ARCH}" in
*) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };;
esac
-SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
fi
@@ -8616,7 +8635,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:8620: checking whether gdbserver is supported on this host" >&5
+echo "configure:8639: checking whether gdbserver is supported on this host" >&5
if test x"${build_gdbserver}" = xyes ; then
configdirs="${configdirs} gdbserver"
SUBDIRS="${SUBDIRS} gdbserver"
@@ -8678,7 +8697,7 @@ fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:8682: checking whether ln -s works" >&5
+echo "configure:8701: 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
@@ -8702,12 +8721,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:8706: checking for Cygwin environment" >&5
+echo "configure:8725: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8711 "configure"
+#line 8730 "configure"
#include "confdefs.h"
int main() {
@@ -8718,7 +8737,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:8722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -8735,19 +8754,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:8739: checking for mingw32 environment" >&5
+echo "configure:8758: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8744 "configure"
+#line 8763 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:8751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -8766,7 +8785,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:8770: checking for executable suffix" >&5
+echo "configure:8789: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8776,10 +8795,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:8780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:8799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -9087,7 +9106,7 @@ 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_max_sed_cmds=60 # 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.
diff --git a/gdb/configure.host b/gdb/configure.host
index 16f6a52c164..883538db3b2 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -15,7 +15,7 @@ arm*) gdb_host_cpu=arm ;;
hppa*) gdb_host_cpu=pa ;;
i[3456]86*) gdb_host_cpu=i386 ;;
m68*) gdb_host_cpu=m68k ;;
-m88*) gdb_host_cpu=m88k ;;
+# OBSOLETE m88*) gdb_host_cpu=m88k ;;
mips*) gdb_host_cpu=mips ;;
powerpc*) gdb_host_cpu=powerpc ;;
sparcv9 | sparc64) gdb_host_cpu=sparc ;;
@@ -54,7 +54,7 @@ i[3456]86-ncr-*) gdb_host=ncr3000 ;;
i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
i[3456]86-sequent-sysv*) gdb_host=ptx ;;
-i[3456]86-*-aix*) gdb_host=i386aix ;;
+# OBSOLETE i[3456]86-*-aix*) gdb_host=i386aix ;;
i[3456]86-*-bsd*) gdb_host=i386bsd ;;
i[3456]86-*-dgux*) gdb_host=i386dgux ;;
i[3456]86-*-freebsd*) gdb_host=fbsd ;;
@@ -65,11 +65,11 @@ i[3456]86-*-go32*) gdb_host=go32 ;;
i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;;
i[3456]86-*-linux*) gdb_host=linux ;;
i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
-i[3456]86-*-mach3*) gdb_host=i386m3 ;;
-i[3456]86-*-mach*) gdb_host=i386mach ;;
+# OBSOLETE i[3456]86-*-mach3*) gdb_host=i386m3 ;;
+# OBSOLETE i[3456]86-*-mach*) gdb_host=i386mach ;;
i[3456]86-*-gnu*) gdb_host=i386gnu ;;
i[3456]86-*-openbsd*) gdb_host=obsd ;;
-i[3456]86-*-osf1mk*) gdb_host=i386mk ;;
+# OBSOLETE i[3456]86-*-osf1mk*) gdb_host=i386mk ;;
i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
i[3456]86-*-sco*) gdb_host=i386sco ;;
@@ -91,12 +91,12 @@ ia64-*-linux*) gdb_host=linux ;;
m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
-m68*-apollo*-sysv*) gdb_host=apollo68v ;;
-m68*-apollo*-bsd*) gdb_host=apollo68b ;;
+# OBSOLETE m68*-apollo*-sysv*) gdb_host=apollo68v ;;
+# OBSOLETE m68*-apollo*-bsd*) gdb_host=apollo68b ;;
m68*-att-*) gdb_host=3b1 ;;
m68*-bull*-sysv*) gdb_host=dpx2 ;;
-m68*-hp-bsd*) gdb_host=hp300bsd ;;
-m68*-hp-hpux*) gdb_host=hp300hpux ;;
+# OBSOLETE m68*-hp-bsd*) gdb_host=hp300bsd ;;
+# OBSOLETE m68*-hp-hpux*) gdb_host=hp300hpux ;;
m68*-*-linux*) gdb_host=linux ;;
m68*-*-lynxos*) gdb_host=m68klynx ;;
m68*-*-netbsd*) gdb_host=nbsdaout ;;
@@ -106,9 +106,9 @@ m68*-sun-sunos3*) gdb_host=sun3os3 ;;
m68*-sun-sunos4*) gdb_host=sun3os4 ;;
m68*-sun-*) gdb_host=sun3os4 ;;
-m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
-m88*-motorola-sysv*) gdb_host=delta88 ;;
-m88*-*-*) gdb_host=m88k ;;
+# OBSOLETE m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
+# OBSOLETE m88*-motorola-sysv*) gdb_host=delta88 ;;
+# OBSOLETE m88*-*-*) gdb_host=m88k ;;
mips-dec-mach3*) gdb_host=mipsm3 ;;
mips-dec-*) gdb_host=decstation ;;
@@ -129,7 +129,10 @@ none-*-*) gdb_host=none ;;
ns32k-*-netbsd*) gdb_host=nbsdaout ;;
-powerpc-*-aix*) gdb_host=aix ;;
+powerpc-*-aix3*) gdb_host=aix ;;
+powerpc-*-aix4.[0-2]*) gdb_host=aix ;;
+powerpc-*-aix4.3.[0-1]*) gdb_host=aix ;;
+powerpc-*-aix*) gdb_host=aix432 ;;
powerpc-*-linux*) gdb_host=linux ;;
powerpc-*-netbsd*) gdb_host=nbsd ;;
@@ -153,6 +156,7 @@ sparc-*-*) gdb_host=sun4os4 ;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*|sparcv9-*-freebsd*)
gdb_host=fbsd ;;
sparc64-*-linux*) gdb_host=linux ;;
+sparc64-*-netbsd*) gdb_host=nbsd64 ;;
sparcv9-*-* | sparc64-*-*) gdb_host=sun4sol2 ;;
strongarm-*-*) gdb_host=arm ;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 8d304594f3a..edc72c3aa94 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -33,10 +33,11 @@ AM_PROG_CC_STDC
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
AC_CANONICAL_SYSTEM
-dnl gdb doesn't use gettext, but bfd does. We call this to ensure we
-dnl link with the correct libraries.
+dnl Set up for gettext. PACKAGE is used when we call bindtextdomain.
ALL_LINGUAS=
CY_GNU_GETTEXT
+AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
+
dnl List of object files added by configure.
@@ -51,6 +52,7 @@ CONFIG_CLEAN=
CONFIG_INSTALL=
CONFIG_UNINSTALL=
+SUBDIRS="doc testsuite nlm"
configdirs="doc testsuite"
AC_ARG_ENABLE(multi-ice,
@@ -120,7 +122,7 @@ esac; esac
AC_CHECK_HEADERS(ctype.h nlist.h link.h thread_db.h proc_service.h \
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
- string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \
+ string.h sys/procfs.h sys/proc.h sys/ptrace.h sys/reg.h stdint.h \
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
@@ -1086,6 +1088,9 @@ if test "${enable_gdbtk}" = "yes"; then
fi
fi
fi
+
+ SUBDIRS="${SUBDIRS} gdbtk"
+ configdirs="${configdirs} gdbtk"
fi
AC_SUBST(X_CFLAGS)
@@ -1292,7 +1297,6 @@ case "${GDB_MULTI_ARCH}" in
*) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
esac
-SUBDIRS="doc testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
fi
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 8861967e16b..385dbd02b3d 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -19,7 +19,7 @@ hppa*) gdb_target_cpu=pa ;;
i[3456]86*) gdb_target_cpu=i386 ;;
m68hc11*|m6811*) gdb_target_cpu=m68hc11 ;;
m68*) gdb_target_cpu=m68k ;;
-m88*) gdb_target_cpu=m88k ;;
+# OBSOLETE m88*) gdb_target_cpu=m88k ;;
mips*) gdb_target_cpu=mips ;;
powerpc*) gdb_target_cpu=powerpc ;;
sparc*) gdb_target_cpu=sparc ;;
@@ -42,8 +42,9 @@ alpha*-*-osf*) gdb_target=alpha-osf1 ;;
alpha*-*-linux*) gdb_target=alpha-linux ;;
alpha*-*-freebsd*) gdb_target=fbsd ;;
alpha*-*-netbsd*) gdb_target=nbsd ;;
+alpha*-*-*) gdb_target=alpha ;;
-arc-*-*) gdb_target=arc ;;
+# OBSOLETE arc-*-*) gdb_target=arc ;;
arm*-wince-pe) gdb_target=wince ;;
arm*-*-linux*) gdb_target=linux
@@ -66,14 +67,15 @@ avr-*-*) gdb_target=avr
cris*) gdb_target=cris ;;
d10v-*-*) gdb_target=d10v ;;
-d30v-*-*) gdb_target=d30v ;;
+# OBSOLETE d30v-*-*) gdb_target=d30v ;;
h8300-*-*) gdb_target=h8300 ;;
h8500-*-*) gdb_target=h8500 ;;
-fr30-*-elf*) gdb_target=fr30 ;;
+# OBSOLETE fr30-*-elf*) gdb_target=fr30 ;;
+frv-*-*) gdb_target=frv ;;
hppa*-*-bsd*) gdb_target=hppabsd ;;
hppa*-*-pro*) gdb_target=hppapro ;;
@@ -81,24 +83,22 @@ hppa*64*-*-hpux11*) gdb_target=hppa64 ;;
hppa*-*-hpux*) gdb_target=hppahpux ;;
hppa*-*-hiux*) gdb_target=hppahpux ;;
hppa*-*-osf*) gdb_target=hppaosf ;;
+hppa*-*-*) gdb_target=hppa ;;
i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
i[3456]86-sequent-sysv*) gdb_target=ptx ;;
i[3456]86-ncr-*) gdb_target=ncr3000 ;;
-i[3456]86-*-aout*) gdb_target=embed ;;
-i[3456]86-*-coff*) gdb_target=embed ;;
-i[3456]86-*-elf*) gdb_target=embed ;;
-i[3456]86-*-aix*) gdb_target=i386aix ;;
+# OBSOLETE i[3456]86-*-aix*) gdb_target=i386aix ;;
i[3456]86-*-bsd*) gdb_target=i386bsd ;;
i[3456]86-*-freebsd*) gdb_target=fbsd ;;
i[3456]86-*-netbsdelf*) gdb_target=nbsdelf ;;
-i[3456]86-*-netbsd*) gdb_target=nbsdaout ;;
-i[3456]86-*-os9k) gdb_target=i386os9k ;;
+i[3456]86-*-netbsd* | i[3456]86-*-openbsd*)
+ gdb_target=nbsdaout ;;
+# OBSOLETE i[3456]86-*-os9k) gdb_target=i386os9k ;;
i[3456]86-*-go32*) gdb_target=i386aout ;;
i[3456]86-*-msdosdjgpp*) gdb_target=go32 ;;
i[3456]86-*-lynxos*) gdb_target=i386lynx ;;
-i[3456]86-*-openbsd*) gdb_target=obsd ;;
i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
i[3456]86-*-sysv4.2*) gdb_target=i386v42mp ;;
i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
@@ -111,27 +111,28 @@ i[3456]86-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
i[3456]86-*-isc*) gdb_target=i386v ;;
-i[3456]86-*-mach3*) gdb_target=i386m3 ;;
+# OBSOLETE i[3456]86-*-mach3*) gdb_target=i386m3 ;;
i[3456]86-*-gnu*) gdb_target=i386gnu ;;
i[3456]86-*-netware*) gdb_target=i386nw
configdirs="${configdirs} nlm" ;;
-i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
+# OBSOLETE i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
i[3456]86-*-cygwin*) gdb_target=cygwin ;;
-i[3456]86-*-pe*) gdb_target=embed ;;
i[3456]86-*-vxworks*) gdb_target=vxworks ;;
+i[3456]86-*-*) gdb_target=embed ;;
-i960-*-bout*) gdb_target=vxworks960 ;;
-i960-nindy-coff*) gdb_target=nindy960 ;;
-i960-*-coff*) gdb_target=mon960 ;;
-i960-nindy-elf*) gdb_target=nindy960 ;;
-i960-*-elf*) gdb_target=mon960 ;;
-i960-*-nindy*) gdb_target=nindy960 ;;
-i960-*-vxworks*) gdb_target=vxworks960 ;;
+# OBSOLETE i960-*-bout*) gdb_target=vxworks960 ;;
+# OBSOLETE i960-nindy-coff*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-coff*) gdb_target=mon960 ;;
+# OBSOLETE i960-nindy-elf*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-elf*) gdb_target=mon960 ;;
+# OBSOLETE i960-*-nindy*) gdb_target=nindy960 ;;
+# OBSOLETE i960-*-vxworks*) gdb_target=vxworks960 ;;
ia64-*-aix*) gdb_target=aix ;;
ia64-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
+ia64*-*-*) gdb_target=ia64 ;;
m32r-*-elf*) gdb_target=m32r ;;
@@ -140,10 +141,10 @@ m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;;
m68000-*-sunos3*) gdb_target=sun2os3 ;;
m68000-*-sunos4*) gdb_target=sun2os4 ;;
-m68*-apollo*-bsd*) gdb_target=apollo68b ;;
+# OBSOLETE m68*-apollo*-bsd*) gdb_target=apollo68b ;;
m68*-bull-sysv*) gdb_target=dpx2 ;;
-m68*-hp-bsd*) gdb_target=hp300bsd ;;
-m68*-hp-hpux*) gdb_target=hp300hpux ;;
+# OBSOLETE m68*-hp-bsd*) gdb_target=hp300bsd ;;
+# OBSOLETE m68*-hp-hpux*) gdb_target=hp300hpux ;;
m68*-att-*) gdb_target=3b1 ;;
m68*-cisco*-*) gdb_target=cisco ;;
m68*-ericsson-*) gdb_target=es1800 ;;
@@ -164,9 +165,9 @@ m68*-*-sunos4*) gdb_target=sun3os4 ;;
m68*-*-sysv4*) gdb_target=m68kv4 ;;
m68*-*-vxworks*) gdb_target=vxworks68 ;;
-m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
-m88*-motorola-*) gdb_target=delta88 ;;
-m88*-*-*) gdb_target=m88k ;;
+# OBSOLETE m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
+# OBSOLETE m88*-motorola-*) gdb_target=delta88 ;;
+# OBSOLETE m88*-*-*) gdb_target=m88k ;;
mcore*-*-*) gdb_target=mcore ;;
mips64*-big-*) gdb_target=bigmips64 ;;
@@ -207,6 +208,7 @@ mips*-*-sysv4*) gdb_target=mipsv4 ;;
mips*-*-sysv*) gdb_target=bigmips ;;
mips*-*-riscos*) gdb_target=bigmips ;;
mips*-*-vxworks*) gdb_target=vxmips ;;
+mips*-*-*) gdb_target=embed ;;
mn10200-*-*) gdb_target=mn10200 ;;
mn10300-*-*) gdb_target=mn10300 ;;
@@ -217,22 +219,15 @@ ns32k-*-netbsd*) gdb_target=nbsdaout ;;
powerpc-*-netbsd*) gdb_target=nbsd ;;
powerpc-*-aix*) gdb_target=aix ;;
-powerpc-*-eabi* | powerpc-*-sysv* | powerpc-*-elf*)
- if test -f ../sim/ppc/Makefile; then
- gdb_target=ppc-sim
- else
- gdb_target=ppc-eabi
- fi ;;
-powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*)
- if test -f ../sim/ppc/Makefile; then
- gdb_target=ppcle-sim
- else
- gdb_target=ppcle-eabi
- fi ;;
powerpc-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
powerpc-*-vxworks*) gdb_target=vxworks ;;
+powerpc*-*-*) if test -f ../sim/ppc/Makefile; then
+ gdb_target=ppc-sim
+ else
+ gdb_target=ppc-eabi
+ fi ;;
rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
rs6000-*-aix4*) gdb_target=aix4 ;;
@@ -259,8 +254,7 @@ sparc-*-coff*) gdb_target=sparc-em ;;
sparc-*-elf*) gdb_target=sparc-em ;;
sparc-*-linux*) gdb_target=linux ;;
sparc-*-lynxos*) gdb_target=sparclynx ;;
-sparc-*-netbsdelf*) gdb_target=nbsdelf ;;
-sparc-*-netbsd*) gdb_target=nbsdaout ;;
+sparc-*-netbsd*) gdb_target=nbsd ;;
sparc-*-solaris2*) gdb_target=sun4sol2 ;;
sparc-*-sunos4*) gdb_target=sun4os4 ;;
sparc-*-sunos5*) gdb_target=sun4sol2 ;;
@@ -278,14 +272,15 @@ sparc86x-*-*) gdb_target=sparclite ;;
sparc64-*-freebsd*|ultrasparc-*-freebsd*|sparcv9-*-freebsd*)
gdb_target=fbsd ;;
sparc64-*-linux*) gdb_target=sp64linux ;;
+sparc64-*-netbsd*) gdb_target=nbsd64 ;;
sparcv9-*-* | sparc64-*-*) gdb_target=sp64 ;;
xstormy16-*-*) gdb_target=xstormy16 ;;
vax-*-*) gdb_target=vax ;;
-fr30-*-*) gdb_target=fr30
- ;;
+# OBSOLETE fr30-*-*) gdb_target=fr30
+# OBSOLETE ;;
v850*-*-*) gdb_target=v850
case ${gdb_host} in
@@ -314,4 +309,5 @@ mn10300) gdb_multi_arch=yes ;;
x86-64linux) gdb_multi_arch=yes ;;
v850) gdb_multi_arch=yes ;;
xstormy16) gdb_multi_arch=yes ;;
+mcore) gdb_multi_arch=yes ;;
esac
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 29eeac87ebe..4f6eef2ce72 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -260,7 +260,10 @@ dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
print_address (addr, info->stream);
}
-/* Read an integer from debugged memory, given address and number of bytes. */
+/* Argument / return result struct for use with
+ do_captured_read_memory_integer(). MEMADDR and LEN are filled in
+ by gdb_read_memory_integer(). RESULT is the contents that were
+ successfully read from MEMADDR of length LEN. */
struct captured_read_memory_integer_arguments
{
@@ -269,6 +272,13 @@ struct captured_read_memory_integer_arguments
LONGEST result;
};
+/* Helper function for gdb_read_memory_integer(). DATA must be a
+ pointer to a captured_read_memory_integer_arguments struct.
+ Return 1 if successful. Note that the catch_errors() interface
+ will return 0 if an error occurred while reading memory. This
+ choice of return code is so that we can distinguish between
+ success and failure. */
+
static int
do_captured_read_memory_integer (void *data)
{
@@ -278,9 +288,13 @@ do_captured_read_memory_integer (void *data)
args->result = read_memory_integer (memaddr, len);
- return 0;
+ return 1;
}
+/* Read memory at MEMADDR of length LEN and put the contents in
+ RETURN_VALUE. Return 0 if MEMADDR couldn't be read and non-zero
+ if successful. */
+
int
safe_read_memory_integer (CORE_ADDR memaddr, int len, LONGEST *return_value)
{
@@ -291,7 +305,7 @@ safe_read_memory_integer (CORE_ADDR memaddr, int len, LONGEST *return_value)
status = catch_errors (do_captured_read_memory_integer, &args,
"", RETURN_MASK_ALL);
- if (!status)
+ if (status)
*return_value = args.result;
return status;
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 7ea9f3f94e9..b7922dab879 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -21,7 +21,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c
index 2801be9ea0f..efaf89a4b70 100644
--- a/gdb/cpu32bug-rom.c
+++ b/gdb/cpu32bug-rom.c
@@ -74,12 +74,22 @@ cpu32bug_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes an "A7".
*/
-static char *cpu32bug_regnames[NUM_REGS] =
+static const char *
+cpu32bug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC",
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC"
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -139,7 +149,8 @@ init_cpu32bug_cmds (void)
cpu32bug_cmds.cmd_end = NULL; /* optional command terminator */
cpu32bug_cmds.target = &cpu32bug_ops; /* target operations */
cpu32bug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- cpu32bug_cmds.regnames = cpu32bug_regnames; /* registers names */
+ cpu32bug_cmds.regnames = NULL; /* registers names */
+ cpu32bug_cmds.regname = cpu32bug_regname;
cpu32bug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
}; /* init_cpu32bug_cmds */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index e85ac129f33..c53c7ea87ac 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -762,7 +762,7 @@ cris_skip_prologue_main (CORE_ADDR pc, int frameless_p)
adjusts pcptr (if necessary) to point to the actual memory location where
the breakpoint should be inserted. */
-unsigned char *
+const unsigned char *
cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char break_insn[] = {0x38, 0xe9};
@@ -774,8 +774,8 @@ cris_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
/* Returns the register SRP (subroutine return pointer) which must contain
the content of the register PC after a function call. */
-CORE_ADDR
-cris_saved_pc_after_call ()
+static CORE_ADDR
+cris_saved_pc_after_call (struct frame_info *frame)
{
return read_register (SRP_REGNUM);
}
@@ -995,7 +995,7 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
/* Return the name of register regno as a string. Return NULL for an invalid or
unimplemented register. */
-char *
+const char *
cris_register_name (int regno)
{
static char *cris_genreg_names[] =
@@ -1155,7 +1155,7 @@ cris_frame_init_saved_regs (struct frame_info *fi)
CORE_ADDR ip;
struct symtab_and_line sal;
int best_limit;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
/* Examine the entire prologue. */
register int frameless_p = 0;
@@ -1520,7 +1520,7 @@ cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
all saved registers. */
void
-cris_pop_frame ()
+cris_pop_frame (void)
{
register struct frame_info *fi = get_current_frame ();
register int regno;
@@ -4161,9 +4161,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
set_gdbarch_double_bit (gdbarch, 32);
set_gdbarch_push_arguments (gdbarch, cris_abi_original_push_arguments);
- set_gdbarch_store_return_value (gdbarch,
+ set_gdbarch_deprecated_store_return_value (gdbarch,
cris_abi_original_store_return_value);
- set_gdbarch_extract_return_value
+ set_gdbarch_deprecated_extract_return_value
(gdbarch, cris_abi_original_extract_return_value);
set_gdbarch_reg_struct_has_addr
(gdbarch, cris_abi_original_reg_struct_has_addr);
@@ -4172,9 +4172,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
set_gdbarch_double_bit (gdbarch, 64);
set_gdbarch_push_arguments (gdbarch, cris_abi_v2_push_arguments);
- set_gdbarch_store_return_value (gdbarch, cris_abi_v2_store_return_value);
- set_gdbarch_extract_return_value (gdbarch,
- cris_abi_v2_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value);
+ set_gdbarch_deprecated_extract_return_value
+ (gdbarch, cris_abi_v2_extract_return_value);
set_gdbarch_reg_struct_has_addr (gdbarch,
cris_abi_v2_reg_struct_has_addr);
}
@@ -4297,8 +4297,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pop_frame (gdbarch, cris_pop_frame);
set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return);
- set_gdbarch_extract_struct_value_address (gdbarch,
- cris_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address
+ (gdbarch, cris_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, cris_use_struct_convention);
set_gdbarch_frame_init_saved_regs (gdbarch, cris_frame_init_saved_regs);
diff --git a/gdb/cxux-nat.c b/gdb/cxux-nat.c
index 742f89cdb19..e8f35a371d4 100644
--- a/gdb/cxux-nat.c
+++ b/gdb/cxux-nat.c
@@ -1,537 +1,537 @@
-/* Native support for Motorola 88k running Harris CX/UX.
- Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000,
- 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include "gdbcore.h"
-#include <sys/user.h>
-
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "symtab.h"
-#include "regcache.h"
-
-#ifndef USER /* added to support BCS ptrace_user */
-#define USER ptrace_user
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include "gdb_stat.h"
-
-#include "symtab.h"
-#include "setjmp.h"
-#include "value.h"
-
-#include <sys/ptrace.h>
-
-/* CX/UX provides them already, but as word offsets instead of char offsets */
-#define SXIP_OFFSET (PT_SXIP * 4)
-#define SNIP_OFFSET (PT_SNIP * 4)
-#define SFIP_OFFSET (PT_SFIP * 4)
-#define PSR_OFFSET (PT_PSR * sizeof(int))
-#define FPSR_OFFSET (PT_FPSR * sizeof(int))
-#define FPCR_OFFSET (PT_FPCR * sizeof(int))
-
-#define XREGADDR(r) (((char *)&u.pt_x0-(char *)&u) + \
- ((r)-X0_REGNUM)*sizeof(X_REGISTER_RAW_TYPE))
-
-extern int have_symbol_file_p ();
-
-extern jmp_buf stack_jmp;
-
-extern int errno;
-
-void
-fetch_inferior_registers (int regno)
-{
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- struct USER u;
- unsigned int offset;
-
- offset = (char *) &u.pt_r0 - (char *) &u;
- regaddr = offset; /* byte offset to r0; */
-
-/* offset = ptrace (3, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */
- for (regno = 0; regno < PC_REGNUM; regno++)
- {
- /*regaddr = register_addr (regno, offset); */
- /* 88k enhancement */
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
- /* now load up registers 32-37; special pc registers */
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) PSR_OFFSET, 0);
- supply_register (PSR_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPSR_OFFSET, 0);
- supply_register (FPSR_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPCR_OFFSET, 0);
- supply_register (FPCR_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0);
- supply_register (SXIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0);
- supply_register (SNIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0);
- supply_register (SFIP_REGNUM, buf);
-
- if (target_is_m88110)
- {
- for (regaddr = XREGADDR (X0_REGNUM), regno = X0_REGNUM;
- regno < NUM_REGS;
- regno++, regaddr += 16)
- {
- X_REGISTER_RAW_TYPE xval;
-
- *(int *) &xval.w1 = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, 0);
- *(int *) &xval.w2 = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) (regaddr + 4), 0);
- *(int *) &xval.w3 = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) (regaddr + 8), 0);
- *(int *) &xval.w4 = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) (regaddr + 12), 0);
- supply_register (regno, (void *) &xval);
- }
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-void
-store_inferior_registers (int regno)
-{
- register unsigned int regaddr;
- char buf[80];
-
- struct USER u;
-
- unsigned int offset = (char *) &u.pt_r0 - (char *) &u;
-
- regaddr = offset;
-
- /* Don't try to deal with EXIP_REGNUM or ENIP_REGNUM, because I think either
- svr3 doesn't run on an 88110, or the kernel isolates the different (not
- completely sure this is true, but seems to be. */
- if (regno >= 0)
- {
- /* regaddr = register_addr (regno, offset); */
- if (regno < PC_REGNUM)
- {
- regaddr = offset + regno * sizeof (int);
- errno = 0;
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- else if (regno == PSR_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno));
- else if (regno == FPSR_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno));
- else if (regno == FPCR_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno));
- else if (regno == SXIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno));
- else if (regno == SNIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno));
- else if (regno == SFIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (regno));
- else if (target_is_m88110 && regno < NUM_REGS)
- {
- X_REGISTER_RAW_TYPE xval;
-
- read_register_bytes (REGISTER_BYTE (regno), (char *) &xval,
- sizeof (X_REGISTER_RAW_TYPE));
- regaddr = XREGADDR (regno);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, xval.w1);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 4, xval.w2);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 8, xval.w3);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr + 12, xval.w4);
- }
- else
- printf_unfiltered ("Bad register number for store_inferior routine\n");
- }
- else
- {
- for (regno = 0; regno < PC_REGNUM; regno++)
- {
- /* regaddr = register_addr (regno, offset); */
- errno = 0;
- regaddr = offset + regno * sizeof (int);
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) PSR_OFFSET, read_register (regno));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPSR_OFFSET, read_register (regno));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) FPCR_OFFSET, read_register (regno));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (SFIP_REGNUM));
- if (target_is_m88110)
- {
- for (regno = X0_REGNUM; regno < NUM_REGS; regno++)
- {
- X_REGISTER_RAW_TYPE xval;
-
- read_register_bytes (REGISTER_BYTE (regno), (char *) &xval,
- sizeof (X_REGISTER_RAW_TYPE));
- regaddr = XREGADDR (regno);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, xval.w1);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 4), xval.w2);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 8), xval.w3);
- ptrace (6, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) (regaddr + 12), xval.w4);
- }
- }
- }
-}
-
-/* blockend is the address of the end of the user structure */
-
-m88k_register_u_addr (int blockend, int regnum)
-{
- struct USER u;
- int ustart = blockend - sizeof (struct USER);
-
- if (regnum < PSR_REGNUM)
- return (ustart + ((int) &u.pt_r0 - (int) &u) +
- REGISTER_SIZE * regnum);
- else if (regnum == PSR_REGNUM)
- return (ustart + ((int) &u.pt_psr) - (int) &u);
- else if (regnum == FPSR_REGNUM)
- return (ustart + ((int) &u.pt_fpsr) - (int) &u);
- else if (regnum == FPCR_REGNUM)
- return (ustart + ((int) &u.pt_fpcr) - (int) &u);
- else if (regnum == SXIP_REGNUM)
- return (ustart + SXIP_OFFSET);
- else if (regnum == SNIP_REGNUM)
- return (ustart + SNIP_OFFSET);
- else if (regnum == SFIP_REGNUM)
- return (ustart + SFIP_OFFSET);
- else if (target_is_m88110)
- return (ustart + ((int) &u.pt_x0 - (int) &u) + /* Must be X register */
- sizeof (u.pt_x0) * (regnum - X0_REGNUM));
- else
- return (blockend + REGISTER_SIZE * regnum);
-}
-
-#ifdef USE_PROC_FS
-
-#include <sys/procfs.h>
-
-/* Prototypes for supply_gregset etc. */
-#include "gregset.h"
-
-/* Given a pointer to a general register set in /proc format (gregset_t *),
- unpack the register contents and supply them as gdb's idea of the current
- register values. */
-
-void
-supply_gregset (gregset_t *gregsetp)
-{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regi = 0; regi <= SP_REGNUM; regi++)
- supply_register (regi, (char *) (regp + regi));
-
- supply_register (SXIP_REGNUM, (char *) (regp + R_XIP));
- supply_register (SNIP_REGNUM, (char *) (regp + R_NIP));
- supply_register (SFIP_REGNUM, (char *) (regp + R_FIP));
- supply_register (PSR_REGNUM, (char *) (regp + R_PSR));
- supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR));
- supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR));
-}
-
-void
-fill_gregset (gregset_t *gregsetp, int regno)
-{
- int regi;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regi = 0; regi <= R_R31; regi++)
- if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(int *) &registers[REGISTER_BYTE (regi)];
-
- if ((regno == -1) || (regno == SXIP_REGNUM))
- *(regp + R_XIP) = *(int *) &registers[REGISTER_BYTE (SXIP_REGNUM)];
- if ((regno == -1) || (regno == SNIP_REGNUM))
- *(regp + R_NIP) = *(int *) &registers[REGISTER_BYTE (SNIP_REGNUM)];
- if ((regno == -1) || (regno == SFIP_REGNUM))
- *(regp + R_FIP) = *(int *) &registers[REGISTER_BYTE (SFIP_REGNUM)];
- if ((regno == -1) || (regno == PSR_REGNUM))
- *(regp + R_PSR) = *(int *) &registers[REGISTER_BYTE (PSR_REGNUM)];
- if ((regno == -1) || (regno == FPSR_REGNUM))
- *(regp + R_FPSR) = *(int *) &registers[REGISTER_BYTE (FPSR_REGNUM)];
- if ((regno == -1) || (regno == FPCR_REGNUM))
- *(regp + R_FPCR) = *(int *) &registers[REGISTER_BYTE (FPCR_REGNUM)];
-}
-
-#endif /* USE_PROC_FS */
-
-/* This support adds the equivalent of adb's % command. When
- the `add-shared-symbol-files' command is given, this routine scans
- the dynamic linker's link map and reads the minimal symbols
- from each shared object file listed in the map. */
-
-struct link_map
-{
- unsigned long l_addr; /* address at which object is mapped */
- char *l_name; /* full name of loaded object */
- void *l_ld; /* dynamic structure of object */
- struct link_map *l_next; /* next link object */
- struct link_map *l_prev; /* previous link object */
-};
-
-#define LINKS_MAP_POINTER "_ld_tail"
-#define LIBC_FILE "/usr/lib/libc.so.1"
-#define SHARED_OFFSET 0xf0001000
-
-#ifndef PATH_MAX
-#define PATH_MAX 1023 /* maximum size of path name on OS */
-#endif
-
-void
-add_shared_symbol_files (void)
-{
- void *desc;
- struct link_map *ld_map, *lm, lms;
- struct minimal_symbol *minsym;
- struct objfile *objfile;
- char *path_name;
-
- if (ptid_equal (inferior_ptid, null_ptid))
- {
- warning ("The program has not yet been started.");
- return;
- }
-
- objfile = symbol_file_add (LIBC_FILE, 0, NULL, 0, OBJF_READNOW);
- minsym = lookup_minimal_symbol (LINKS_MAP_POINTER, objfile);
-
- ld_map = (struct link_map *)
- read_memory_integer (((int) SYMBOL_VALUE_ADDRESS (minsym) + SHARED_OFFSET), 4);
- lm = ld_map;
- while (lm)
- {
- int local_errno = 0;
-
- read_memory ((CORE_ADDR) lm, (char *) &lms, sizeof (struct link_map));
- if (lms.l_name)
- {
- if (target_read_string ((CORE_ADDR) lms.l_name, &path_name,
- PATH_MAX, &local_errno))
- {
- struct section_addr_info section_addrs;
- memset (&section_addrs, 0, sizeof (section_addrs));
- section_addrs.other[0].addr = lms.l_addr;
- section_addrs.other[0].name = ".text";
- symbol_file_add (path_name, 1, &section_addrs, 0, 0);
- xfree (path_name);
- }
- }
- /* traverse links in reverse order so that we get the
- the symbols the user actually gets. */
- lm = lms.l_prev;
- }
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-}
-
-#if defined(_ES_MP)
-
-#include <sys/regset.h>
-
-unsigned int
-m88k_harris_core_register_addr (int regno, int reg_ptr)
-{
- unsigned int word_offset;
-
- switch (regno)
- {
- case PSR_REGNUM:
- word_offset = R_EPSR;
- break;
- case FPSR_REGNUM:
- word_offset = R_FPSR;
- break;
- case FPCR_REGNUM:
- word_offset = R_FPCR;
- break;
- case SXIP_REGNUM:
- word_offset = R_EXIP;
- break;
- case SNIP_REGNUM:
- word_offset = R_ENIP;
- break;
- case SFIP_REGNUM:
- word_offset = R_EFIP;
- break;
- default:
- if (regno <= FP_REGNUM)
- word_offset = regno;
- else
- word_offset = ((regno - X0_REGNUM) * 4);
- }
- return (word_offset * 4);
-}
-
-#endif /* _ES_MP */
-
-void
-_initialize_m88k_nat (void)
-{
-#ifdef _ES_MP
- /* Enable 88110 support, as we don't support the 88100 under ES/MP. */
-
- target_is_m88110 = 1;
-#elif defined(_CX_UX)
- /* Determine whether we're running on an 88100 or an 88110. */
- target_is_m88110 = (sinfo (SYSMACHINE, 0) == SYS5800);
-#endif /* _CX_UX */
-}
-
-#ifdef _ES_MP
-/* Given a pointer to a general register set in /proc format (gregset_t *),
- unpack the register contents and supply them as gdb's idea of the current
- register values. */
-
-void
-supply_gregset (gregset_t *gregsetp)
-{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regi = 0; regi < R_R31; regi++)
- {
- supply_register (regi, (char *) (regp + regi));
- }
- supply_register (PSR_REGNUM, (char *) (regp + R_EPSR));
- supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR));
- supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR));
- supply_register (SXIP_REGNUM, (char *) (regp + R_EXIP));
- supply_register (SNIP_REGNUM, (char *) (regp + R_ENIP));
- supply_register (SFIP_REGNUM, (char *) (regp + R_EFIP));
-}
-
-/* Given a pointer to a floating point register set in /proc format
- (fpregset_t *), unpack the register contents and supply them as gdb's
- idea of the current floating point register values. */
-
-void
-supply_fpregset (fpregset_t *fpregsetp)
-{
- register int regi;
- char *from;
-
- for (regi = FP0_REGNUM; regi <= FPLAST_REGNUM; regi++)
- {
- from = (char *) &((*fpregsetp)[regi - FP0_REGNUM]);
- supply_register (regi, from);
- }
-}
-
-#endif /* _ES_MP */
-
-#ifdef _CX_UX
-
-#include <sys/regset.h>
-
-unsigned int
-m88k_harris_core_register_addr (int regno, int reg_ptr)
-{
- unsigned int word_offset;
-
- switch (regno)
- {
- case PSR_REGNUM:
- word_offset = R_PSR;
- break;
- case FPSR_REGNUM:
- word_offset = R_FPSR;
- break;
- case FPCR_REGNUM:
- word_offset = R_FPCR;
- break;
- case SXIP_REGNUM:
- word_offset = R_XIP;
- break;
- case SNIP_REGNUM:
- word_offset = R_NIP;
- break;
- case SFIP_REGNUM:
- word_offset = R_FIP;
- break;
- default:
- if (regno <= FP_REGNUM)
- word_offset = regno;
- else
- word_offset = ((regno - X0_REGNUM) * 4) + R_X0;
- }
- return (word_offset * 4);
-}
-
-#endif /* _CX_UX */
+// 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 <sys/types.h>
+// OBSOLETE #include <sys/param.h>
+// OBSOLETE #include <sys/dir.h>
+// OBSOLETE #include <signal.h>
+// OBSOLETE #include "gdbcore.h"
+// OBSOLETE #include <sys/user.h>
+// 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 <sys/ioctl.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE #include <sys/file.h>
+// OBSOLETE #include "gdb_stat.h"
+// OBSOLETE
+// OBSOLETE #include "symtab.h"
+// OBSOLETE #include "setjmp.h"
+// OBSOLETE #include "value.h"
+// OBSOLETE
+// OBSOLETE #include <sys/ptrace.h>
+// 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 <sys/procfs.h>
+// 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 *) &registers[REGISTER_BYTE (regi)];
+// OBSOLETE
+// OBSOLETE if ((regno == -1) || (regno == SXIP_REGNUM))
+// OBSOLETE *(regp + R_XIP) = *(int *) &registers[REGISTER_BYTE (SXIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == SNIP_REGNUM))
+// OBSOLETE *(regp + R_NIP) = *(int *) &registers[REGISTER_BYTE (SNIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == SFIP_REGNUM))
+// OBSOLETE *(regp + R_FIP) = *(int *) &registers[REGISTER_BYTE (SFIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == PSR_REGNUM))
+// OBSOLETE *(regp + R_PSR) = *(int *) &registers[REGISTER_BYTE (PSR_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == FPSR_REGNUM))
+// OBSOLETE *(regp + R_FPSR) = *(int *) &registers[REGISTER_BYTE (FPSR_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == FPCR_REGNUM))
+// OBSOLETE *(regp + R_FPCR) = *(int *) &registers[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 (&section_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, &section_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 <sys/regset.h>
+// 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 <sys/regset.h>
+// 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 cd260da8086..4e021069609 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -24,7 +24,6 @@
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "gdbcmd.h"
@@ -41,6 +40,7 @@
#include "floatformat.h"
#include "gdb/sim-d10v.h"
+#include "sim-regno.h"
struct frame_extra_info
{
@@ -94,6 +94,10 @@ enum
extern void _initialize_d10v_tdep (void);
+static CORE_ADDR d10v_read_sp (void);
+
+static CORE_ADDR d10v_read_fp (void);
+
static void d10v_eva_prepare_to_trace (void);
static void d10v_eva_get_trace_data (void);
@@ -182,7 +186,7 @@ enum ts2_regnums
TS2_A0_REGNUM = 35
};
-static char *
+static const char *
d10v_ts2_register_name (int reg_nr)
{
static char *register_names[] =
@@ -208,7 +212,7 @@ enum ts3_regnums
TS3_A0_REGNUM = 32
};
-static char *
+static const char *
d10v_ts3_register_name (int reg_nr)
{
static char *register_names[] =
@@ -296,6 +300,8 @@ d10v_imap_register (int reg_nr)
static int
d10v_ts2_register_sim_regno (int nr)
{
+ if (legacy_register_sim_regno (nr) < 0)
+ return legacy_register_sim_regno (nr);
if (nr >= TS2_IMAP0_REGNUM
&& nr < TS2_IMAP0_REGNUM + NR_IMAP_REGS)
return nr - TS2_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM;
@@ -310,6 +316,8 @@ d10v_ts2_register_sim_regno (int nr)
static int
d10v_ts3_register_sim_regno (int nr)
{
+ if (legacy_register_sim_regno (nr) < 0)
+ return legacy_register_sim_regno (nr);
if (nr >= TS3_IMAP0_REGNUM
&& nr < TS3_IMAP0_REGNUM + NR_IMAP_REGS)
return nr - TS3_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM;
@@ -361,6 +369,8 @@ d10v_register_virtual_type (int reg_nr)
{
if (reg_nr == PC_REGNUM)
return builtin_type_void_func_ptr;
+ if (reg_nr == _SP_REGNUM || reg_nr == _FP_REGNUM)
+ return builtin_type_void_data_ptr;
else if (reg_nr >= A0_REGNUM
&& reg_nr < (A0_REGNUM + NR_A_REGS))
return builtin_type_int64;
@@ -439,20 +449,16 @@ d10v_pointer_to_address (struct type *type, void *buf)
return d10v_make_daddr (addr);
}
+/* Don't do anything if we have an integer, this way users can type 'x
+ <addr>' w/o having gdb outsmart them. The internal gdb conversions
+ to the correct space are taken care of in the pointer_to_address
+ function. If we don't do this, 'x $fp' wouldn't work. */
static CORE_ADDR
d10v_integer_to_address (struct type *type, void *buf)
{
LONGEST val;
val = unpack_long (type, buf);
- if (TYPE_CODE (type) == TYPE_CODE_INT
- && TYPE_LENGTH (type) <= TYPE_LENGTH (builtin_type_void_data_ptr))
- /* Convert small integers that would would be directly copied into
- a pointer variable into an address pointing into data space. */
- return d10v_make_daddr (val & 0xffff);
- else
- /* The value is too large to fit in a pointer. Assume this was
- intentional and that the user in fact specified a raw address. */
- return val;
+ return val;
}
/* Store the address of the place in which to copy the structure the
@@ -475,9 +481,20 @@ d10v_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
static void
d10v_store_return_value (struct type *type, char *valbuf)
{
- write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
- valbuf,
- TYPE_LENGTH (type));
+ char tmp = 0;
+ /* Only char return values need to be shifted right within R0. */
+ if (TYPE_LENGTH (type) == 1
+ && TYPE_CODE (type) == TYPE_CODE_INT)
+ {
+ write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
+ &tmp, 1); /* zero the high byte */
+ write_register_bytes (REGISTER_BYTE (RET1_REGNUM) + 1,
+ valbuf, 1); /* copy the low byte */
+ }
+ else
+ write_register_bytes (REGISTER_BYTE (RET1_REGNUM),
+ valbuf,
+ TYPE_LENGTH (type));
}
/* Extract from an array REGBUF containing the (raw) register state
@@ -843,7 +860,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi)
fi->extra_info->size = -next_addr;
if (!(fp & 0xffff))
- fp = d10v_make_daddr (read_register (SP_REGNUM));
+ fp = d10v_read_sp ();
for (i = 0; i < NUM_REGS - 1; i++)
if (fi->saved_regs[i])
@@ -870,7 +887,7 @@ d10v_frame_init_saved_regs (struct frame_info *fi)
/* otherwise, it isn't being used, so we use the SP instead */
if (uses_frame)
fi->saved_regs[SP_REGNUM]
- = read_register (FP_REGNUM) + fi->extra_info->size;
+ = d10v_read_fp () + fi->extra_info->size;
else
{
fi->saved_regs[SP_REGNUM] = fp + fi->extra_info->size;
@@ -1068,6 +1085,15 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int i;
int regnum = ARG1_REGNUM;
struct stack_item *si = NULL;
+ long val;
+
+ /* If struct_return is true, then the struct return address will
+ consume one argument-passing register. No need to actually
+ write the value to the register -- that's done by
+ d10v_store_struct_return(). */
+
+ if (struct_return)
+ regnum++;
/* Fill in registers and arg lists */
for (i = 0; i < nargs; i++)
@@ -1076,39 +1102,38 @@ d10v_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
struct type *type = check_typedef (VALUE_TYPE (arg));
char *contents = VALUE_CONTENTS (arg);
int len = TYPE_LENGTH (type);
+ int aligned_regnum = (regnum + 1) & ~1;
+
/* printf ("push: type=%d len=%d\n", TYPE_CODE (type), len); */
+ if (len <= 2 && regnum <= ARGN_REGNUM)
+ /* fits in a single register, do not align */
+ {
+ val = extract_unsigned_integer (contents, len);
+ write_register (regnum++, val);
+ }
+ else if (len <= (ARGN_REGNUM - aligned_regnum + 1) * 2)
+ /* value fits in remaining registers, store keeping left
+ aligned */
{
- int aligned_regnum = (regnum + 1) & ~1;
- if (len <= 2 && regnum <= ARGN_REGNUM)
- /* fits in a single register, do not align */
+ int b;
+ regnum = aligned_regnum;
+ for (b = 0; b < (len & ~1); b += 2)
{
- long val = extract_unsigned_integer (contents, len);
+ val = extract_unsigned_integer (&contents[b], 2);
write_register (regnum++, val);
}
- else if (len <= (ARGN_REGNUM - aligned_regnum + 1) * 2)
- /* value fits in remaining registers, store keeping left
- aligned */
- {
- int b;
- regnum = aligned_regnum;
- for (b = 0; b < (len & ~1); b += 2)
- {
- long val = extract_unsigned_integer (&contents[b], 2);
- write_register (regnum++, val);
- }
- if (b < len)
- {
- long val = extract_unsigned_integer (&contents[b], 1);
- write_register (regnum++, (val << 8));
- }
- }
- else
+ if (b < len)
{
- /* arg will go onto stack */
- regnum = ARGN_REGNUM + 1;
- si = push_stack_item (si, contents, len);
+ val = extract_unsigned_integer (&contents[b], 1);
+ write_register (regnum++, (val << 8));
}
}
+ else
+ {
+ /* arg will go onto stack */
+ regnum = ARGN_REGNUM + 1;
+ si = push_stack_item (si, contents, len);
+ }
}
while (si)
@@ -1130,25 +1155,31 @@ d10v_extract_return_value (struct type *type, char regbuf[REGISTER_BYTES],
char *valbuf)
{
int len;
- /* printf("RET: TYPE=%d len=%d r%d=0x%x\n", TYPE_CODE (type), TYPE_LENGTH (type), RET1_REGNUM - R0_REGNUM, (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM))); */
+#if 0
+ printf("RET: TYPE=%d len=%d r%d=0x%x\n", TYPE_CODE (type),
+ TYPE_LENGTH (type), RET1_REGNUM - R0_REGNUM,
+ (int) extract_unsigned_integer (regbuf + REGISTER_BYTE(RET1_REGNUM),
+ REGISTER_RAW_SIZE (RET1_REGNUM)));
+#endif
+ len = TYPE_LENGTH (type);
+ if (len == 1)
{
- len = TYPE_LENGTH (type);
- if (len == 1)
- {
- unsigned short c = extract_unsigned_integer (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM));
- store_unsigned_integer (valbuf, 1, c);
- }
- else if ((len & 1) == 0)
- memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM), len);
- else
- {
- /* For return values of odd size, the first byte is in the
- least significant part of the first register. The
- remaining bytes in remaining registers. Interestingly,
- when such values are passed in, the last byte is in the
- most significant byte of that same register - wierd. */
- memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM) + 1, len);
- }
+ unsigned short c;
+
+ c = extract_unsigned_integer (regbuf + REGISTER_BYTE (RET1_REGNUM),
+ REGISTER_RAW_SIZE (RET1_REGNUM));
+ store_unsigned_integer (valbuf, 1, c);
+ }
+ else if ((len & 1) == 0)
+ memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM), len);
+ else
+ {
+ /* For return values of odd size, the first byte is in the
+ least significant part of the first register. The
+ remaining bytes in remaining registers. Interestingly,
+ when such values are passed in, the last byte is in the
+ most significant byte of that same register - wierd. */
+ memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM) + 1, len);
}
}
@@ -1572,17 +1603,17 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_extract_return_value (gdbarch, d10v_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, d10v_extract_return_value);
set_gdbarch_push_arguments (gdbarch, d10v_push_arguments);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, d10v_push_return_address);
set_gdbarch_store_struct_return (gdbarch, d10v_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, d10v_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, d10v_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, d10v_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, d10v_use_struct_convention);
set_gdbarch_frame_init_saved_regs (gdbarch, d10v_frame_init_saved_regs);
diff --git a/gdb/d30v-tdep.c b/gdb/d30v-tdep.c
index b5d3a3b4b93..089137059db 100644
--- a/gdb/d30v-tdep.c
+++ b/gdb/d30v-tdep.c
@@ -1,1365 +1,1365 @@
-/* Target-dependent code for Mitsubishi D30V, for GDB.
-
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
- Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Contributed by Martin Hunt, hunt@cygnus.com */
-
-#include "defs.h"
-#include "frame.h"
-#include "obstack.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "gdbcmd.h"
-#include "gdbcore.h"
-#include "gdb_string.h"
-#include "value.h"
-#include "inferior.h"
-#include "dis-asm.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "regcache.h"
-
-#include "language.h" /* For local_hex_string() */
-
-void d30v_frame_find_saved_regs (struct frame_info *fi,
- struct frame_saved_regs *fsr);
-void d30v_frame_find_saved_regs_offsets (struct frame_info *fi,
- struct frame_saved_regs *fsr);
-static void d30v_pop_dummy_frame (struct frame_info *fi);
-static void d30v_print_flags (void);
-static void print_flags_command (char *, int);
-
-/* the following defines assume:
- fp is r61, lr is r62, sp is r63, and ?? is r22
- if that changes, they will need to be updated */
-
-#define OP_MASK_ALL_BUT_RA 0x0ffc0fff /* throw away Ra, keep the rest */
-
-#define OP_STW_SPM 0x054c0fc0 /* stw Ra, @(sp-) */
-#define OP_STW_SP_R0 0x05400fc0 /* stw Ra, @(sp,r0) */
-#define OP_STW_SP_IMM0 0x05480fc0 /* st Ra, @(sp, 0x0) */
-#define OP_STW_R22P_R0 0x05440580 /* stw Ra, @(r22+,r0) */
-
-#define OP_ST2W_SPM 0x056c0fc0 /* st2w Ra, @(sp-) */
-#define OP_ST2W_SP_R0 0x05600fc0 /* st2w Ra, @(sp, r0) */
-#define OP_ST2W_SP_IMM0 0x05680fc0 /* st2w Ra, @(sp, 0x0) */
-#define OP_ST2W_R22P_R0 0x05640580 /* st2w Ra, @(r22+, r0) */
-
-#define OP_MASK_OPCODE 0x0ffc0000 /* just the opcode, ign operands */
-#define OP_NOP 0x00f00000 /* nop */
-
-#define OP_MASK_ALL_BUT_IMM 0x0fffffc0 /* throw away imm, keep the rest */
-#define OP_SUB_SP_IMM 0x082bffc0 /* sub sp,sp,imm */
-#define OP_ADD_SP_IMM 0x080bffc0 /* add sp,sp,imm */
-#define OP_ADD_R22_SP_IMM 0x08096fc0 /* add r22,sp,imm */
-#define OP_STW_FP_SP_IMM 0x054bdfc0 /* stw fp,@(sp,imm) */
-#define OP_OR_SP_R0_IMM 0x03abf000 /* or sp,r0,imm */
-
-/* no mask */
-#define OP_OR_FP_R0_SP 0x03a3d03f /* or fp,r0,sp */
-#define OP_OR_FP_SP_R0 0x03a3dfc0 /* or fp,sp,r0 */
-#define OP_OR_FP_IMM0_SP 0x03abd03f /* or fp,0x0,sp */
-#define OP_STW_FP_R22P_R0 0x0547d580 /* stw fp,@(r22+,r0) */
-#define OP_STW_LR_R22P_R0 0x0547e580 /* stw lr,@(r22+,r0) */
-
-#define OP_MASK_OP_AND_RB 0x0ff80fc0 /* keep op and rb,throw away rest */
-#define OP_STW_SP_IMM 0x05480fc0 /* stw Ra,@(sp,imm) */
-#define OP_ST2W_SP_IMM 0x05680fc0 /* st2w Ra,@(sp,imm) */
-#define OP_STW_FP_IMM 0x05480f40 /* stw Ra,@(fp,imm) */
-#define OP_STW_FP_R0 0x05400f40 /* stw Ra,@(fp,r0) */
-
-#define OP_MASK_FM_BIT 0x80000000
-#define OP_MASK_CC_BITS 0x70000000
-#define OP_MASK_SUB_INST 0x0fffffff
-
-#define EXTRACT_RA(op) (((op) >> 12) & 0x3f)
-#define EXTRACT_RB(op) (((op) >> 6) & 0x3f)
-#define EXTRACT_RC(op) (((op) & 0x3f)
-#define EXTRACT_UIMM6(op) ((op) & 0x3f)
-#define EXTRACT_IMM6(op) ((((int)EXTRACT_UIMM6(op)) << 26) >> 26)
-#define EXTRACT_IMM26(op) ((((op)&0x0ff00000) >> 2) | ((op)&0x0003ffff))
-#define EXTRACT_IMM32(opl, opr) ((EXTRACT_UIMM6(opl) << 26)|EXTRACT_IMM26(opr))
-
-
-int
-d30v_frame_chain_valid (CORE_ADDR chain, struct frame_info *fi)
-{
-#if 0
- return ((chain) != 0 && (fi) != 0 && (fi)->return_pc != 0);
-#else
- return ((chain) != 0 && (fi) != 0 && (fi)->frame <= chain);
-#endif
-}
-
-/* Discard from the stack the innermost frame, restoring all saved
- registers. */
-
-void
-d30v_pop_frame (void)
-{
- struct frame_info *frame = get_current_frame ();
- CORE_ADDR fp;
- int regnum;
- struct frame_saved_regs fsr;
- char raw_buffer[8];
-
- fp = FRAME_FP (frame);
- if (frame->dummy)
- {
- d30v_pop_dummy_frame (frame);
- return;
- }
-
- /* fill out fsr with the address of where each */
- /* register was stored in the frame */
- get_frame_saved_regs (frame, &fsr);
-
- /* now update the current registers with the old values */
- for (regnum = A0_REGNUM; regnum < A0_REGNUM + 2; regnum++)
- {
- if (fsr.regs[regnum])
- {
- read_memory (fsr.regs[regnum], raw_buffer, 8);
- write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 8);
- }
- }
- for (regnum = 0; regnum < SP_REGNUM; regnum++)
- {
- if (fsr.regs[regnum])
- {
- write_register (regnum, read_memory_unsigned_integer (fsr.regs[regnum], 4));
- }
- }
- if (fsr.regs[PSW_REGNUM])
- {
- write_register (PSW_REGNUM, read_memory_unsigned_integer (fsr.regs[PSW_REGNUM], 4));
- }
-
- write_register (PC_REGNUM, read_register (LR_REGNUM));
- write_register (SP_REGNUM, fp + frame->size);
- target_store_registers (-1);
- flush_cached_frames ();
-}
-
-static int
-check_prologue (unsigned long op)
-{
- /* add sp,sp,imm -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
- return 1;
-
- /* add r22,sp,imm -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM)
- return 1;
-
- /* or fp,r0,sp -- observed */
- if (op == OP_OR_FP_R0_SP)
- return 1;
-
- /* nop */
- if ((op & OP_MASK_OPCODE) == OP_NOP)
- return 1;
-
- /* stw Ra,@(sp,r0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_R0)
- return 1;
-
- /* stw Ra,@(sp,0x0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_IMM0)
- return 1;
-
- /* st2w Ra,@(sp,r0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_R0)
- return 1;
-
- /* st2w Ra,@(sp,0x0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_IMM0)
- return 1;
-
- /* stw fp, @(r22+,r0) -- observed */
- if (op == OP_STW_FP_R22P_R0)
- return 1;
-
- /* stw r62, @(r22+,r0) -- observed */
- if (op == OP_STW_LR_R22P_R0)
- return 1;
-
- /* stw Ra, @(fp,r0) -- observed */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_FP_R0)
- return 1; /* first arg */
-
- /* stw Ra, @(fp,imm) -- observed */
- if ((op & OP_MASK_OP_AND_RB) == OP_STW_FP_IMM)
- return 1; /* second and subsequent args */
-
- /* stw fp,@(sp,imm) -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_STW_FP_SP_IMM)
- return 1;
-
- /* st2w Ra,@(r22+,r0) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_R22P_R0)
- return 1;
-
- /* stw Ra, @(sp-) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SPM)
- return 1;
-
- /* st2w Ra, @(sp-) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SPM)
- return 1;
-
- /* sub.? sp,sp,imm */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_SUB_SP_IMM)
- return 1;
-
- return 0;
-}
-
-CORE_ADDR
-d30v_skip_prologue (CORE_ADDR pc)
-{
- unsigned long op[2];
- unsigned long opl, opr; /* left / right sub operations */
- unsigned long fm0, fm1; /* left / right mode bits */
- unsigned long cc0, cc1;
- unsigned long op1, op2;
- CORE_ADDR func_addr, func_end;
- struct symtab_and_line sal;
-
- /* If we have line debugging information, then the end of the */
- /* prologue should the first assembly instruction of the first source line */
- if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
- {
- sal = find_pc_line (func_addr, 0);
- if (sal.end && sal.end < func_end)
- return sal.end;
- }
-
- if (target_read_memory (pc, (char *) &op[0], 8))
- return pc; /* Can't access it -- assume no prologue. */
-
- while (1)
- {
- opl = (unsigned long) read_memory_integer (pc, 4);
- opr = (unsigned long) read_memory_integer (pc + 4, 4);
-
- fm0 = (opl & OP_MASK_FM_BIT);
- fm1 = (opr & OP_MASK_FM_BIT);
-
- cc0 = (opl & OP_MASK_CC_BITS);
- cc1 = (opr & OP_MASK_CC_BITS);
-
- opl = (opl & OP_MASK_SUB_INST);
- opr = (opr & OP_MASK_SUB_INST);
-
- if (fm0 && fm1)
- {
- /* long instruction (opl contains the opcode) */
- if (((opl & OP_MASK_ALL_BUT_IMM) != OP_ADD_SP_IMM) && /* add sp,sp,imm */
- ((opl & OP_MASK_ALL_BUT_IMM) != OP_ADD_R22_SP_IMM) && /* add r22,sp,imm */
- ((opl & OP_MASK_OP_AND_RB) != OP_STW_SP_IMM) && /* stw Ra, @(sp,imm) */
- ((opl & OP_MASK_OP_AND_RB) != OP_ST2W_SP_IMM)) /* st2w Ra, @(sp,imm) */
- break;
- }
- else
- {
- /* short instructions */
- if (fm0 && !fm1)
- {
- op1 = opr;
- op2 = opl;
- }
- else
- {
- op1 = opl;
- op2 = opr;
- }
- if (check_prologue (op1))
- {
- if (!check_prologue (op2))
- {
- /* if the previous opcode was really part of the prologue */
- /* and not just a NOP, then we want to break after both instructions */
- if ((op1 & OP_MASK_OPCODE) != OP_NOP)
- pc += 8;
- break;
- }
- }
- else
- break;
- }
- pc += 8;
- }
- return pc;
-}
-
-static int end_of_stack;
-
-/* 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.
- */
-
-CORE_ADDR
-d30v_frame_chain (struct frame_info *frame)
-{
- struct frame_saved_regs fsr;
-
- d30v_frame_find_saved_regs (frame, &fsr);
-
- if (end_of_stack)
- return (CORE_ADDR) 0;
-
- if (frame->return_pc == IMEM_START)
- return (CORE_ADDR) 0;
-
- if (!fsr.regs[FP_REGNUM])
- {
- if (!fsr.regs[SP_REGNUM] || fsr.regs[SP_REGNUM] == STACK_START)
- return (CORE_ADDR) 0;
-
- return fsr.regs[SP_REGNUM];
- }
-
- if (!read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4))
- return (CORE_ADDR) 0;
-
- return read_memory_unsigned_integer (fsr.regs[FP_REGNUM], 4);
-}
-
-static int next_addr, uses_frame;
-static int frame_size;
-
-static int
-prologue_find_regs (unsigned long op, struct frame_saved_regs *fsr,
- CORE_ADDR addr)
-{
- int n;
- int offset;
-
- /* add sp,sp,imm -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
- {
- offset = EXTRACT_IMM6 (op);
- /*next_addr += offset; */
- frame_size += -offset;
- return 1;
- }
-
- /* add r22,sp,imm -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM)
- {
- offset = EXTRACT_IMM6 (op);
- next_addr = (offset - frame_size);
- return 1;
- }
-
- /* stw Ra, @(fp, offset) -- observed */
- if ((op & OP_MASK_OP_AND_RB) == OP_STW_FP_IMM)
- {
- n = EXTRACT_RA (op);
- offset = EXTRACT_IMM6 (op);
- fsr->regs[n] = (offset - frame_size);
- return 1;
- }
-
- /* stw Ra, @(fp, r0) -- observed */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_FP_R0)
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = (-frame_size);
- return 1;
- }
-
- /* or fp,0,sp -- observed */
- if ((op == OP_OR_FP_R0_SP) ||
- (op == OP_OR_FP_SP_R0) ||
- (op == OP_OR_FP_IMM0_SP))
- {
- uses_frame = 1;
- return 1;
- }
-
- /* nop */
- if ((op & OP_MASK_OPCODE) == OP_NOP)
- return 1;
-
- /* stw Ra,@(r22+,r0) -- observed */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_R22P_R0)
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = next_addr;
- next_addr += 4;
- return 1;
- }
-#if 0 /* subsumed in pattern above */
- /* stw fp,@(r22+,r0) -- observed */
- if (op == OP_STW_FP_R22P_R0)
- {
- fsr->regs[FP_REGNUM] = next_addr; /* XXX */
- next_addr += 4;
- return 1;
- }
-
- /* stw r62,@(r22+,r0) -- observed */
- if (op == OP_STW_LR_R22P_R0)
- {
- fsr->regs[LR_REGNUM] = next_addr;
- next_addr += 4;
- return 1;
- }
-#endif
- /* st2w Ra,@(r22+,r0) -- observed */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_R22P_R0)
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = next_addr;
- fsr->regs[n + 1] = next_addr + 4;
- next_addr += 8;
- return 1;
- }
-
- /* stw rn, @(sp-) */
- if ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SPM)
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = next_addr;
- next_addr -= 4;
- return 1;
- }
-
- /* st2w Ra, @(sp-) */
- else if ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SPM)
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = next_addr;
- fsr->regs[n + 1] = next_addr + 4;
- next_addr -= 8;
- return 1;
- }
-
- /* sub sp,sp,imm */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_SUB_SP_IMM)
- {
- offset = EXTRACT_IMM6 (op);
- frame_size += -offset;
- return 1;
- }
-
- /* st rn, @(sp,0) -- observed */
- if (((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_R0) ||
- ((op & OP_MASK_ALL_BUT_RA) == OP_STW_SP_IMM0))
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = (-frame_size);
- return 1;
- }
-
- /* st2w rn, @(sp,0) */
- if (((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_R0) ||
- ((op & OP_MASK_ALL_BUT_RA) == OP_ST2W_SP_IMM0))
- {
- n = EXTRACT_RA (op);
- fsr->regs[n] = (-frame_size);
- fsr->regs[n + 1] = (-frame_size) + 4;
- return 1;
- }
-
- /* stw fp,@(sp,imm) -- observed */
- if ((op & OP_MASK_ALL_BUT_IMM) == OP_STW_FP_SP_IMM)
- {
- offset = EXTRACT_IMM6 (op);
- fsr->regs[FP_REGNUM] = (offset - frame_size);
- return 1;
- }
- return 0;
-}
-
-/* Put here the code to store, into a struct frame_saved_regs, the
- addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special: the address we
- return for it IS the sp for the next frame. */
-void
-d30v_frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
-{
- CORE_ADDR fp, pc;
- unsigned long opl, opr;
- unsigned long op1, op2;
- unsigned long fm0, fm1;
- int i;
-
- fp = fi->frame;
- memset (fsr, 0, sizeof (*fsr));
- next_addr = 0;
- frame_size = 0;
- end_of_stack = 0;
-
- uses_frame = 0;
-
- d30v_frame_find_saved_regs_offsets (fi, fsr);
-
- fi->size = frame_size;
-
- if (!fp)
- fp = read_register (SP_REGNUM);
-
- for (i = 0; i < NUM_REGS - 1; i++)
- if (fsr->regs[i])
- {
- fsr->regs[i] = fsr->regs[i] + fp + frame_size;
- }
-
- if (fsr->regs[LR_REGNUM])
- fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4);
- else
- fi->return_pc = read_register (LR_REGNUM);
-
- /* the SP is not normally (ever?) saved, but check anyway */
- if (!fsr->regs[SP_REGNUM])
- {
- /* if the FP was saved, that means the current FP is valid, */
- /* otherwise, it isn't being used, so we use the SP instead */
- if (uses_frame)
- fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size;
- else
- {
- fsr->regs[SP_REGNUM] = fp + fi->size;
- fi->frameless = 1;
- fsr->regs[FP_REGNUM] = 0;
- }
- }
-}
-
-void
-d30v_frame_find_saved_regs_offsets (struct frame_info *fi,
- struct frame_saved_regs *fsr)
-{
- CORE_ADDR fp, pc;
- unsigned long opl, opr;
- unsigned long op1, op2;
- unsigned long fm0, fm1;
- int i;
-
- fp = fi->frame;
- memset (fsr, 0, sizeof (*fsr));
- next_addr = 0;
- frame_size = 0;
- end_of_stack = 0;
-
- pc = get_pc_function_start (fi->pc);
-
- uses_frame = 0;
- while (pc < fi->pc)
- {
- opl = (unsigned long) read_memory_integer (pc, 4);
- opr = (unsigned long) read_memory_integer (pc + 4, 4);
-
- fm0 = (opl & OP_MASK_FM_BIT);
- fm1 = (opr & OP_MASK_FM_BIT);
-
- opl = (opl & OP_MASK_SUB_INST);
- opr = (opr & OP_MASK_SUB_INST);
-
- if (fm0 && fm1)
- {
- /* long instruction */
- if ((opl & OP_MASK_ALL_BUT_IMM) == OP_ADD_SP_IMM)
- {
- /* add sp,sp,n */
- long offset = EXTRACT_IMM32 (opl, opr);
- frame_size += -offset;
- }
- else if ((opl & OP_MASK_ALL_BUT_IMM) == OP_ADD_R22_SP_IMM)
- {
- /* add r22,sp,offset */
- long offset = EXTRACT_IMM32 (opl, opr);
- next_addr = (offset - frame_size);
- }
- else if ((opl & OP_MASK_OP_AND_RB) == OP_STW_SP_IMM)
- {
- /* st Ra, @(sp,imm) */
- long offset = EXTRACT_IMM32 (opl, opr);
- short n = EXTRACT_RA (opl);
- fsr->regs[n] = (offset - frame_size);
- }
- else if ((opl & OP_MASK_OP_AND_RB) == OP_ST2W_SP_IMM)
- {
- /* st2w Ra, @(sp,offset) */
- long offset = EXTRACT_IMM32 (opl, opr);
- short n = EXTRACT_RA (opl);
- fsr->regs[n] = (offset - frame_size);
- fsr->regs[n + 1] = (offset - frame_size) + 4;
- }
- else if ((opl & OP_MASK_ALL_BUT_IMM) == OP_OR_SP_R0_IMM)
- {
- end_of_stack = 1;
- }
- else
- break;
- }
- else
- {
- /* short instructions */
- if (fm0 && !fm1)
- {
- op2 = opl;
- op1 = opr;
- }
- else
- {
- op1 = opl;
- op2 = opr;
- }
- if (!prologue_find_regs (op1, fsr, pc) || !prologue_find_regs (op2, fsr, pc))
- break;
- }
- pc += 8;
- }
-
-#if 0
- fi->size = frame_size;
-
- if (!fp)
- fp = read_register (SP_REGNUM);
-
- for (i = 0; i < NUM_REGS - 1; i++)
- if (fsr->regs[i])
- {
- fsr->regs[i] = fsr->regs[i] + fp + frame_size;
- }
-
- if (fsr->regs[LR_REGNUM])
- fi->return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], 4);
- else
- fi->return_pc = read_register (LR_REGNUM);
-
- /* the SP is not normally (ever?) saved, but check anyway */
- if (!fsr->regs[SP_REGNUM])
- {
- /* if the FP was saved, that means the current FP is valid, */
- /* otherwise, it isn't being used, so we use the SP instead */
- if (uses_frame)
- fsr->regs[SP_REGNUM] = read_register (FP_REGNUM) + fi->size;
- else
- {
- fsr->regs[SP_REGNUM] = fp + fi->size;
- fi->frameless = 1;
- fsr->regs[FP_REGNUM] = 0;
- }
- }
-#endif
-}
-
-void
-d30v_init_extra_frame_info (int fromleaf, struct frame_info *fi)
-{
- struct frame_saved_regs dummy;
-
- if (fi->next && (fi->pc == 0))
- fi->pc = fi->next->return_pc;
-
- d30v_frame_find_saved_regs_offsets (fi, &dummy);
-
- if (uses_frame == 0)
- fi->frameless = 1;
- else
- fi->frameless = 0;
-
- if ((fi->next == 0) && (uses_frame == 0))
- /* innermost frame and it's "frameless",
- so the fi->frame field is wrong, fix it! */
- fi->frame = read_sp ();
-
- if (dummy.regs[LR_REGNUM])
- {
- /* it was saved, grab it! */
- dummy.regs[LR_REGNUM] += (fi->frame + frame_size);
- fi->return_pc = read_memory_unsigned_integer (dummy.regs[LR_REGNUM], 4);
- }
- else
- fi->return_pc = read_register (LR_REGNUM);
-}
-
-void
-d30v_init_frame_pc (int fromleaf, struct frame_info *prev)
-{
- /* default value, put here so we can breakpoint on it and
- see if the default value is really the right thing to use */
- prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
- prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
-}
-
-static void d30v_print_register (int regnum, int tabular);
-
-static void
-d30v_print_register (int regnum, int tabular)
-{
- if (regnum < A0_REGNUM)
- {
- if (tabular)
- printf_filtered ("%08lx", (long) read_register (regnum));
- else
- printf_filtered ("0x%lx %ld",
- (long) read_register (regnum),
- (long) read_register (regnum));
- }
- else
- {
- char regbuf[MAX_REGISTER_RAW_SIZE];
-
- frame_register_read (selected_frame, regnum, regbuf);
-
- val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
- gdb_stdout, 'x', 1, 0, Val_pretty_default);
-
- if (!tabular)
- {
- printf_filtered (" ");
- val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
- gdb_stdout, 'd', 1, 0, Val_pretty_default);
- }
- }
-}
-
-static void
-d30v_print_flags (void)
-{
- long psw = read_register (PSW_REGNUM);
- printf_filtered ("flags #1");
- printf_filtered (" (sm) %d", (psw & PSW_SM) != 0);
- printf_filtered (" (ea) %d", (psw & PSW_EA) != 0);
- printf_filtered (" (db) %d", (psw & PSW_DB) != 0);
- printf_filtered (" (ds) %d", (psw & PSW_DS) != 0);
- printf_filtered (" (ie) %d", (psw & PSW_IE) != 0);
- printf_filtered (" (rp) %d", (psw & PSW_RP) != 0);
- printf_filtered (" (md) %d\n", (psw & PSW_MD) != 0);
-
- printf_filtered ("flags #2");
- printf_filtered (" (f0) %d", (psw & PSW_F0) != 0);
- printf_filtered (" (f1) %d", (psw & PSW_F1) != 0);
- printf_filtered (" (f2) %d", (psw & PSW_F2) != 0);
- printf_filtered (" (f3) %d", (psw & PSW_F3) != 0);
- printf_filtered (" (s) %d", (psw & PSW_S) != 0);
- printf_filtered (" (v) %d", (psw & PSW_V) != 0);
- printf_filtered (" (va) %d", (psw & PSW_VA) != 0);
- printf_filtered (" (c) %d\n", (psw & PSW_C) != 0);
-}
-
-static void
-print_flags_command (char *args, int from_tty)
-{
- d30v_print_flags ();
-}
-
-void
-d30v_do_registers_info (int regnum, int fpregs)
-{
- long long num1, num2;
- long psw;
-
- if (regnum != -1)
- {
- if (REGISTER_NAME (0) == NULL || REGISTER_NAME (0)[0] == '\000')
- return;
-
- printf_filtered ("%s ", REGISTER_NAME (regnum));
- d30v_print_register (regnum, 0);
-
- printf_filtered ("\n");
- return;
- }
-
- /* Have to print all the registers. Format them nicely. */
-
- printf_filtered ("PC=");
- print_address (read_pc (), gdb_stdout);
-
- printf_filtered (" PSW=");
- d30v_print_register (PSW_REGNUM, 1);
-
- printf_filtered (" BPC=");
- print_address (read_register (BPC_REGNUM), gdb_stdout);
-
- printf_filtered (" BPSW=");
- d30v_print_register (BPSW_REGNUM, 1);
- printf_filtered ("\n");
-
- printf_filtered ("DPC=");
- print_address (read_register (DPC_REGNUM), gdb_stdout);
-
- printf_filtered (" DPSW=");
- d30v_print_register (DPSW_REGNUM, 1);
-
- printf_filtered (" IBA=");
- print_address (read_register (IBA_REGNUM), gdb_stdout);
- printf_filtered ("\n");
-
- printf_filtered ("RPT_C=");
- d30v_print_register (RPT_C_REGNUM, 1);
-
- printf_filtered (" RPT_S=");
- print_address (read_register (RPT_S_REGNUM), gdb_stdout);
-
- printf_filtered (" RPT_E=");
- print_address (read_register (RPT_E_REGNUM), gdb_stdout);
- printf_filtered ("\n");
-
- printf_filtered ("MOD_S=");
- print_address (read_register (MOD_S_REGNUM), gdb_stdout);
-
- printf_filtered (" MOD_E=");
- print_address (read_register (MOD_E_REGNUM), gdb_stdout);
- printf_filtered ("\n");
-
- printf_filtered ("EIT_VB=");
- print_address (read_register (EIT_VB_REGNUM), gdb_stdout);
-
- printf_filtered (" INT_S=");
- d30v_print_register (INT_S_REGNUM, 1);
-
- printf_filtered (" INT_M=");
- d30v_print_register (INT_M_REGNUM, 1);
- printf_filtered ("\n");
-
- d30v_print_flags ();
- for (regnum = 0; regnum <= 63;)
- {
- int i;
-
- printf_filtered ("R%d-R%d ", regnum, regnum + 7);
- if (regnum < 10)
- printf_filtered (" ");
- if (regnum + 7 < 10)
- printf_filtered (" ");
-
- for (i = 0; i < 8; i++)
- {
- printf_filtered (" ");
- d30v_print_register (regnum++, 1);
- }
-
- printf_filtered ("\n");
- }
-
- printf_filtered ("A0-A1 ");
-
- d30v_print_register (A0_REGNUM, 1);
- printf_filtered (" ");
- d30v_print_register (A1_REGNUM, 1);
- printf_filtered ("\n");
-}
-
-CORE_ADDR
-d30v_fix_call_dummy (char *dummyname, CORE_ADDR start_sp, CORE_ADDR fun,
- int nargs, struct value **args,
- struct type *type, int gcc_p)
-{
- int regnum;
- CORE_ADDR sp;
- char buffer[MAX_REGISTER_RAW_SIZE];
- struct frame_info *frame = get_current_frame ();
- frame->dummy = start_sp;
- /*start_sp |= DMEM_START; */
-
- sp = start_sp;
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- sp -= REGISTER_RAW_SIZE (regnum);
- store_address (buffer, REGISTER_RAW_SIZE (regnum), read_register (regnum));
- write_memory (sp, buffer, REGISTER_RAW_SIZE (regnum));
- }
- write_register (SP_REGNUM, (LONGEST) sp);
- /* now we need to load LR with the return address */
- write_register (LR_REGNUM, (LONGEST) d30v_call_dummy_address ());
- return sp;
-}
-
-static void
-d30v_pop_dummy_frame (struct frame_info *fi)
-{
- CORE_ADDR sp = fi->dummy;
- int regnum;
-
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- sp -= REGISTER_RAW_SIZE (regnum);
- write_register (regnum, read_memory_unsigned_integer (sp, REGISTER_RAW_SIZE (regnum)));
- }
- flush_cached_frames (); /* needed? */
-}
-
-
-CORE_ADDR
-d30v_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
-{
- int i, len, index = 0, regnum = 2;
- char buffer[4], *contents;
- LONGEST val;
- CORE_ADDR ptrs[10];
-
-#if 0
- /* Pass 1. Put all large args on stack */
- for (i = 0; i < nargs; i++)
- {
- struct value *arg = args[i];
- struct type *arg_type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (arg_type);
- contents = VALUE_CONTENTS (arg);
- val = extract_signed_integer (contents, len);
- if (len > 4)
- {
- /* put on stack and pass pointers */
- sp -= len;
- write_memory (sp, contents, len);
- ptrs[index++] = sp;
- }
- }
-#endif
- index = 0;
-
- for (i = 0; i < nargs; i++)
- {
- struct value *arg = args[i];
- struct type *arg_type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (arg_type);
- contents = VALUE_CONTENTS (arg);
- if (len > 4)
- {
- /* we need multiple registers */
- int ndx;
-
- for (ndx = 0; len > 0; ndx += 8, len -= 8)
- {
- if (regnum & 1)
- regnum++; /* all args > 4 bytes start in even register */
-
- if (regnum < 18)
- {
- val = extract_signed_integer (&contents[ndx], 4);
- write_register (regnum++, val);
-
- if (len >= 8)
- val = extract_signed_integer (&contents[ndx + 4], 4);
- else
- val = extract_signed_integer (&contents[ndx + 4], len - 4);
- write_register (regnum++, val);
- }
- else
- {
- /* no more registers available. put it on the stack */
-
- /* all args > 4 bytes are padded to a multiple of 8 bytes
- and start on an 8 byte boundary */
- if (sp & 7)
- sp -= (sp & 7); /* align it */
-
- sp -= ((len + 7) & ~7); /* allocate space */
- write_memory (sp, &contents[ndx], len);
- break;
- }
- }
- }
- else
- {
- if (regnum < 18)
- {
- val = extract_signed_integer (contents, len);
- write_register (regnum++, val);
- }
- else
- {
- /* all args are padded to a multiple of 4 bytes (at least) */
- sp -= ((len + 3) & ~3);
- write_memory (sp, contents, len);
- }
- }
- }
- if (sp & 7)
- /* stack pointer is not on an 8 byte boundary -- align it */
- sp -= (sp & 7);
- return sp;
-}
-
-
-/* pick an out-of-the-way place to set the return value */
-/* for an inferior function call. The link register is set to this */
-/* value and a momentary breakpoint is set there. When the breakpoint */
-/* is hit, the dummy frame is popped and the previous environment is */
-/* restored. */
-
-CORE_ADDR
-d30v_call_dummy_address (void)
-{
- CORE_ADDR entry;
- struct minimal_symbol *sym;
-
- entry = entry_point_address ();
-
- if (entry != 0)
- return entry;
-
- sym = lookup_minimal_symbol ("_start", NULL, symfile_objfile);
-
- if (!sym || MSYMBOL_TYPE (sym) != mst_text)
- return 0;
- else
- return SYMBOL_VALUE_ADDRESS (sym);
-}
-
-/* Given a return value in `regbuf' with a type `valtype',
- extract and copy its value into `valbuf'. */
-
-void
-d30v_extract_return_value (struct type *valtype, char regbuf[REGISTER_BYTES],
- char *valbuf)
-{
- memcpy (valbuf, regbuf + REGISTER_BYTE (2), TYPE_LENGTH (valtype));
-}
-
-/* The following code implements access to, and display of, the D30V's
- instruction trace buffer. The buffer consists of 64K or more
- 4-byte words of data, of which each words includes an 8-bit count,
- an 8-bit segment number, and a 16-bit instruction address.
-
- In theory, the trace buffer is continuously capturing instruction
- data that the CPU presents on its "debug bus", but in practice, the
- ROMified GDB stub only enables tracing when it continues or steps
- the program, and stops tracing when the program stops; so it
- actually works for GDB to read the buffer counter out of memory and
- then read each trace word. The counter records where the tracing
- stops, but there is no record of where it started, so we remember
- the PC when we resumed and then search backwards in the trace
- buffer for a word that includes that address. This is not perfect,
- because you will miss trace data if the resumption PC is the target
- of a branch. (The value of the buffer counter is semi-random, any
- trace data from a previous program stop is gone.) */
-
-/* The address of the last word recorded in the trace buffer. */
-
-#define DBBC_ADDR (0xd80000)
-
-/* The base of the trace buffer, at least for the "Board_0". */
-
-#define TRACE_BUFFER_BASE (0xf40000)
-
-static void trace_command (char *, int);
-
-static void untrace_command (char *, int);
-
-static void trace_info (char *, int);
-
-static void tdisassemble_command (char *, int);
-
-static void display_trace (int, int);
-
-/* True when instruction traces are being collected. */
-
-static int tracing;
-
-/* Remembered PC. */
-
-static CORE_ADDR last_pc;
-
-/* True when trace output should be displayed whenever program stops. */
-
-static int trace_display;
-
-/* True when trace listing should include source lines. */
-
-static int default_trace_show_source = 1;
-
-struct trace_buffer
- {
- int size;
- short *counts;
- CORE_ADDR *addrs;
- }
-trace_data;
-
-static void
-trace_command (char *args, int from_tty)
-{
- /* Clear the host-side trace buffer, allocating space if needed. */
- trace_data.size = 0;
- if (trace_data.counts == NULL)
- trace_data.counts = (short *) xmalloc (65536 * sizeof (short));
- if (trace_data.addrs == NULL)
- trace_data.addrs = (CORE_ADDR *) xmalloc (65536 * sizeof (CORE_ADDR));
-
- tracing = 1;
-
- printf_filtered ("Tracing is now on.\n");
-}
-
-static void
-untrace_command (char *args, int from_tty)
-{
- tracing = 0;
-
- printf_filtered ("Tracing is now off.\n");
-}
-
-static void
-trace_info (char *args, int from_tty)
-{
- int i;
-
- if (trace_data.size)
- {
- printf_filtered ("%d entries in trace buffer:\n", trace_data.size);
-
- for (i = 0; i < trace_data.size; ++i)
- {
- printf_filtered ("%d: %d instruction%s at 0x%s\n",
- i, trace_data.counts[i],
- (trace_data.counts[i] == 1 ? "" : "s"),
- paddr_nz (trace_data.addrs[i]));
- }
- }
- else
- printf_filtered ("No entries in trace buffer.\n");
-
- printf_filtered ("Tracing is currently %s.\n", (tracing ? "on" : "off"));
-}
-
-/* Print the instruction at address MEMADDR in debugged memory,
- on STREAM. Returns length of the instruction, in bytes. */
-
-static int
-print_insn (CORE_ADDR memaddr, struct ui_file *stream)
-{
- /* If there's no disassembler, something is very wrong. */
- if (tm_print_insn == NULL)
- internal_error (__FILE__, __LINE__,
- "print_insn: no disassembler");
-
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- tm_print_insn_info.endian = BFD_ENDIAN_BIG;
- else
- tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
- return TARGET_PRINT_INSN (memaddr, &tm_print_insn_info);
-}
-
-void
-d30v_eva_prepare_to_trace (void)
-{
- if (!tracing)
- return;
-
- last_pc = read_register (PC_REGNUM);
-}
-
-/* Collect trace data from the target board and format it into a form
- more useful for display. */
-
-void
-d30v_eva_get_trace_data (void)
-{
- int count, i, j, oldsize;
- int trace_addr, trace_seg, trace_cnt, next_cnt;
- unsigned int last_trace, trace_word, next_word;
- unsigned int *tmpspace;
-
- if (!tracing)
- return;
-
- tmpspace = xmalloc (65536 * sizeof (unsigned int));
-
- last_trace = read_memory_unsigned_integer (DBBC_ADDR, 2) << 2;
-
- /* Collect buffer contents from the target, stopping when we reach
- the word recorded when execution resumed. */
-
- count = 0;
- while (last_trace > 0)
- {
- QUIT;
- trace_word =
- read_memory_unsigned_integer (TRACE_BUFFER_BASE + last_trace, 4);
- trace_addr = trace_word & 0xffff;
- last_trace -= 4;
- /* Ignore an apparently nonsensical entry. */
- if (trace_addr == 0xffd5)
- continue;
- tmpspace[count++] = trace_word;
- if (trace_addr == last_pc)
- break;
- if (count > 65535)
- break;
- }
-
- /* Move the data to the host-side trace buffer, adjusting counts to
- include the last instruction executed and transforming the address
- into something that GDB likes. */
-
- for (i = 0; i < count; ++i)
- {
- trace_word = tmpspace[i];
- next_word = ((i == 0) ? 0 : tmpspace[i - 1]);
- trace_addr = trace_word & 0xffff;
- next_cnt = (next_word >> 24) & 0xff;
- j = trace_data.size + count - i - 1;
- trace_data.addrs[j] = (trace_addr << 2) + 0x1000000;
- trace_data.counts[j] = next_cnt + 1;
- }
-
- oldsize = trace_data.size;
- trace_data.size += count;
-
- xfree (tmpspace);
-
- if (trace_display)
- display_trace (oldsize, trace_data.size);
-}
-
-static void
-tdisassemble_command (char *arg, int from_tty)
-{
- int i, count;
- CORE_ADDR low, high;
- char *space_index;
-
- if (!arg)
- {
- low = 0;
- high = trace_data.size;
- }
- else if (!(space_index = (char *) strchr (arg, ' ')))
- {
- low = parse_and_eval_address (arg);
- high = low + 5;
- }
- else
- {
- /* Two arguments. */
- *space_index = '\0';
- low = parse_and_eval_address (arg);
- high = parse_and_eval_address (space_index + 1);
- if (high < low)
- high = low;
- }
-
- printf_filtered ("Dump of trace from %s to %s:\n",
- paddr_u (low),
- paddr_u (high));
-
- display_trace (low, high);
-
- printf_filtered ("End of trace dump.\n");
- gdb_flush (gdb_stdout);
-}
-
-static void
-display_trace (int low, int high)
-{
- int i, count, trace_show_source, first, suppress;
- CORE_ADDR next_address;
-
- trace_show_source = default_trace_show_source;
- if (!have_full_symbols () && !have_partial_symbols ())
- {
- trace_show_source = 0;
- printf_filtered ("No symbol table is loaded. Use the \"file\" command.\n");
- printf_filtered ("Trace will not display any source.\n");
- }
-
- first = 1;
- suppress = 0;
- for (i = low; i < high; ++i)
- {
- next_address = trace_data.addrs[i];
- count = trace_data.counts[i];
- while (count-- > 0)
- {
- QUIT;
- if (trace_show_source)
- {
- struct symtab_and_line sal, sal_prev;
-
- sal_prev = find_pc_line (next_address - 4, 0);
- sal = find_pc_line (next_address, 0);
-
- if (sal.symtab)
- {
- if (first || sal.line != sal_prev.line)
- print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
- suppress = 0;
- }
- else
- {
- if (!suppress)
- /* FIXME-32x64--assumes sal.pc fits in long. */
- printf_filtered ("No source file for address %s.\n",
- local_hex_string ((unsigned long) sal.pc));
- suppress = 1;
- }
- }
- first = 0;
- print_address (next_address, gdb_stdout);
- printf_filtered (":");
- printf_filtered ("\t");
- wrap_here (" ");
- next_address = next_address + print_insn (next_address, gdb_stdout);
- printf_filtered ("\n");
- gdb_flush (gdb_stdout);
- }
- }
-}
-
-extern void (*target_resume_hook) (void);
-extern void (*target_wait_loop_hook) (void);
-
-void
-_initialize_d30v_tdep (void)
-{
- tm_print_insn = print_insn_d30v;
-
- target_resume_hook = d30v_eva_prepare_to_trace;
- target_wait_loop_hook = d30v_eva_get_trace_data;
-
- add_info ("flags", print_flags_command, "Print d30v flags.");
-
- add_com ("trace", class_support, trace_command,
- "Enable tracing of instruction execution.");
-
- add_com ("untrace", class_support, untrace_command,
- "Disable tracing of instruction execution.");
-
- add_com ("tdisassemble", class_vars, tdisassemble_command,
- "Disassemble the trace buffer.\n\
-Two optional arguments specify a range of trace buffer entries\n\
-as reported by info trace (NOT addresses!).");
-
- add_info ("trace", trace_info,
- "Display info about the trace data buffer.");
-
- add_show_from_set (add_set_cmd ("tracedisplay", no_class,
- var_integer, (char *) &trace_display,
- "Set automatic display of trace.\n", &setlist),
- &showlist);
- add_show_from_set (add_set_cmd ("tracesource", no_class,
- var_integer, (char *) &default_trace_show_source,
- "Set display of source code with trace.\n", &setlist),
- &showlist);
-
-}
+/* 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 f31555738eb..bd20184c006 100644
--- a/gdb/dbug-rom.c
+++ b/gdb/dbug-rom.c
@@ -76,13 +76,25 @@ dbug_supply_register (char *regname, int regnamelen, char *val, int vallen)
different names than GDB does, and don't support all the registers
either. So, typing "info reg sp" becomes an "A7". */
-static char *dbug_regnames[NUM_REGS] =
+static const char *
+dbug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC"
- /* no float registers */
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC"
+ /* no float registers */
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+
+}
+
static struct target_ops dbug_ops;
static struct monitor_ops dbug_cmds;
@@ -135,7 +147,8 @@ init_dbug_cmds (void)
dbug_cmds.cmd_end = NULL; /* optional command terminator */
dbug_cmds.target = &dbug_ops; /* target operations */
dbug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- dbug_cmds.regnames = dbug_regnames; /* registers names */
+ dbug_cmds.regnames = NULL; /* registers names */
+ dbug_cmds.regname = dbug_regname;
dbug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
} /* init_debug_ops */
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 430e3f51f29..1d6024a597d 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -42,7 +42,7 @@
#include <fcntl.h>
#endif
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "gdb_stat.h"
#include "symtab.h"
#include "breakpoint.h"
diff --git a/gdb/defs.h b/gdb/defs.h
index a83b6e93737..89a90d6fba9 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -39,6 +39,8 @@
#include <unistd.h>
#endif
+#include "gdb_locale.h"
+
/* For ``enum target_signal''. */
#include "gdb/signals.h"
@@ -207,7 +209,7 @@ enum language
language_c, /* C */
language_cplus, /* C++ */
language_java, /* Java */
- language_chill, /* Chill */
+ /* OBSOLETE language_chill, */ /* Chill */
language_fortran, /* Fortran */
language_m2, /* Modula-2 */
language_asm, /* Assembly language */
@@ -222,6 +224,14 @@ enum precision_type
unspecified_precision
};
+/* A generic, not quite boolean, enumeration. */
+enum auto_boolean
+{
+ AUTO_BOOLEAN_TRUE,
+ AUTO_BOOLEAN_FALSE,
+ AUTO_BOOLEAN_AUTO
+};
+
/* the cleanup list records things that have to be undone
if an error happens (descriptors to be closed, memory to be freed, etc.)
Each link in the chain records a function to call and an
@@ -290,9 +300,9 @@ extern int inside_entry_file (CORE_ADDR addr);
extern int inside_main_func (CORE_ADDR pc);
-/* From ch-lang.c, for the moment. (FIXME) */
+/* OBSOLETE From ch-lang.c, for the moment. (FIXME) */
-extern char *chill_demangle (const char *);
+/* OBSOLETE extern char *chill_demangle (const char *); */
/* From utils.c */
@@ -525,6 +535,8 @@ extern char *skip_quoted (char *);
extern char *gdb_readline (char *);
+extern char *gdb_readline_wrapper (char *);
+
extern char *command_line_input (char *, int, char *);
extern void print_prompt (void);
@@ -836,10 +848,11 @@ extern void xmfree (void *md, void *ptr);
"libiberty.h". */
extern void xfree (void *);
-/* Utility macro to allocate typed memory. Avoids errors like
+/* Utility macros to allocate typed memory. Avoids errors like
``struct foo *foo = xmalloc (sizeof bar)'' and ``struct foo *foo =
(struct foo *) xmalloc (sizeof bar)''. */
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
@@ -1058,9 +1071,9 @@ extern void *alloca ();
/* In findvar.c. */
-extern LONGEST extract_signed_integer (void *, int);
+extern LONGEST extract_signed_integer (const void *, int);
-extern ULONGEST extract_unsigned_integer (void *, int);
+extern ULONGEST extract_unsigned_integer (const void *, int);
extern int extract_long_unsigned_integer (void *, int, LONGEST *);
@@ -1143,7 +1156,6 @@ extern void (*error_begin_hook) (void);
extern int (*ui_load_progress_hook) (const char *section, unsigned long num);
-extern void (*selected_frame_level_changed_hook) (int level);
/* Inhibit window interface if non-zero. */
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 577ddb146bc..4693072ed6b 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,121 @@
+2002-08-23 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Update
+ STORE_RETURN_VALUE, mention regcache.
+
+2002-08-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Document
+ print_registers_info. Note that DO_REGISTERS_INFO is deprecated.
+
+2002-08-19 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Remote Protocol): Reformat. Use cross references.
+ Fix minor typos. Add index entries.
+
+2002-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Data): Add ``Vector Unit'' to menu.
+
+2002-08-15 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Document
+ PRINT_VECTOR_INFO.
+ * gdb.texinfo (Vector Unit): Document "info vectors" command.
+
+2002-08-13 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Maintenance Commands): Document "maint print
+ registers", "maint print raw-registers" and "maint print
+ cooked-registers".
+
+2002-08-08 Grace Sainsbury <graces@redhat.com>
+
+ From Mark Salter:
+ * gdb.texinfo (Protocol): Document T packet extension to
+ allow watchpoint address reporting.
+
+2002-08-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Dump/Restore Files): Move `[]' to outside of @var.
+
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * stabs.texinfo, gdb.texinfo, gdbint.texinfo: Obsolete references
+ to CHILL.
+
+2002-08-01 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Coding): Revise section "Include Files".
+
+2002-07-24 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo: Obsolete references to m88k.
+ * gdb.texinfo: Ditto.
+
+2002-07-10 Joel Brobecker <brobecker@gnat.com>
+
+ * gdbint.texinfo (Create a release candiate): Add the location
+ where the proper version of autoconf can be retrieved.
+
+2002-07-09 Don Howard <dhoward@redhat.com>
+
+ * gdb.texinfo (Command Files): Further describe the behavior of
+ sourced command files.
+
+2002-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (User Interface): ISO C rather than ISO-C.
+ (Coding): Clarify ISO C version that GDB assumes.
+
+2002-06-26 Tom Tromey <tromey@redhat.com>
+
+ * gdbint.texinfo (User Interface): Mention add_setshow_cmd and
+ add_setshow_cmd_full.
+
+2002-06-25 Don Howard <dhoward@redhat.com>
+
+ * gdb.texinfo (Memory Region Attributes): Document new behavior
+ for 'mem' command.
+
+2002-06-11 Jim Blandy <jimb@redhat.com>
+
+ * gdb.texinfo (Symbols): Update documentation for `info source'
+ command.
+
+ * gdb.texinfo (Macros): Call the command `info macro', not
+ `show macro'.
+
+2002-06-09 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Coding): Add section ``Per-architecture module
+ data''.
+
+2002-06-09 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbint.texinfo (Target Architecture Definition): Document
+ GDB_OSABI_GO32 and GDB_OSABI_NETWARE.
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Fix typos in @itemize @bullet
+ lists.
+
+2002-06-08 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Revise the section ``Cut the
+ Branch''.
+
+2002-06-01 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Add section
+ ``Converting an existing Target Architecture to Multi-arch''.
+
+2002-05-30 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Rename ``Obsoleting any code''
+ to ``Obsoleting code''. Revise.
+
2002-05-17 Jim Blandy <jimb@redhat.com>
* gdb.texinfo (C Preprocessor Macros): New chapter.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 5d840479bfd..84ed89ebc34 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -194,10 +194,12 @@ You can use @value{GDBN} to debug programs written in C and C++.
For more information, see @ref{Support,,Supported languages}.
For more information, see @ref{C,,C and C++}.
-@cindex Chill
+@c OBSOLETE @cindex Chill
@cindex Modula-2
-Support for Modula-2 and Chill is partial. For information on Modula-2,
-see @ref{Modula-2,,Modula-2}. For information on Chill, see @ref{Chill}.
+Support for Modula-2
+@c OBSOLETE and Chill
+is partial. For information on Modula-2, see @ref{Modula-2,,Modula-2}.
+@c OBSOLETE For information on Chill, see @ref{Chill}.
@cindex Pascal
Debugging Pascal programs which use sets, subranges, file variables, or
@@ -4416,6 +4418,7 @@ Table}.
* Convenience Vars:: Convenience variables
* Registers:: Registers
* Floating Point Hardware:: Floating point hardware
+* Vector Unit:: Vector Unit
* Memory Region Attributes:: Memory region attributes
* Dump/Restore Files:: Copy between memory and a file
@end menu
@@ -5581,6 +5584,20 @@ floating point chip. Currently, @samp{info float} is supported on
the ARM and x86 machines.
@end table
+@node Vector Unit
+@section Vector Unit
+@cindex vector unit
+
+Depending on the configuration, @value{GDBN} may be able to give you
+more information about the status of the vector unit.
+
+@table @code
+@kindex info vector
+@item info vector
+Display information about the vector unit. The exact contents and
+layout vary depending on the hardware.
+@end table
+
@node Memory Region Attributes
@section Memory region attributes
@cindex memory region attributes
@@ -5601,9 +5618,11 @@ to enable, disable, or remove a memory region, you specify that number.
@table @code
@kindex mem
-@item mem @var{address1} @var{address2} @var{attributes}@dots{}
-Define memory region bounded by @var{address1} and @var{address2}
-with attributes @var{attributes}@dots{}.
+@item mem @var{lower} @var{upper} @var{attributes}@dots{}
+Define memory region bounded by @var{lower} and @var{upper} with
+attributes @var{attributes}@dots{}. Note that @var{upper} == 0 is a
+special case: it is treated as the the target's maximum memory address.
+(0xffff on 16 bit targets, 0xffffffff on 32 bit targets, etc.)
@kindex delete mem
@item delete mem @var{nums}@dots{}
@@ -5769,7 +5788,7 @@ tekhex format file @var{filename}.
@item dump tekhex value @var{filename} @var{expression}
Dump value of @var{expression} into tekhex format file @var{filename}.
-@item restore @var{filename} @var{[binary]} @var{bias} @var{start} @var{end}
+@item restore @var{filename} [@var{binary}] @var{bias} @var{start} @var{end}
Restore the contents of file @var{filename} into memory. The @code{restore}
command can automatically recognize any known bfd file format, except for
raw binary. To restore a raw binary file you must use the optional argument
@@ -5843,10 +5862,10 @@ expansions. Since @value{GDBN} simply expands macros, but does not
parse the result, @var{expression} need not be a valid expression; it
can be any string of tokens.
-@kindex show macro
+@kindex info macro
@cindex macro definition, showing
@cindex definition, showing a macro's
-@item show macro @var{macro}
+@item info macro @var{macro}
Show the definition of the macro named @var{macro}, and describe the
source location where that definition was established.
@@ -5941,10 +5960,10 @@ to decide which macro definitions are in scope:
10 printf ("Hello, world!\n");
11 #undef N
12 printf ("We're so creative.\n");
-(gdb) show macro ADD
+(gdb) info macro ADD
Defined at /home/jimb/gdb/macros/play/sample.c:5
#define ADD(x) (M + x)
-(gdb) show macro Q
+(gdb) info macro Q
Defined at /home/jimb/gdb/macros/play/sample.h:1
included at /home/jimb/gdb/macros/play/sample.c:2
#define Q <
@@ -5977,7 +5996,7 @@ Breakpoint 1, main () at sample.c:10
At line 10, the definition of the macro @code{N} at line 9 is in force:
@smallexample
-(gdb) show macro N
+(gdb) info macro N
Defined at /home/jimb/gdb/macros/play/sample.c:9
#define N 28
(gdb) macro expand N Q M
@@ -5995,13 +6014,13 @@ thereof) in force at each point:
(gdb) next
Hello, world!
12 printf ("We're so creative.\n");
-(gdb) show macro N
+(gdb) info macro N
The symbol `N' has no definition as a C/C++ preprocessor macro
at /home/jimb/gdb/macros/play/sample.c:12
(gdb) next
We're so creative.
14 printf ("Goodbye, world!\n");
-(gdb) show macro N
+(gdb) info macro N
Defined at /home/jimb/gdb/macros/play/sample.c:13
#define N 1729
(gdb) macro expand N Q M
@@ -7112,10 +7131,10 @@ C@t{++} source file
@itemx .F
Fortran source file
-@item .ch
-@itemx .c186
-@itemx .c286
-CHILL source file
+@c OBSOLETE @item .ch
+@c OBSOLETE @itemx .c186
+@c OBSOLETE @itemx .c286
+@c OBSOLETE CHILL source file
@item .mod
Modula-2 source file
@@ -7388,7 +7407,9 @@ being set automatically by @value{GDBN}.
@node Support
@section Supported languages
-@value{GDBN} supports C, C@t{++}, Fortran, Java, Chill, assembly, and Modula-2.
+@value{GDBN} supports C, C@t{++}, Fortran, Java,
+@c OBSOLETE Chill,
+assembly, and Modula-2.
@c This is false ...
Some @value{GDBN} features may be used in expressions regardless of the
language you use: the @value{GDBN} @code{@@} and @code{::} operators,
@@ -7407,7 +7428,7 @@ language reference or tutorial.
@menu
* C:: C and C@t{++}
* Modula-2:: Modula-2
-* Chill:: Chill
+@c OBSOLETE * Chill:: Chill
@end menu
@node C
@@ -8373,504 +8394,504 @@ address can be specified by an integral constant, the construct
In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is
interpreted as the beginning of a comment. Use @code{<>} instead.
-@node Chill
-@subsection Chill
-
-The extensions made to @value{GDBN} to support Chill only support output
-from the @sc{gnu} Chill compiler. Other Chill compilers are not currently
-supported, and attempting to debug executables produced by them is most
-likely to give an error as @value{GDBN} reads in the executable's symbol
-table.
-
-@c This used to say "... following Chill related topics ...", but since
-@c menus are not shown in the printed manual, it would look awkward.
-This section covers the Chill related topics and the features
-of @value{GDBN} which support these topics.
-
-@menu
-* How modes are displayed:: How modes are displayed
-* Locations:: Locations and their accesses
-* Values and their Operations:: Values and their Operations
-* Chill type and range checks::
-* Chill defaults::
-@end menu
-
-@node How modes are displayed
-@subsubsection How modes are displayed
-
-The Chill Datatype- (Mode) support of @value{GDBN} is directly related
-with the functionality of the @sc{gnu} Chill compiler, and therefore deviates
-slightly from the standard specification of the Chill language. The
-provided modes are:
-
-@c FIXME: this @table's contents effectively disable @code by using @r
-@c on every @item. So why does it need @code?
-@table @code
-@item @r{@emph{Discrete modes:}}
-@itemize @bullet
-@item
-@emph{Integer Modes} which are predefined by @code{BYTE, UBYTE, INT,
-UINT, LONG, ULONG},
-@item
-@emph{Boolean Mode} which is predefined by @code{BOOL},
-@item
-@emph{Character Mode} which is predefined by @code{CHAR},
-@item
-@emph{Set Mode} which is displayed by the keyword @code{SET}.
-@smallexample
-(@value{GDBP}) ptype x
-type = SET (karli = 10, susi = 20, fritzi = 100)
-@end smallexample
-If the type is an unnumbered set the set element values are omitted.
-@item
-@emph{Range Mode} which is displayed by
-@smallexample
-@code{type = <basemode>(<lower bound> : <upper bound>)}
-@end smallexample
-where @code{<lower bound>, <upper bound>} can be of any discrete literal
-expression (e.g. set element names).
-@end itemize
-
-@item @r{@emph{Powerset Mode:}}
-A Powerset Mode is displayed by the keyword @code{POWERSET} followed by
-the member mode of the powerset. The member mode can be any discrete mode.
-@smallexample
-(@value{GDBP}) ptype x
-type = POWERSET SET (egon, hugo, otto)
-@end smallexample
-
-@item @r{@emph{Reference Modes:}}
-@itemize @bullet
-@item
-@emph{Bound Reference Mode} which is displayed by the keyword @code{REF}
-followed by the mode name to which the reference is bound.
-@item
-@emph{Free Reference Mode} which is displayed by the keyword @code{PTR}.
-@end itemize
-
-@item @r{@emph{Procedure mode}}
-The procedure mode is displayed by @code{type = PROC(<parameter list>)
-<return mode> EXCEPTIONS (<exception list>)}. The @code{<parameter
-list>} is a list of the parameter modes. @code{<return mode>} indicates
-the mode of the result of the procedure if any. The exceptionlist lists
-all possible exceptions which can be raised by the procedure.
-
-@ignore
-@item @r{@emph{Instance mode}}
-The instance mode is represented by a structure, which has a static
-type, and is therefore not really of interest.
-@end ignore
-
-@item @r{@emph{Synchronization Modes:}}
-@itemize @bullet
-@item
-@emph{Event Mode} which is displayed by
-@smallexample
-@code{EVENT (<event length>)}
-@end smallexample
-where @code{(<event length>)} is optional.
-@item
-@emph{Buffer Mode} which is displayed by
-@smallexample
-@code{BUFFER (<buffer length>)<buffer element mode>}
-@end smallexample
-where @code{(<buffer length>)} is optional.
-@end itemize
-
-@item @r{@emph{Timing Modes:}}
-@itemize @bullet
-@item
-@emph{Duration Mode} which is predefined by @code{DURATION}
-@item
-@emph{Absolute Time Mode} which is predefined by @code{TIME}
-@end itemize
-
-@item @r{@emph{Real Modes:}}
-Real Modes are predefined with @code{REAL} and @code{LONG_REAL}.
-
-@item @r{@emph{String Modes:}}
-@itemize @bullet
-@item
-@emph{Character String Mode} which is displayed by
-@smallexample
-@code{CHARS(<string length>)}
-@end smallexample
-followed by the keyword @code{VARYING} if the String Mode is a varying
-mode
-@item
-@emph{Bit String Mode} which is displayed by
-@smallexample
-@code{BOOLS(<string
-length>)}
-@end smallexample
-@end itemize
-
-@item @r{@emph{Array Mode:}}
-The Array Mode is displayed by the keyword @code{ARRAY(<range>)}
-followed by the element mode (which may in turn be an array mode).
-@smallexample
-(@value{GDBP}) ptype x
-type = ARRAY (1:42)
- ARRAY (1:20)
- SET (karli = 10, susi = 20, fritzi = 100)
-@end smallexample
-
-@item @r{@emph{Structure Mode}}
-The Structure mode is displayed by the keyword @code{STRUCT(<field
-list>)}. The @code{<field list>} consists of names and modes of fields
-of the structure. Variant structures have the keyword @code{CASE <field>
-OF <variant fields> ESAC} in their field list. Since the current version
-of the GNU Chill compiler doesn't implement tag processing (no runtime
-checks of variant fields, and therefore no debugging info), the output
-always displays all variant fields.
-@smallexample
-(@value{GDBP}) ptype str
-type = STRUCT (
- as x,
- bs x,
- CASE bs OF
- (karli):
- cs a
- (ott):
- ds x
- ESAC
-)
-@end smallexample
-@end table
-
-@node Locations
-@subsubsection Locations and their accesses
-
-A location in Chill is an object which can contain values.
-
-A value of a location is generally accessed by the (declared) name of
-the location. The output conforms to the specification of values in
-Chill programs. How values are specified
-is the topic of the next section, @ref{Values and their Operations}.
-
-The pseudo-location @code{RESULT} (or @code{result}) can be used to
-display or change the result of a currently-active procedure:
-
-@smallexample
-set result := EXPR
-@end smallexample
-
-@noindent
-This does the same as the Chill action @code{RESULT EXPR} (which
-is not available in @value{GDBN}).
-
-Values of reference mode locations are printed by @code{PTR(<hex
-value>)} in case of a free reference mode, and by @code{(REF <reference
-mode>) (<hex-value>)} in case of a bound reference. @code{<hex value>}
-represents the address where the reference points to. To access the
-value of the location referenced by the pointer, use the dereference
-operator @samp{->}.
-
-Values of procedure mode locations are displayed by
-@smallexample
-@code{@{ PROC
-(<argument modes> ) <return mode> @} <address> <name of procedure
-location>}
-@end smallexample
-@code{<argument modes>} is a list of modes according to the parameter
-specification of the procedure and @code{<address>} shows the address of
-the entry point.
-
-@ignore
-Locations of instance modes are displayed just like a structure with two
-fields specifying the @emph{process type} and the @emph{copy number} of
-the investigated instance location@footnote{This comes from the current
-implementation of instances. They are implemented as a structure (no
-na). The output should be something like @code{[<name of the process>;
-<instance number>]}.}. The field names are @code{__proc_type} and
-@code{__proc_copy}.
-
-Locations of synchronization modes are displayed like a structure with
-the field name @code{__event_data} in case of a event mode location, and
-like a structure with the field @code{__buffer_data} in case of a buffer
-mode location (refer to previous paragraph).
-
-Structure Mode locations are printed by @code{[.<field name>: <value>,
-...]}. The @code{<field name>} corresponds to the structure mode
-definition and the layout of @code{<value>} varies depending of the mode
-of the field. If the investigated structure mode location is of variant
-structure mode, the variant parts of the structure are enclosed in curled
-braces (@samp{@{@}}). Fields enclosed by @samp{@{,@}} are residing
-on the same memory location and represent the current values of the
-memory location in their specific modes. Since no tag processing is done
-all variants are displayed. A variant field is printed by
-@code{(<variant name>) = .<field name>: <value>}. (who implements the
-stuff ???)
-@smallexample
-(@value{GDBP}) print str1 $4 = [.as: 0, .bs: karli, .<TAG>: { (karli) =
-[.cs: []], (susi) = [.ds: susi]}]
-@end smallexample
-@end ignore
-
-Substructures of string mode-, array mode- or structure mode-values
-(e.g. array slices, fields of structure locations) are accessed using
-certain operations which are described in the next section, @ref{Values
-and their Operations}.
-
-A location value may be interpreted as having a different mode using the
-location conversion. This mode conversion is written as @code{<mode
-name>(<location>)}. The user has to consider that the sizes of the modes
-have to be equal otherwise an error occurs. Furthermore, no range
-checking of the location against the destination mode is performed, and
-therefore the result can be quite confusing.
-
-@smallexample
-(@value{GDBP}) print int (s(3 up 4)) XXX TO be filled in !! XXX
-@end smallexample
-
-@node Values and their Operations
-@subsubsection Values and their Operations
-
-Values are used to alter locations, to investigate complex structures in
-more detail or to filter relevant information out of a large amount of
-data. There are several (mode dependent) operations defined which enable
-such investigations. These operations are not only applicable to
-constant values but also to locations, which can become quite useful
-when debugging complex structures. During parsing the command line
-(e.g. evaluating an expression) @value{GDBN} treats location names as
-the values behind these locations.
-
-This section describes how values have to be specified and which
-operations are legal to be used with such values.
-
-@table @code
-@item Literal Values
-Literal values are specified in the same manner as in @sc{gnu} Chill programs.
-For detailed specification refer to the @sc{gnu} Chill implementation Manual
-chapter 1.5.
-@c FIXME: if the Chill Manual is a Texinfo documents, the above should
-@c be converted to a @ref.
-
-@ignore
-@itemize @bullet
-@item
-@emph{Integer Literals} are specified in the same manner as in Chill
-programs (refer to the Chill Standard z200/88 chpt 5.2.4.2)
-@item
-@emph{Boolean Literals} are defined by @code{TRUE} and @code{FALSE}.
-@item
-@emph{Character Literals} are defined by @code{'<character>'}. (e.g.
-@code{'M'})
-@item
-@emph{Set Literals} are defined by a name which was specified in a set
-mode. The value delivered by a Set Literal is the set value. This is
-comparable to an enumeration in C/C@t{++} language.
-@item
-@emph{Emptiness Literal} is predefined by @code{NULL}. The value of the
-emptiness literal delivers either the empty reference value, the empty
-procedure value or the empty instance value.
-
-@item
-@emph{Character String Literals} are defined by a sequence of characters
-enclosed in single- or double quotes. If a single- or double quote has
-to be part of the string literal it has to be stuffed (specified twice).
-@item
-@emph{Bitstring Literals} are specified in the same manner as in Chill
-programs (refer z200/88 chpt 5.2.4.8).
-@item
-@emph{Floating point literals} are specified in the same manner as in
-(gnu-)Chill programs (refer @sc{gnu} Chill implementation Manual chapter 1.5).
-@end itemize
-@end ignore
-
-@item Tuple Values
-A tuple is specified by @code{<mode name>[<tuple>]}, where @code{<mode
-name>} can be omitted if the mode of the tuple is unambiguous. This
-unambiguity is derived from the context of a evaluated expression.
-@code{<tuple>} can be one of the following:
-
-@itemize @bullet
-@item @emph{Powerset Tuple}
-@item @emph{Array Tuple}
-@item @emph{Structure Tuple}
-Powerset tuples, array tuples and structure tuples are specified in the
-same manner as in Chill programs refer to z200/88 chpt 5.2.5.
-@end itemize
-
-@item String Element Value
-A string element value is specified by
-@smallexample
-@code{<string value>(<index>)}
-@end smallexample
-where @code{<index>} is a integer expression. It delivers a character
-value which is equivalent to the character indexed by @code{<index>} in
-the string.
-
-@item String Slice Value
-A string slice value is specified by @code{<string value>(<slice
-spec>)}, where @code{<slice spec>} can be either a range of integer
-expressions or specified by @code{<start expr> up <size>}.
-@code{<size>} denotes the number of elements which the slice contains.
-The delivered value is a string value, which is part of the specified
-string.
-
-@item Array Element Values
-An array element value is specified by @code{<array value>(<expr>)} and
-delivers a array element value of the mode of the specified array.
-
-@item Array Slice Values
-An array slice is specified by @code{<array value>(<slice spec>)}, where
-@code{<slice spec>} can be either a range specified by expressions or by
-@code{<start expr> up <size>}. @code{<size>} denotes the number of
-arrayelements the slice contains. The delivered value is an array value
-which is part of the specified array.
-
-@item Structure Field Values
-A structure field value is derived by @code{<structure value>.<field
-name>}, where @code{<field name>} indicates the name of a field specified
-in the mode definition of the structure. The mode of the delivered value
-corresponds to this mode definition in the structure definition.
-
-@item Procedure Call Value
-The procedure call value is derived from the return value of the
-procedure@footnote{If a procedure call is used for instance in an
-expression, then this procedure is called with all its side
-effects. This can lead to confusing results if used carelessly.}.
-
-Values of duration mode locations are represented by @code{ULONG} literals.
-
-Values of time mode locations appear as
-@smallexample
-@code{TIME(<secs>:<nsecs>)}
-@end smallexample
-
-
-@ignore
-This is not implemented yet:
-@item Built-in Value
-@noindent
-The following built in functions are provided:
-
-@table @code
-@item @code{ADDR()}
-@item @code{NUM()}
-@item @code{PRED()}
-@item @code{SUCC()}
-@item @code{ABS()}
-@item @code{CARD()}
-@item @code{MAX()}
-@item @code{MIN()}
-@item @code{SIZE()}
-@item @code{UPPER()}
-@item @code{LOWER()}
-@item @code{LENGTH()}
-@item @code{SIN()}
-@item @code{COS()}
-@item @code{TAN()}
-@item @code{ARCSIN()}
-@item @code{ARCCOS()}
-@item @code{ARCTAN()}
-@item @code{EXP()}
-@item @code{LN()}
-@item @code{LOG()}
-@item @code{SQRT()}
-@end table
-
-For a detailed description refer to the GNU Chill implementation manual
-chapter 1.6.
-@end ignore
-
-@item Zero-adic Operator Value
-The zero-adic operator value is derived from the instance value for the
-current active process.
-
-@item Expression Values
-The value delivered by an expression is the result of the evaluation of
-the specified expression. If there are error conditions (mode
-incompatibility, etc.) the evaluation of expressions is aborted with a
-corresponding error message. Expressions may be parenthesised which
-causes the evaluation of this expression before any other expression
-which uses the result of the parenthesised expression. The following
-operators are supported by @value{GDBN}:
-
-@table @code
-@item @code{OR, ORIF, XOR}
-@itemx @code{AND, ANDIF}
-@itemx @code{NOT}
-Logical operators defined over operands of boolean mode.
-
-@item @code{=, /=}
-Equality and inequality operators defined over all modes.
-
-@item @code{>, >=}
-@itemx @code{<, <=}
-Relational operators defined over predefined modes.
-
-@item @code{+, -}
-@itemx @code{*, /, MOD, REM}
-Arithmetic operators defined over predefined modes.
-
-@item @code{-}
-Change sign operator.
-
-@item @code{//}
-String concatenation operator.
-
-@item @code{()}
-String repetition operator.
-
-@item @code{->}
-Referenced location operator which can be used either to take the
-address of a location (@code{->loc}), or to dereference a reference
-location (@code{loc->}).
-
-@item @code{OR, XOR}
-@itemx @code{AND}
-@itemx @code{NOT}
-Powerset and bitstring operators.
-
-@item @code{>, >=}
-@itemx @code{<, <=}
-Powerset inclusion operators.
-
-@item @code{IN}
-Membership operator.
-@end table
-@end table
-
-@node Chill type and range checks
-@subsubsection Chill type and range checks
-
-@value{GDBN} considers two Chill variables mode equivalent if the sizes
-of the two modes are equal. This rule applies recursively to more
-complex datatypes which means that complex modes are treated
-equivalent if all element modes (which also can be complex modes like
-structures, arrays, etc.) have the same size.
-
-Range checking is done on all mathematical operations, assignment, array
-index bounds and all built in procedures.
-
-Strong type checks are forced using the @value{GDBN} command @code{set
-check strong}. This enforces strong type and range checks on all
-operations where Chill constructs are used (expressions, built in
-functions, etc.) in respect to the semantics as defined in the z.200
-language specification.
-
-All checks can be disabled by the @value{GDBN} command @code{set check
-off}.
-
-@ignore
-@c Deviations from the Chill Standard Z200/88
-see last paragraph ?
-@end ignore
-
-@node Chill defaults
-@subsubsection Chill defaults
-
-If type and range checking are set automatically by @value{GDBN}, they
-both default to @code{on} whenever the working language changes to
-Chill. This happens regardless of whether you or @value{GDBN}
-selected the working language.
-
-If you allow @value{GDBN} to set the language automatically, then entering
-code compiled from a file whose name ends with @file{.ch} sets the
-working language to Chill. @xref{Automatically, ,Having @value{GDBN} set
-the language automatically}, for further details.
+@c OBSOLETE @node Chill
+@c OBSOLETE @subsection Chill
+@c OBSOLETE
+@c OBSOLETE The extensions made to @value{GDBN} to support Chill only support output
+@c OBSOLETE from the @sc{gnu} Chill compiler. Other Chill compilers are not currently
+@c OBSOLETE supported, and attempting to debug executables produced by them is most
+@c OBSOLETE likely to give an error as @value{GDBN} reads in the executable's symbol
+@c OBSOLETE table.
+@c OBSOLETE
+@c OBSOLETE @c This used to say "... following Chill related topics ...", but since
+@c OBSOLETE @c menus are not shown in the printed manual, it would look awkward.
+@c OBSOLETE This section covers the Chill related topics and the features
+@c OBSOLETE of @value{GDBN} which support these topics.
+@c OBSOLETE
+@c OBSOLETE @menu
+@c OBSOLETE * How modes are displayed:: How modes are displayed
+@c OBSOLETE * Locations:: Locations and their accesses
+@c OBSOLETE * Values and their Operations:: Values and their Operations
+@c OBSOLETE * Chill type and range checks::
+@c OBSOLETE * Chill defaults::
+@c OBSOLETE @end menu
+@c OBSOLETE
+@c OBSOLETE @node How modes are displayed
+@c OBSOLETE @subsubsection How modes are displayed
+@c OBSOLETE
+@c OBSOLETE The Chill Datatype- (Mode) support of @value{GDBN} is directly related
+@c OBSOLETE with the functionality of the @sc{gnu} Chill compiler, and therefore deviates
+@c OBSOLETE slightly from the standard specification of the Chill language. The
+@c OBSOLETE provided modes are:
+@c OBSOLETE
+@c OBSOLETE @c FIXME: this @table's contents effectively disable @code by using @r
+@c OBSOLETE @c on every @item. So why does it need @code?
+@c OBSOLETE @table @code
+@c OBSOLETE @item @r{@emph{Discrete modes:}}
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Integer Modes} which are predefined by @code{BYTE, UBYTE, INT,
+@c OBSOLETE UINT, LONG, ULONG},
+@c OBSOLETE @item
+@c OBSOLETE @emph{Boolean Mode} which is predefined by @code{BOOL},
+@c OBSOLETE @item
+@c OBSOLETE @emph{Character Mode} which is predefined by @code{CHAR},
+@c OBSOLETE @item
+@c OBSOLETE @emph{Set Mode} which is displayed by the keyword @code{SET}.
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) ptype x
+@c OBSOLETE type = SET (karli = 10, susi = 20, fritzi = 100)
+@c OBSOLETE @end smallexample
+@c OBSOLETE If the type is an unnumbered set the set element values are omitted.
+@c OBSOLETE @item
+@c OBSOLETE @emph{Range Mode} which is displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{type = <basemode>(<lower bound> : <upper bound>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE where @code{<lower bound>, <upper bound>} can be of any discrete literal
+@c OBSOLETE expression (e.g. set element names).
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Powerset Mode:}}
+@c OBSOLETE A Powerset Mode is displayed by the keyword @code{POWERSET} followed by
+@c OBSOLETE the member mode of the powerset. The member mode can be any discrete mode.
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) ptype x
+@c OBSOLETE type = POWERSET SET (egon, hugo, otto)
+@c OBSOLETE @end smallexample
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Reference Modes:}}
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Bound Reference Mode} which is displayed by the keyword @code{REF}
+@c OBSOLETE followed by the mode name to which the reference is bound.
+@c OBSOLETE @item
+@c OBSOLETE @emph{Free Reference Mode} which is displayed by the keyword @code{PTR}.
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Procedure mode}}
+@c OBSOLETE The procedure mode is displayed by @code{type = PROC(<parameter list>)
+@c OBSOLETE <return mode> EXCEPTIONS (<exception list>)}. The @code{<parameter
+@c OBSOLETE list>} is a list of the parameter modes. @code{<return mode>} indicates
+@c OBSOLETE the mode of the result of the procedure if any. The exceptionlist lists
+@c OBSOLETE all possible exceptions which can be raised by the procedure.
+@c OBSOLETE
+@c OBSOLETE @ignore
+@c OBSOLETE @item @r{@emph{Instance mode}}
+@c OBSOLETE The instance mode is represented by a structure, which has a static
+@c OBSOLETE type, and is therefore not really of interest.
+@c OBSOLETE @end ignore
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Synchronization Modes:}}
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Event Mode} which is displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{EVENT (<event length>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE where @code{(<event length>)} is optional.
+@c OBSOLETE @item
+@c OBSOLETE @emph{Buffer Mode} which is displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{BUFFER (<buffer length>)<buffer element mode>}
+@c OBSOLETE @end smallexample
+@c OBSOLETE where @code{(<buffer length>)} is optional.
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Timing Modes:}}
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Duration Mode} which is predefined by @code{DURATION}
+@c OBSOLETE @item
+@c OBSOLETE @emph{Absolute Time Mode} which is predefined by @code{TIME}
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Real Modes:}}
+@c OBSOLETE Real Modes are predefined with @code{REAL} and @code{LONG_REAL}.
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{String Modes:}}
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Character String Mode} which is displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{CHARS(<string length>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE followed by the keyword @code{VARYING} if the String Mode is a varying
+@c OBSOLETE mode
+@c OBSOLETE @item
+@c OBSOLETE @emph{Bit String Mode} which is displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{BOOLS(<string
+@c OBSOLETE length>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Array Mode:}}
+@c OBSOLETE The Array Mode is displayed by the keyword @code{ARRAY(<range>)}
+@c OBSOLETE followed by the element mode (which may in turn be an array mode).
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) ptype x
+@c OBSOLETE type = ARRAY (1:42)
+@c OBSOLETE ARRAY (1:20)
+@c OBSOLETE SET (karli = 10, susi = 20, fritzi = 100)
+@c OBSOLETE @end smallexample
+@c OBSOLETE
+@c OBSOLETE @item @r{@emph{Structure Mode}}
+@c OBSOLETE The Structure mode is displayed by the keyword @code{STRUCT(<field
+@c OBSOLETE list>)}. The @code{<field list>} consists of names and modes of fields
+@c OBSOLETE of the structure. Variant structures have the keyword @code{CASE <field>
+@c OBSOLETE OF <variant fields> ESAC} in their field list. Since the current version
+@c OBSOLETE of the GNU Chill compiler doesn't implement tag processing (no runtime
+@c OBSOLETE checks of variant fields, and therefore no debugging info), the output
+@c OBSOLETE always displays all variant fields.
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) ptype str
+@c OBSOLETE type = STRUCT (
+@c OBSOLETE as x,
+@c OBSOLETE bs x,
+@c OBSOLETE CASE bs OF
+@c OBSOLETE (karli):
+@c OBSOLETE cs a
+@c OBSOLETE (ott):
+@c OBSOLETE ds x
+@c OBSOLETE ESAC
+@c OBSOLETE )
+@c OBSOLETE @end smallexample
+@c OBSOLETE @end table
+@c OBSOLETE
+@c OBSOLETE @node Locations
+@c OBSOLETE @subsubsection Locations and their accesses
+@c OBSOLETE
+@c OBSOLETE A location in Chill is an object which can contain values.
+@c OBSOLETE
+@c OBSOLETE A value of a location is generally accessed by the (declared) name of
+@c OBSOLETE the location. The output conforms to the specification of values in
+@c OBSOLETE Chill programs. How values are specified
+@c OBSOLETE is the topic of the next section, @ref{Values and their Operations}.
+@c OBSOLETE
+@c OBSOLETE The pseudo-location @code{RESULT} (or @code{result}) can be used to
+@c OBSOLETE display or change the result of a currently-active procedure:
+@c OBSOLETE
+@c OBSOLETE @smallexample
+@c OBSOLETE set result := EXPR
+@c OBSOLETE @end smallexample
+@c OBSOLETE
+@c OBSOLETE @noindent
+@c OBSOLETE This does the same as the Chill action @code{RESULT EXPR} (which
+@c OBSOLETE is not available in @value{GDBN}).
+@c OBSOLETE
+@c OBSOLETE Values of reference mode locations are printed by @code{PTR(<hex
+@c OBSOLETE value>)} in case of a free reference mode, and by @code{(REF <reference
+@c OBSOLETE mode>) (<hex-value>)} in case of a bound reference. @code{<hex value>}
+@c OBSOLETE represents the address where the reference points to. To access the
+@c OBSOLETE value of the location referenced by the pointer, use the dereference
+@c OBSOLETE operator @samp{->}.
+@c OBSOLETE
+@c OBSOLETE Values of procedure mode locations are displayed by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{@{ PROC
+@c OBSOLETE (<argument modes> ) <return mode> @} <address> <name of procedure
+@c OBSOLETE location>}
+@c OBSOLETE @end smallexample
+@c OBSOLETE @code{<argument modes>} is a list of modes according to the parameter
+@c OBSOLETE specification of the procedure and @code{<address>} shows the address of
+@c OBSOLETE the entry point.
+@c OBSOLETE
+@c OBSOLETE @ignore
+@c OBSOLETE Locations of instance modes are displayed just like a structure with two
+@c OBSOLETE fields specifying the @emph{process type} and the @emph{copy number} of
+@c OBSOLETE the investigated instance location@footnote{This comes from the current
+@c OBSOLETE implementation of instances. They are implemented as a structure (no
+@c OBSOLETE na). The output should be something like @code{[<name of the process>;
+@c OBSOLETE <instance number>]}.}. The field names are @code{__proc_type} and
+@c OBSOLETE @code{__proc_copy}.
+@c OBSOLETE
+@c OBSOLETE Locations of synchronization modes are displayed like a structure with
+@c OBSOLETE the field name @code{__event_data} in case of a event mode location, and
+@c OBSOLETE like a structure with the field @code{__buffer_data} in case of a buffer
+@c OBSOLETE mode location (refer to previous paragraph).
+@c OBSOLETE
+@c OBSOLETE Structure Mode locations are printed by @code{[.<field name>: <value>,
+@c OBSOLETE ...]}. The @code{<field name>} corresponds to the structure mode
+@c OBSOLETE definition and the layout of @code{<value>} varies depending of the mode
+@c OBSOLETE of the field. If the investigated structure mode location is of variant
+@c OBSOLETE structure mode, the variant parts of the structure are enclosed in curled
+@c OBSOLETE braces (@samp{@{@}}). Fields enclosed by @samp{@{,@}} are residing
+@c OBSOLETE on the same memory location and represent the current values of the
+@c OBSOLETE memory location in their specific modes. Since no tag processing is done
+@c OBSOLETE all variants are displayed. A variant field is printed by
+@c OBSOLETE @code{(<variant name>) = .<field name>: <value>}. (who implements the
+@c OBSOLETE stuff ???)
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) print str1 $4 = [.as: 0, .bs: karli, .<TAG>: { (karli) =
+@c OBSOLETE [.cs: []], (susi) = [.ds: susi]}]
+@c OBSOLETE @end smallexample
+@c OBSOLETE @end ignore
+@c OBSOLETE
+@c OBSOLETE Substructures of string mode-, array mode- or structure mode-values
+@c OBSOLETE (e.g. array slices, fields of structure locations) are accessed using
+@c OBSOLETE certain operations which are described in the next section, @ref{Values
+@c OBSOLETE and their Operations}.
+@c OBSOLETE
+@c OBSOLETE A location value may be interpreted as having a different mode using the
+@c OBSOLETE location conversion. This mode conversion is written as @code{<mode
+@c OBSOLETE name>(<location>)}. The user has to consider that the sizes of the modes
+@c OBSOLETE have to be equal otherwise an error occurs. Furthermore, no range
+@c OBSOLETE checking of the location against the destination mode is performed, and
+@c OBSOLETE therefore the result can be quite confusing.
+@c OBSOLETE
+@c OBSOLETE @smallexample
+@c OBSOLETE (@value{GDBP}) print int (s(3 up 4)) XXX TO be filled in !! XXX
+@c OBSOLETE @end smallexample
+@c OBSOLETE
+@c OBSOLETE @node Values and their Operations
+@c OBSOLETE @subsubsection Values and their Operations
+@c OBSOLETE
+@c OBSOLETE Values are used to alter locations, to investigate complex structures in
+@c OBSOLETE more detail or to filter relevant information out of a large amount of
+@c OBSOLETE data. There are several (mode dependent) operations defined which enable
+@c OBSOLETE such investigations. These operations are not only applicable to
+@c OBSOLETE constant values but also to locations, which can become quite useful
+@c OBSOLETE when debugging complex structures. During parsing the command line
+@c OBSOLETE (e.g. evaluating an expression) @value{GDBN} treats location names as
+@c OBSOLETE the values behind these locations.
+@c OBSOLETE
+@c OBSOLETE This section describes how values have to be specified and which
+@c OBSOLETE operations are legal to be used with such values.
+@c OBSOLETE
+@c OBSOLETE @table @code
+@c OBSOLETE @item Literal Values
+@c OBSOLETE Literal values are specified in the same manner as in @sc{gnu} Chill programs.
+@c OBSOLETE For detailed specification refer to the @sc{gnu} Chill implementation Manual
+@c OBSOLETE chapter 1.5.
+@c OBSOLETE @c FIXME: if the Chill Manual is a Texinfo documents, the above should
+@c OBSOLETE @c be converted to a @ref.
+@c OBSOLETE
+@c OBSOLETE @ignore
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item
+@c OBSOLETE @emph{Integer Literals} are specified in the same manner as in Chill
+@c OBSOLETE programs (refer to the Chill Standard z200/88 chpt 5.2.4.2)
+@c OBSOLETE @item
+@c OBSOLETE @emph{Boolean Literals} are defined by @code{TRUE} and @code{FALSE}.
+@c OBSOLETE @item
+@c OBSOLETE @emph{Character Literals} are defined by @code{'<character>'}. (e.g.
+@c OBSOLETE @code{'M'})
+@c OBSOLETE @item
+@c OBSOLETE @emph{Set Literals} are defined by a name which was specified in a set
+@c OBSOLETE mode. The value delivered by a Set Literal is the set value. This is
+@c OBSOLETE comparable to an enumeration in C/C@t{++} language.
+@c OBSOLETE @item
+@c OBSOLETE @emph{Emptiness Literal} is predefined by @code{NULL}. The value of the
+@c OBSOLETE emptiness literal delivers either the empty reference value, the empty
+@c OBSOLETE procedure value or the empty instance value.
+@c OBSOLETE
+@c OBSOLETE @item
+@c OBSOLETE @emph{Character String Literals} are defined by a sequence of characters
+@c OBSOLETE enclosed in single- or double quotes. If a single- or double quote has
+@c OBSOLETE to be part of the string literal it has to be stuffed (specified twice).
+@c OBSOLETE @item
+@c OBSOLETE @emph{Bitstring Literals} are specified in the same manner as in Chill
+@c OBSOLETE programs (refer z200/88 chpt 5.2.4.8).
+@c OBSOLETE @item
+@c OBSOLETE @emph{Floating point literals} are specified in the same manner as in
+@c OBSOLETE (gnu-)Chill programs (refer @sc{gnu} Chill implementation Manual chapter 1.5).
+@c OBSOLETE @end itemize
+@c OBSOLETE @end ignore
+@c OBSOLETE
+@c OBSOLETE @item Tuple Values
+@c OBSOLETE A tuple is specified by @code{<mode name>[<tuple>]}, where @code{<mode
+@c OBSOLETE name>} can be omitted if the mode of the tuple is unambiguous. This
+@c OBSOLETE unambiguity is derived from the context of a evaluated expression.
+@c OBSOLETE @code{<tuple>} can be one of the following:
+@c OBSOLETE
+@c OBSOLETE @itemize @bullet
+@c OBSOLETE @item @emph{Powerset Tuple}
+@c OBSOLETE @item @emph{Array Tuple}
+@c OBSOLETE @item @emph{Structure Tuple}
+@c OBSOLETE Powerset tuples, array tuples and structure tuples are specified in the
+@c OBSOLETE same manner as in Chill programs refer to z200/88 chpt 5.2.5.
+@c OBSOLETE @end itemize
+@c OBSOLETE
+@c OBSOLETE @item String Element Value
+@c OBSOLETE A string element value is specified by
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{<string value>(<index>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE where @code{<index>} is a integer expression. It delivers a character
+@c OBSOLETE value which is equivalent to the character indexed by @code{<index>} in
+@c OBSOLETE the string.
+@c OBSOLETE
+@c OBSOLETE @item String Slice Value
+@c OBSOLETE A string slice value is specified by @code{<string value>(<slice
+@c OBSOLETE spec>)}, where @code{<slice spec>} can be either a range of integer
+@c OBSOLETE expressions or specified by @code{<start expr> up <size>}.
+@c OBSOLETE @code{<size>} denotes the number of elements which the slice contains.
+@c OBSOLETE The delivered value is a string value, which is part of the specified
+@c OBSOLETE string.
+@c OBSOLETE
+@c OBSOLETE @item Array Element Values
+@c OBSOLETE An array element value is specified by @code{<array value>(<expr>)} and
+@c OBSOLETE delivers a array element value of the mode of the specified array.
+@c OBSOLETE
+@c OBSOLETE @item Array Slice Values
+@c OBSOLETE An array slice is specified by @code{<array value>(<slice spec>)}, where
+@c OBSOLETE @code{<slice spec>} can be either a range specified by expressions or by
+@c OBSOLETE @code{<start expr> up <size>}. @code{<size>} denotes the number of
+@c OBSOLETE arrayelements the slice contains. The delivered value is an array value
+@c OBSOLETE which is part of the specified array.
+@c OBSOLETE
+@c OBSOLETE @item Structure Field Values
+@c OBSOLETE A structure field value is derived by @code{<structure value>.<field
+@c OBSOLETE name>}, where @code{<field name>} indicates the name of a field specified
+@c OBSOLETE in the mode definition of the structure. The mode of the delivered value
+@c OBSOLETE corresponds to this mode definition in the structure definition.
+@c OBSOLETE
+@c OBSOLETE @item Procedure Call Value
+@c OBSOLETE The procedure call value is derived from the return value of the
+@c OBSOLETE procedure@footnote{If a procedure call is used for instance in an
+@c OBSOLETE expression, then this procedure is called with all its side
+@c OBSOLETE effects. This can lead to confusing results if used carelessly.}.
+@c OBSOLETE
+@c OBSOLETE Values of duration mode locations are represented by @code{ULONG} literals.
+@c OBSOLETE
+@c OBSOLETE Values of time mode locations appear as
+@c OBSOLETE @smallexample
+@c OBSOLETE @code{TIME(<secs>:<nsecs>)}
+@c OBSOLETE @end smallexample
+@c OBSOLETE
+@c OBSOLETE
+@c OBSOLETE @ignore
+@c OBSOLETE This is not implemented yet:
+@c OBSOLETE @item Built-in Value
+@c OBSOLETE @noindent
+@c OBSOLETE The following built in functions are provided:
+@c OBSOLETE
+@c OBSOLETE @table @code
+@c OBSOLETE @item @code{ADDR()}
+@c OBSOLETE @item @code{NUM()}
+@c OBSOLETE @item @code{PRED()}
+@c OBSOLETE @item @code{SUCC()}
+@c OBSOLETE @item @code{ABS()}
+@c OBSOLETE @item @code{CARD()}
+@c OBSOLETE @item @code{MAX()}
+@c OBSOLETE @item @code{MIN()}
+@c OBSOLETE @item @code{SIZE()}
+@c OBSOLETE @item @code{UPPER()}
+@c OBSOLETE @item @code{LOWER()}
+@c OBSOLETE @item @code{LENGTH()}
+@c OBSOLETE @item @code{SIN()}
+@c OBSOLETE @item @code{COS()}
+@c OBSOLETE @item @code{TAN()}
+@c OBSOLETE @item @code{ARCSIN()}
+@c OBSOLETE @item @code{ARCCOS()}
+@c OBSOLETE @item @code{ARCTAN()}
+@c OBSOLETE @item @code{EXP()}
+@c OBSOLETE @item @code{LN()}
+@c OBSOLETE @item @code{LOG()}
+@c OBSOLETE @item @code{SQRT()}
+@c OBSOLETE @end table
+@c OBSOLETE
+@c OBSOLETE For a detailed description refer to the GNU Chill implementation manual
+@c OBSOLETE chapter 1.6.
+@c OBSOLETE @end ignore
+@c OBSOLETE
+@c OBSOLETE @item Zero-adic Operator Value
+@c OBSOLETE The zero-adic operator value is derived from the instance value for the
+@c OBSOLETE current active process.
+@c OBSOLETE
+@c OBSOLETE @item Expression Values
+@c OBSOLETE The value delivered by an expression is the result of the evaluation of
+@c OBSOLETE the specified expression. If there are error conditions (mode
+@c OBSOLETE incompatibility, etc.) the evaluation of expressions is aborted with a
+@c OBSOLETE corresponding error message. Expressions may be parenthesised which
+@c OBSOLETE causes the evaluation of this expression before any other expression
+@c OBSOLETE which uses the result of the parenthesised expression. The following
+@c OBSOLETE operators are supported by @value{GDBN}:
+@c OBSOLETE
+@c OBSOLETE @table @code
+@c OBSOLETE @item @code{OR, ORIF, XOR}
+@c OBSOLETE @itemx @code{AND, ANDIF}
+@c OBSOLETE @itemx @code{NOT}
+@c OBSOLETE Logical operators defined over operands of boolean mode.
+@c OBSOLETE
+@c OBSOLETE @item @code{=, /=}
+@c OBSOLETE Equality and inequality operators defined over all modes.
+@c OBSOLETE
+@c OBSOLETE @item @code{>, >=}
+@c OBSOLETE @itemx @code{<, <=}
+@c OBSOLETE Relational operators defined over predefined modes.
+@c OBSOLETE
+@c OBSOLETE @item @code{+, -}
+@c OBSOLETE @itemx @code{*, /, MOD, REM}
+@c OBSOLETE Arithmetic operators defined over predefined modes.
+@c OBSOLETE
+@c OBSOLETE @item @code{-}
+@c OBSOLETE Change sign operator.
+@c OBSOLETE
+@c OBSOLETE @item @code{//}
+@c OBSOLETE String concatenation operator.
+@c OBSOLETE
+@c OBSOLETE @item @code{()}
+@c OBSOLETE String repetition operator.
+@c OBSOLETE
+@c OBSOLETE @item @code{->}
+@c OBSOLETE Referenced location operator which can be used either to take the
+@c OBSOLETE address of a location (@code{->loc}), or to dereference a reference
+@c OBSOLETE location (@code{loc->}).
+@c OBSOLETE
+@c OBSOLETE @item @code{OR, XOR}
+@c OBSOLETE @itemx @code{AND}
+@c OBSOLETE @itemx @code{NOT}
+@c OBSOLETE Powerset and bitstring operators.
+@c OBSOLETE
+@c OBSOLETE @item @code{>, >=}
+@c OBSOLETE @itemx @code{<, <=}
+@c OBSOLETE Powerset inclusion operators.
+@c OBSOLETE
+@c OBSOLETE @item @code{IN}
+@c OBSOLETE Membership operator.
+@c OBSOLETE @end table
+@c OBSOLETE @end table
+@c OBSOLETE
+@c OBSOLETE @node Chill type and range checks
+@c OBSOLETE @subsubsection Chill type and range checks
+@c OBSOLETE
+@c OBSOLETE @value{GDBN} considers two Chill variables mode equivalent if the sizes
+@c OBSOLETE of the two modes are equal. This rule applies recursively to more
+@c OBSOLETE complex datatypes which means that complex modes are treated
+@c OBSOLETE equivalent if all element modes (which also can be complex modes like
+@c OBSOLETE structures, arrays, etc.) have the same size.
+@c OBSOLETE
+@c OBSOLETE Range checking is done on all mathematical operations, assignment, array
+@c OBSOLETE index bounds and all built in procedures.
+@c OBSOLETE
+@c OBSOLETE Strong type checks are forced using the @value{GDBN} command @code{set
+@c OBSOLETE check strong}. This enforces strong type and range checks on all
+@c OBSOLETE operations where Chill constructs are used (expressions, built in
+@c OBSOLETE functions, etc.) in respect to the semantics as defined in the z.200
+@c OBSOLETE language specification.
+@c OBSOLETE
+@c OBSOLETE All checks can be disabled by the @value{GDBN} command @code{set check
+@c OBSOLETE off}.
+@c OBSOLETE
+@c OBSOLETE @ignore
+@c OBSOLETE @c Deviations from the Chill Standard Z200/88
+@c OBSOLETE see last paragraph ?
+@c OBSOLETE @end ignore
+@c OBSOLETE
+@c OBSOLETE @node Chill defaults
+@c OBSOLETE @subsubsection Chill defaults
+@c OBSOLETE
+@c OBSOLETE If type and range checking are set automatically by @value{GDBN}, they
+@c OBSOLETE both default to @code{on} whenever the working language changes to
+@c OBSOLETE Chill. This happens regardless of whether you or @value{GDBN}
+@c OBSOLETE selected the working language.
+@c OBSOLETE
+@c OBSOLETE If you allow @value{GDBN} to set the language automatically, then entering
+@c OBSOLETE code compiled from a file whose name ends with @file{.ch} sets the
+@c OBSOLETE working language to Chill. @xref{Automatically, ,Having @value{GDBN} set
+@c OBSOLETE the language automatically}, for further details.
@node Symbols
@chapter Examining the Symbol Table
@@ -9020,9 +9041,25 @@ collect}.
@kindex info source
@item info source
-Show the name of the current source file---that is, the source file for
-the function containing the current point of execution---and the language
-it was written in.
+Show information about the current source file---that is, the source file for
+the function containing the current point of execution:
+@itemize @bullet
+@item
+the name of the source file, and the directory containing it,
+@item
+the directory it was compiled in,
+@item
+its length, in lines,
+@item
+which programming language it is written in,
+@item
+whether the executable includes debugging information for that file, and
+if so, what format the information is in (e.g., STABS, Dwarf 2, etc.), and
+@item
+whether the debugging information includes information about
+preprocessor macros.
+@end itemize
+
@kindex info sources
@item info sources
@@ -11289,7 +11326,7 @@ configurations.
* i960:: Intel i960
* M32R/D:: Mitsubishi M32R/D
* M68K:: Motorola M68K
-* M88K:: Motorola M88K
+@c OBSOLETE * M88K:: Motorola M88K
* MIPS Embedded:: MIPS Embedded
* PA:: HP PA Embedded
* PowerPC: PowerPC
@@ -11724,16 +11761,16 @@ ROMBUG ROM monitor for OS/9000.
@end table
-@node M88K
-@subsection M88K
-
-@table @code
-
-@kindex target bug
-@item target bug @var{dev}
-BUG monitor, running on a MVME187 (m88k) board.
-
-@end table
+@c OBSOLETE @node M88K
+@c OBSOLETE @subsection M88K
+@c OBSOLETE
+@c OBSOLETE @table @code
+@c OBSOLETE
+@c OBSOLETE @kindex target bug
+@c OBSOLETE @item target bug @var{dev}
+@c OBSOLETE BUG monitor, running on a MVME187 (m88k) board.
+@c OBSOLETE
+@c OBSOLETE @end table
@node MIPS Embedded
@subsection MIPS Embedded
@@ -12955,8 +12992,8 @@ Execute the command file @var{filename}.
@end table
The lines in a command file are executed sequentially. They are not
-printed as they are executed. An error in any command terminates execution
-of the command file.
+printed as they are executed. An error in any command terminates
+execution of the command file and control is returned to the console.
Commands that would ask for confirmation if used interactively proceed
without asking when used in a command file. Many @value{GDBN} commands that
@@ -14173,12 +14210,39 @@ Shared library events.
@end table
+@kindex maint print registers
+@kindex maint print raw-registers
+@kindex maint print cooked-registers
+@item maint print registers
+@itemx maint print raw-registers
+@itemx maint print cooked-registers
+Print @value{GDBN}'s internal register data structures.
+
+The command @samp{maint print raw-registers} includes the contents of
+the raw register cache; and the command @samp{maint print
+cooked-registers} includes the (cooked) value of all registers.
+@xref{Registers,, Registers, gdbint, @value{GDBN} Internals}.
+
+Takes an optional file parameter.
+
@end table
@node Remote Protocol
@appendix @value{GDBN} Remote Serial Protocol
+@menu
+* Overview::
+* Packets::
+* Stop Reply Packets::
+* General Query Packets::
+* Register Packet Format::
+* Examples::
+@end menu
+
+@node Overview
+@section Overview
+
There may be occasions when you need to know something about the
protocol---for example, if there is only one serial port to your target
machine, you might want your program to do something special if it
@@ -14241,8 +14305,9 @@ exception of @samp{#} and @samp{$} (see @samp{X} packet for additional
exceptions).
Fields within the packet should be separated using @samp{,} @samp{;} or
+@cindex remote protocol, field separator
@samp{:}. Except where otherwise noted all numbers are represented in
-HEX with leading zeros suppressed.
+@sc{hex} with leading zeros suppressed.
Implementors should note that prior to @value{GDBN} 5.0, the character
@samp{:} could not appear as the third character in a packet (as it
@@ -14279,166 +14344,179 @@ A stub is required to support the @samp{g}, @samp{G}, @samp{m}, @samp{M},
@samp{c}, and @samp{s} @var{command}s. All other @var{command}s are
optional.
-Below is a complete list of all currently defined @var{command}s and
-their corresponding response @var{data}:
-@page
-@multitable @columnfractions .30 .30 .40
-@item Packet
-@tab Request
-@tab Description
-
-@item extended mode
-@tab @code{!}
-@tab
+@node Packets
+@section Packets
+
+The following table provides a complete list of all currently defined
+@var{command}s and their corresponding response @var{data}.
+
+@table @r
+
+@item @code{!} --- extended mode
+@cindex @code{!} packet
+
Enable extended mode. In extended mode, the remote server is made
persistent. The @samp{R} packet is used to restart the program being
debugged.
-@item
-@tab reply @samp{OK}
-@tab
+
+Reply:
+@table @samp
+@item OK
The remote target both supports and has enabled extended mode.
+@end table
-@item last signal
-@tab @code{?}
-@tab
-Indicate the reason the target halted. The reply is the same as for step
-and continue.
-@item
-@tab reply
-@tab see below
+@item @code{?} --- last signal
+@cindex @code{?} packet
+Indicate the reason the target halted. The reply is the same as for
+step and continue.
-@item reserved
-@tab @code{a}
-@tab Reserved for future use
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item @code{a} --- reserved
+
+Reserved for future use.
+
+@item @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,@dots{}} --- set program arguments @strong{(reserved)}
+@cindex @code{A} packet
-@item set program arguments @strong{(reserved)}
-@tab @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,...}
-@tab
-@item
-@tab
-@tab
Initialized @samp{argv[]} array passed into program. @var{arglen}
specifies the number of bytes in the hex encoded byte stream @var{arg}.
-See @file{gdbserver} for more details.
-@item
-@tab reply @code{OK}
-@item
-@tab reply @code{E}@var{NN}
-
-@item set baud @strong{(deprecated)}
-@tab @code{b}@var{baud}
-@tab
-Change the serial line speed to @var{baud}. JTC: @emph{When does the
-transport layer state change? When it's received, or after the ACK is
-transmitted. In either case, there are problems if the command or the
-acknowledgment packet is dropped.} Stan: @emph{If people really wanted
-to add something like this, and get it working for the first time, they
-ought to modify ser-unix.c to send some kind of out-of-band message to a
-specially-setup stub and have the switch happen "in between" packets, so
-that from remote protocol's point of view, nothing actually
-happened.}
-
-@item set breakpoint @strong{(deprecated)}
-@tab @code{B}@var{addr},@var{mode}
-@tab
+See @code{gdbserver} for more details.
+
+Reply:
+@table @samp
+@item OK
+@item E@var{NN}
+@end table
+
+@item @code{b}@var{baud} --- set baud @strong{(deprecated)}
+@cindex @code{b} packet
+
+Change the serial line speed to @var{baud}.
+
+JTC: @emph{When does the transport layer state change? When it's
+received, or after the ACK is transmitted. In either case, there are
+problems if the command or the acknowledgment packet is dropped.}
+
+Stan: @emph{If people really wanted to add something like this, and get
+it working for the first time, they ought to modify ser-unix.c to send
+some kind of out-of-band message to a specially-setup stub and have the
+switch happen "in between" packets, so that from remote protocol's point
+of view, nothing actually happened.}
+
+@item @code{B}@var{addr},@var{mode} --- set breakpoint @strong{(deprecated)}
+@cindex @code{B} packet
+
Set (@var{mode} is @samp{S}) or clear (@var{mode} is @samp{C}) a
-breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z} and
-@samp{z} packets.}
+breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z}
+and @samp{z} packets.}
+
+@item @code{c}@var{addr} --- continue
+@cindex @code{c} packet
-@item continue
-@tab @code{c}@var{addr}
-@tab
-@var{addr} is address to resume. If @var{addr} is omitted, resume at
+@var{addr} is address to resume. If @var{addr} is omitted, resume at
current address.
-@item
-@tab reply
-@tab see below
-@item continue with signal
-@tab @code{C}@var{sig}@code{;}@var{addr}
-@tab
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item @code{C}@var{sig}@code{;}@var{addr} --- continue with signal
+@cindex @code{C} packet
+
Continue with signal @var{sig} (hex signal number). If
@code{;}@var{addr} is omitted, resume at same address.
-@item
-@tab reply
-@tab see below
-@item toggle debug @strong{(deprecated)}
-@tab @code{d}
-@tab
-toggle debug flag.
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
-@item detach
-@tab @code{D}
-@tab
-Detach @value{GDBN} from the remote system. Sent to the remote target before
-@value{GDBN} disconnects.
-@item
-@tab reply @emph{no response}
-@tab
+@item @code{d} --- toggle debug @strong{(deprecated)}
+@cindex @code{d} packet
+
+Toggle debug flag.
+
+@item @code{D} --- detach
+@cindex @code{D} packet
+
+Detach @value{GDBN} from the remote system. Sent to the remote target
+before @value{GDBN} disconnects.
+
+Reply:
+@table @samp
+@item @emph{no response}
@value{GDBN} does not check for any response after sending this packet.
+@end table
-@item reserved
-@tab @code{e}
-@tab Reserved for future use
+@item @code{e} --- reserved
-@item reserved
-@tab @code{E}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{f}
-@tab Reserved for future use
+@item @code{E} --- reserved
-@item reserved
-@tab @code{F}
-@tab Reserved for future use
+Reserved for future use.
-@item read registers
-@tab @code{g}
-@tab Read general registers.
-@item
-@tab reply @var{XX...}
-@tab
+@item @code{f} --- reserved
+
+Reserved for future use.
+
+@item @code{F} --- reserved
+
+Reserved for future use.
+
+@item @code{g} --- read registers
+@anchor{read registers packet}
+@cindex @code{g} packet
+
+Read general registers.
+
+Reply:
+@table @samp
+@item @var{XX@dots{}}
Each byte of register data is described by two hex digits. The bytes
with the register are transmitted in target byte order. The size of
each register and their position within the @samp{g} @var{packet} are
-determined by the @value{GDBN} internal macros @var{REGISTER_RAW_SIZE} and
-@var{REGISTER_NAME} macros. The specification of several standard
+determined by the @value{GDBN} internal macros @var{REGISTER_RAW_SIZE}
+and @var{REGISTER_NAME} macros. The specification of several standard
@code{g} packets is specified below.
-@item
-@tab @code{E}@var{NN}
-@tab for an error.
+@item E@var{NN}
+for an error.
+@end table
-@item write regs
-@tab @code{G}@var{XX...}
-@tab
-See @samp{g} for a description of the @var{XX...} data.
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab reply @code{E}@var{NN}
-@tab for an error
+@item @code{G}@var{XX@dots{}} --- write regs
+@cindex @code{G} packet
+
+@xref{read registers packet}, for a description of the @var{XX@dots{}}
+data.
+
+Reply:
+@table @samp
+@item OK
+for success
+@item E@var{NN}
+for an error
+@end table
+
+@item @code{h} --- reserved
+
+Reserved for future use.
-@item reserved
-@tab @code{h}
-@tab Reserved for future use
+@item @code{H}@var{c}@var{t@dots{}} --- set thread
+@cindex @code{H} packet
-@item set thread
-@tab @code{H}@var{c}@var{t...}
-@tab
Set thread for subsequent operations (@samp{m}, @samp{M}, @samp{g},
-@samp{G}, et.al.). @var{c} = @samp{c} for thread used in step and
-continue; @var{t...} can be -1 for all threads. @var{c} = @samp{g} for
-thread used in other operations. If zero, pick a thread, any thread.
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab reply @code{E}@var{NN}
-@tab for an error
+@samp{G}, et.al.). @var{c} depends on the operation to be performed: it
+should be @samp{c} for step and continue operations, @samp{g} for other
+operations. The thread designator @var{t@dots{}} may be -1, meaning all
+the threads, a thread number, or zero which means pick any thread.
+
+Reply:
+@table @samp
+@item OK
+for success
+@item E@var{NN}
+for an error
+@end table
@c FIXME: JTC:
@c 'H': How restrictive (or permissive) is the thread model. If a
@@ -14455,262 +14533,289 @@ thread used in other operations. If zero, pick a thread, any thread.
@c selected, sets the registers of the register block of
@c that thread; otherwise sets current registers.
-@item cycle step @strong{(draft)}
-@tab @code{i}@var{addr}@code{,}@var{nnn}
-@tab
+@item @code{i}@var{addr}@code{,}@var{nnn} --- cycle step @strong{(draft)}
+@anchor{cycle step packet}
+@cindex @code{i} packet
+
Step the remote target by a single clock cycle. If @code{,}@var{nnn} is
present, cycle step @var{nnn} cycles. If @var{addr} is present, cycle
step starting at that address.
-@item signal then cycle step @strong{(reserved)}
-@tab @code{I}
-@tab
-See @samp{i} and @samp{S} for likely syntax and semantics.
+@item @code{I} --- signal then cycle step @strong{(reserved)}
+@cindex @code{I} packet
+
+@xref{step with signal packet}. @xref{cycle step packet}.
-@item reserved
-@tab @code{j}
-@tab Reserved for future use
+@item @code{j} --- reserved
-@item reserved
-@tab @code{J}
-@tab Reserved for future use
+Reserved for future use.
+
+@item @code{J} --- reserved
+
+Reserved for future use.
+
+@item @code{k} --- kill request
+@cindex @code{k} packet
-@item kill request
-@tab @code{k}
-@tab
FIXME: @emph{There is no description of how to operate when a specific
-thread context has been selected (i.e.@: does 'k' kill only that thread?)}.
+thread context has been selected (i.e.@: does 'k' kill only that
+thread?)}.
+
+@item @code{K} --- reserved
+
+Reserved for future use.
+
+@item @code{l} --- reserved
-@item reserved
-@tab @code{l}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{L}
-@tab Reserved for future use
+@item @code{L} --- reserved
+
+Reserved for future use.
+
+@item @code{m}@var{addr}@code{,}@var{length} --- read memory
+@cindex @code{m} packet
-@item read memory
-@tab @code{m}@var{addr}@code{,}@var{length}
-@tab
Read @var{length} bytes of memory starting at address @var{addr}.
-Neither @value{GDBN} nor the stub assume that sized memory transfers are assumed
-using word alligned accesses. FIXME: @emph{A word aligned memory
+Neither @value{GDBN} nor the stub assume that sized memory transfers are
+assumed using word alligned accesses. FIXME: @emph{A word aligned memory
transfer mechanism is needed.}
-@item
-@tab reply @var{XX...}
-@tab
-@var{XX...} is mem contents. Can be fewer bytes than requested if able
-to read only part of the data. Neither @value{GDBN} nor the stub assume that
-sized memory transfers are assumed using word alligned accesses. FIXME:
-@emph{A word aligned memory transfer mechanism is needed.}
-@item
-@tab reply @code{E}@var{NN}
-@tab @var{NN} is errno
-@item write mem
-@tab @code{M}@var{addr},@var{length}@code{:}@var{XX...}
-@tab
+Reply:
+@table @samp
+@item @var{XX@dots{}}
+@var{XX@dots{}} is mem contents. Can be fewer bytes than requested if able
+to read only part of the data. Neither @value{GDBN} nor the stub assume
+that sized memory transfers are assumed using word alligned
+accesses. FIXME: @emph{A word aligned memory transfer mechanism is
+needed.}
+@item E@var{NN}
+@var{NN} is errno
+@end table
+
+@item @code{M}@var{addr},@var{length}@code{:}@var{XX@dots{}} --- write mem
+@cindex @code{M} packet
+
Write @var{length} bytes of memory starting at address @var{addr}.
-@var{XX...} is the data.
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab reply @code{E}@var{NN}
-@tab
+@var{XX@dots{}} is the data.
+
+Reply:
+@table @samp
+@item OK
+for success
+@item E@var{NN}
for an error (this includes the case where only part of the data was
written).
+@end table
-@item reserved
-@tab @code{n}
-@tab Reserved for future use
+@item @code{n} --- reserved
-@item reserved
-@tab @code{N}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{o}
-@tab Reserved for future use
+@item @code{N} --- reserved
-@item reserved
-@tab @code{O}
-@tab Reserved for future use
+Reserved for future use.
-@item read reg @strong{(reserved)}
-@tab @code{p}@var{n...}
-@tab
-See write register.
-@item
-@tab return @var{r....}
-@tab The hex encoded value of the register in target byte order.
+@item @code{o} --- reserved
+
+Reserved for future use.
+
+@item @code{O} --- reserved
+
+Reserved for future use.
+
+@item @code{p}@var{n@dots{}} --- read reg @strong{(reserved)}
+@cindex @code{p} packet
+
+@xref{write register packet}.
+
+Reply:
+@table @samp
+@item @var{r@dots{}.}
+The hex encoded value of the register in target byte order.
+@end table
-@item write reg
-@tab @code{P}@var{n...}@code{=}@var{r...}
-@tab
-Write register @var{n...} with value @var{r...}, which contains two hex
+@item @code{P}@var{n@dots{}}@code{=}@var{r@dots{}} --- write register
+@anchor{write register packet}
+@cindex @code{P} packet
+
+Write register @var{n@dots{}} with value @var{r@dots{}}, which contains two hex
digits for each byte in the register (target byte order).
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab reply @code{E}@var{NN}
-@tab for an error
-@item general query
-@tab @code{q}@var{query}
-@tab
-Request info about @var{query}. In general @value{GDBN} queries
-have a leading upper case letter. Custom vendor queries should use a
-company prefix (in lower case) ex: @samp{qfsf.var}. @var{query} may
-optionally be followed by a @samp{,} or @samp{;} separated list. Stubs
-must ensure that they match the full @var{query} name.
-@item
-@tab reply @code{XX...}
-@tab Hex encoded data from query. The reply can not be empty.
-@item
-@tab reply @code{E}@var{NN}
-@tab error reply
+Reply:
+@table @samp
+@item OK
+for success
+@item E@var{NN}
+for an error
+@end table
+
+@item @code{q}@var{query} --- general query
+@anchor{general query packet}
+@cindex @code{q} packet
+
+Request info about @var{query}. In general @value{GDBN} queries have a
+leading upper case letter. Custom vendor queries should use a company
+prefix (in lower case) ex: @samp{qfsf.var}. @var{query} may optionally
+be followed by a @samp{,} or @samp{;} separated list. Stubs must ensure
+that they match the full @var{query} name.
+
+Reply:
+@table @samp
+@item @var{XX@dots{}}
+Hex encoded data from query. The reply can not be empty.
+@item E@var{NN}
+error reply
@item
-@tab reply @samp{}
-@tab Indicating an unrecognized @var{query}.
+Indicating an unrecognized @var{query}.
+@end table
+
+@item @code{Q}@var{var}@code{=}@var{val} --- general set
+@cindex @code{Q} packet
+
+Set value of @var{var} to @var{val}.
+
+@xref{general query packet}, for a discussion of naming conventions.
-@item general set
-@tab @code{Q}@var{var}@code{=}@var{val}
-@tab
-Set value of @var{var} to @var{val}. See @samp{q} for a discussing of
-naming conventions.
+@item @code{r} --- reset @strong{(deprecated)}
+@cindex @code{r} packet
-@item reset @strong{(deprecated)}
-@tab @code{r}
-@tab
Reset the entire system.
-@item remote restart
-@tab @code{R}@var{XX}
-@tab
+@item @code{R}@var{XX} --- remote restart
+@cindex @code{R} packet
+
Restart the program being debugged. @var{XX}, while needed, is ignored.
This packet is only available in extended mode.
-@item
-@tab
-no reply
-@tab
+
+Reply:
+@table @samp
+@item @emph{no reply}
The @samp{R} packet has no reply.
+@end table
+
+@item @code{s}@var{addr} --- step
+@cindex @code{s} packet
-@item step
-@tab @code{s}@var{addr}
-@tab
@var{addr} is address to resume. If @var{addr} is omitted, resume at
same address.
-@item
-@tab reply
-@tab see below
-@item step with signal
-@tab @code{S}@var{sig}@code{;}@var{addr}
-@tab
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item @code{S}@var{sig}@code{;}@var{addr} --- step with signal
+@anchor{step with signal packet}
+@cindex @code{S} packet
+
Like @samp{C} but step not continue.
-@item
-@tab reply
-@tab see below
-@item search
-@tab @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM}
-@tab
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} --- search
+@cindex @code{t} packet
+
Search backwards starting at address @var{addr} for a match with pattern
-@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4
-bytes. @var{addr} must be at least 3 digits.
+@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4 bytes.
+@var{addr} must be at least 3 digits.
-@item thread alive
-@tab @code{T}@var{XX}
-@tab Find out if the thread XX is alive.
-@item
-@tab reply @code{OK}
-@tab thread is still alive
-@item
-@tab reply @code{E}@var{NN}
-@tab thread is dead
+@item @code{T}@var{XX} --- thread alive
+@cindex @code{T} packet
+
+Find out if the thread XX is alive.
+
+Reply:
+@table @samp
+@item OK
+thread is still alive
+@item E@var{NN}
+thread is dead
+@end table
+
+@item @code{u} --- reserved
+
+Reserved for future use.
+
+@item @code{U} --- reserved
+
+Reserved for future use.
+
+@item @code{v} --- reserved
+
+Reserved for future use.
+
+@item @code{V} --- reserved
+
+Reserved for future use.
-@item reserved
-@tab @code{u}
-@tab Reserved for future use
+@item @code{w} --- reserved
-@item reserved
-@tab @code{U}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{v}
-@tab Reserved for future use
+@item @code{W} --- reserved
-@item reserved
-@tab @code{V}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{w}
-@tab Reserved for future use
+@item @code{x} --- reserved
-@item reserved
-@tab @code{W}
-@tab Reserved for future use
+Reserved for future use.
-@item reserved
-@tab @code{x}
-@tab Reserved for future use
+@item @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX@dots{}} --- write mem (binary)
+@cindex @code{X} packet
-@item write mem (binary)
-@tab @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX...}
-@tab
-@var{addr} is address, @var{length} is number of bytes, @var{XX...} is
-binary data. The characters @code{$}, @code{#}, and @code{0x7d} are
+@var{addr} is address, @var{length} is number of bytes, @var{XX@dots{}}
+is binary data. The characters @code{$}, @code{#}, and @code{0x7d} are
escaped using @code{0x7d}.
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab reply @code{E}@var{NN}
-@tab for an error
-@item reserved
-@tab @code{y}
-@tab Reserved for future use
+Reply:
+@table @samp
+@item OK
+for success
+@item E@var{NN}
+for an error
+@end table
+
+@item @code{y} --- reserved
+
+Reserved for future use.
+
+@item @code{Y} reserved
+
+Reserved for future use.
-@item reserved
-@tab @code{Y}
-@tab Reserved for future use
+@item @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length} --- remove break or watchpoint @strong{(draft)}
+@cindex @code{z} packet
-@item remove break or watchpoint @strong{(draft)}
-@tab @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length}
-@tab
-See @samp{Z}.
+@xref{insert breakpoint or watchpoint packet}.
+
+@item @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length} --- insert break or watchpoint @strong{(draft)}
+@anchor{insert breakpoint or watchpoint packet}
+@cindex @code{Z} packet
-@item insert break or watchpoint @strong{(draft)}
-@tab @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length}
-@tab
@var{t} is type: @samp{0} - software breakpoint, @samp{1} - hardware
-breakpoint, @samp{2} - write watchpoint, @samp{3} - read watchpoint,
+breakpoint, @samp{2} --- write watchpoint, @samp{3} - read watchpoint,
@samp{4} - access watchpoint; @var{addr} is address; @var{length} is in
bytes. For a software breakpoint, @var{length} specifies the size of
the instruction to be patched. For hardware breakpoints and watchpoints
@var{length} specifies the memory region to be monitored. To avoid
potential problems with duplicate packets, the operations should be
implemented in an idempotent way.
-@item
-@tab reply @code{E}@var{NN}
-@tab for an error
-@item
-@tab reply @code{OK}
-@tab for success
-@item
-@tab @samp{}
-@tab If not supported.
-@item reserved
-@tab <other>
-@tab Reserved for future use
+Reply:
+@table @samp
+@item E@var{NN}
+for an error
+@item OK
+for success
+@item @samp{}
+If not supported.
+@end table
+
+@end table
-@end multitable
+@node Stop Reply Packets
+@section Stop Reply Packets
+@cindex stop reply packets
The @samp{C}, @samp{c}, @samp{S}, @samp{s} and @samp{?} packets can
receive any of the below as a reply. In the case of the @samp{C},
@@ -14719,282 +14824,259 @@ when the target halts. In the below the exact meaning of @samp{signal
number} is poorly defined. In general one of the UNIX signal numbering
conventions is used.
-@multitable @columnfractions .4 .6
+@table @samp
-@item @code{S}@var{AA}
-@tab @var{AA} is the signal number
+@item S@var{AA}
+@var{AA} is the signal number
@item @code{T}@var{AA}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}
-@tab
+@cindex @code{T} packet reply
+
@var{AA} = two hex digit signal number; @var{n...} = register number
(hex), @var{r...} = target byte ordered register contents, size defined
by @code{REGISTER_RAW_SIZE}; @var{n...} = @samp{thread}, @var{r...} =
-thread process ID, this is a hex integer; @var{n...} = other string not
-starting with valid hex digit. @value{GDBN} should ignore this
-@var{n...}, @var{r...} pair and go on to the next. This way we can
-extend the protocol.
+thread process ID, this is a hex integer; @var{n...} = (@samp{watch} |
+@samp{rwatch} | @samp{awatch}, @var{r...} = data address, this is a hex
+integer; @var{n...} = other string not starting with valid hex digit.
+@value{GDBN} should ignore this @var{n...}, @var{r...} pair and go on
+to the next. This way we can extend the protocol.
+
+@item W@var{AA}
-@item @code{W}@var{AA}
-@tab
The process exited, and @var{AA} is the exit status. This is only
-applicable for certains sorts of targets.
+applicable to certain targets.
+
+@item X@var{AA}
-@item @code{X}@var{AA}
-@tab
The process terminated with signal @var{AA}.
-@item @code{N}@var{AA}@code{;}@var{t...}@code{;}@var{d...}@code{;}@var{b...} @strong{(obsolete)}
-@tab
-@var{AA} = signal number; @var{t...} = address of symbol "_start";
-@var{d...} = base of data section; @var{b...} = base of bss section.
-@emph{Note: only used by Cisco Systems targets. The difference between
-this reply and the "qOffsets" query is that the 'N' packet may arrive
-spontaneously whereas the 'qOffsets' is a query initiated by the host
-debugger.}
+@item N@var{AA};@var{t@dots{}};@var{d@dots{}};@var{b@dots{}} @strong{(obsolete)}
-@item @code{O}@var{XX...}
-@tab
-@var{XX...} is hex encoding of @sc{ascii} data. This can happen at any time
-while the program is running and the debugger should continue to wait
-for 'W', 'T', etc.
+@var{AA} = signal number; @var{t@dots{}} = address of symbol
+@code{_start}; @var{d@dots{}} = base of data section; @var{b@dots{}} =
+base of bss section. @emph{Note: only used by Cisco Systems targets.
+The difference between this reply and the @samp{qOffsets} query is that
+the @samp{N} packet may arrive spontaneously whereas the @samp{qOffsets}
+is a query initiated by the host debugger.}
-@end multitable
+@item O@var{XX@dots{}}
+
+@var{XX@dots{}} is hex encoding of @sc{ascii} data. This can happen at
+any time while the program is running and the debugger should continue
+to wait for @samp{W}, @samp{T}, etc.
+
+@end table
+
+@node General Query Packets
+@section General Query Packets
The following set and query packets have already been defined.
-@multitable @columnfractions .2 .2 .6
+@table @r
-@item current thread
-@tab @code{q}@code{C}
-@tab Return the current thread id.
-@item
-@tab reply @code{QC}@var{pid}
-@tab
+@item @code{q}@code{C} --- current thread
+
+Return the current thread id.
+
+Reply:
+@table @samp
+@item @code{QC}@var{pid}
Where @var{pid} is a HEX encoded 16 bit process id.
-@item
-@tab reply *
-@tab Any other reply implies the old pid.
+@item *
+Any other reply implies the old pid.
+@end table
+
+@item @code{q}@code{fThreadInfo} -- all thread ids
+
+@code{q}@code{sThreadInfo}
-@item all thread ids
-@tab @code{q}@code{fThreadInfo}
-@item
-@tab @code{q}@code{sThreadInfo}
-@tab
Obtain a list of active thread ids from the target (OS). Since there
may be too many active threads to fit into one reply packet, this query
works iteratively: it may require more than one query/reply sequence to
obtain the entire list of threads. The first query of the sequence will
be the @code{qf}@code{ThreadInfo} query; subsequent queries in the
sequence will be the @code{qs}@code{ThreadInfo} query.
-@item
-@tab
-@tab NOTE: replaces the @code{qL} query (see below).
-@item
-@tab reply @code{m}@var{<id>}
-@tab A single thread id
-@item
-@tab reply @code{m}@var{<id>},@var{<id>...}
-@tab a comma-separated list of thread ids
-@item
-@tab reply @code{l}
-@tab (lower case 'el') denotes end of list.
-@item
-@tab
-@tab
-In response to each query, the target will reply with a list of one
-or more thread ids, in big-endian hex, separated by commas. GDB will
-respond to each reply with a request for more thread ids (using the
+
+NOTE: replaces the @code{qL} query (see below).
+
+Reply:
+@table @samp
+@item @code{m}@var{id}
+A single thread id
+@item @code{m}@var{id},@var{id}@dots{}
+a comma-separated list of thread ids
+@item @code{l}
+(lower case 'el') denotes end of list.
+@end table
+
+In response to each query, the target will reply with a list of one or
+more thread ids, in big-endian hex, separated by commas. @value{GDBN}
+will respond to each reply with a request for more thread ids (using the
@code{qs} form of the query), until the target responds with @code{l}
(lower-case el, for @code{'last'}).
-@item extra thread info
-@tab @code{q}@code{ThreadExtraInfo}@code{,}@var{id}
-@tab
-@item
-@tab
-@tab
-Where @var{<id>} is a thread-id in big-endian hex.
-Obtain a printable string description of a thread's attributes from
-the target OS. This string may contain anything that the target OS
-thinks is interesting for @value{GDBN} to tell the user about the thread.
-The string is displayed in @value{GDBN}'s @samp{info threads} display.
-Some examples of possible thread extra info strings are "Runnable", or
-"Blocked on Mutex".
-@item
-@tab reply @var{XX...}
-@tab
-Where @var{XX...} is a hex encoding of @sc{ascii} data, comprising the
-printable string containing the extra information about the thread's
+@item @code{q}@code{ThreadExtraInfo}@code{,}@var{id} --- extra thread info
+
+Where @var{id} is a thread-id in big-endian hex. Obtain a printable
+string description of a thread's attributes from the target OS. This
+string may contain anything that the target OS thinks is interesting for
+@value{GDBN} to tell the user about the thread. The string is displayed
+in @value{GDBN}'s @samp{info threads} display. Some examples of
+possible thread extra info strings are ``Runnable'', or ``Blocked on
+Mutex''.
+
+Reply:
+@table @samp
+@item @var{XX@dots{}}
+Where @var{XX@dots{}} is a hex encoding of @sc{ascii} data, comprising
+the printable string containing the extra information about the thread's
attributes.
+@end table
+
+@item @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread} --- query @var{LIST} or @var{threadLIST} @strong{(deprecated)}
-@item query @var{LIST} or @var{threadLIST} @strong{(deprecated)}
-@tab @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread}
-@tab
-@item
-@tab
-@tab
Obtain thread information from RTOS. Where: @var{startflag} (one hex
digit) is one to indicate the first query and zero to indicate a
subsequent query; @var{threadcount} (two hex digits) is the maximum
number of threads the response packet can contain; and @var{nextthread}
(eight hex digits), for subsequent queries (@var{startflag} is zero), is
returned in the response as @var{argthread}.
-@item
-@tab
-@tab NOTE: this query is replaced by the @code{q}@code{fThreadInfo}
-query (see above).
-@item
-@tab reply @code{q}@code{M}@var{count}@var{done}@var{argthread}@var{thread...}
-@tab
-@item
-@tab
-@tab
+
+NOTE: this query is replaced by the @code{q}@code{fThreadInfo} query
+(see above).
+
+Reply:
+@table @samp
+@item @code{q}@code{M}@var{count}@var{done}@var{argthread}@var{thread@dots{}}
Where: @var{count} (two hex digits) is the number of threads being
returned; @var{done} (one hex digit) is zero to indicate more threads
and one indicates no further threads; @var{argthreadid} (eight hex
-digits) is @var{nextthread} from the request packet; @var{thread...} is
-a sequence of thread IDs from the target. @var{threadid} (eight hex
+digits) is @var{nextthread} from the request packet; @var{thread@dots{}}
+is a sequence of thread IDs from the target. @var{threadid} (eight hex
digits). See @code{remote.c:parse_threadlist_response()}.
+@end table
-@item compute CRC of memory block
-@tab @code{q}@code{CRC:}@var{addr}@code{,}@var{length}
-@tab
-@item
-@tab reply @code{E}@var{NN}
-@tab An error (such as memory fault)
-@item
-@tab reply @code{C}@var{CRC32}
-@tab A 32 bit cyclic redundancy check of the specified memory region.
+@item @code{q}@code{CRC:}@var{addr}@code{,}@var{length} --- compute CRC of memory block
+
+Reply:
+@table @samp
+@item @code{E}@var{NN}
+An error (such as memory fault)
+@item @code{C}@var{CRC32}
+A 32 bit cyclic redundancy check of the specified memory region.
+@end table
+
+@item @code{q}@code{Offsets} --- query sect offs
-@item query sect offs
-@tab @code{q}@code{Offsets}
-@tab
Get section offsets that the target used when re-locating the downloaded
image. @emph{Note: while a @code{Bss} offset is included in the
response, @value{GDBN} ignores this and instead applies the @code{Data}
offset to the @code{Bss} section.}
-@item
-@tab reply @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz}
-@item thread info request
-@tab @code{q}@code{P}@var{mode}@var{threadid}
-@tab
-@item
-@tab
-@tab
+Reply:
+@table @samp
+@item @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz}
+@end table
+
+@item @code{q}@code{P}@var{mode}@var{threadid} --- thread info request
+
Returns information on @var{threadid}. Where: @var{mode} is a hex
encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID.
-@item
-@tab reply *
-@tab
+
+Reply:
+@table @samp
+@item *
+@end table
+
See @code{remote.c:remote_unpack_thread_info_response()}.
-@item remote command
-@tab @code{q}@code{Rcmd,}@var{COMMAND}
-@tab
-@item
-@tab
-@tab
-@var{COMMAND} (hex encoded) is passed to the local interpreter for
+@item @code{q}@code{Rcmd,}@var{command} --- remote command
+
+@var{command} (hex encoded) is passed to the local interpreter for
execution. Invalid commands should be reported using the output string.
Before the final result packet, the target may also respond with a
-number of intermediate @code{O}@var{OUTPUT} console output
-packets. @emph{Implementors should note that providing access to a
-stubs's interpreter may have security implications}.
-@item
-@tab reply @code{OK}
-@tab
+number of intermediate @code{O}@var{output} console output packets.
+@emph{Implementors should note that providing access to a stubs's
+interpreter may have security implications}.
+
+Reply:
+@table @samp
+@item OK
A command response with no output.
-@item
-@tab reply @var{OUTPUT}
-@tab
+@item @var{OUTPUT}
A command response with the hex encoded output string @var{OUTPUT}.
-@item
-@tab reply @code{E}@var{NN}
-@tab
+@item @code{E}@var{NN}
Indicate a badly formed request.
-
-@item
-@tab reply @samp{}
-@tab
+@item @samp{}
When @samp{q}@samp{Rcmd} is not recognized.
+@end table
+
+@item @code{qSymbol::} --- symbol lookup
-@item symbol lookup
-@tab @code{qSymbol::}
-@tab
Notify the target that @value{GDBN} is prepared to serve symbol lookup
requests. Accept requests from the target for the values of symbols.
-@item
-@tab
-@tab
-@item
-@tab reply @code{OK}
-@tab
+
+Reply:
+@table @samp
+@item @code{OK}
The target does not need to look up any (more) symbols.
-@item
-@tab reply @code{qSymbol:}@var{sym_name}
-@tab
-@sp 2
-@noindent
-The target requests the value of symbol @var{sym_name} (hex encoded).
-@value{GDBN} may provide the value by using the
-@code{qSymbol:}@var{sym_value}:@var{sym_name}
-message, described below.
-
-@item symbol value
-@tab @code{qSymbol:}@var{sym_value}:@var{sym_name}
-@tab
-@sp 1
-@noindent
-Set the value of SYM_NAME to SYM_VALUE.
-@item
-@tab
-@tab
-@var{sym_name} (hex encoded) is the name of a symbol whose value
-the target has previously requested.
-@item
-@tab
-@tab
-@var{sym_value} (hex) is the value for symbol @var{sym_name}.
-If @value{GDBN} cannot supply a value for @var{sym_name}, then this
-field will be empty.
-@item
-@tab reply @code{OK}
-@tab
+@item @code{qSymbol:}@var{sym_name}
+The target requests the value of symbol @var{sym_name} (hex encoded).
+@value{GDBN} may provide the value by using the
+@code{qSymbol:}@var{sym_value}:@var{sym_name} message, described below.
+@end table
+
+@item @code{qSymbol:}@var{sym_value}:@var{sym_name} --- symbol value
+
+Set the value of @var{sym_name} to @var{sym_value}.
+
+@var{sym_name} (hex encoded) is the name of a symbol whose value the
+target has previously requested.
+
+@var{sym_value} (hex) is the value for symbol @var{sym_name}. If
+@value{GDBN} cannot supply a value for @var{sym_name}, then this field
+will be empty.
+
+Reply:
+@table @samp
+@item @code{OK}
The target does not need to look up any (more) symbols.
-@item
-@tab reply @code{qSymbol:}@var{sym_name}
-@tab
-@sp 2
-@noindent
-The target requests the value of a new symbol @var{sym_name} (hex encoded).
-@value{GDBN} will continue to supply the values of symbols (if available),
-until the target ceases to request them.
+@item @code{qSymbol:}@var{sym_name}
+The target requests the value of a new symbol @var{sym_name} (hex
+encoded). @value{GDBN} will continue to supply the values of symbols
+(if available), until the target ceases to request them.
+@end table
+
+@end table
-@end multitable
+@node Register Packet Format
+@section Register Packet Format
The following @samp{g}/@samp{G} packets have previously been defined.
-In the below, some thirty-two bit registers are transferred as sixty-four
-bits. Those registers should be zero/sign extended (which?) to fill the
-space allocated. Register bytes are transfered in target byte order.
-The two nibbles within a register byte are transfered most-significant -
-least-significant.
+In the below, some thirty-two bit registers are transferred as
+sixty-four bits. Those registers should be zero/sign extended (which?)
+to fill the space allocated. Register bytes are transfered in target
+byte order. The two nibbles within a register byte are transfered
+most-significant - least-significant.
-@multitable @columnfractions .5 .5
+@table @r
@item MIPS32
-@tab
+
All registers are transfered as thirty-two bit quantities in the order:
32 general-purpose; sr; lo; hi; bad; cause; pc; 32 floating-point
registers; fsr; fir; fp.
@item MIPS64
-@tab
+
All registers are transfered as sixty-four bit quantities (including
thirty-two bit registers such as @code{sr}). The ordering is the same
as @code{MIPS32}.
-@end multitable
+@end table
+
+@node Examples
+@section Examples
Example sequence of a target being re-started. Notice how the restart
does not get any direct output:
@@ -15012,7 +15094,7 @@ does not get any direct output:
Example sequence of a target being stepped by a single instruction:
@smallexample
-<- @code{G1445...}
+<- @code{G1445@dots{}}
-> @code{+}
<- @code{s}
-> @code{+}
@@ -15021,7 +15103,7 @@ Example sequence of a target being stepped by a single instruction:
<- @code{+}
<- @code{g}
-> @code{+}
--> @code{1455...}
+-> @code{1455@dots{}}
<- @code{+}
@end smallexample
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 4f76f5fb524..a5f4de503ca 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -50,7 +50,7 @@ Software Foundation raise funds for GNU development.''
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001
+Copyright @copyright{} 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001, 2002
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -722,6 +722,14 @@ the main command list, and should be used for those commands. The usual
place to add commands is in the @code{_initialize_@var{xyz}} routines at
the ends of most source files.
+@findex add_setshow_cmd
+@findex add_setshow_cmd_full
+To add paired @samp{set} and @samp{show} commands, use
+@code{add_setshow_cmd} or @code{add_setshow_cmd_full}. The former is
+a slightly simpler interface which is useful when you don't need to
+further modify the new command structures, while the latter returns
+the new command structures for manipulation.
+
@cindex deprecating commands
@findex deprecate_cmd
Before removing commands from the command set it is a good idea to
@@ -946,7 +954,7 @@ be signaled.
This function first opens the tuple and then establishes a cleanup
(@pxref{Coding, Cleanups}) to close the tuple. It provides a convenient
and correct implementation of the non-portable@footnote{The function
-cast is not portable ISO-C.} code sequence:
+cast is not portable ISO C.} code sequence:
@smallexample
struct cleanup *old_cleanup;
ui_out_tuple_begin (uiout, "...");
@@ -1826,7 +1834,7 @@ The file @file{mdebugread.c} implements reading for this format.
DWARF 1 is a debugging format that was originally designed to be
used with ELF in SVR4 systems.
-@c CHILL_PRODUCER
+@c OBSOLETE CHILL_PRODUCER
@c GCC_PRODUCER
@c GPLUS_PRODUCER
@c LCC_PRODUCER
@@ -2386,6 +2394,14 @@ NetBSD using the ELF executable format
@item GDB_OSABI_WINCE
Windows CE
+@findex GDB_OSABI_GO32
+@item GDB_OSABI_GO32
+DJGPP
+
+@findex GDB_OSABI_NETWARE
+@item GDB_OSABI_NETWARE
+Novell NetWare
+
@findex GDB_OSABI_ARM_EABI_V1
@item GDB_OSABI_ARM_EABI_V1
ARM Embedded ABI version 1
@@ -3078,11 +3094,31 @@ library in which breakpoints cannot be set and so should be disabled.
@findex DO_REGISTERS_INFO
If defined, use this to print the value of a register or all registers.
+This method is deprecated.
+
@item PRINT_FLOAT_INFO()
-#findex PRINT_FLOAT_INFO
+@findex PRINT_FLOAT_INFO
If defined, then the @samp{info float} command will print information about
the processor's floating point unit.
+@item print_registers_info (@var{gdbarch}, @var{frame}, @var{regnum}, @var{all})
+@findex print_registers_info
+If defined, pretty print the value of the register @var{regnum} for the
+specified @var{frame}. If the value of @var{regnum} is -1, pretty print
+either all registers (@var{all} is non zero) or a select subset of
+registers (@var{all} is zero).
+
+The default method prints one register per line, and if @var{all} is
+zero omits floating-point registers.
+
+@item PRINT_VECTOR_INFO()
+@findex PRINT_VECTOR_INFO
+If defined, then the @samp{info vector} command will call this function
+to print information about the processor's vector unit.
+
+By default, the @samp{info vector} command will print all vector
+registers (the register's type having the vector attribute).
+
@item DWARF_REG_TO_REGNUM
@findex DWARF_REG_TO_REGNUM
Convert DWARF register number into @value{GDBN} regnum. If not defined,
@@ -3613,9 +3649,9 @@ for parameters/results have been allocated on the stack.
Define this to convert sdb register numbers into @value{GDBN} regnums. If not
defined, no conversion will be done.
-@item SHIFT_INST_REGS
-@findex SHIFT_INST_REGS
-(Only used for m88k targets.)
+@c OBSOLETE @item SHIFT_INST_REGS
+@c OBSOLETE @findex SHIFT_INST_REGS
+@c OBSOLETE (Only used for m88k targets.)
@item SKIP_PERMANENT_BREAKPOINT
@findex SKIP_PERMANENT_BREAKPOINT
@@ -3665,10 +3701,11 @@ delay slot. If a breakpoint has been placed in the instruction's delay
slot, @value{GDBN} will single-step over that instruction before resuming
normally. Currently only defined for the Mips.
-@item STORE_RETURN_VALUE (@var{type}, @var{valbuf})
+@item STORE_RETURN_VALUE (@var{type}, @var{regcache}, @var{valbuf})
@findex STORE_RETURN_VALUE
-A C expression that stores a function return value of type @var{type},
-where @var{valbuf} is the address of the value to be stored.
+A C expression that writes the function return value, found in
+@var{valbuf}, into the @var{regcache}. @var{type} is the type of the
+value that is to be returned.
@item SUN_FIXED_LBRAC_BUG
@findex SUN_FIXED_LBRAC_BUG
@@ -3885,6 +3922,168 @@ that just @code{#include}s @file{tm-@var{arch}.h} and
@file{config/tm-@var{os}.h}.
+@section Converting an existing Target Architecture to Multi-arch
+@cindex converting targets to multi-arch
+
+This section describes the current accepted best practice for converting
+an existing target architecture to the multi-arch framework.
+
+The process consists of generating, testing, posting and committing a
+sequence of patches. Each patch must contain a single change, for
+instance:
+
+@itemize @bullet
+
+@item
+Directly convert a group of functions into macros (the conversion does
+not change the behavior of any of the functions).
+
+@item
+Replace a non-multi-arch with a multi-arch mechanism (e.g.,
+@code{FRAME_INFO}).
+
+@item
+Enable multi-arch level one.
+
+@item
+Delete one or more files.
+
+@end itemize
+
+@noindent
+There isn't a size limit on a patch, however, a developer is strongly
+encouraged to keep the patch size down.
+
+Since each patch is well defined, and since each change has been tested
+and shows no regressions, the patches are considered @emph{fairly}
+obvious. Such patches, when submitted by developers listed in the
+@file{MAINTAINERS} file, do not need approval. Occasional steps in the
+process may be more complicated and less clear. The developer is
+expected to use their judgment and is encouraged to seek advice as
+needed.
+
+@subsection Preparation
+
+The first step is to establish control. Build (with @option{-Werror}
+enabled) and test the target so that there is a baseline against which
+the debugger can be compared.
+
+At no stage can the test results regress or @value{GDBN} stop compiling
+with @option{-Werror}.
+
+@subsection Add the multi-arch initialization code
+
+The objective of this step is to establish the basic multi-arch
+framework. It involves
+
+@itemize @bullet
+
+@item
+The addition of a @code{@var{arch}_gdbarch_init} function@footnote{The
+above is from the original example and uses K&R C. @value{GDBN}
+has since converted to ISO C but lets ignore that.} that creates
+the architecture:
+@smallexample
+static struct gdbarch *
+d10v_gdbarch_init (info, arches)
+ struct gdbarch_info info;
+ struct gdbarch_list *arches;
+@{
+ struct gdbarch *gdbarch;
+ /* there is only one d10v architecture */
+ if (arches != NULL)
+ return arches->gdbarch;
+ gdbarch = gdbarch_alloc (&info, NULL);
+ return gdbarch;
+@}
+@end smallexample
+@noindent
+@emph{}
+
+@item
+A per-architecture dump function to print any architecture specific
+information:
+@smallexample
+static void
+mips_dump_tdep (struct gdbarch *current_gdbarch,
+ struct ui_file *file)
+@{
+ @dots{} code to print architecture specific info @dots{}
+@}
+@end smallexample
+
+@item
+A change to @code{_initialize_@var{arch}_tdep} to register this new
+architecture:
+@smallexample
+void
+_initialize_mips_tdep (void)
+@{
+ gdbarch_register (bfd_arch_mips, mips_gdbarch_init,
+ mips_dump_tdep);
+@end smallexample
+
+@item
+Add the macro @code{GDB_MULTI_ARCH}, defined as 0 (zero), to the file@*
+@file{config/@var{arch}/tm-@var{arch}.h}.
+
+@end itemize
+
+@subsection Update multi-arch incompatible mechanisms
+
+Some mechanisms do not work with multi-arch. They include:
+
+@table @code
+@item EXTRA_FRAME_INFO
+Delete.
+@item FRAME_FIND_SAVED_REGS
+Replaced with @code{FRAME_INIT_SAVED_REGS}
+@end table
+
+@noindent
+At this stage you could also consider converting the macros into
+functions.
+
+@subsection Prepare for multi-arch level to one
+
+Temporally set @code{GDB_MULTI_ARCH} to @code{GDB_MULTI_ARCH_PARTIAL}
+and then build and start @value{GDBN} (the change should not be
+committed). @value{GDBN} may not build, and once built, it may die with
+an internal error listing the architecture methods that must be
+provided.
+
+Fix any build problems (patch(es)).
+
+Convert all the architecture methods listed, which are only macros, into
+functions (patch(es)).
+
+Update @code{@var{arch}_gdbarch_init} to set all the missing
+architecture methods and wrap the corresponding macros in @code{#if
+!GDB_MULTI_ARCH} (patch(es)).
+
+@subsection Set multi-arch level one
+
+Change the value of @code{GDB_MULTI_ARCH} to GDB_MULTI_ARCH_PARTIAL (a
+single patch).
+
+Any problems with throwing ``the switch'' should have been fixed
+already.
+
+@subsection Convert remaining macros
+
+Suggest converting macros into functions (and setting the corresponding
+architecture method) in small batches.
+
+@subsection Set multi-arch level to two
+
+This should go smoothly.
+
+@subsection Delete the TM file
+
+The @file{tm-@var{arch}.h} can be deleted. @file{@var{arch}.mt} and
+@file{configure.in} updated.
+
+
@node Target Vector Definition
@chapter Target Vector Definition
@@ -4446,6 +4645,143 @@ interruption must be on the cleanup chain before you call these
functions, since they might never return to your code (they
@samp{longjmp} instead).
+@section Per-architecture module data
+@cindex per-architecture module data
+@cindex multi-arch data
+@cindex data-pointer, per-architecture/per-module
+
+The multi-arch framework includes a mechanism for adding module specific
+per-architecture data-pointers to the @code{struct gdbarch} architecture
+object.
+
+A module registers one or more per-architecture data-pointers using the
+function @code{register_gdbarch_data}:
+
+@deftypefun struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *@var{init}, gdbarch_data_free_ftype *@var{free})
+
+The @var{init} function is used to obtain an initial value for a
+per-architecture data-pointer. The function is called, after the
+architecture has been created, when the data-pointer is still
+uninitialized (@code{NULL}) and its value has been requested via a call
+to @code{gdbarch_data}. A data-pointer can also be initialize
+explicitly using @code{set_gdbarch_data}.
+
+The @var{free} function is called when a data-pointer needs to be
+destroyed. This occurs when either the corresponding @code{struct
+gdbarch} object is being destroyed or when @code{set_gdbarch_data} is
+overriding a non-@code{NULL} data-pointer value.
+
+The function @code{register_gdbarch_data} returns a @code{struct
+gdbarch_data} that is used to identify the data-pointer that was added
+to the module.
+
+@end deftypefun
+
+A typical module has @code{init} and @code{free} functions of the form:
+
+@smallexample
+static struct gdbarch_data *nozel_handle;
+static void *
+nozel_init (struct gdbarch *gdbarch)
+@{
+ struct nozel *data = XMALLOC (struct nozel);
+ @dots{}
+ return data;
+@}
+@dots{}
+static void
+nozel_free (struct gdbarch *gdbarch, void *data)
+@{
+ xfree (data);
+@}
+@end smallexample
+
+Since uninitialized (@code{NULL}) data-pointers are initialized
+on-demand, an @code{init} function is free to call other modules that
+use data-pointers. Those modules data-pointers will be initialized as
+needed. Care should be taken to ensure that the @code{init} call graph
+does not contain cycles.
+
+The data-pointer is registered with the call:
+
+@smallexample
+void
+_initialize_nozel (void)
+@{
+ nozel_handle = register_gdbarch_data (nozel_init, nozel_free);
+@dots{}
+@end smallexample
+
+The per-architecture data-pointer is accessed using the function:
+
+@deftypefun void *gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *@var{data_handle})
+Given the architecture @var{arch} and module data handle
+@var{data_handle} (returned by @code{register_gdbarch_data}, this
+function returns the current value of the per-architecture data-pointer.
+@end deftypefun
+
+The non-@code{NULL} data-pointer returned by @code{gdbarch_data} should
+be saved in a local variable and then used directly:
+
+@smallexample
+int
+nozel_total (struct gdbarch *gdbarch)
+@{
+ int total;
+ struct nozel *data = gdbarch_data (gdbarch, nozel_handle);
+ @dots{}
+ return total;
+@}
+@end smallexample
+
+It is also possible to directly initialize the data-pointer using:
+
+@deftypefun void set_gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *handle, void *@var{pointer})
+Update the data-pointer corresponding to @var{handle} with the value of
+@var{pointer}. If the previous data-pointer value is non-NULL, then it
+is freed using data-pointers @var{free} function.
+@end deftypefun
+
+This function is used by modules that require a mechanism for explicitly
+setting the per-architecture data-pointer during architecture creation:
+
+@smallexample
+/* Called during architecture creation. */
+extern void
+set_gdbarch_nozel (struct gdbarch *gdbarch,
+ int total)
+@{
+ struct nozel *data = XMALLOC (struct nozel);
+ @dots{}
+ set_gdbarch_data (gdbarch, nozel_handle, nozel);
+@}
+@end smallexample
+
+@smallexample
+/* Default, called when nozel not set by set_gdbarch_nozel(). */
+static void *
+nozel_init (struct gdbarch *gdbarch)
+@{
+ struct nozel *default_nozel = XMALLOC (struc nozel);
+ @dots{}
+ return default_nozel;
+@}
+@end smallexample
+
+@smallexample
+void
+_initialize_nozel (void)
+@{
+ nozel_handle = register_gdbarch_data (nozel_init, NULL);
+ @dots{}
+@end smallexample
+
+@noindent
+Note that an @code{init} function still needs to be registered. It is
+used to initialize the data-pointer when the architecture creation phase
+fail to set an initial value.
+
+
@section Wrapping Output Lines
@cindex line wrap in output
@@ -4486,11 +4822,12 @@ but does not require it, @value{GDBN} requires it.
@value{GDBN}, as described in the following sections.
-@subsection ISO-C
+@subsection ISO C
-@value{GDBN} assumes an ISO-C compliant compiler.
+@value{GDBN} assumes an ISO/IEC 9899:1990 (a.k.a.@: ISO C90) compliant
+compiler.
-@value{GDBN} does not assume an ISO-C or POSIX compliant C library.
+@value{GDBN} does not assume an ISO C or POSIX compliant C library.
@subsection Memory Management
@@ -4749,19 +5086,30 @@ For other files @samp{-} is used as the separator.
@subsection Include Files
-All @file{.c} files should include @file{defs.h} first.
+A @file{.c} file should include @file{defs.h} first.
+
+A @file{.c} file should directly include the @code{.h} file of every
+declaration and/or definition it directly refers to. It cannot rely on
+indirect inclusion.
+
+A @file{.h} file should directly include the @code{.h} file of every
+declaration and/or definition it directly refers to. It cannot rely on
+indirect inclusion. Exception: The file @file{defs.h} does not need to
+be directly included.
-All @file{.c} files should explicitly include the headers for any
-declarations they refer to. They should not rely on files being
-included indirectly.
+An external declaration should only appear in one include file.
-With the exception of the global definitions supplied by @file{defs.h},
-a header file should explicitly include the header declaring any
-@code{typedefs} et.al.@: it refers to.
+An external declaration should never appear in a @code{.c} file.
+Exception: a declaration for the @code{_initialize} function that
+pacifies @option{-Wmissing-declaration}.
-@code{extern} declarations should never appear in @code{.c} files.
+A @code{typedef} definition should only appear in one include file.
-All include files should be wrapped in:
+An opaque @code{struct} declaration can appear in multiple @file{.h}
+files. Where possible, a @file{.h} file should use an opaque
+@code{struct} declaration instead of an include.
+
+All @file{.h} files should be wrapped in:
@smallexample
#ifndef INCLUDE_FILE_NAME_H
@@ -5158,41 +5506,50 @@ This means that changes such as adding a new architectures or (within
reason) support for a new host are considered acceptable.}
-@section Obsolete any code
+@section Obsoleting code
Before anything else, poke the other developers (and around the source
code) to see if there is anything that can be removed from @value{GDBN}
(an old target, an unused file).
Obsolete code is identified by adding an @code{OBSOLETE} prefix to every
-line. Doing this means that it is easy to identify obsolete code when
-grepping through the sources.
+line. Doing this means that it is easy to identify something that has
+been obsoleted when greping through the sources.
-The process has a number of steps and is intentionally slow --- this is
-to mainly ensure that people have had a reasonable chance to respond.
-Remember, everything on the internet takes a week.
+The process is done in stages --- this is mainly to ensure that the
+wider @value{GDBN} community has a reasonable opportunity to respond.
+Remember, everything on the Internet takes a week.
-@itemize @bullet
+@enumerate
@item
-announce the change on @email{gdb@@sources.redhat.com, GDB mailing list}
+Post the proposal on @email{gdb@@sources.redhat.com, the GDB mailing
+list} Creating a bug report to track the task's state, is also highly
+recommended.
@item
-wait a week or so
+Wait a week or so.
@item
-announce the change on @email{gdb-announce@@sources.redhat.com, GDB
-Announcement mailing list}
+Post the proposal on @email{gdb-announce@@sources.redhat.com, the GDB
+Announcement mailing list}.
@item
-wait a week or so
+Wait a week or so.
@item
-go through and edit all relevant files and lines (e.g., in
-@file{configure.tgt}) so that they are prefixed with the word
-@code{OBSOLETE}.
-@end itemize
+Go through and edit all relevant files and lines so that they are
+prefixed with the word @code{OBSOLETE}.
+@item
+Wait until the next GDB version, containing this obsolete code, has been
+released.
+@item
+Remove the obsolete code.
+@end enumerate
+
+@noindent
+@emph{Maintainer note: While removing old code is regrettable it is
+hopefully better for @value{GDBN}'s long term development. Firstly it
+helps the developers by removing code that is either no longer relevant
+or simply wrong. Secondly since it removes any history associated with
+the file (effectively clearing the slate) the developer has a much freer
+hand when it comes to fixing broken files.}
-@emph{Maintainer note: Removing old code, while regrettable, is a good
-thing. Firstly it helps the developers by removing code that is either
-no longer relevant or simply wrong. Secondly since it removes any
-history associated with the file (effectively clearing the slate) the
-developer has a much freer hand when it comes to fixing broken files.}
@section Before the Branch
@@ -5246,38 +5603,142 @@ Close anything obviously fixed.
The targets are listed in @file{gdb/MAINTAINERS}.
-@section Cut the branch
+@section Cut the Branch
-@subheading The dirty work
-
-I think something like the below was used:
+@subheading Create the branch
@smallexample
-$ d=`date -u +%Y-%m-%d`
-$ echo $d
-2002-01-24
-$ cvs -f -d /cvs/src rtag -D $d-gmt \
-gdb_5_1-$d-branchpoint insight+dejagnu
-$ cvs -f -d /cvs/src rtag -b -r gdb_V_V-$d-branchpoint \
-gdb_5_1-$d-branch insight+dejagnu
+$ u=5.1
+$ v=5.2
+$ V=`echo $v | sed 's/\./_/g'`
+$ D=`date -u +%Y-%m-%d`
+$ echo $u $V $D
+5.1 5_2 2002-03-03
+$ echo cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
+-D $D-gmt gdb_$V-$D-branchpoint insight+dejagnu
+cvs -f -d :ext:sources.redhat.com:/cvs/src rtag
+-D 2002-03-03-gmt gdb_5_2-2002-03-03-branchpoint insight+dejagnu
+$ ^echo ^^
+...
+$ echo cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
+-b -r gdb_$V-$D-branchpoint gdb_$V-branch insight+dejagnu
+cvs -f -d :ext:sources.redhat.com:/cvs/src rtag \
+-b -r gdb_5_2-2002-03-03-branchpoint gdb_5_2-branch insight+dejagnu
+$ ^echo ^^
+...
$
@end smallexample
@itemize @bullet
@item
-the @kbd{-D YYYY-MM-DD-gmt} forces the branch to an exact date/time.
+by using @kbd{-D YYYY-MM-DD-gmt} the branch is forced to an exact
+date/time.
@item
-the trunk is first tagged so that the branch point can easily be found
+the trunk is first taged so that the branch point can easily be found
@item
-Insight (which includes GDB) and dejagnu are tagged at the same time
+Insight (which includes GDB) and dejagnu are all tagged at the same time
+@item
+@file{version.in} gets bumped to avoid version number conflicts
+@item
+the reading of @file{.cvsrc} is disabled using @file{-f}
+@end itemize
+
+@subheading Update @file{version.in}
+
+@smallexample
+$ u=5.1
+$ v=5.2
+$ V=`echo $v | sed 's/\./_/g'`
+$ echo $u $v$V
+5.1 5_2
+$ cd /tmp
+$ echo cvs -f -d :ext:sources.redhat.com:/cvs/src co \
+-r gdb_$V-branch src/gdb/version.in
+cvs -f -d :ext:sources.redhat.com:/cvs/src co
+ -r gdb_5_2-branch src/gdb/version.in
+$ ^echo ^^
+U src/gdb/version.in
+$ cd src/gdb
+$ echo $u.90-0000-00-00-cvs > version.in
+$ cat version.in
+5.1.90-0000-00-00-cvs
+$ cvs -f commit version.in
+@end smallexample
+
+@itemize @bullet
+@item
+@file{0000-00-00} is used as a date to pump prime the version.in update
+mechanism
+@item
+@file{.90} and the previous branch version are used as fairly arbitrary
+initial branch version number
@end itemize
-@subheading Post the branch info
@subheading Update the web and news pages
+Something?
+
@subheading Tweak cron to track the new branch
+The file @file{gdbadmin/cron/crontab} contains gdbadmin's cron table.
+This file needs to be updated so that:
+
+@itemize @bullet
+@item
+a daily timestamp is added to the file @file{version.in}
+@item
+the new branch is included in the snapshot process
+@end itemize
+
+@noindent
+See the file @file{gdbadmin/cron/README} for how to install the updated
+cron table.
+
+The file @file{gdbadmin/ss/README} should also be reviewed to reflect
+any changes. That file is copied to both the branch/ and current/
+snapshot directories.
+
+
+@subheading Update the NEWS and README files
+
+The @file{NEWS} file needs to be updated so that on the branch it refers
+to @emph{changes in the current release} while on the trunk it also
+refers to @emph{changes since the current release}.
+
+The @file{README} file needs to be updated so that it refers to the
+current release.
+
+@subheading Post the branch info
+
+Send an announcement to the mailing lists:
+
+@itemize @bullet
+@item
+@email{gdb-announce@@sources.redhat.com, GDB Announcement mailing list}
+@item
+@email{gdb@@sources.redhat.com, GDB Discsussion mailing list} and
+@email{gdb-testers@@sources.redhat.com, GDB Discsussion mailing list}
+@end itemize
+
+@emph{Pragmatics: The branch creation is sent to the announce list to
+ensure that people people not subscribed to the higher volume discussion
+list are alerted.}
+
+The announcement should include:
+
+@itemize @bullet
+@item
+the branch tag
+@item
+how to check out the branch using CVS
+@item
+the date/number of weeks until the release
+@item
+the branch commit policy
+still holds.
+@end itemize
+
@section Stabilize the branch
Something goes here.
@@ -5325,7 +5786,8 @@ Notes:
@itemize @bullet
@item
Check the @code{autoconf} version carefully. You want to be using the
-version taken from the @file{binutils} snapshot directory. It is very
+version taken from the @file{binutils} snapshot directory, which can be
+found at @uref{ftp://sources.redhat.com/pub/binutils/}. It is very
unlikely that a system installed version of @code{autoconf} (e.g.,
@file{/usr/bin/autoconf}) is correct.
@end itemize
diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo
index 52b88b47ff7..6b4c3dc4d45 100644
--- a/gdb/doc/stabs.texinfo
+++ b/gdb/doc/stabs.texinfo
@@ -1754,7 +1754,8 @@ Pascal set type. @var{type-information} must be a small type such as an
enumeration or a subrange, and the type is a bitmask whose length is
specified by the number of elements in @var{type-information}.
-In CHILL, if it is a bitstring instead of a set, also use the @samp{S}
+In CHILL, @c OBSOLETE
+if it is a bitstring instead of a set, also use the @samp{S}
type attribute (@pxref{String Field}).
@item * @var{type-information}
@@ -1955,7 +1956,8 @@ string. I don't know the difference.
Pascal Stringptr. What is this? This is an AIX feature.
@end table
-Languages, such as CHILL which have a string type which is basically
+Languages, such as CHILL @c OBSOLETE
+which have a string type which is basically
just an array of characters use the @samp{S} type attribute
(@pxref{String Field}).
diff --git a/gdb/doublest.c b/gdb/doublest.c
index a4b4b763f7f..6e96d78f0c0 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -681,6 +681,7 @@ store_floating (void *addr, int len, DOUBLEST val)
{
warning ("Can't store a floating-point number of %d bytes.", len);
memset (addr, 0, len);
+ return;
}
floatformat_from_doublest (fmt, &val, addr);
diff --git a/gdb/dst.h b/gdb/dst.h
index b72c58c9653..89ad9eca09f 100644
--- a/gdb/dst.h
+++ b/gdb/dst.h
@@ -1,1671 +1,1671 @@
-/* <apollo/dst.h> */
-/* Apollo object module DST (debug symbol table) description */
-
-#ifndef apollo_dst_h
-#define apollo_dst_h
-
-#if defined(apollo) && !defined(__GNUC__)
-#define ALIGNED1 __attribute( (aligned(1)) )
-#else
-/* Remove attribute directives from non-Apollo code: */
-#define ALIGNED1 /* nil */
-#endif
-
-
-
-/* Identification of this version of the debug symbol table. Producers of the
- debug symbol table must write these values into the version number field of
- the compilation unit record in .blocks .
- */
-#define dst_version_major 1
-#define dst_version_minor 3
-
-
-/*
- ** Enumeration of debug record types appearing in .blocks and .symbols ...
- */
-typedef enum
- {
- dst_typ_pad, /* 0 */
- dst_typ_comp_unit, /* 1 */
- dst_typ_section_tab, /* 2 */
- dst_typ_file_tab, /* 3 */
- dst_typ_block, /* 4 */
- dst_typ_5,
- dst_typ_var,
- dst_typ_pointer, /* 7 */
- dst_typ_array, /* 8 */
- dst_typ_subrange, /* 9 */
- dst_typ_set, /* 10 */
- dst_typ_implicit_enum, /* 11 */
- dst_typ_explicit_enum, /* 12 */
- dst_typ_short_rec, /* 13 */
- dst_typ_old_record,
- dst_typ_short_union, /* 15 */
- dst_typ_old_union,
- dst_typ_file, /* 17 */
- dst_typ_offset, /* 18 */
- dst_typ_alias, /* 19 */
- dst_typ_signature, /* 20 */
- dst_typ_21,
- dst_typ_old_label, /* 22 */
- dst_typ_scope, /* 23 */
- dst_typ_end_scope, /* 24 */
- dst_typ_25,
- dst_typ_26,
- dst_typ_string_tab, /* 27 */
- dst_typ_global_name_tab, /* 28 */
- dst_typ_forward, /* 29 */
- dst_typ_aux_size, /* 30 */
- dst_typ_aux_align, /* 31 */
- dst_typ_aux_field_size, /* 32 */
- dst_typ_aux_field_off, /* 33 */
- dst_typ_aux_field_align, /* 34 */
- dst_typ_aux_qual, /* 35 */
- dst_typ_aux_var_bound, /* 36 */
- dst_typ_extension, /* 37 */
- dst_typ_string, /* 38 */
- dst_typ_old_entry,
- dst_typ_const, /* 40 */
- dst_typ_reference, /* 41 */
- dst_typ_record, /* 42 */
- dst_typ_union, /* 43 */
- dst_typ_aux_type_deriv, /* 44 */
- dst_typ_locpool, /* 45 */
- dst_typ_variable, /* 46 */
- dst_typ_label, /* 47 */
- dst_typ_entry, /* 48 */
- dst_typ_aux_lifetime, /* 49 */
- dst_typ_aux_ptr_base, /* 50 */
- dst_typ_aux_src_range, /* 51 */
- dst_typ_aux_reg_val, /* 52 */
- dst_typ_aux_unit_names, /* 53 */
- dst_typ_aux_sect_info, /* 54 */
- dst_typ_END_OF_ENUM
- }
-dst_rec_type_t;
-
-
-/*
- ** Dummy bounds for variably dimensioned arrays:
- */
-#define dst_dummy_array_size 100
-
-
-/*
- ** Reference to another item in the symbol table.
- **
- ** The value of a dst_rel_offset_t is the relative offset from the start of the
- ** referencing record to the start of the referenced record, string, etc.
- **
- ** The value of a NIL dst_rel_offset_t is zero.
- */
-
-typedef long dst_rel_offset_t ALIGNED1;
-
-
-/* FIXME: Here and many places we make assumptions about sizes of host
- data types, structure layout, etc. Only needs to be fixed if we care
- about cross-debugging, though. */
-
-/*
- ** Section-relative reference.
- **
- ** The section index field is an index into the local compilation unit's
- ** section table (see dst_rec_section_tab_t)--NOT into the object module
- ** section table!
- **
- ** The sect_offset field is the offset in bytes into the section.
- **
- ** A NIL dst_sect_ref_t has a sect_index field of zero. Indexes originate
- ** at one.
- */
-
-typedef struct
- {
- unsigned short sect_index;
- unsigned long sect_offset ALIGNED1;
- }
-dst_sect_ref_t;
-
-#define dst_sect_index_nil 0
-#define dst_sect_index_origin 1
-
-
-/*
- ** Source location descriptor.
- **
- ** The file_index field is an index into the local compilation unit's
- ** file table (see dst_rec_file_tab_t).
- **
- ** A NIL dst_src_loc_t has a file_index field of zero. Indexes originate
- ** at one.
- */
-
-typedef struct
- {
- boolean reserved:1; /* reserved for future use */
- int file_index:11; /* index into .blocks source file list */
- int line_number:20; /* source line number */
- }
-dst_src_loc_t;
-
-#define dst_file_index_nil 0
-#define dst_file_index_origin 1
-
-
-/*
- ** Standard (primitive) type codes.
- */
-
-typedef enum
- {
- dst_non_std_type,
- dst_int8_type, /* 8 bit integer */
- dst_int16_type, /* 16 bit integer */
- dst_int32_type, /* 32 bit integer */
- dst_uint8_type, /* 8 bit unsigned integer */
- dst_uint16_type, /* 16 bit unsigned integer */
- dst_uint32_type, /* 32 bit unsigned integer */
- dst_real32_type, /* single precision ieee floatining point */
- dst_real64_type, /* double precision ieee floatining point */
- dst_complex_type, /* single precision complex */
- dst_dcomplex_type, /* double precision complex */
- dst_bool8_type, /* boolean =logical*1 */
- dst_bool16_type, /* boolean =logical*2 */
- dst_bool32_type, /* boolean =logical*4 */
- dst_char_type, /* 8 bit ascii character */
- dst_string_type, /* string of 8 bit ascii characters */
- dst_ptr_type, /* univ_pointer */
- dst_set_type, /* generic 256 bit set */
- dst_proc_type, /* generic procedure (signature not specified) */
- dst_func_type, /* generic function (signature not specified) */
- dst_void_type, /* c void type */
- dst_uchar_type, /* c unsigned char */
- dst_std_type_END_OF_ENUM
- }
-dst_std_type_t;
-
-
-/*
- ** General data type descriptor
- **
- ** If the user_defined_type bit is clear, then the type is a standard type, and
- ** the remaining bits contain the dst_std_type_t of the type. If the bit is
- ** set, then the type is defined in a separate dst record, which is referenced
- ** by the remaining bits as a dst_rel_offset_t.
- */
-
-typedef union
- {
- struct
- {
- boolean user_defined_type:1; /* tag field */
- int must_be_zero:23; /* 23 bits of pad */
- dst_std_type_t dtc:8; /* 8 bit primitive data */
- }
- std_type;
-
- struct
- {
- boolean user_defined_type:1; /* tag field */
- int doffset:31; /* offset to type record */
- }
- user_type;
- }
-dst_type_t ALIGNED1;
-
-/* The user_type.doffset field is a 31-bit signed value. Some versions of C
- do not support signed bit fields. The following macro will extract that
- field as a signed value:
- */
-#define dst_user_type_offset(type_rec) \
- ( ((int) ((type_rec).user_type.doffset << 1)) >> 1 )
-
-
-/*================================================*/
-/*========== RECORDS IN .blocks SECTION ==========*/
-/*================================================*/
-
-/*-----------------------
- COMPILATION UNIT record
- -----------------------
- This must be the first record in each .blocks section.
- Provides a set of information describing the output of a single compilation
- and pointers to additional information for the compilation unit.
-*/
-
-typedef enum
- {
- dst_pc_code_locs, /* ranges in loc strings are pc ranges */
- dst_comp_unit_END_OF_ENUM
- }
-dst_comp_unit_flag_t;
-
-typedef enum
- {
- dst_lang_unk, /* unknown language */
- dst_lang_pas, /* Pascal */
- dst_lang_ftn, /* FORTRAN */
- dst_lang_c, /* C */
- dst_lang_mod2, /* Modula-2 */
- dst_lang_asm_m68k, /* 68K assembly language */
- dst_lang_asm_a88k, /* AT assembly language */
- dst_lang_ada, /* Ada */
- dst_lang_cxx, /* C++ */
- dst_lang_END_OF_ENUM
- }
-dst_lang_type_t;
-
-typedef struct
- {
- struct
- {
- unsigned char major_part; /* = dst_version_major */
- unsigned char minor_part; /* = dst_version_minor */
- }
- version; /* version of dst */
- unsigned short flags; /* mask of dst_comp_unit_flag_t */
- unsigned short lang_type; /* source language */
- unsigned short number_of_blocks; /* number of blocks records */
- dst_rel_offset_t root_block_offset; /* offset to root block (module?) */
- dst_rel_offset_t section_table /* offset to section table record */ ;
- dst_rel_offset_t file_table; /* offset to file table record */
- unsigned long data_size; /* total size of .blocks data */
- }
-dst_rec_comp_unit_t ALIGNED1;
-
-
-/*--------------------
- SECTION TABLE record
- --------------------
- There must be one section table associated with each compilation unit.
- Other debug records refer to sections via their index in this table. The
- section base addresses in the table are virtual addresses of the sections,
- relocated by the linker.
-*/
-
-typedef struct
- {
- unsigned short number_of_sections; /* size of array: */
- unsigned long section_base[dst_dummy_array_size] ALIGNED1;
- }
-dst_rec_section_tab_t ALIGNED1;
-
-
-/*-----------------
- FILE TABLE record
- -----------------
- There must be one file table associated with each compilation unit describing
- the source (and include) files used by each compilation unit. Other debug
- records refer to files via their index in this table. The first entry is the
- primary source file.
-*/
-
-typedef struct
- {
- long dtm; /* time last modified (time_$clock_t) */
- dst_rel_offset_t noffset; /* offset to name string for source file */
- }
-dst_file_desc_t;
-
-typedef struct
- {
- unsigned short number_of_files; /* size of array: */
- dst_file_desc_t files[dst_dummy_array_size] ALIGNED1;
- }
-dst_rec_file_tab_t ALIGNED1;
-
-
-/*-----------------
- NAME TABLE record
- -----------------
- A name table record may appear as an auxiliary record to the file table,
- providing additional qualification of the file indexes for languages that
- need it (i.e. Ada). Name table entries parallel file table entries of the
- same file index.
-*/
-
-typedef struct
- {
- unsigned short number_of_names; /* size of array: */
- dst_rel_offset_t names[dst_dummy_array_size] ALIGNED1;
- }
-dst_rec_name_tab_t ALIGNED1;
-
-
-/*--------------
- BLOCK record
- --------------
- Describes a lexical program block--a procedure, function, module, etc.
-*/
-
-/* Block types. These may be used in any way desired by the compiler writers.
- The debugger uses them only to give a description to the user of the type of
- a block. The debugger makes no other assumptions about the meaning of any
- of these. For example, the fact that a block is executable (e.g., program)
- or not (e.g., module) is expressed in block attributes (see below), not
- guessed at from the block type.
- */
-typedef enum
- {
- dst_block_module, /* some pascal = modula = ada types */
- dst_block_program,
- dst_block_procedure,
- dst_block_function, /* C function */
- dst_block_subroutine, /* some fortran block types */
- dst_block_block_data,
- dst_block_stmt_function,
- dst_block_package, /* a few particular to Ada */
- dst_block_package_body,
- dst_block_subunit,
- dst_block_task,
- dst_block_file, /* a C outer scope? */
- dst_block_class, /* C++ or Simula */
- dst_block_END_OF_ENUM
- }
-dst_block_type_t;
-
-/* Block attributes. This is the information used by the debugger to represent
- the semantics of blocks.
- */
-typedef enum
- {
- dst_block_main_entry, /* the block's entry point is a main entry into
- the compilation unit */
- dst_block_executable, /* the block has an entry point */
- dst_block_attr_END_OF_ENUM
- }
-dst_block_attr_t;
-
-/* Code range. Each block has associated with it one or more code ranges. An
- individual code range is identified by a range of source (possibly nil) and
- a range of executable code. For example, a block which has its executable
- code spread over multiple sections will have one code range per section.
- */
-typedef struct
- {
- unsigned long code_size; /* size of executable code (in bytes ) */
- dst_sect_ref_t code_start; /* starting address of executable code */
- dst_sect_ref_t lines_start; /* start of line number tables */
- }
-dst_code_range_t;
-
-typedef struct
- {
- dst_block_type_t block_type:8;
- unsigned short flags:8; /* mask of dst_block_attr_t flags */
- dst_rel_offset_t sibling_block_off; /* offset to next sibling block */
- dst_rel_offset_t child_block_off; /* offset to first contained block */
- dst_rel_offset_t noffset; /* offset to block name string */
- dst_sect_ref_t symbols_start; /* start of debug symbols */
- unsigned short n_of_code_ranges; /* size of array... */
- dst_code_range_t code_ranges[dst_dummy_array_size] ALIGNED1;
- }
-dst_rec_block_t ALIGNED1;
-
-
-/*--------------------------
- AUX SECT INFO TABLE record
- --------------------------
- Appears as an auxiliary to a block record. Expands code range information
- by providing references into additional, language-dependent sections for
- information related to specific code ranges of the block. Sect info table
- entries parallel code range array entries of the same index.
-*/
-
-typedef struct
- {
- unsigned char tag; /* currently can only be zero */
- unsigned char number_of_refs; /* size of array: */
- dst_sect_ref_t refs[dst_dummy_array_size] ALIGNED1;
- }
-dst_rec_sect_info_tab_t ALIGNED1;
-
-/*=================================================*/
-/*========== RECORDS IN .symbols SECTION ==========*/
-/*=================================================*/
-
-/*-----------------
- CONSTANT record
- -----------------
- Describes a symbolic constant.
-*/
-
-typedef struct
- {
- float r; /* real part */
- float i; /* imaginary part */
- }
-dst_complex_t;
-
-typedef struct
- {
- double dr; /* real part */
- double di; /* imaginary part */
- }
-dst_double_complex_t;
-
-/* The following record provides a way of describing constant values with
- non-standard type and no limit on size.
- */
-typedef union
- {
- char char_data[dst_dummy_array_size];
- short int_data[dst_dummy_array_size];
- long long_data[dst_dummy_array_size];
- }
-dst_big_kon_t;
-
-/* Representation of the value of a general constant.
- */
-typedef struct
- {
- unsigned short length; /* size of constant value (bytes) */
-
- union
- {
- unsigned short kon_int8;
- short kon_int16;
- long kon_int32 ALIGNED1;
- float kon_real ALIGNED1;
- double kon_dbl ALIGNED1;
- dst_complex_t kon_cplx ALIGNED1;
- dst_double_complex_t kon_dcplx ALIGNED1;
- char kon_char;
- dst_big_kon_t kon ALIGNED1;
- }
- val; /* value data of constant */
- }
-dst_const_t ALIGNED1;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of const definition */
- dst_type_t type_desc; /* type of this (manifest) constant */
- dst_const_t value;
- }
-dst_rec_const_t ALIGNED1;
-
-/*----------------
- VARIABLE record
- ----------------
- Describes a program variable.
-*/
-
-/* Variable attributes. These define certain variable semantics to the
- debugger.
- */
-typedef enum
- {
- dst_var_attr_read_only, /* is read-only (a program literal) */
- dst_var_attr_volatile, /* same as compiler's VOLATILE attribute */
- dst_var_attr_global, /* is a global definition or reference */
- dst_var_attr_compiler_gen, /* is compiler-generated */
- dst_var_attr_static, /* has static location */
- dst_var_attr_END_OF_ENUM
- }
-dst_var_attr_t;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_rel_offset_t loffset; /* offset to loc string */
- dst_src_loc_t src_loc; /* file/line of variable definition */
- dst_type_t type_desc; /* type descriptor */
- unsigned short attributes; /* mask of dst_var_attr_t flags */
- }
-dst_rec_variable_t ALIGNED1;
-
-
-/*----------------
- old VAR record
- -----------------
- Used by older compilers to describe a variable
-*/
-
-typedef enum
- {
- dst_var_loc_unknown, /* Actually defined as "unknown" */
- dst_var_loc_abs, /* Absolute address */
- dst_var_loc_sect_off, /* Absolute address as a section offset */
- dst_var_loc_ind_sect_off, /* An indexed section offset ???? */
- dst_var_loc_reg, /* register */
- dst_var_loc_reg_rel, /* register relative - usually fp */
- dst_var_loc_ind_reg_rel, /* Indexed register relative */
- dst_var_loc_ftn_ptr_based, /* Fortran pointer based */
- dst_var_loc_pc_rel, /* PC relative. Really. */
- dst_var_loc_external, /* External */
- dst_var_loc_END_OF_ENUM
- }
-dst_var_loc_t;
-
-/* Locations come in two versions. The short, and the long. The difference
- * between the short and the long is the addition of a statement number
- * field to the start andend of the range of the long, and and unkown
- * purpose field in the middle. Also, loc_type and loc_index aren't
- * bitfields in the long version.
- */
-
-typedef struct
- {
- unsigned short loc_type:4;
- unsigned short loc_index:12;
- long location;
- short start_line; /* start_line and end_line? */
- short end_line; /* I'm guessing here. */
- }
-dst_var_loc_short_t;
-
-typedef struct
- {
- unsigned short loc_type;
- unsigned short loc_index;
- long location;
- short unknown; /* Always 0003 or 3b3c. Why? */
- short start_statement;
- short start_line;
- short end_statement;
- short end_line;
- }
-dst_var_loc_long_t;
-
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of description */
- dst_type_t type_desc; /* Type description */
- unsigned short attributes; /* mask of dst_var_attr_t flags */
- unsigned short no_of_locs:15; /* Number of locations */
- unsigned short short_locs:1; /* True if short locations. */
- union
- {
- dst_var_loc_short_t shorts[dst_dummy_array_size];
- dst_var_loc_long_t longs[dst_dummy_array_size];
- }
- locs;
- }
-dst_rec_var_t;
-
-/*----------------
- old LABEL record
- -----------------
- Used by older compilers to describe a label
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of description */
- char location[12]; /* location string */
- }
-dst_rec_old_label_t ALIGNED1;
-
-/*----------------
- POINTER record
- ----------------
- Describes a pointer type.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to the name string for this type */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_type_t type_desc; /* base type of this pointer */
- }
-dst_rec_pointer_t ALIGNED1;
-
-
-/*-------------
- ARRAY record
- -------------
- Describes an array type.
-
- Multidimensional arrays are described with a number of dst_rec_array_t
- records, one per array dimension, each linked to the next through the
- elem_type_desc.doffset field. Each record must have its multi_dim flag
- set.
-
- If column_major is true (as with FORTRAN arrays) then the last array bound in
- the declaration is the first array index in memory, which is the opposite of
- the usual case (as with Pascal and C arrays).
-
- Variable array bounds are described by auxiliary records; if aux_var_bound
- records are present, the lo_bound and hi_bound fields of this record are
- ignored by the debugger.
-
- span_comp identifies one of the language-dependent ways in which the distance
- between successive array elements (span) is calculated.
- dst_use_span_field -- the span is the value of span field.
- dst_compute_from_prev -- the span is the size of the previous dimension.
- dst_compute_from_next -- the span is the size of the next dimension.
- In the latter two cases, the span field contains an amount of padding to add
- to the size of the appropriate dimension to calculate the span.
-*/
-
-typedef enum
- {
- dst_use_span_field,
- dst_compute_from_prev,
- dst_compute_from_next,
- dst_span_comp_END_OF_ENUM
- }
-dst_span_comp_t;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_type_t elem_type_desc; /* array element type */
- dst_type_t indx_type_desc; /* array index type */
- long lo_bound; /* lower bound of index */
- long hi_bound; /* upper bound of index */
- unsigned long span; /* see above */
- unsigned long size; /* total array size (bytes) */
- boolean multi_dim:1;
- boolean is_packed:1; /* true if packed array */
- boolean is_signed:1; /* true if packed elements are signed */
- dst_span_comp_t span_comp:2; /* how to compute span */
- boolean column_major:1;
- unsigned short reserved:2; /* must be zero */
- unsigned short elem_size:8; /* element size if packed (bits) */
- }
-dst_rec_array_t ALIGNED1;
-
-
-/*-----------------
- SUBRANGE record
- -----------------
- Describes a subrange type.
-*/
-
-/* Variable subrange bounds are described by auxiliary records; if aux_var_bound
- records are present, the lo_bound and hi_bound fields of this record are
- ignored by the debugger.
- */
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of subrange definition */
- dst_type_t type_desc; /* parent type */
- long lo_bound; /* lower bound of subrange */
- long hi_bound; /* upper bound of subrange */
- unsigned short size; /* storage size (bytes) */
- }
-dst_rec_subrange_t ALIGNED1;
-
-
-/*---------------
- STRING record
- ---------------
- Describes a string type.
-*/
-
-/* Variable subrange bounds are described by auxiliary records; if aux_var_bound
- records are present, the lo_bound and hi_bound fields of this record are
- ignored by the debugger.
- */
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of string definition */
- dst_type_t elem_type_desc; /* element type */
- dst_type_t indx_type_desc; /* index type */
- long lo_bound; /* lower bound */
- long hi_bound; /* upper bound */
- unsigned long size; /* total string size (bytes) if fixed */
- }
-dst_rec_string_t ALIGNED1;
-
-
-/*---------------
- SET record
- ---------------
- Describes a set type.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_type_t type_desc; /* element type */
- unsigned short nbits; /* number of bits in set */
- unsigned short size; /* storage size (bytes) */
- }
-dst_rec_set_t ALIGNED1;
-
-
-/*-----------------------------
- IMPLICIT ENUMERATION record
- -----------------------------
- Describes an enumeration type with implicit element values = 0, 1, 2, ...
- (Pascal-style).
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- unsigned short nelems; /* number of elements in enumeration */
- unsigned short size; /* storage size (bytes) */
- /* offsets to name strings of elements 0, 1, 2, ... */
- dst_rel_offset_t elem_noffsets[dst_dummy_array_size];
- }
-dst_rec_implicit_enum_t ALIGNED1;
-
-
-/*-----------------------------
- EXPLICIT ENUMERATION record
- -----------------------------
- Describes an enumeration type with explicitly assigned element values
- (C-style).
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to element name string */
- long value; /* element value */
- }
-dst_enum_elem_t;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- unsigned short nelems; /* number of elements in enumeration */
- unsigned short size; /* storage size (bytes) */
- /* name/value pairs, one describing each enumeration value: */
- dst_enum_elem_t elems[dst_dummy_array_size];
- }
-dst_rec_explicit_enum_t ALIGNED1;
-
-
-/*-----------------------
- RECORD / UNION record
- -----------------------
- Describes a record (struct) or union.
-
- If the record is larger than 2**16 bytes then an attached aux record
- specifies its size. Also, if the record is stored in short form then
- attached records specify field offsets larger than 2**16 bytes.
-
- Whether the fields[] array or sfields[] array is used is selected by
- the dst_rec_type_t of the overall dst record.
-*/
-
-/*
- Record field descriptor, short form. This form handles only fields which
- are an even number of bytes long, located some number of bytes from the
- start of the record.
- */
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to field name string */
- dst_type_t type_desc; /* field type */
- unsigned short foffset; /* field offset from start of record (bytes) */
- }
-dst_short_field_t ALIGNED1;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_type_t type_desc; /* field type */
- unsigned short foffset; /* byte offset */
- unsigned short is_packed:1; /* True if field is packed */
- unsigned short bit_offset:6; /* Bit offset */
- unsigned short size:6; /* Size in bits */
- unsigned short sign:1; /* True if signed */
- unsigned short pad:2; /* Padding. Must be 0 */
- }
-dst_old_field_t ALIGNED1;
-
-/* Tag enumeration for long record field descriptor:
- */
-typedef enum
- {
- dst_field_byte,
- dst_field_bit,
- dst_field_loc,
- dst_field_END_OF_ENUM
- }
-dst_field_format_t;
-
-/*
- Record field descriptor, long form. The format of the field information
- is identified by the format_tag, which contains one of the above values.
- The field_byte variant is equivalent to the short form of field descriptor.
- The field_bit variant handles fields which are any number of bits long,
- located some number of bits from the start of the record. The field_loc
- variant allows the location of the field to be described by a general loc
- string.
- */
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name of field */
- dst_type_t type_desc; /* type of field */
- union
- {
- struct
- {
- dst_field_format_t format_tag:2; /* dst_field_byte */
- unsigned long offset:30; /* offset of field in bytes */
- }
- field_byte ALIGNED1;
- struct
- {
- dst_field_format_t format_tag:2; /* dst_field_bit */
- unsigned long nbits:6; /* bit size of field */
- unsigned long is_signed:1; /* signed/unsigned attribute */
- unsigned long bit_offset:3; /* bit offset from byte boundary */
- int pad:4; /* must be zero */
- unsigned short byte_offset; /* offset of byte boundary */
- }
- field_bit ALIGNED1;
- struct
- {
- dst_field_format_t format_tag:2; /* dst_field_loc */
- int loffset:30; /* dst_rel_offset_t to loc string */
- }
- field_loc ALIGNED1;
- }
- f ALIGNED1;
- }
-dst_field_t;
-
-/* The field_loc.loffset field is a 30-bit signed value. Some versions of C do
- not support signed bit fields. The following macro will extract that field
- as a signed value:
- */
-#define dst_field_loffset(field_rec) \
- ( ((int) ((field_rec).f.field_loc.loffset << 2)) >> 2 )
-
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to record name string */
- dst_src_loc_t src_loc; /* file/line where this record is defined */
- unsigned short size; /* storage size (bytes) */
- unsigned short nfields; /* number of fields in this record */
- union
- {
- dst_field_t fields[dst_dummy_array_size];
- dst_short_field_t sfields[dst_dummy_array_size];
- dst_old_field_t ofields[dst_dummy_array_size];
- }
- f; /* array of fields */
- }
-dst_rec_record_t ALIGNED1;
-
-
-/*-------------
- FILE record
- -------------
- Describes a file type.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line where type was defined */
- dst_type_t type_desc; /* file element type */
- }
-dst_rec_file_t ALIGNED1;
-
-
-/*---------------
- OFFSET record
- ---------------
- Describes a Pascal offset type.
- (This type, an undocumented Domain Pascal extension, is currently not
- supported by the debugger)
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to the name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_type_t area_type_desc; /* area type */
- dst_type_t base_type_desc; /* base type */
- long lo_bound; /* low bound of the offset range */
- long hi_bound; /* high bound of the offset range */
- long bias; /* bias */
- unsigned short scale; /* scale factor */
- unsigned short size; /* storage size (bytes) */
- }
-dst_rec_offset_t ALIGNED1;
-
-
-/*--------------
- ALIAS record
- --------------
- Describes a type alias (e.g., typedef).
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_type_t type_desc; /* parent type */
- }
-dst_rec_alias_t ALIGNED1;
-
-
-/*------------------
- SIGNATURE record
- ------------------
- Describes a procedure/function type.
-*/
-
-/* Enumeration of argument semantics. Note that most are mutually
- exclusive.
- */
-typedef enum
- {
- dst_arg_attr_val, /* passed by value */
- dst_arg_attr_ref, /* passed by reference */
- dst_arg_attr_name, /* passed by name */
- dst_arg_attr_in, /* readable in the callee */
- dst_arg_attr_out, /* writable in the callee */
- dst_arg_attr_hidden, /* not visible in the caller */
- dst_arg_attr_END_OF_ENUM
- }
-dst_arg_attr_t;
-
-/* Argument descriptor. Actually points to a variable record for most of the
- information.
- */
-typedef struct
- {
- dst_rel_offset_t var_offset; /* offset to variable record */
- unsigned short attributes; /* a mask of dst_arg_attr_t flags */
- }
-dst_arg_t ALIGNED1;
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to name string */
- dst_src_loc_t src_loc; /* file/line of function definition */
- dst_rel_offset_t result; /* offset to function result variable record */
- unsigned short nargs; /* number of arguments */
- dst_arg_t args[dst_dummy_array_size];
- }
-dst_rec_signature_t ALIGNED1;
-
-/*--------------
- SCOPE record
- --------------
- Obsolete. Use the new ENTRY type instead.
- Old compilers may put this in as the first entry in a function,
- terminated by an end of scope entry.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* Name offset */
- dst_src_loc_t start_line; /* Starting line */
- dst_src_loc_t end_line; /* Ending line */
- }
-dst_rec_scope_t ALIGNED1;
-
-/*--------------
- ENTRY record
- --------------
- Describes a procedure/function entry point. An entry record is to a
- signature record roughly as a variable record is to a type descriptor record.
-
- The entry_number field is keyed to the entry numbers in .lines -- the
- debugger locates the code location of an entry by searching the line
- number table for an entry numbered with the value of entry_number. The
- main entry is numbered zero.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to entry name string */
- dst_rel_offset_t loffset; /* where to jump to call this entry */
- dst_src_loc_t src_loc; /* file/line of definition */
- dst_rel_offset_t sig_desc; /* offset to signature descriptor */
- unsigned int entry_number:8;
- int pad:8; /* must be zero */
- }
-dst_rec_entry_t ALIGNED1;
-
-/*-----------------------
- Old format ENTRY record
- -----------------------
- Supposedly obsolete but still used by some compilers.
- */
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* Offset to entry name string */
- dst_src_loc_t src_loc; /* Location in source */
- dst_rel_offset_t sig_desc; /* Signature description */
- char unknown[36];
- }
-dst_rec_old_entry_t ALIGNED1;
-
-/*--------------
- LABEL record
- --------------
- Describes a program label.
-*/
-
-typedef struct
- {
- dst_rel_offset_t noffset; /* offset to label string */
- dst_rel_offset_t loffset; /* offset to loc string */
- dst_src_loc_t src_loc; /* file/line of definition */
- }
-dst_rec_label_t ALIGNED1;
-
-
-/*-----------------------
- AUXILIARY SIZE record
- -----------------------
- May appear in the auxiliary record list of any type or variable record to
- modify the default size of the type or variable.
-*/
-
-typedef struct
- {
- unsigned long size; /* size (bytes) */
- }
-dst_rec_aux_size_t ALIGNED1;
-
-
-/*-----------------------
- AUXILIARY ALIGN record
- -----------------------
- May appear in the auxiliary record list of any type or variable record to
- modify the default alignment of the type or variable.
-*/
-
-typedef struct
- {
- unsigned short alignment; /* # of low order zero bits */
- }
-dst_rec_aux_align_t ALIGNED1;
-
-
-/*-----------------------------
- AUXILIARY FIELD SIZE record
- -----------------------------
- May appear in the auxiliary record list of any RECORD/UNION record to
- modify the default size of a field.
-*/
-
-typedef struct
- {
- unsigned short field_no; /* field number */
- unsigned long size; /* size (bits) */
- }
-dst_rec_aux_field_size_t ALIGNED1;
-
-
-
-/*-----------------------------
- AUXILIARY FIELD OFFSET record
- -----------------------------
- May appear in the auxiliary record list of any RECORD/UNION record to
- specify a field offset larger than 2**16.
-*/
-
-typedef struct
- {
- unsigned short field_no; /* field number */
- unsigned long foffset; /* offset */
- }
-dst_rec_aux_field_off_t ALIGNED1;
-
-
-/*-----------------------------
- AUXILIARY FIELD ALIGN record
- -----------------------------
- May appear in the auxiliary record list of any RECORD/UNION record to
- modify the default alignment of a field.
-*/
-
-typedef struct
- {
- unsigned short field_no; /* field number */
- unsigned short alignment; /* number of low order zero bits */
- }
-dst_rec_aux_field_align_t ALIGNED1;
-
-
-/*----------------------------
- AUXILIARY VAR BOUND record
- ----------------------------
- May appear in the auxiliary record list of any ARRAY, SUBRANGE or STRING
- record to describe a variable bound for the range of the type.
-*/
-
-typedef enum
- {
- dst_low_bound, /* the low bound is variable */
- dst_high_bound, /* the high bound is variable */
- dst_var_bound_END_OF_ENUM
- }
-dst_var_bound_t;
-
-typedef struct
- {
- unsigned short which; /* which bound */
- dst_rel_offset_t voffset ALIGNED1; /* variable that defines bound */
- }
-dst_rec_aux_var_bound_t ALIGNED1;
-
-
-/*----------------------------------
- AUXILIARY TYPE DERIVATION record
- ----------------------------------
- May appear in the auxiliary record list of any RECORD/UNION record to denote
- class inheritance of that type from a parent type.
-
- Inheritance implies that it is possible to convert the inheritor type to the
- inherited type, retaining those fields which were inherited. To allow this,
- orig_field_no, a field number into the record type, is provided. If
- orig_is_pointer is false, then the start of the inherited record is located
- at the location of the field indexed by orig_field_no. If orig_is_pointer
- is true, then it is located at the address contained in the field indexed
- by orig_field_no (assumed to be a pointer).
-*/
-
-typedef struct
- {
- dst_type_t parent_type; /* reference to inherited type */
- unsigned short orig_field_no;
- boolean orig_is_pointer:1;
- int unused:15; /* must be zero */
- }
-dst_rec_aux_type_deriv_t ALIGNED1;
-
-
-/*------------------------------------
- AUXILIARY VARIABLE LIFETIME record
- ------------------------------------
- May appear in the auxiliary record list of a VARIABLE record to add location
- information for an additional variable lifetime.
-*/
-
-typedef struct
- {
- dst_rel_offset_t loffset;
- }
-dst_rec_aux_lifetime_t ALIGNED1;
-
-
-/*-------------------------------
- AUXILIARY POINTER BASE record
- -------------------------------
- May appear in the auxiliary record list of a VARIABLE record to provide a
- pointer base to substitute for references to any such bases in the location
- string of the variable. A pointer base is another VARIABLE record. When
- the variable is evaluated by the debugger, it uses the current value of the
- pointer base variable in computing its location.
-
- This is useful for representing FORTRAN pointer-based variables.
-*/
-
-typedef struct
- {
- dst_rel_offset_t voffset;
- }
-dst_rec_aux_ptr_base_t ALIGNED1;
-
-
-/*---------------------------------
- AUXILIARY REGISTER VALUE record
- ---------------------------------
- May appear in the auxiliary record list of an ENTRY record to specify
- a register that must be set to a specific value before jumping to the entry
- point in a debugger "call". The debugger must set the debuggee register,
- specified by the register code, to the value of the *address* to which the
- location string resolves. If the address is register-relative, then the
- call cannot be made unless the current stack frame is the lexical parent
- of the entry. An example of this is when a (Pascal) nested procedure
- contains references to its parent's variables, which it accesses through
- a static link register. The static link register must be set to some
- address relative to the parent's stack base register.
-*/
-
-typedef struct
- {
- unsigned short reg; /* identifies register to set (isp enum) */
- dst_rel_offset_t loffset; /* references a location string */
- }
-dst_rec_aux_reg_val_t ALIGNED1;
-
-
-/*==========================================================*/
-/*========== RECORDS USED IN .blocks AND .symbols ==========*/
-/*==========================================================*/
-
-/*---------------------
- STRING TABLE record
- ---------------------
- A string table record contains any number of null-terminated, variable length
- strings. The length field gives the size in bytes of the text field, which
- can be any size.
-
- The global name table shares this format. This record appears in the
- .blocks section. Each string in the table identifies a global defined in
- the current compilation unit.
-
- The loc pool record shares this format as well. Loc strings are described
- elsewhere.
-*/
-
-typedef struct
- {
- unsigned long length;
- char text[dst_dummy_array_size];
- }
-dst_rec_string_tab_t ALIGNED1;
-
-
-/*-----------------------
- AUXILIARY QUAL record
- -----------------------
- May appear in the auxiliary record list of any BLOCK, VARIABLE, or type record
- to provide it with a fully-qualified, language-dependent name.
-*/
-
-typedef struct
- {
- dst_rel_offset_t lang_qual_name;
- }
-dst_rec_aux_qual_t ALIGNED1;
-
-
-/*----------------
- FORWARD record
- ----------------
- Reference to a record somewhere else. This allows identical definitions in
- different scopes to share data.
-*/
-
-typedef struct
- {
- dst_rel_offset_t rec_off;
- }
-dst_rec_forward_t ALIGNED1;
-
-
-/*-------------------------------
- AUXILIARY SOURCE RANGE record
- -------------------------------
- May appear in the auxiliary record list of any BLOCK record to specify a
- range of source lines over which the block is active.
-*/
-
-typedef struct
- {
- dst_src_loc_t first_line; /* first source line */
- dst_src_loc_t last_line; /* last source line */
- }
-dst_rec_aux_src_range_t ALIGNED1;
-
-
-/*------------------
- EXTENSION record
- ------------------
- Provision for "foreign" records, such as might be generated by a non-Apollo
- compiler. Apollo software will ignore these.
-*/
-
-typedef struct
- {
- unsigned short rec_size; /* record size (bytes) */
- unsigned short ext_type; /* defined by whoever generates it */
- unsigned short ext_data; /* place-holder for arbitrary amount of data */
- }
-dst_rec_extension_t ALIGNED1;
-
-
-/*
- ** DEBUG SYMBOL record -- The wrapper for all .blocks and .symbols records.
- **
- ** This record ties together all previous .blocks and .symbols records
- ** together in a union with a common header. The rec_type field of the
- ** header identifies the record type. The rec_flags field currently only
- ** defines auxiliary record lists.
- **
- ** If a record carries with it a non-null auxiliary record list, its
- ** dst_flag_has_aux_recs flag is set, and each of the records that follow
- ** it are treated as its auxiliary records, until the end of the compilation
- ** unit or scope is reached, or until an auxiliary record with its
- ** dst_flag_last_aux_rec flag set is reached.
- */
-
-typedef enum
- {
- dst_flag_has_aux_recs,
- dst_flag_last_aux_rec,
- dst_rec_flag_END_OF_ENUM
- }
-dst_rec_flags_t;
-
-typedef struct
- {
- dst_rec_type_t rec_type:8; /* record type */
- int rec_flags:8; /* mask of dst_rec_flags_t */
- union /* switched on rec_type field above */
- {
- /* dst_typ_pad requires no additional fields */
- dst_rec_comp_unit_t comp_unit_;
- dst_rec_section_tab_t section_tab_;
- dst_rec_file_tab_t file_tab_;
- dst_rec_block_t block_;
- dst_rec_var_t var_;
- dst_rec_pointer_t pointer_;
- dst_rec_array_t array_;
- dst_rec_subrange_t subrange_;
- dst_rec_set_t set_;
- dst_rec_implicit_enum_t implicit_enum_;
- dst_rec_explicit_enum_t explicit_enum_;
- /* dst_typ_short_{rec,union} are represented by 'rec' (below) */
- dst_rec_file_t file_;
- dst_rec_offset_t offset_;
- dst_rec_alias_t alias_;
- dst_rec_signature_t signature_;
- dst_rec_old_label_t old_label_;
- dst_rec_scope_t scope_;
- /* dst_typ_end_scope requires no additional fields */
- dst_rec_string_tab_t string_tab_;
- /* dst_typ_global_name_tab is represented by 'string_tab' (above) */
- dst_rec_forward_t forward_;
- dst_rec_aux_size_t aux_size_;
- dst_rec_aux_align_t aux_align_;
- dst_rec_aux_field_size_t aux_field_size_;
- dst_rec_aux_field_off_t aux_field_off_;
- dst_rec_aux_field_align_t aux_field_align_;
- dst_rec_aux_qual_t aux_qual_;
- dst_rec_aux_var_bound_t aux_var_bound_;
- dst_rec_extension_t extension_;
- dst_rec_string_t string_;
- dst_rec_const_t const_;
- /* dst_typ_reference is represented by 'pointer' (above) */
- dst_rec_record_t record_;
- /* dst_typ_union is represented by 'record' (above) */
- dst_rec_aux_type_deriv_t aux_type_deriv_;
- /* dst_typ_locpool is represented by 'string_tab' (above) */
- dst_rec_variable_t variable_;
- dst_rec_label_t label_;
- dst_rec_entry_t entry_;
- dst_rec_aux_lifetime_t aux_lifetime_;
- dst_rec_aux_ptr_base_t aux_ptr_base_;
- dst_rec_aux_src_range_t aux_src_range_;
- dst_rec_aux_reg_val_t aux_reg_val_;
- dst_rec_name_tab_t aux_unit_names_;
- dst_rec_sect_info_tab_t aux_sect_info_;
- }
- rec_data ALIGNED1;
- }
-dst_rec_t, *dst_rec_ptr_t;
-
-
-/*===============================================*/
-/*========== .lines SECTION DEFINITIONS =========*/
-/*===============================================*/
-/*
- The .lines section contains a sequence of line number tables. There is no
- record structure within the section. The start of the table for a routine
- is pointed to by the block record, and the end of the table is signaled by
- an escape code.
-
- A line number table is a sequence of bytes. The default entry contains a line
- number delta (-7..+7) in the high 4 bits and a pc delta (0..15) in the low 4
- bits. Special cases, including when one or both of the values is too large
- to fit in 4 bits and other special cases are handled through escape entries.
- Escape entries are identified by the value 0x8 in the high 4 bits. The low 4
- bits are occupied by a function code. Some escape entries are followed by
- additional arguments, which may be bytes, words, or longwords. This data is
- not aligned.
-
- The initial PC offset, file number and line number are zero. Normally, the
- table begins with a dst_ln_file escape which establishes the initial file
- and line number. All PC deltas are unsigned (thus the table is ordered by
- increasing PC); line number deltas are signed. The table ends with a
- dst_ln_end escape, which is followed by a final table entry whose PC delta
- gives the code size of the last statement.
-
- Escape Semantic
- --------- ------------------------------------------------------------
- file Changes file state. The current source file remains constant
- until another file escape. Though the line number state is
- also updated by a file escape, a file escape does NOT
- constitute a line table entry.
-
- statement Alters the statement number of the next table entry. By
- default, all table entries refer to the first statement on a
- line. Statement number one is the second statement, and so on.
-
- entry Identifies the next table entry as the position of an entry
- point for the current block. The PC position should follow
- any procedure prologue code. An argument specifies the entry
- number, which is keyed to the entry number of the corresponding
- .symbols ENTRY record.
-
- exit Identifies the next table entry as the last position within
- the current block before a procedure epiloge and subsequent
- procedure exit.
-
- gap By default, the executable code corresponding to a table entry
- is assumed to extend to the beginning of the next table entry.
- If this is not the case--there is a "hole" in the table--then
- a gap escape should follow the first table entry to specify
- where the code for that entry ends.
- */
-
-#define dst_ln_escape_flag -8
-
-/*
- Escape function codes:
- */
-typedef enum
- {
- dst_ln_pad, /* pad byte */
- dst_ln_file, /* file escape. Next 4 bytes are a dst_src_loc_t */
- dst_ln_dln1_dpc1, /* 1 byte line delta, 1 byte pc delta */
- dst_ln_dln2_dpc2, /* 2 bytes line delta, 2 bytes pc delta */
- dst_ln_ln4_pc4, /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
- dst_ln_dln1_dpc0, /* 1 byte line delta, pc delta = 0 */
- dst_ln_ln_off_1, /* statement escape, stmt # = 1 (2nd stmt on line) */
- dst_ln_ln_off, /* statement escape, stmt # = next byte */
- dst_ln_entry, /* entry escape, next byte is entry number */
- dst_ln_exit, /* exit escape */
- dst_ln_stmt_end, /* gap escape, 4 bytes pc delta */
- dst_ln_escape_11, /* reserved */
- dst_ln_escape_12, /* reserved */
- dst_ln_escape_13, /* reserved */
- dst_ln_nxt_byte, /* next byte contains the real escape code */
- dst_ln_end, /* end escape, final entry follows */
- dst_ln_escape_END_OF_ENUM
- }
-dst_ln_escape_t;
-
-/*
- Line number table entry
- */
-typedef union
- {
- struct
- {
- unsigned int ln_delta:4; /* 4 bit line number delta */
- unsigned int pc_delta:4; /* 4 bit pc delta */
- }
- delta;
-
- struct
- {
- unsigned int esc_flag:4; /* alias for ln_delta */
- dst_ln_escape_t esc_code:4; /* escape function code */
- }
- esc;
-
- char sdata; /* signed data byte */
- unsigned char udata; /* unsigned data byte */
- }
-dst_ln_entry_t,
- *dst_ln_entry_ptr_t,
- dst_ln_table_t[dst_dummy_array_size];
-
-/* The following macro will extract the ln_delta field as a signed value:
- */
-#define dst_ln_ln_delta(ln_rec) \
- ( ((short) ((ln_rec).delta.ln_delta << 12)) >> 12 )
-
-
-
-
-typedef struct dst_sec_struct
- {
- char *buffer;
- long position;
- long size;
- long base;
- }
-dst_sec;
-
-
-/* Macros for access to the data */
-
-#define DST_comp_unit(x) ((x)->rec_data.comp_unit_)
-#define DST_section_tab(x) ((x)->rec_data.section_tab_)
-#define DST_file_tab(x) ((x)->rec_data.file_tab_)
-#define DST_block(x) ((x)->rec_data.block_)
-#define DST_var(x) ((x)->rec_data.var_)
-#define DST_pointer(x) ((x)->rec_data.pointer_)
-#define DST_array(x) ((x)->rec_data.array_)
-#define DST_subrange(x) ((x)->rec_data.subrange_)
-#define DST_set(x) ((x)->rec_data.set_)
-#define DST_implicit_enum(x) ((x)->rec_data.implicit_enum_)
-#define DST_explicit_enum(x) ((x)->rec_data.explicit_enum_)
-#define DST_short_rec(x) ((x)->rec_data.record_)
-#define DST_short_union(x) ((x)->rec_data.record_)
-#define DST_file(x) ((x)->rec_data.file_)
-#define DST_offset(x) ((x)->rec_data.offset_)
-#define DST_alias(x) ((x)->rec_data.alias_)
-#define DST_signature(x) ((x)->rec_data.signature_)
-#define DST_old_label(x) ((x)->rec_data.old_label_)
-#define DST_scope(x) ((x)->rec_data.scope_)
-#define DST_string_tab(x) ((x)->rec_data.string_tab_)
-#define DST_global_name_tab(x) ((x)->rec_data.string_tab_)
-#define DST_forward(x) ((x)->rec_data.forward_)
-#define DST_aux_size(x) ((x)->rec_data.aux_size_)
-#define DST_aux_align(x) ((x)->rec_data.aux_align_)
-#define DST_aux_field_size(x) ((x)->rec_data.aux_field_size_)
-#define DST_aux_field_off(x) ((x)->rec_data.aux_field_off_)
-#define DST_aux_field_align(x) ((x)->rec_data.aux_field_align_)
-#define DST_aux_qual(x) ((x)->rec_data.aux_qual_)
-#define DST_aux_var_bound(x) ((x)->rec_data.aux_var_bound_)
-#define DST_extension(x) ((x)->rec_data.extension_)
-#define DST_string(x) ((x)->rec_data.string_)
-#define DST_const(x) ((x)->rec_data.const_)
-#define DST_reference(x) ((x)->rec_data.pointer_)
-#define DST_record(x) ((x)->rec_data.record_)
-#define DST_union(x) ((x)->rec_data.record_)
-#define DST_aux_type_deriv(x) ((x)->rec_data.aux_type_deriv_)
-#define DST_locpool(x) ((x)->rec_data.string_tab_)
-#define DST_variable(x) ((x)->rec_data.variable_)
-#define DST_label(x) ((x)->rec_data.label_)
-#define DST_entry(x) ((x)->rec_data.entry_)
-#define DST_aux_lifetime(x) ((x)->rec_data.aux_lifetime_)
-#define DST_aux_ptr_base(x) ((x)->rec_data.aux_ptr_base_)
-#define DST_aux_src_range(x) ((x)->rec_data.aux_src_range_)
-#define DST_aux_reg_val(x) ((x)->rec_data.aux_reg_val_)
-#define DST_aux_unit_names(x) ((x)->rec_data.aux_unit_names_)
-#define DST_aux_sect_info(x) ((x)->rec_data.aux_sect_info_)
-
-
-/*
- * Type codes for loc strings. I'm not entirely certain about all of
- * these, but they seem to work.
- * troy@cbme.unsw.EDU.AU
- * If you find a variable whose location can't be decoded, you should
- * find out it's code using "dstdump -s filename". It will record an
- * entry for the variable, and give a text representation of what
- * the locstring means. Before that explaination there will be a
- * number. In the LOCSTRING table, that number will appear before
- * the start of the location string. Location string codes are
- * five bit codes with a 3 bit argument. Check the high 5 bits of
- * the one byte code, and figure out where it goes in here.
- * Then figure out exactly what the meaning is and code it in
- * dstread.c
- *
- * Note that ranged locs mean that the variable is in different locations
- * depending on the current PC. We ignore these because (a) gcc can't handle
- * them, and (b), If you don't use high levels of optimisation they won't
- * occur.
- */
-typedef enum
- {
- dst_lsc_end, /* End of string */
- dst_lsc_indirect, /* Indirect through previous. Arg == 6 */
- /* Or register ax (x=arg) */
- dst_lsc_dreg, /* register dx (x=arg) */
- dst_lsc_03,
- dst_lsc_section, /* Section (arg+1) */
- dst_lsc_05,
- dst_lsc_06,
- dst_lsc_add, /* Add (arg+1)*2 */
- dst_lsc_sub, /* Subtract (arg+1)*2 */
- dst_lsc_09,
- dst_lsc_0a,
- dst_lsc_sec_byte, /* Section of next byte+1 */
- dst_lsc_add_byte, /* Add next byte (arg == 5) or next word
- * (arg == 6)
- */
- dst_lsc_sub_byte, /* Subtract next byte. (arg == 1) or next
- * word (arg == 6 ?)
- */
- dst_lsc_sbreg, /* Stack base register (frame pointer). Arg==0 */
- dst_lsc_0f,
- dst_lsc_ranged, /* location is pc dependent */
- dst_lsc_11,
- dst_lsc_12,
- dst_lsc_13,
- dst_lsc_14,
- dst_lsc_15,
- dst_lsc_16,
- dst_lsc_17,
- dst_lsc_18,
- dst_lsc_19,
- dst_lsc_1a,
- dst_lsc_1b,
- dst_lsc_1c,
- dst_lsc_1d,
- dst_lsc_1e,
- dst_lsc_1f
- }
-dst_loc_string_code_t;
-
-/* If the following occurs after an addition/subtraction, that addition
- * or subtraction should be multiplied by 256. It's a complete byte, not
- * a code.
- */
-
-#define dst_multiply_256 ((char) 0x73)
-
-typedef struct
- {
- char code:5;
- char arg:3;
- }
-dst_loc_header_t ALIGNED1;
-
-typedef union
- {
- dst_loc_header_t header;
- char data;
- }
-dst_loc_entry_t ALIGNED1;
-
-#undef ALIGNED1
-#endif /* apollo_dst_h */
+// OBSOLETE /* <apollo/dst.h> */
+// 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
index abcce097a27..8692c986467 100644
--- a/gdb/dstread.c
+++ b/gdb/dstread.c
@@ -1,1596 +1,1598 @@
-/* Read apollo DST symbol tables and convert to internal format, for GDB.
- Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "breakpoint.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "buildsym.h"
-#include "obstack.h"
-
-#include "gdb_string.h"
-
-#include "dst.h"
-
-CORE_ADDR cur_src_start_addr, cur_src_end_addr;
-dst_sec blocks_info, lines_info, symbols_info;
-
-/* Vector of line number information. */
-
-static struct linetable *line_vector;
-
-/* Index of next entry to go in line_vector_index. */
-
-static int line_vector_index;
-
-/* Last line number recorded in the line vector. */
-
-static int prev_line_number;
-
-/* Number of elements allocated for line_vector currently. */
-
-static int line_vector_length;
-
-static int init_dst_sections (int);
-
-static void read_dst_symtab (struct objfile *);
-
-static void find_dst_sections (bfd *, sec_ptr, PTR);
-
-static void dst_symfile_init (struct objfile *);
-
-static void dst_new_init (struct objfile *);
-
-static void dst_symfile_read (struct objfile *, int);
-
-static void dst_symfile_finish (struct objfile *);
-
-static void dst_end_symtab (struct objfile *);
-
-static void complete_symtab (char *, CORE_ADDR, unsigned int);
-
-static void dst_start_symtab (void);
-
-static void dst_record_line (int, CORE_ADDR);
-
-/* Manage the vector of line numbers. */
-/* FIXME: Use record_line instead. */
-
-static void
-dst_record_line (int line, CORE_ADDR pc)
-{
- struct linetable_entry *e;
- /* Make sure line vector is big enough. */
-
- if (line_vector_index + 2 >= line_vector_length)
- {
- line_vector_length *= 2;
- line_vector = (struct linetable *)
- xrealloc ((char *) line_vector, sizeof (struct linetable)
- + (line_vector_length
- * sizeof (struct linetable_entry)));
- }
-
- e = line_vector->item + line_vector_index++;
- e->line = line;
- e->pc = pc;
-}
-
-/* Start a new symtab for a new source file.
- It indicates the start of data for one original source file. */
-/* FIXME: use start_symtab, like coffread.c now does. */
-
-static void
-dst_start_symtab (void)
-{
- /* Initialize the source file line number information for this file. */
-
- if (line_vector) /* Unlikely, but maybe possible? */
- xfree (line_vector);
- line_vector_index = 0;
- line_vector_length = 1000;
- prev_line_number = -2; /* Force first line number to be explicit */
- line_vector = (struct linetable *)
- xmalloc (sizeof (struct linetable)
- + line_vector_length * sizeof (struct linetable_entry));
-}
-
-/* Save the vital information from when starting to read a file,
- for use when closing off the current file.
- NAME is the file name the symbols came from, START_ADDR is the first
- text address for the file, and SIZE is the number of bytes of text. */
-
-static void
-complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
-{
- last_source_file = savestring (name, strlen (name));
- cur_src_start_addr = start_addr;
- cur_src_end_addr = start_addr + size;
-
- if (current_objfile->ei.entry_point >= cur_src_start_addr &&
- current_objfile->ei.entry_point < cur_src_end_addr)
- {
- current_objfile->ei.entry_file_lowpc = cur_src_start_addr;
- current_objfile->ei.entry_file_highpc = cur_src_end_addr;
- }
-}
-
-/* Finish the symbol definitions for one main source file,
- close off all the lexical contexts for that file
- (creating struct block's for them), then make the
- struct symtab for that file and put it in the list of all such. */
-/* FIXME: Use end_symtab, like coffread.c now does. */
-
-static void
-dst_end_symtab (struct objfile *objfile)
-{
- register struct symtab *symtab;
- register struct blockvector *blockvector;
- register struct linetable *lv;
-
- /* Create the blockvector that points to all the file's blocks. */
-
- blockvector = make_blockvector (objfile);
-
- /* Now create the symtab object for this source file. */
- symtab = allocate_symtab (last_source_file, objfile);
-
- /* Fill in its components. */
- symtab->blockvector = blockvector;
- symtab->free_code = free_linetable;
- symtab->free_ptr = 0;
- symtab->filename = last_source_file;
- symtab->dirname = NULL;
- symtab->debugformat = obsavestring ("Apollo DST", 10,
- &objfile->symbol_obstack);
- lv = line_vector;
- lv->nitems = line_vector_index;
- symtab->linetable = (struct linetable *)
- xrealloc ((char *) lv, (sizeof (struct linetable)
- + lv->nitems * sizeof (struct linetable_entry)));
-
- free_named_symtabs (symtab->filename);
-
- /* Reinitialize for beginning of new file. */
- line_vector = 0;
- line_vector_length = -1;
- last_source_file = NULL;
-}
-
-/* dst_symfile_init ()
- is the dst-specific initialization routine for reading symbols.
-
- We will only be called if this is a DST or DST-like file.
- BFD handles figuring out the format of the file, and code in symtab.c
- uses BFD's determination to vector to us.
-
- The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
-
-static void
-dst_symfile_init (struct objfile *objfile)
-{
- asection *section;
- bfd *abfd = objfile->obfd;
-
- init_entry_point_info (objfile);
-
-}
-
-/* This function is called for every section; it finds the outer limits
- of the line table (minimum and maximum file offset) so that the
- mainline code can read the whole thing for efficiency. */
-
-/* ARGSUSED */
-static void
-find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo)
-{
- int size, count;
- long base;
- file_ptr offset, maxoff;
- dst_sec *section;
-
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- size = asect->_raw_size;
- offset = asect->filepos;
- base = asect->vma;
-/* End of warning */
-
- section = NULL;
- if (!strcmp (asect->name, ".blocks"))
- section = &blocks_info;
- else if (!strcmp (asect->name, ".lines"))
- section = &lines_info;
- else if (!strcmp (asect->name, ".symbols"))
- section = &symbols_info;
- if (!section)
- return;
- section->size = size;
- section->position = offset;
- section->base = base;
-}
-
-
-/* The BFD for this file -- only good while we're actively reading
- symbols into a psymtab or a symtab. */
-
-static bfd *symfile_bfd;
-
-/* Read a symbol file, after initialization by dst_symfile_init. */
-/* FIXME! Addr and Mainline are not used yet -- this will not work for
- shared libraries or add_file! */
-
-/* ARGSUSED */
-static void
-dst_symfile_read (struct objfile *objfile, int mainline)
-{
- bfd *abfd = objfile->obfd;
- char *name = bfd_get_filename (abfd);
- int desc;
- register int val;
- int num_symbols;
- int symtab_offset;
- int stringtab_offset;
-
- symfile_bfd = abfd; /* Kludge for swap routines */
-
-/* WARNING WILL ROBINSON! ACCESSING BFD-PRIVATE DATA HERE! FIXME! */
- desc = fileno ((FILE *) (abfd->iostream)); /* File descriptor */
-
- /* Read the line number table, all at once. */
- bfd_map_over_sections (abfd, find_dst_sections, (PTR) NULL);
-
- val = init_dst_sections (desc);
- if (val < 0)
- error ("\"%s\": error reading debugging symbol tables\n", name);
-
- init_minimal_symbol_collection ();
- make_cleanup_discard_minimal_symbols ();
-
- /* Now that the executable file is positioned at symbol table,
- process it and define symbols accordingly. */
-
- read_dst_symtab (objfile);
-
- /* Sort symbols alphabetically within each block. */
-
- {
- struct symtab *s;
- for (s = objfile->symtabs; s != NULL; s = s->next)
- {
- sort_symtab_syms (s);
- }
- }
-
- /* Install any minimal symbols that have been collected as the current
- minimal symbols for this objfile. */
-
- install_minimal_symbols (objfile);
-}
-
-static void
-dst_new_init (struct objfile *ignore)
-{
- /* Nothin' to do */
-}
-
-/* Perform any local cleanups required when we are done with a particular
- objfile. I.E, we are in the process of discarding all symbol information
- for an objfile, freeing up all memory held for it, and unlinking the
- objfile struct from the global list of known objfiles. */
-
-static void
-dst_symfile_finish (struct objfile *objfile)
-{
- /* Nothing to do */
-}
-
-
-/* Get the next line number from the DST. Returns 0 when we hit an
- * end directive or cannot continue for any other reason.
- *
- * Note that ordinary pc deltas are multiplied by two. Apparently
- * this is what was really intended.
- */
-static int
-get_dst_line (signed char **buffer, long *pc)
-{
- static last_pc = 0;
- static long last_line = 0;
- static int last_file = 0;
- dst_ln_entry_ptr_t entry;
- int size;
- dst_src_loc_t *src_loc;
-
- if (*pc != -1)
- {
- last_pc = *pc;
- *pc = -1;
- }
- entry = (dst_ln_entry_ptr_t) * buffer;
-
- while (dst_ln_ln_delta (*entry) == dst_ln_escape_flag)
- {
- switch (entry->esc.esc_code)
- {
- case dst_ln_pad:
- size = 1; /* pad byte */
- break;
- case dst_ln_file:
- /* file escape. Next 4 bytes are a dst_src_loc_t */
- size = 5;
- src_loc = (dst_src_loc_t *) (*buffer + 1);
- last_line = src_loc->line_number;
- last_file = src_loc->file_index;
- break;
- case dst_ln_dln1_dpc1:
- /* 1 byte line delta, 1 byte pc delta */
- last_line += (*buffer)[1];
- last_pc += 2 * (unsigned char) (*buffer)[2];
- dst_record_line (last_line, last_pc);
- size = 3;
- break;
- case dst_ln_dln2_dpc2:
- /* 2 bytes line delta, 2 bytes pc delta */
- last_line += *(short *) (*buffer + 1);
- last_pc += 2 * (*(short *) (*buffer + 3));
- size = 5;
- dst_record_line (last_line, last_pc);
- break;
- case dst_ln_ln4_pc4:
- /* 4 bytes ABSOLUTE line number, 4 bytes ABSOLUTE pc */
- last_line = *(unsigned long *) (*buffer + 1);
- last_pc = *(unsigned long *) (*buffer + 5);
- size = 9;
- dst_record_line (last_line, last_pc);
- break;
- case dst_ln_dln1_dpc0:
- /* 1 byte line delta, pc delta = 0 */
- size = 2;
- last_line += (*buffer)[1];
- break;
- case dst_ln_ln_off_1:
- /* statement escape, stmt # = 1 (2nd stmt on line) */
- size = 1;
- break;
- case dst_ln_ln_off:
- /* statement escape, stmt # = next byte */
- size = 2;
- break;
- case dst_ln_entry:
- /* entry escape, next byte is entry number */
- size = 2;
- break;
- case dst_ln_exit:
- /* exit escape */
- size = 1;
- break;
- case dst_ln_stmt_end:
- /* gap escape, 4 bytes pc delta */
- size = 5;
- /* last_pc += 2 * (*(long *) (*buffer + 1)); */
- /* Apparently this isn't supposed to actually modify
- * the pc value. Totally weird.
- */
- break;
- case dst_ln_escape_11:
- case dst_ln_escape_12:
- case dst_ln_escape_13:
- size = 1;
- break;
- case dst_ln_nxt_byte:
- /* This shouldn't happen. If it does, we're SOL */
- return 0;
- break;
- case dst_ln_end:
- /* end escape, final entry follows */
- return 0;
- }
- *buffer += (size < 0) ? -size : size;
- entry = (dst_ln_entry_ptr_t) * buffer;
- }
- last_line += dst_ln_ln_delta (*entry);
- last_pc += entry->delta.pc_delta * 2;
- (*buffer)++;
- dst_record_line (last_line, last_pc);
- return 1;
-}
-
-static void
-enter_all_lines (char *buffer, long address)
-{
- if (buffer)
- while (get_dst_line (&buffer, &address));
-}
-
-static int
-get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry)
-{
- int size;
- dst_rec_ptr_t entry;
- static int last_type;
- int ar_size;
- static unsigned lu3;
-
- entry = (dst_rec_ptr_t) buffer;
- switch (entry->rec_type)
- {
- case dst_typ_pad:
- size = 0;
- break;
- case dst_typ_comp_unit:
- size = sizeof (DST_comp_unit (entry));
- break;
- case dst_typ_section_tab:
- size = sizeof (DST_section_tab (entry))
- + ((int) DST_section_tab (entry).number_of_sections
- - dst_dummy_array_size) * sizeof (long);
- break;
- case dst_typ_file_tab:
- size = sizeof (DST_file_tab (entry))
- + ((int) DST_file_tab (entry).number_of_files
- - dst_dummy_array_size) * sizeof (dst_file_desc_t);
- break;
- case dst_typ_block:
- size = sizeof (DST_block (entry))
- + ((int) DST_block (entry).n_of_code_ranges
- - dst_dummy_array_size) * sizeof (dst_code_range_t);
- break;
- case dst_typ_5:
- size = -1;
- break;
- case dst_typ_var:
- size = sizeof (DST_var (entry)) -
- sizeof (dst_var_loc_long_t) * dst_dummy_array_size +
- DST_var (entry).no_of_locs *
- (DST_var (entry).short_locs ?
- sizeof (dst_var_loc_short_t) :
- sizeof (dst_var_loc_long_t));
- break;
- case dst_typ_pointer:
- size = sizeof (DST_pointer (entry));
- break;
- case dst_typ_array:
- size = sizeof (DST_array (entry));
- break;
- case dst_typ_subrange:
- size = sizeof (DST_subrange (entry));
- break;
- case dst_typ_set:
- size = sizeof (DST_set (entry));
- break;
- case dst_typ_implicit_enum:
- size = sizeof (DST_implicit_enum (entry))
- + ((int) DST_implicit_enum (entry).nelems
- - dst_dummy_array_size) * sizeof (dst_rel_offset_t);
- break;
- case dst_typ_explicit_enum:
- size = sizeof (DST_explicit_enum (entry))
- + ((int) DST_explicit_enum (entry).nelems
- - dst_dummy_array_size) * sizeof (dst_enum_elem_t);
- break;
- case dst_typ_short_rec:
- size = sizeof (DST_short_rec (entry))
- + DST_short_rec (entry).nfields * sizeof (dst_short_field_t)
- - dst_dummy_array_size * sizeof (dst_field_t);
- break;
- case dst_typ_short_union:
- size = sizeof (DST_short_union (entry))
- + DST_short_union (entry).nfields * sizeof (dst_short_field_t)
- - dst_dummy_array_size * sizeof (dst_field_t);
- break;
- case dst_typ_file:
- size = sizeof (DST_file (entry));
- break;
- case dst_typ_offset:
- size = sizeof (DST_offset (entry));
- break;
- case dst_typ_alias:
- size = sizeof (DST_alias (entry));
- break;
- case dst_typ_signature:
- size = sizeof (DST_signature (entry)) +
- ((int) DST_signature (entry).nargs -
- dst_dummy_array_size) * sizeof (dst_arg_t);
- break;
- case dst_typ_21:
- size = -1;
- break;
- case dst_typ_old_label:
- size = sizeof (DST_old_label (entry));
- break;
- case dst_typ_scope:
- size = sizeof (DST_scope (entry));
- break;
- case dst_typ_end_scope:
- size = 0;
- break;
- case dst_typ_25:
- case dst_typ_26:
- size = -1;
- break;
- case dst_typ_string_tab:
- case dst_typ_global_name_tab:
- size = sizeof (DST_string_tab (entry))
- + DST_string_tab (entry).length
- - dst_dummy_array_size;
- break;
- case dst_typ_forward:
- size = sizeof (DST_forward (entry));
- get_dst_entry ((char *) entry + DST_forward (entry).rec_off, &entry);
- break;
- case dst_typ_aux_size:
- size = sizeof (DST_aux_size (entry));
- break;
- case dst_typ_aux_align:
- size = sizeof (DST_aux_align (entry));
- break;
- case dst_typ_aux_field_size:
- size = sizeof (DST_aux_field_size (entry));
- break;
- case dst_typ_aux_field_off:
- size = sizeof (DST_aux_field_off (entry));
- break;
- case dst_typ_aux_field_align:
- size = sizeof (DST_aux_field_align (entry));
- break;
- case dst_typ_aux_qual:
- size = sizeof (DST_aux_qual (entry));
- break;
- case dst_typ_aux_var_bound:
- size = sizeof (DST_aux_var_bound (entry));
- break;
- case dst_typ_extension:
- size = DST_extension (entry).rec_size;
- break;
- case dst_typ_string:
- size = sizeof (DST_string (entry));
- break;
- case dst_typ_old_entry:
- size = 48; /* Obsolete entry type */
- break;
- case dst_typ_const:
- size = sizeof (DST_const (entry))
- + DST_const (entry).value.length
- - sizeof (DST_const (entry).value.val);
- break;
- case dst_typ_reference:
- size = sizeof (DST_reference (entry));
- break;
- case dst_typ_old_record:
- case dst_typ_old_union:
- case dst_typ_record:
- case dst_typ_union:
- size = sizeof (DST_record (entry))
- + ((int) DST_record (entry).nfields
- - dst_dummy_array_size) * sizeof (dst_field_t);
- break;
- case dst_typ_aux_type_deriv:
- size = sizeof (DST_aux_type_deriv (entry));
- break;
- case dst_typ_locpool:
- size = sizeof (DST_locpool (entry))
- + ((int) DST_locpool (entry).length -
- dst_dummy_array_size);
- break;
- case dst_typ_variable:
- size = sizeof (DST_variable (entry));
- break;
- case dst_typ_label:
- size = sizeof (DST_label (entry));
- break;
- case dst_typ_entry:
- size = sizeof (DST_entry (entry));
- break;
- case dst_typ_aux_lifetime:
- size = sizeof (DST_aux_lifetime (entry));
- break;
- case dst_typ_aux_ptr_base:
- size = sizeof (DST_aux_ptr_base (entry));
- break;
- case dst_typ_aux_src_range:
- size = sizeof (DST_aux_src_range (entry));
- break;
- case dst_typ_aux_reg_val:
- size = sizeof (DST_aux_reg_val (entry));
- break;
- case dst_typ_aux_unit_names:
- size = sizeof (DST_aux_unit_names (entry))
- + ((int) DST_aux_unit_names (entry).number_of_names
- - dst_dummy_array_size) * sizeof (dst_rel_offset_t);
- break;
- case dst_typ_aux_sect_info:
- size = sizeof (DST_aux_sect_info (entry))
- + ((int) DST_aux_sect_info (entry).number_of_refs
- - dst_dummy_array_size) * sizeof (dst_sect_ref_t);
- break;
- default:
- size = -1;
- break;
- }
- if (size == -1)
- {
- fprintf_unfiltered (gdb_stderr, "Warning: unexpected DST entry type (%d) found\nLast valid entry was of type: %d\n",
- (int) entry->rec_type,
- last_type);
- fprintf_unfiltered (gdb_stderr, "Last unknown_3 value: %d\n", lu3);
- size = 0;
- }
- else
- last_type = entry->rec_type;
- if (size & 1) /* Align on a word boundary */
- size++;
- size += 2;
- *ret_entry = entry;
- return size;
-}
-
-static int
-next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table)
-{
- if (*buffer - table->buffer >= table->size)
- {
- *entry = NULL;
- return 0;
- }
- *buffer += get_dst_entry (*buffer, entry);
- return 1;
-}
-
-#define NEXT_BLK(a, b) next_dst_entry(a, b, &blocks_info)
-#define NEXT_SYM(a, b) next_dst_entry(a, b, &symbols_info)
-#define DST_OFFSET(a, b) ((char *) (a) + (b))
-
-static dst_rec_ptr_t section_table = NULL;
-
-char *
-get_sec_ref (dst_sect_ref_t *ref)
-{
- dst_sec *section = NULL;
- long offset;
-
- if (!section_table || !ref->sect_index)
- return NULL;
- offset = DST_section_tab (section_table).section_base[ref->sect_index - 1]
- + ref->sect_offset;
- if (offset >= blocks_info.base &&
- offset < blocks_info.base + blocks_info.size)
- section = &blocks_info;
- else if (offset >= symbols_info.base &&
- offset < symbols_info.base + symbols_info.size)
- section = &symbols_info;
- else if (offset >= lines_info.base &&
- offset < lines_info.base + lines_info.size)
- section = &lines_info;
- if (!section)
- return NULL;
- return section->buffer + (offset - section->base);
-}
-
-CORE_ADDR
-dst_get_addr (int section, long offset)
-{
- if (!section_table || !section)
- return 0;
- return DST_section_tab (section_table).section_base[section - 1] + offset;
-}
-
-CORE_ADDR
-dst_sym_addr (dst_sect_ref_t *ref)
-{
- if (!section_table || !ref->sect_index)
- return 0;
- return DST_section_tab (section_table).section_base[ref->sect_index - 1]
- + ref->sect_offset;
-}
-
-static struct symbol *
-create_new_symbol (struct objfile *objfile, char *name)
-{
- struct symbol *sym = (struct symbol *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
- memset (sym, 0, sizeof (struct symbol));
- SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
- &objfile->symbol_obstack);
- SYMBOL_VALUE (sym) = 0;
- SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
-
- SYMBOL_CLASS (sym) = LOC_BLOCK;
- return sym;
-};
-
-static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t);
-
-static struct type *
-decode_type_desc (struct objfile *objfile, dst_type_t *type_desc,
- dst_rec_ptr_t base)
-{
- struct type *type;
- dst_rec_ptr_t entry;
- if (type_desc->std_type.user_defined_type)
- {
- entry = (dst_rec_ptr_t) DST_OFFSET (base,
- dst_user_type_offset (*type_desc));
- type = decode_dst_type (objfile, entry);
- }
- else
- {
- switch (type_desc->std_type.dtc)
- {
- case dst_int8_type:
- type = builtin_type_signed_char;
- break;
- case dst_int16_type:
- type = builtin_type_short;
- break;
- case dst_int32_type:
- type = builtin_type_long;
- break;
- case dst_uint8_type:
- type = builtin_type_unsigned_char;
- break;
- case dst_uint16_type:
- type = builtin_type_unsigned_short;
- break;
- case dst_uint32_type:
- type = builtin_type_unsigned_long;
- break;
- case dst_real32_type:
- type = builtin_type_float;
- break;
- case dst_real64_type:
- type = builtin_type_double;
- break;
- case dst_complex_type:
- type = builtin_type_complex;
- break;
- case dst_dcomplex_type:
- type = builtin_type_double_complex;
- break;
- case dst_bool8_type:
- type = builtin_type_char;
- break;
- case dst_bool16_type:
- type = builtin_type_short;
- break;
- case dst_bool32_type:
- type = builtin_type_long;
- break;
- case dst_char_type:
- type = builtin_type_char;
- break;
- /* The next few are more complex. I will take care
- * of them properly at a later point.
- */
- case dst_string_type:
- type = builtin_type_void;
- break;
- case dst_ptr_type:
- type = builtin_type_void;
- break;
- case dst_set_type:
- type = builtin_type_void;
- break;
- case dst_proc_type:
- type = builtin_type_void;
- break;
- case dst_func_type:
- type = builtin_type_void;
- break;
- /* Back tto some ordinary ones */
- case dst_void_type:
- type = builtin_type_void;
- break;
- case dst_uchar_type:
- type = builtin_type_unsigned_char;
- break;
- default:
- type = builtin_type_void;
- break;
- }
- }
- return type;
-}
-
-struct structure_list
-{
- struct structure_list *next;
- struct type *type;
-};
-
-static struct structure_list *struct_list = NULL;
-
-static struct type *
-find_dst_structure (char *name)
-{
- struct structure_list *element;
-
- for (element = struct_list; element; element = element->next)
- if (!strcmp (name, TYPE_NAME (element->type)))
- return element->type;
- return NULL;
-}
-
-
-static struct type *
-decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code,
- int version)
-{
- struct type *type, *child_type;
- char *struct_name;
- char *name, *field_name;
- int i;
- int fieldoffset, fieldsize;
- dst_type_t type_desc;
- struct structure_list *element;
-
- struct_name = DST_OFFSET (entry, DST_record (entry).noffset);
- name = concat ((code == TYPE_CODE_UNION) ? "union " : "struct ",
- struct_name, NULL);
- type = find_dst_structure (name);
- if (type)
- {
- xfree (name);
- return type;
- }
- type = alloc_type (objfile);
- TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
- name, strlen (name));
- xfree (name);
- TYPE_CODE (type) = code;
- TYPE_LENGTH (type) = DST_record (entry).size;
- TYPE_NFIELDS (type) = DST_record (entry).nfields;
- TYPE_FIELDS (type) = (struct field *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) *
- DST_record (entry).nfields);
- fieldoffset = fieldsize = 0;
- INIT_CPLUS_SPECIFIC (type);
- element = (struct structure_list *)
- xmalloc (sizeof (struct structure_list));
- element->type = type;
- element->next = struct_list;
- struct_list = element;
- for (i = 0; i < DST_record (entry).nfields; i++)
- {
- switch (version)
- {
- case 2:
- field_name = DST_OFFSET (entry,
- DST_record (entry).f.ofields[i].noffset);
- fieldoffset = DST_record (entry).f.ofields[i].foffset * 8 +
- DST_record (entry).f.ofields[i].bit_offset;
- fieldsize = DST_record (entry).f.ofields[i].size;
- type_desc = DST_record (entry).f.ofields[i].type_desc;
- break;
- case 1:
- field_name = DST_OFFSET (entry,
- DST_record (entry).f.fields[i].noffset);
- type_desc = DST_record (entry).f.fields[i].type_desc;
- switch (DST_record (entry).f.fields[i].f.field_loc.format_tag)
- {
- case dst_field_byte:
- fieldoffset = DST_record (entry).f.
- fields[i].f.field_byte.offset * 8;
- fieldsize = -1;
- break;
- case dst_field_bit:
- fieldoffset = DST_record (entry).f.
- fields[i].f.field_bit.byte_offset * 8 +
- DST_record (entry).f.
- fields[i].f.field_bit.bit_offset;
- fieldsize = DST_record (entry).f.
- fields[i].f.field_bit.nbits;
- break;
- case dst_field_loc:
- fieldoffset += fieldsize;
- fieldsize = -1;
- break;
- }
- break;
- case 0:
- field_name = DST_OFFSET (entry,
- DST_record (entry).f.sfields[i].noffset);
- fieldoffset = DST_record (entry).f.sfields[i].foffset;
- type_desc = DST_record (entry).f.sfields[i].type_desc;
- if (i < DST_record (entry).nfields - 1)
- fieldsize = DST_record (entry).f.sfields[i + 1].foffset;
- else
- fieldsize = DST_record (entry).size;
- fieldsize -= fieldoffset;
- fieldoffset *= 8;
- fieldsize *= 8;
- }
- TYPE_FIELDS (type)[i].name =
- obstack_copy0 (&objfile->symbol_obstack,
- field_name, strlen (field_name));
- TYPE_FIELDS (type)[i].type = decode_type_desc (objfile,
- &type_desc,
- entry);
- if (fieldsize == -1)
- fieldsize = TYPE_LENGTH (TYPE_FIELDS (type)[i].type) *
- 8;
- TYPE_FIELDS (type)[i].bitsize = fieldsize;
- TYPE_FIELDS (type)[i].bitpos = fieldoffset;
- }
- return type;
-}
-
-static struct type *
-decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry)
-{
- struct type *child_type, *type, *range_type, *index_type;
-
- switch (entry->rec_type)
- {
- case dst_typ_var:
- return decode_type_desc (objfile,
- &DST_var (entry).type_desc,
- entry);
- break;
- case dst_typ_variable:
- return decode_type_desc (objfile,
- &DST_variable (entry).type_desc,
- entry);
- break;
- case dst_typ_short_rec:
- return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 0);
- case dst_typ_short_union:
- return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 0);
- case dst_typ_union:
- return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 1);
- case dst_typ_record:
- return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 1);
- case dst_typ_old_union:
- return decode_dst_structure (objfile, entry, TYPE_CODE_UNION, 2);
- case dst_typ_old_record:
- return decode_dst_structure (objfile, entry, TYPE_CODE_STRUCT, 2);
- case dst_typ_pointer:
- return make_pointer_type (
- decode_type_desc (objfile,
- &DST_pointer (entry).type_desc,
- entry),
- NULL);
- case dst_typ_array:
- child_type = decode_type_desc (objfile,
- &DST_pointer (entry).type_desc,
- entry);
- index_type = lookup_fundamental_type (objfile,
- FT_INTEGER);
- range_type = create_range_type ((struct type *) NULL,
- index_type, DST_array (entry).lo_bound,
- DST_array (entry).hi_bound);
- return create_array_type ((struct type *) NULL, child_type,
- range_type);
- case dst_typ_alias:
- return decode_type_desc (objfile,
- &DST_alias (entry).type_desc,
- entry);
- default:
- return builtin_type_int;
- }
-}
-
-struct symbol_list
-{
- struct symbol_list *next;
- struct symbol *symbol;
-};
-
-static struct symbol_list *dst_global_symbols = NULL;
-static int total_globals = 0;
-
-static void
-decode_dst_locstring (char *locstr, struct symbol *sym)
-{
- dst_loc_entry_t *entry, *next_entry;
- CORE_ADDR temp;
- int count = 0;
-
- while (1)
- {
- if (count++ == 100)
- {
- fprintf_unfiltered (gdb_stderr, "Error reading locstring\n");
- break;
- }
- entry = (dst_loc_entry_t *) locstr;
- next_entry = (dst_loc_entry_t *) (locstr + 1);
- switch (entry->header.code)
- {
- case dst_lsc_end: /* End of string */
- return;
- case dst_lsc_indirect: /* Indirect through previous. Arg == 6 */
- /* Or register ax x == arg */
- if (entry->header.arg < 6)
- {
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = entry->header.arg + 8;
- }
- /* We predict indirects */
- locstr++;
- break;
- case dst_lsc_dreg:
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- SYMBOL_VALUE (sym) = entry->header.arg;
- locstr++;
- break;
- case dst_lsc_section: /* Section (arg+1) */
- SYMBOL_VALUE (sym) = dst_get_addr (entry->header.arg + 1, 0);
- locstr++;
- break;
- case dst_lsc_sec_byte: /* Section (next_byte+1) */
- SYMBOL_VALUE (sym) = dst_get_addr (locstr[1] + 1, 0);
- locstr += 2;
- break;
- case dst_lsc_add: /* Add (arg+1)*2 */
- case dst_lsc_sub: /* Subtract (arg+1)*2 */
- temp = (entry->header.arg + 1) * 2;
- locstr++;
- if (*locstr == dst_multiply_256)
- {
- temp <<= 8;
- locstr++;
- }
- switch (entry->header.code)
- {
- case dst_lsc_add:
- if (SYMBOL_CLASS (sym) == LOC_LOCAL)
- SYMBOL_CLASS (sym) = LOC_ARG;
- SYMBOL_VALUE (sym) += temp;
- break;
- case dst_lsc_sub:
- SYMBOL_VALUE (sym) -= temp;
- break;
- }
- break;
- case dst_lsc_add_byte:
- case dst_lsc_sub_byte:
- switch (entry->header.arg & 0x03)
- {
- case 1:
- temp = (unsigned char) locstr[1];
- locstr += 2;
- break;
- case 2:
- temp = *(unsigned short *) (locstr + 1);
- locstr += 3;
- break;
- case 3:
- temp = *(unsigned long *) (locstr + 1);
- locstr += 5;
- break;
- }
- if (*locstr == dst_multiply_256)
- {
- temp <<= 8;
- locstr++;
- }
- switch (entry->header.code)
- {
- case dst_lsc_add_byte:
- if (SYMBOL_CLASS (sym) == LOC_LOCAL)
- SYMBOL_CLASS (sym) = LOC_ARG;
- SYMBOL_VALUE (sym) += temp;
- break;
- case dst_lsc_sub_byte:
- SYMBOL_VALUE (sym) -= temp;
- break;
- }
- break;
- case dst_lsc_sbreg: /* Stack base register (frame pointer). Arg==0 */
- if (next_entry->header.code != dst_lsc_indirect)
- {
- SYMBOL_VALUE (sym) = 0;
- SYMBOL_CLASS (sym) = LOC_STATIC;
- return;
- }
- SYMBOL_VALUE (sym) = 0;
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- locstr++;
- break;
- default:
- SYMBOL_VALUE (sym) = 0;
- SYMBOL_CLASS (sym) = LOC_STATIC;
- return;
- }
- }
-}
-
-static struct symbol_list *
-process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
- int *nsyms_ret)
-{
- struct symbol_list *list = NULL, *element;
- struct symbol *sym;
- char *symname;
- int nsyms = 0;
- char *location;
- long line;
- dst_type_t symtype;
- struct type *type;
- dst_var_attr_t attr;
- dst_var_loc_t loc_type;
- unsigned loc_index;
- long loc_value;
-
- if (!entry)
- {
- *nsyms_ret = 0;
- return NULL;
- }
- location = (char *) entry;
- while (NEXT_SYM (&location, &entry) &&
- entry->rec_type != dst_typ_end_scope)
- {
- if (entry->rec_type == dst_typ_var)
- {
- if (DST_var (entry).short_locs)
- {
- loc_type = DST_var (entry).locs.shorts[0].loc_type;
- loc_index = DST_var (entry).locs.shorts[0].loc_index;
- loc_value = DST_var (entry).locs.shorts[0].location;
- }
- else
- {
- loc_type = DST_var (entry).locs.longs[0].loc_type;
- loc_index = DST_var (entry).locs.longs[0].loc_index;
- loc_value = DST_var (entry).locs.longs[0].location;
- }
- if (loc_type == dst_var_loc_external)
- continue;
- symname = DST_OFFSET (entry, DST_var (entry).noffset);
- line = DST_var (entry).src_loc.line_number;
- symtype = DST_var (entry).type_desc;
- attr = DST_var (entry).attributes;
- }
- else if (entry->rec_type == dst_typ_variable)
- {
- symname = DST_OFFSET (entry,
- DST_variable (entry).noffset);
- line = DST_variable (entry).src_loc.line_number;
- symtype = DST_variable (entry).type_desc;
- attr = DST_variable (entry).attributes;
- }
- else
- {
- continue;
- }
- if (symname && name && !strcmp (symname, name))
- /* It's the function return value */
- continue;
- sym = create_new_symbol (objfile, symname);
-
- if ((attr & (1 << dst_var_attr_global)) ||
- (attr & (1 << dst_var_attr_static)))
- SYMBOL_CLASS (sym) = LOC_STATIC;
- else
- SYMBOL_CLASS (sym) = LOC_LOCAL;
- SYMBOL_LINE (sym) = line;
- SYMBOL_TYPE (sym) = decode_type_desc (objfile, &symtype,
- entry);
- SYMBOL_VALUE (sym) = 0;
- switch (entry->rec_type)
- {
- case dst_typ_var:
- switch (loc_type)
- {
- case dst_var_loc_abs:
- SYMBOL_VALUE_ADDRESS (sym) = loc_value;
- break;
- case dst_var_loc_sect_off:
- case dst_var_loc_ind_sect_off: /* What is this? */
- SYMBOL_VALUE_ADDRESS (sym) = dst_get_addr (
- loc_index,
- loc_value);
- break;
- case dst_var_loc_ind_reg_rel: /* What is this? */
- case dst_var_loc_reg_rel:
- /* If it isn't fp relative, specify the
- * register it's relative to.
- */
- if (loc_index)
- {
- sym->aux_value.basereg = loc_index;
- }
- SYMBOL_VALUE (sym) = loc_value;
- if (loc_value > 0 &&
- SYMBOL_CLASS (sym) == LOC_BASEREG)
- SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
- break;
- case dst_var_loc_reg:
- SYMBOL_VALUE (sym) = loc_index;
- SYMBOL_CLASS (sym) = LOC_REGISTER;
- break;
- }
- break;
- case dst_typ_variable:
- /* External variable..... don't try to interpret
- * its nonexistant locstring.
- */
- if (DST_variable (entry).loffset == -1)
- continue;
- decode_dst_locstring (DST_OFFSET (entry,
- DST_variable (entry).loffset),
- sym);
- }
- element = (struct symbol_list *)
- xmalloc (sizeof (struct symbol_list));
-
- if (attr & (1 << dst_var_attr_global))
- {
- element->next = dst_global_symbols;
- dst_global_symbols = element;
- total_globals++;
- }
- else
- {
- element->next = list;
- list = element;
- nsyms++;
- }
- element->symbol = sym;
- }
- *nsyms_ret = nsyms;
- return list;
-}
-
-
-static struct symbol *
-process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
- CORE_ADDR address)
-{
- struct symbol *sym;
- struct type *type, *ftype;
- dst_rec_ptr_t sym_entry, typ_entry;
- char *location;
- struct symbol_list *element;
-
- type = builtin_type_int;
- sym = create_new_symbol (objfile, name);
- SYMBOL_CLASS (sym) = LOC_BLOCK;
-
- if (entry)
- {
- location = (char *) entry;
- do
- {
- NEXT_SYM (&location, &sym_entry);
- }
- while (sym_entry && sym_entry->rec_type != dst_typ_signature);
-
- if (sym_entry)
- {
- SYMBOL_LINE (sym) =
- DST_signature (sym_entry).src_loc.line_number;
- if (DST_signature (sym_entry).result)
- {
- typ_entry = (dst_rec_ptr_t)
- DST_OFFSET (sym_entry,
- DST_signature (sym_entry).result);
- type = decode_dst_type (objfile, typ_entry);
- }
- }
- }
-
- if (!type->function_type)
- {
- ftype = alloc_type (objfile);
- type->function_type = ftype;
- TYPE_TARGET_TYPE (ftype) = type;
- TYPE_CODE (ftype) = TYPE_CODE_FUNC;
- }
- SYMBOL_TYPE (sym) = type->function_type;
-
- /* Now add ourselves to the global symbols list */
- element = (struct symbol_list *)
- xmalloc (sizeof (struct symbol_list));
-
- element->next = dst_global_symbols;
- dst_global_symbols = element;
- total_globals++;
- element->symbol = sym;
-
- return sym;
-}
-
-static struct block *
-process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry)
-{
- struct block *block;
- struct symbol *function = NULL;
- CORE_ADDR address;
- long size;
- char *name;
- dst_rec_ptr_t child_entry, symbol_entry;
- struct block *child_block;
- int total_symbols = 0;
- char fake_name[20];
- static long fake_seq = 0;
- struct symbol_list *symlist, *nextsym;
- int symnum;
-
- if (DST_block (entry).noffset)
- name = DST_OFFSET (entry, DST_block (entry).noffset);
- else
- name = NULL;
- if (DST_block (entry).n_of_code_ranges)
- {
- address = dst_sym_addr (
- &DST_block (entry).code_ranges[0].code_start);
- size = DST_block (entry).code_ranges[0].code_size;
- }
- else
- {
- address = -1;
- size = 0;
- }
- symbol_entry = (dst_rec_ptr_t) get_sec_ref (&DST_block (entry).symbols_start);
- switch (DST_block (entry).block_type)
- {
- /* These are all really functions. Even the "program" type.
- * This is because the Apollo OS was written in Pascal, and
- * in Pascal, the main procedure is described as the Program.
- * Cute, huh?
- */
- case dst_block_procedure:
- case dst_block_function:
- case dst_block_subroutine:
- case dst_block_program:
- prim_record_minimal_symbol (name, address, mst_text, objfile);
- function = process_dst_function (
- objfile,
- symbol_entry,
- name,
- address);
- enter_all_lines (get_sec_ref (&DST_block (entry).code_ranges[0].lines_start), address);
- break;
- case dst_block_block_data:
- break;
-
- default:
- /* GDB has to call it something, and the module name
- * won't cut it
- */
- sprintf (fake_name, "block_%08lx", fake_seq++);
- function = process_dst_function (
- objfile, NULL, fake_name, address);
- break;
- }
- symlist = process_dst_symbols (objfile, symbol_entry,
- name, &total_symbols);
- block = (struct block *)
- obstack_alloc (&objfile->symbol_obstack,
- sizeof (struct block) +
- (total_symbols - 1) * sizeof (struct symbol *));
-
- symnum = 0;
- while (symlist)
- {
- nextsym = symlist->next;
-
- block->sym[symnum] = symlist->symbol;
-
- xfree (symlist);
- symlist = nextsym;
- symnum++;
- }
- BLOCK_NSYMS (block) = total_symbols;
- BLOCK_START (block) = address;
- BLOCK_END (block) = address + size;
- BLOCK_SUPERBLOCK (block) = 0;
- if (function)
- {
- SYMBOL_BLOCK_VALUE (function) = block;
- BLOCK_FUNCTION (block) = function;
- }
- else
- BLOCK_FUNCTION (block) = 0;
-
- if (DST_block (entry).child_block_off)
- {
- child_entry = (dst_rec_ptr_t) DST_OFFSET (entry,
- DST_block (entry).child_block_off);
- while (child_entry)
- {
- child_block = process_dst_block (objfile, child_entry);
- if (child_block)
- {
- if (BLOCK_START (child_block) <
- BLOCK_START (block) ||
- BLOCK_START (block) == -1)
- BLOCK_START (block) =
- BLOCK_START (child_block);
- if (BLOCK_END (child_block) >
- BLOCK_END (block) ||
- BLOCK_END (block) == -1)
- BLOCK_END (block) =
- BLOCK_END (child_block);
- BLOCK_SUPERBLOCK (child_block) = block;
- }
- if (DST_block (child_entry).sibling_block_off)
- child_entry = (dst_rec_ptr_t) DST_OFFSET (
- child_entry,
- DST_block (child_entry).sibling_block_off);
- else
- child_entry = NULL;
- }
- }
- record_pending_block (objfile, block, NULL);
- return block;
-}
-
-
-static void
-read_dst_symtab (struct objfile *objfile)
-{
- char *buffer;
- dst_rec_ptr_t entry, file_table, root_block;
- char *source_file;
- struct block *block, *global_block;
- int symnum;
- struct symbol_list *nextsym;
- int module_num = 0;
- struct structure_list *element;
-
- current_objfile = objfile;
- buffer = blocks_info.buffer;
- while (NEXT_BLK (&buffer, &entry))
- {
- if (entry->rec_type == dst_typ_comp_unit)
- {
- file_table = (dst_rec_ptr_t) DST_OFFSET (entry,
- DST_comp_unit (entry).file_table);
- section_table = (dst_rec_ptr_t) DST_OFFSET (entry,
- DST_comp_unit (entry).section_table);
- root_block = (dst_rec_ptr_t) DST_OFFSET (entry,
- DST_comp_unit (entry).root_block_offset);
- source_file = DST_OFFSET (file_table,
- DST_file_tab (file_table).files[0].noffset);
- /* Point buffer to the start of the next comp_unit */
- buffer = DST_OFFSET (entry,
- DST_comp_unit (entry).data_size);
- dst_start_symtab ();
-
- block = process_dst_block (objfile, root_block);
-
- global_block = (struct block *)
- obstack_alloc (&objfile->symbol_obstack,
- sizeof (struct block) +
- (total_globals - 1) *
- sizeof (struct symbol *));
- BLOCK_NSYMS (global_block) = total_globals;
- for (symnum = 0; symnum < total_globals; symnum++)
- {
- nextsym = dst_global_symbols->next;
-
- global_block->sym[symnum] =
- dst_global_symbols->symbol;
-
- xfree (dst_global_symbols);
- dst_global_symbols = nextsym;
- }
- dst_global_symbols = NULL;
- total_globals = 0;
- BLOCK_FUNCTION (global_block) = 0;
- BLOCK_START (global_block) = BLOCK_START (block);
- BLOCK_END (global_block) = BLOCK_END (block);
- BLOCK_SUPERBLOCK (global_block) = 0;
- BLOCK_SUPERBLOCK (block) = global_block;
- record_pending_block (objfile, global_block, NULL);
-
- complete_symtab (source_file,
- BLOCK_START (block),
- BLOCK_END (block) - BLOCK_START (block));
- module_num++;
- dst_end_symtab (objfile);
- }
- }
- if (module_num)
- prim_record_minimal_symbol ("<end_of_program>",
- BLOCK_END (block), mst_text, objfile);
- /* One more faked symbol to make sure nothing can ever run off the
- * end of the symbol table. This one represents the end of the
- * text space. It used to be (CORE_ADDR) -1 (effectively the highest
- * int possible), but some parts of gdb treated it as a signed
- * number and failed comparisons. We could equally use 7fffffff,
- * but no functions are ever mapped to an address higher than
- * 40000000
- */
- prim_record_minimal_symbol ("<end_of_text>",
- (CORE_ADDR) 0x40000000,
- mst_text, objfile);
- while (struct_list)
- {
- element = struct_list;
- struct_list = element->next;
- xfree (element);
- }
-}
-
-
-/* Support for line number handling */
-static char *linetab = NULL;
-static long linetab_offset;
-static unsigned long linetab_size;
-
-/* Read in all the line numbers for fast lookups later. Leave them in
- external (unswapped) format in memory; we'll swap them as we enter
- them into GDB's data structures. */
-static int
-init_one_section (int chan, dst_sec *secinfo)
-{
- if (secinfo->size == 0
- || lseek (chan, secinfo->position, 0) == -1
- || (secinfo->buffer = xmalloc (secinfo->size)) == NULL
- || myread (chan, secinfo->buffer, secinfo->size) == -1)
- return 0;
- else
- return 1;
-}
-
-static int
-init_dst_sections (int chan)
-{
-
- if (!init_one_section (chan, &blocks_info) ||
- !init_one_section (chan, &lines_info) ||
- !init_one_section (chan, &symbols_info))
- return -1;
- else
- return 0;
-}
-
-/* Fake up support for relocating symbol addresses. FIXME. */
-
-struct section_offsets dst_symfile_faker =
-{0};
-
-void
-dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
-{
- objfile->num_sections = 1;
- objfile->section_offsets = &dst_symfile_faker;
-}
-
-/* Register our ability to parse symbols for DST BFD files */
-
-static struct sym_fns dst_sym_fns =
-{
- /* FIXME: Can this be integrated with coffread.c? If not, should it be
- a separate flavour like ecoff? */
- (enum bfd_flavour) -2,
-
- dst_new_init, /* sym_new_init: init anything gbl to entire symtab */
- dst_symfile_init, /* sym_init: read initial info, setup for sym_read() */
- dst_symfile_read, /* sym_read: read a symbol file into symtab */
- dst_symfile_finish, /* sym_finish: finished with file, cleanup */
- dst_symfile_offsets, /* sym_offsets: xlate external to internal form */
- NULL /* next: pointer to next struct sym_fns */
-};
-
-void
-_initialize_dstread (void)
-{
- add_symtab_fns (&dst_sym_fns);
-}
+// 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 ("<end_of_program>",
+// 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 ("<end_of_text>",
+// 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/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 783d1c014e0..18782b16dc8 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -21,6 +21,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "gdbcore.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
@@ -29,12 +30,13 @@
#include "inferior.h"
#include "regcache.h"
#include "dwarf2cfi.h"
+#include "gdb_assert.h"
/* Common Information Entry - holds information that is shared among many
Frame Descriptors. */
struct cie_unit
{
- /* Offset of this unit in dwarf_frame_buffer. */
+ /* Offset of this unit in .debug_frame or .eh_frame. */
ULONGEST offset;
/* A null-terminated string that identifies the augmentation to this CIE or
@@ -176,6 +178,15 @@ struct frame_state
struct objfile *objfile;
};
+enum ptr_encoding
+{
+ PE_absptr = DW_EH_PE_absptr,
+ PE_pcrel = DW_EH_PE_pcrel,
+ PE_textrel = DW_EH_PE_textrel,
+ PE_datarel = DW_EH_PE_datarel,
+ PE_funcrel = DW_EH_PE_funcrel
+};
+
#define UNWIND_CONTEXT(fi) ((struct context *) (fi->context))
@@ -188,8 +199,6 @@ extern file_ptr dwarf_frame_offset;
extern unsigned int dwarf_frame_size;
extern file_ptr dwarf_eh_frame_offset;
extern unsigned int dwarf_eh_frame_size;
-
-static char *dwarf_frame_buffer;
extern char *dwarf2_read_section (struct objfile *objfile, file_ptr offset,
@@ -201,26 +210,28 @@ static void fde_chunks_need_space ();
static struct context *context_alloc ();
static struct frame_state *frame_state_alloc ();
+static void unwind_tmp_obstack_init ();
static void unwind_tmp_obstack_free ();
static void context_cpy (struct context *dst, struct context *src);
-static unsigned int read_1u (bfd *abfd, char **p);
-static int read_1s (bfd *abfd, char **p);
-static unsigned int read_2u (bfd *abfd, char **p);
-static int read_2s (bfd *abfd, char **p);
-static unsigned int read_4u (bfd *abfd, char **p);
-static int read_4s (bfd *abfd, char **p);
-static ULONGEST read_8u (bfd *abfd, char **p);
-static LONGEST read_8s (bfd *abfd, char **p);
-
-static ULONGEST read_uleb128 (bfd *abfd, char **p);
-static LONGEST read_sleb128 (bfd *abfd, char **p);
-static CORE_ADDR read_pointer (bfd *abfd, char **p);
-static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p,
+static unsigned int read_1u (bfd * abfd, char **p);
+static int read_1s (bfd * abfd, char **p);
+static unsigned int read_2u (bfd * abfd, char **p);
+static int read_2s (bfd * abfd, char **p);
+static unsigned int read_4u (bfd * abfd, char **p);
+static int read_4s (bfd * abfd, char **p);
+static ULONGEST read_8u (bfd * abfd, char **p);
+static LONGEST read_8s (bfd * abfd, char **p);
+
+static ULONGEST read_uleb128 (bfd * abfd, char **p);
+static LONGEST read_sleb128 (bfd * abfd, char **p);
+static CORE_ADDR read_pointer (bfd * abfd, char **p);
+static CORE_ADDR read_encoded_pointer (bfd * abfd, char **p,
unsigned char encoding);
+static enum ptr_encoding pointer_encoding (unsigned char encoding);
-static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read);
-static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read,
+static LONGEST read_initial_length (bfd * abfd, char *buf, int *bytes_read);
+static ULONGEST read_length (bfd * abfd, char *buf, int *bytes_read,
int dwarf64);
static int is_cie (ULONGEST cie_id, int dwarf64);
@@ -235,11 +246,12 @@ static void frame_state_for (struct context *context, struct frame_state *fs);
static void get_reg (char *reg, struct context *context, int regnum);
static CORE_ADDR execute_stack_op (struct objfile *objfile,
char *op_ptr, char *op_end,
- struct context *context, CORE_ADDR initial);
+ struct context *context,
+ CORE_ADDR initial);
static void update_context (struct context *context, struct frame_state *fs,
int chain);
-
+
/* Memory allocation functions. */
static struct fde_unit *
fde_unit_alloc (void)
@@ -262,7 +274,7 @@ cie_unit_alloc (void)
}
static void
-fde_chunks_need_space ()
+fde_chunks_need_space (void)
{
if (fde_chunks.elems < fde_chunks.array_size)
return;
@@ -275,7 +287,7 @@ fde_chunks_need_space ()
/* Alocate a new `struct context' on temporary obstack. */
static struct context *
-context_alloc ()
+context_alloc (void)
{
struct context *context;
@@ -292,7 +304,7 @@ context_alloc ()
/* Alocate a new `struct frame_state' on temporary obstack. */
static struct frame_state *
-frame_state_alloc ()
+frame_state_alloc (void)
{
struct frame_state *fs;
@@ -301,20 +313,26 @@ frame_state_alloc ()
fs = (struct frame_state *) obstack_alloc (&unwind_tmp_obstack,
sizeof (struct frame_state));
memset (fs, 0, sizeof (struct frame_state));
- fs->regs.reg = (struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack,
- regs_size);
+ fs->regs.reg =
+ (struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack, regs_size);
memset (fs->regs.reg, 0, regs_size);
return fs;
}
static void
-unwind_tmp_obstack_free ()
+unwind_tmp_obstack_init (void)
{
- obstack_free (&unwind_tmp_obstack, NULL);
obstack_init (&unwind_tmp_obstack);
}
static void
+unwind_tmp_obstack_free (void)
+{
+ obstack_free (&unwind_tmp_obstack, NULL);
+ unwind_tmp_obstack_init ();
+}
+
+static void
context_cpy (struct context *dst, struct context *src)
{
int regs_size = sizeof (struct context_reg) * NUM_REGS;
@@ -334,92 +352,92 @@ context_cpy (struct context *dst, struct context *src)
dreg = dst->reg;
*dst = *src;
dst->reg = dreg;
-
+
memcpy (dst->reg, src->reg, regs_size);
}
static unsigned int
-read_1u (bfd *abfd, char **p)
+read_1u (bfd * abfd, char **p)
{
unsigned ret;
- ret= bfd_get_8 (abfd, (bfd_byte *) *p);
- (*p) ++;
+ ret = bfd_get_8 (abfd, (bfd_byte *) * p);
+ (*p)++;
return ret;
}
static int
-read_1s (bfd *abfd, char **p)
+read_1s (bfd * abfd, char **p)
{
int ret;
- ret= bfd_get_signed_8 (abfd, (bfd_byte *) *p);
- (*p) ++;
+ ret = bfd_get_signed_8 (abfd, (bfd_byte *) * p);
+ (*p)++;
return ret;
}
static unsigned int
-read_2u (bfd *abfd, char **p)
+read_2u (bfd * abfd, char **p)
{
unsigned ret;
- ret= bfd_get_16 (abfd, (bfd_byte *) *p);
- (*p) ++;
+ ret = bfd_get_16 (abfd, (bfd_byte *) * p);
+ (*p)++;
return ret;
}
static int
-read_2s (bfd *abfd, char **p)
+read_2s (bfd * abfd, char **p)
{
int ret;
- ret= bfd_get_signed_16 (abfd, (bfd_byte *) *p);
+ ret = bfd_get_signed_16 (abfd, (bfd_byte *) * p);
(*p) += 2;
return ret;
}
static unsigned int
-read_4u (bfd *abfd, char **p)
+read_4u (bfd * abfd, char **p)
{
unsigned int ret;
- ret= bfd_get_32 (abfd, (bfd_byte *) *p);
+ ret = bfd_get_32 (abfd, (bfd_byte *) * p);
(*p) += 4;
return ret;
}
static int
-read_4s (bfd *abfd, char **p)
+read_4s (bfd * abfd, char **p)
{
int ret;
- ret= bfd_get_signed_32 (abfd, (bfd_byte *) *p);
+ ret = bfd_get_signed_32 (abfd, (bfd_byte *) * p);
(*p) += 4;
return ret;
}
static ULONGEST
-read_8u (bfd *abfd, char **p)
+read_8u (bfd * abfd, char **p)
{
ULONGEST ret;
- ret = bfd_get_64 (abfd, (bfd_byte *) *p);
+ ret = bfd_get_64 (abfd, (bfd_byte *) * p);
(*p) += 8;
return ret;
}
static LONGEST
-read_8s (bfd *abfd, char **p)
+read_8s (bfd * abfd, char **p)
{
LONGEST ret;
- ret = bfd_get_signed_64 (abfd, (bfd_byte *) *p);
+ ret = bfd_get_signed_64 (abfd, (bfd_byte *) * p);
(*p) += 8;
return ret;
}
static ULONGEST
-read_uleb128 (bfd *abfd, char **p)
+read_uleb128 (bfd * abfd, char **p)
{
ULONGEST ret;
int i, shift;
@@ -430,8 +448,8 @@ read_uleb128 (bfd *abfd, char **p)
i = 0;
while (1)
{
- byte = bfd_get_8 (abfd, (bfd_byte *) *p);
- (*p) ++;
+ byte = bfd_get_8 (abfd, (bfd_byte *) * p);
+ (*p)++;
ret |= ((unsigned long) (byte & 127) << shift);
if ((byte & 128) == 0)
{
@@ -443,7 +461,7 @@ read_uleb128 (bfd *abfd, char **p)
}
static LONGEST
-read_sleb128 (bfd *abfd, char **p)
+read_sleb128 (bfd * abfd, char **p)
{
LONGEST ret;
int i, shift, size, num_read;
@@ -456,8 +474,8 @@ read_sleb128 (bfd *abfd, char **p)
i = 0;
while (1)
{
- byte = bfd_get_8 (abfd, (bfd_byte *) *p);
- (*p) ++;
+ byte = bfd_get_8 (abfd, (bfd_byte *) * p);
+ (*p)++;
ret |= ((long) (byte & 127) << shift);
shift += 7;
if ((byte & 128) == 0)
@@ -473,7 +491,7 @@ read_sleb128 (bfd *abfd, char **p)
}
static CORE_ADDR
-read_pointer (bfd *abfd, char **p)
+read_pointer (bfd * abfd, char **p)
{
switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
{
@@ -486,8 +504,11 @@ read_pointer (bfd *abfd, char **p)
}
}
+/* This functions only reads appropriate amount of data from *p
+ * and returns the resulting value. Calling function must handle
+ * different encoding possibilities itself! */
static CORE_ADDR
-read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
+read_encoded_pointer (bfd * abfd, char **p, unsigned char encoding)
{
CORE_ADDR ret;
@@ -529,22 +550,33 @@ read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
"read_encoded_pointer: unknown pointer encoding");
}
- if (ret != 0)
- switch (encoding & 0xf0)
- {
- case DW_EH_PE_absptr:
- break;
- case DW_EH_PE_pcrel:
- ret += (CORE_ADDR) *p;
- break;
- case DW_EH_PE_textrel:
- case DW_EH_PE_datarel:
- case DW_EH_PE_funcrel:
- default:
- internal_error (__FILE__, __LINE__,
- "read_encoded_pointer: unknown pointer encoding");
- }
+ return ret;
+}
+/* Variable 'encoding' carries 3 different flags:
+ * - encoding & 0x0f : size of the address (handled in read_encoded_pointer())
+ * - encoding & 0x70 : type (absolute, relative, ...)
+ * - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80). */
+enum ptr_encoding
+pointer_encoding (unsigned char encoding)
+{
+ int ret;
+
+ if (encoding & DW_EH_PE_indirect)
+ warning ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect");
+
+ switch (encoding & 0x70)
+ {
+ case DW_EH_PE_absptr:
+ case DW_EH_PE_pcrel:
+ case DW_EH_PE_textrel:
+ case DW_EH_PE_datarel:
+ case DW_EH_PE_funcrel:
+ ret = encoding & 0x70;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "CFI: unknown pointer encoding");
+ }
return ret;
}
@@ -584,8 +616,8 @@ read_length (bfd * abfd, char *buf, int *bytes_read, int dwarf64)
}
static void
-execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
- struct context *context, struct frame_state *fs)
+execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end,
+ struct context *context, struct frame_state *fs)
{
struct frame_state_regs *unused_rs = NULL;
@@ -604,7 +636,7 @@ execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
{
reg = insn & 0x3f;
uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
- offset = (long) uoffset * fs->data_align;
+ offset = (long) uoffset *fs->data_align;
fs->regs.reg[reg].how = REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = offset;
}
@@ -619,6 +651,10 @@ execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
case DW_CFA_set_loc:
fs->pc = read_encoded_pointer (objfile->obfd, &insn_ptr,
fs->addr_encoding);
+
+ if (pointer_encoding (fs->addr_encoding) != PE_absptr)
+ warning ("CFI: DW_CFA_set_loc uses relative addressing");
+
break;
case DW_CFA_advance_loc1:
@@ -806,28 +842,23 @@ frame_state_for (struct context *context, struct frame_state *fs)
if (fde == NULL)
return;
-
+
fs->pc = fde->initial_location;
- if (fde->cie_ptr)
- {
- cie = fde->cie_ptr;
-
- fs->code_align = cie->code_align;
- fs->data_align = cie->data_align;
- fs->retaddr_column = cie->ra;
- fs->addr_encoding = cie->addr_encoding;
- fs->objfile = cie->objfile;
-
- execute_cfa_program (cie->objfile, cie->data,
- cie->data + cie->data_length, context, fs);
- execute_cfa_program (cie->objfile, fde->data,
- fde->data + fde->data_length, context, fs);
- }
- else
- internal_error (__FILE__, __LINE__,
- "%s(): Internal error: fde->cie_ptr==NULL !",
- __func__);
+ gdb_assert (fde->cie_ptr != NULL);
+
+ cie = fde->cie_ptr;
+
+ fs->code_align = cie->code_align;
+ fs->data_align = cie->data_align;
+ fs->retaddr_column = cie->ra;
+ fs->addr_encoding = cie->addr_encoding;
+ fs->objfile = cie->objfile;
+
+ execute_cfa_program (cie->objfile, cie->data,
+ cie->data + cie->data_length, context, fs);
+ execute_cfa_program (cie->objfile, fde->data,
+ fde->data + fde->data_length, context, fs);
}
static void
@@ -854,8 +885,7 @@ get_reg (char *reg, struct context *context, int regnum)
REGISTER_RAW_SIZE (regnum));
break;
default:
- internal_error (__FILE__, __LINE__,
- "get_reg: unknown register rule");
+ internal_error (__FILE__, __LINE__, "get_reg: unknown register rule");
}
}
@@ -1087,32 +1117,21 @@ execute_stack_op (struct objfile *objfile,
{
case DW_OP_deref:
{
- char *ptr = (char *) result;
- result = read_pointer (objfile->obfd, &ptr);
+ int len = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+ if (len != 4 && len != 8)
+ internal_error (__FILE__, __LINE__,
+ "execute_stack_op error");
+ result = read_memory_unsigned_integer (result, len);
}
break;
case DW_OP_deref_size:
{
- char *ptr = (char *) result;
- switch (*op_ptr++)
- {
- case 1:
- result = read_1u (objfile->obfd, &ptr);
- break;
- case 2:
- result = read_2u (objfile->obfd, &ptr);
- break;
- case 4:
- result = read_4u (objfile->obfd, &ptr);
- break;
- case 8:
- result = read_8u (objfile->obfd, &ptr);
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "execute_stack_op error");
- }
+ int len = *op_ptr++;
+ if (len != 1 && len != 2 && len != 4 && len !=8)
+ internal_error (__FILE__, __LINE__,
+ "execute_stack_op error");
+ result = read_memory_unsigned_integer (result, len);
}
break;
@@ -1208,8 +1227,9 @@ execute_stack_op (struct objfile *objfile,
case DW_OP_ne:
result = (LONGEST) first != (LONGEST) second;
break;
- default: /* This label is here just to avoid warning. */
- break;
+ default:
+ error ("execute_stack_op: Unknown DW_OP_ value");
+ break;
}
}
break;
@@ -1252,11 +1272,14 @@ static void
update_context (struct context *context, struct frame_state *fs, int chain)
{
struct context *orig_context;
- CORE_ADDR cfa;
+ CORE_ADDR cfa = 0;
long i;
+ unwind_tmp_obstack_init ();
+
orig_context = context_alloc ();
context_cpy (orig_context, context);
+
/* Compute this frame's CFA. */
switch (fs->cfa_how)
{
@@ -1267,9 +1290,9 @@ update_context (struct context *context, struct frame_state *fs, int chain)
case CFA_EXP:
/* ??? No way of knowing what register number is the stack pointer
- to do the same sort of handling as above. Assume that if the
- CFA calculation is so complicated as to require a stack program
- that this will not be a problem. */
+ to do the same sort of handling as above. Assume that if the
+ CFA calculation is so complicated as to require a stack program
+ that this will not be a problem. */
{
char *exp = fs->cfa_exp;
ULONGEST len;
@@ -1324,9 +1347,9 @@ update_context (struct context *context, struct frame_state *fs, int chain)
context->reg[i].how = REG_CTX_SAVED_ADDR;
context->reg[i].loc.addr =
orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
+ break;
default:
- internal_error (__FILE__, __LINE__,
- "%s: unknown register rule", __func__);
+ internal_error (__FILE__, __LINE__, "bad switch");
}
break;
case REG_SAVED_EXP:
@@ -1343,8 +1366,7 @@ update_context (struct context *context, struct frame_state *fs, int chain)
}
break;
default:
- internal_error (__FILE__, __LINE__,
- "%s: unknown register rule", __func__);
+ internal_error (__FILE__, __LINE__, "bad switch");
}
get_reg ((char *) &context->ra, context, fs->retaddr_column);
unwind_tmp_obstack_free ();
@@ -1371,39 +1393,46 @@ compare_fde_unit (const void *a, const void *b)
}
/* Build the cie_chunks and fde_chunks tables from informations
- in .debug_frame section. */
-void
-dwarf2_build_frame_info (struct objfile *objfile)
+ found in .debug_frame and .eh_frame sections. */
+/* We can handle both of these sections almost in the same way, however there
+ are some exceptions:
+ - CIE ID is -1 in debug_frame, but 0 in eh_frame
+ - eh_frame may contain some more information that are used only by gcc
+ (eg. personality pointer, LSDA pointer, ...). Most of them we can ignore.
+ - In debug_frame FDE's item cie_id contains offset of it's parent CIE.
+ In eh_frame FDE's item cie_id is a relative pointer to the parent CIE.
+ Anyway we don't need to bother with this, because we are smart enough
+ to keep the pointer to the parent CIE of oncomming FDEs in 'last_cie'.
+ - Although debug_frame items can contain Augmentation as well as
+ eh_frame ones, I have never seen them non-empty. Thus only in eh_frame
+ we can encounter for example non-absolute pointers (Aug. 'R').
+ -- mludvig */
+static void
+parse_frame_info (struct objfile *objfile, file_ptr frame_offset,
+ unsigned int frame_size, int eh_frame)
{
bfd *abfd = objfile->obfd;
+ asection *curr_section_ptr;
char *start = NULL;
char *end = NULL;
- int from_eh = 0;
-
- obstack_init (&unwind_tmp_obstack);
+ char *frame_buffer = NULL;
+ char *curr_section_name, *aug_data;
+ struct cie_unit *last_cie = NULL;
+ int last_dup_fde = 0;
+ int aug_len, i;
+ CORE_ADDR curr_section_vma = 0;
- dwarf_frame_buffer = 0;
+ unwind_tmp_obstack_init ();
- if (dwarf_frame_offset)
- {
- dwarf_frame_buffer = dwarf2_read_section (objfile,
- dwarf_frame_offset,
- dwarf_frame_size);
+ frame_buffer = dwarf2_read_section (objfile, frame_offset, frame_size);
- start = dwarf_frame_buffer;
- end = dwarf_frame_buffer + dwarf_frame_size;
- }
- else if (dwarf_eh_frame_offset)
- {
- dwarf_frame_buffer = dwarf2_read_section (objfile,
- dwarf_eh_frame_offset,
- dwarf_eh_frame_size);
+ start = frame_buffer;
+ end = frame_buffer + frame_size;
- start = dwarf_frame_buffer;
- end = dwarf_frame_buffer + dwarf_eh_frame_size;
-
- from_eh = 1;
- }
+ curr_section_name = eh_frame ? ".eh_frame" : ".debug_frame";
+ curr_section_ptr = bfd_get_section_by_name (abfd, curr_section_name);
+ if (curr_section_ptr)
+ curr_section_vma = curr_section_ptr->vma;
if (start)
{
@@ -1411,9 +1440,8 @@ dwarf2_build_frame_info (struct objfile *objfile)
{
unsigned long length;
ULONGEST cie_id;
- ULONGEST unit_offset = start - dwarf_frame_buffer;
- int bytes_read;
- int dwarf64;
+ ULONGEST unit_offset = start - frame_buffer;
+ int bytes_read, dwarf64;
char *block_end;
length = read_initial_length (abfd, start, &bytes_read);
@@ -1421,10 +1449,16 @@ dwarf2_build_frame_info (struct objfile *objfile)
dwarf64 = (bytes_read == 12);
block_end = start + length;
+ if (length == 0)
+ {
+ start = block_end;
+ continue;
+ }
+
cie_id = read_length (abfd, start, &bytes_read, dwarf64);
start += bytes_read;
- if ((from_eh && cie_id == 0) || is_cie (cie_id, dwarf64))
+ if ((eh_frame && cie_id == 0) || is_cie (cie_id, dwarf64))
{
struct cie_unit *cie = cie_unit_alloc ();
char *aug;
@@ -1440,84 +1474,186 @@ dwarf2_build_frame_info (struct objfile *objfile)
start++; /* version */
cie->augmentation = aug = start;
- while (*start)
- start++;
- start++; /* skip past NUL */
+ while (*start++); /* Skips last NULL as well */
cie->code_align = read_uleb128 (abfd, &start);
cie->data_align = read_sleb128 (abfd, &start);
cie->ra = read_1u (abfd, &start);
+ /* Augmentation:
+ z Indicates that a uleb128 is present to size the
+ augmentation section.
+ L Indicates the encoding (and thus presence) of
+ an LSDA pointer in the FDE augmentation.
+ R Indicates a non-default pointer encoding for
+ FDE code pointers.
+ P Indicates the presence of an encoding + language
+ personality routine in the CIE augmentation.
+
+ [This info comes from GCC's dwarf2out.c]
+ */
if (*aug == 'z')
{
- int xtra = read_uleb128 (abfd, &start);
- start += xtra;
+ aug_len = read_uleb128 (abfd, &start);
+ aug_data = start;
+ start += aug_len;
++aug;
}
+ cie->data = start;
+ cie->data_length = block_end - cie->data;
+
while (*aug != '\0')
{
if (aug[0] == 'e' && aug[1] == 'h')
{
- start += sizeof (void *);
- aug += 2;
+ aug_data += sizeof (void *);
+ aug++;
}
else if (aug[0] == 'R')
+ cie->addr_encoding = *aug_data++;
+ else if (aug[0] == 'P')
{
- cie->addr_encoding = *start++;
- aug += 1;
+ CORE_ADDR pers_addr;
+ int pers_addr_enc;
+
+ pers_addr_enc = *aug_data++;
+ /* We don't need pers_addr value and so we
+ don't care about it's encoding. */
+ pers_addr = read_encoded_pointer (abfd, &aug_data,
+ pers_addr_enc);
}
- else if (aug[0] == 'P')
+ else if (aug[0] == 'L' && eh_frame)
{
- CORE_ADDR ptr;
- ptr = read_encoded_pointer (abfd, &start,
- cie->addr_encoding);
- aug += 1;
+ int lsda_addr_enc;
+
+ /* Perhaps we should save this to CIE for later use?
+ Do we need it for something in GDB? */
+ lsda_addr_enc = *aug_data++;
}
else
- warning ("%s(): unknown augmentation", __func__);
+ warning ("CFI warning: unknown augmentation \"%c\""
+ " in \"%s\" of\n"
+ "\t%s", aug[0], curr_section_name,
+ objfile->name);
+ aug++;
}
- cie->data = start;
- cie->data_length = block_end - start;
+ last_cie = cie;
}
else
{
struct fde_unit *fde;
struct cie_unit *cie;
+ int dup = 0;
+ CORE_ADDR init_loc;
+
+ /* We assume that debug_frame is in order
+ CIE,FDE,CIE,FDE,FDE,... and thus the CIE for this FDE
+ should be stored in last_cie pointer. If not, we'll
+ try to find it by the older way. */
+ if (last_cie)
+ cie = last_cie;
+ else
+ {
+ warning ("CFI: last_cie == NULL. "
+ "Perhaps a malformed %s section in '%s'...?\n",
+ curr_section_name, objfile->name);
- fde_chunks_need_space ();
- fde = fde_unit_alloc ();
+ cie = cie_chunks;
+ while (cie)
+ {
+ if (cie->objfile == objfile)
+ {
+ if (eh_frame &&
+ (cie->offset ==
+ (unit_offset + bytes_read - cie_id)))
+ break;
+ if (!eh_frame && (cie->offset == cie_id))
+ break;
+ }
+
+ cie = cie->next;
+ }
+ if (!cie)
+ error ("CFI: can't find CIE pointer");
+ }
- fde_chunks.array[fde_chunks.elems++] = fde;
-
- fde->initial_location = read_pointer (abfd, &start)
- + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- fde->address_range = read_pointer (abfd, &start);
+ init_loc = read_encoded_pointer (abfd, &start,
+ cie->addr_encoding);
- cie = cie_chunks;
- while(cie)
- {
- if (cie->objfile == objfile)
+ switch (pointer_encoding (cie->addr_encoding))
{
- if (from_eh && (cie->offset == (unit_offset + bytes_read - cie_id)))
- break;
- if (!from_eh && (cie->offset == cie_id))
- break;
+ case PE_absptr:
+ break;
+ case PE_pcrel:
+ /* start-frame_buffer gives offset from
+ the beginning of actual section. */
+ init_loc += curr_section_vma + start - frame_buffer;
+ break;
+ default:
+ warning ("CFI: Unsupported pointer encoding\n");
}
- cie = cie->next;
- }
-
- if (!cie)
- error ("%s(): can't find CIE pointer", __func__);
- fde->cie_ptr = cie;
+ /* For relocatable objects we must add an offset telling
+ where the section is actually mapped in the memory. */
+ init_loc += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
+
+ /* If we have both .debug_frame and .eh_frame present in
+ a file, we must eliminate duplicate FDEs. For now we'll
+ run through all entries in fde_chunks and check it one
+ by one. Perhaps in the future we can implement a faster
+ searching algorithm. */
+ /* eh_frame==2 indicates, that this file has an already
+ parsed .debug_frame too. When eh_frame==1 it means, that no
+ .debug_frame is present and thus we don't need to check for
+ duplicities. eh_frame==0 means, that we parse .debug_frame
+ and don't need to care about duplicate FDEs, because
+ .debug_frame is parsed first. */
+ if (eh_frame == 2)
+ for (i = 0; eh_frame == 2 && i < fde_chunks.elems; i++)
+ {
+ /* We assume that FDEs in .debug_frame and .eh_frame
+ have the same order (if they are present, of course).
+ If we find a duplicate entry for one FDE and save
+ it's index to last_dup_fde it's very likely, that
+ we'll find an entry for the following FDE right after
+ the previous one. Thus in many cases we'll run this
+ loop only once. */
+ last_dup_fde = (last_dup_fde + i) % fde_chunks.elems;
+ if (fde_chunks.array[last_dup_fde]->initial_location
+ == init_loc)
+ {
+ dup = 1;
+ break;
+ }
+ }
+
+ /* Allocate a new entry only if this FDE isn't a duplicate of
+ something we have already seen. */
+ if (!dup)
+ {
+ fde_chunks_need_space ();
+ fde = fde_unit_alloc ();
+
+ fde_chunks.array[fde_chunks.elems++] = fde;
- if (cie->augmentation[0] == 'z')
- read_uleb128 (abfd, &start);
+ fde->initial_location = init_loc;
+ fde->address_range = read_encoded_pointer (abfd, &start,
+ cie->
+ addr_encoding);
- fde->data = start;
- fde->data_length = block_end - start;
+ fde->cie_ptr = cie;
+
+ /* Here we intentionally ignore augmentation data
+ from FDE, because we don't need them. */
+ if (cie->augmentation[0] == 'z')
+ start += read_uleb128 (abfd, &start);
+
+ fde->data = start;
+ fde->data_length = block_end - start;
+ }
}
start = block_end;
}
@@ -1525,16 +1661,41 @@ dwarf2_build_frame_info (struct objfile *objfile)
sizeof (struct fde_unit *), compare_fde_unit);
}
}
-
+
+/* We must parse both .debug_frame section and .eh_frame because
+ * not all frames must be present in both of these sections. */
+void
+dwarf2_build_frame_info (struct objfile *objfile)
+{
+ int after_debug_frame = 0;
+
+ /* If we have .debug_frame then the parser is called with
+ eh_frame==0 for .debug_frame and eh_frame==2 for .eh_frame,
+ otherwise it's only called once for .eh_frame with argument
+ eh_frame==1. */
+
+ if (dwarf_frame_offset)
+ {
+ parse_frame_info (objfile, dwarf_frame_offset,
+ dwarf_frame_size, 0 /* = debug_frame */ );
+ after_debug_frame = 1;
+ }
+
+ if (dwarf_eh_frame_offset)
+ parse_frame_info (objfile, dwarf_eh_frame_offset, dwarf_eh_frame_size,
+ 1 /* = eh_frame */ + after_debug_frame);
+}
/* Return the frame address. */
CORE_ADDR
-cfi_read_fp ()
+cfi_read_fp (void)
{
struct context *context;
struct frame_state *fs;
CORE_ADDR cfa;
+ unwind_tmp_obstack_init ();
+
context = context_alloc ();
fs = frame_state_alloc ();
@@ -1544,7 +1705,9 @@ cfi_read_fp ()
update_context (context, fs, 0);
cfa = context->cfa;
+
unwind_tmp_obstack_free ();
+
return cfa;
}
@@ -1556,6 +1719,8 @@ cfi_write_fp (CORE_ADDR val)
struct context *context;
struct frame_state *fs;
+ unwind_tmp_obstack_init ();
+
context = context_alloc ();
fs = frame_state_alloc ();
@@ -1579,11 +1744,9 @@ cfi_write_fp (CORE_ADDR val)
void
cfi_pop_frame (struct frame_info *fi)
{
- char regbuf[MAX_REGISTER_RAW_SIZE];
+ char *regbuf = alloca (MAX_REGISTER_RAW_SIZE);
int regnum;
- fi = get_current_frame ();
-
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
get_reg (regbuf, UNWIND_CONTEXT (fi), regnum);
@@ -1603,6 +1766,8 @@ cfi_frame_chain (struct frame_info *fi)
struct frame_state *fs;
CORE_ADDR cfa;
+ unwind_tmp_obstack_init ();
+
context = context_alloc ();
fs = frame_state_alloc ();
context_cpy (context, UNWIND_CONTEXT (fi));
@@ -1619,7 +1784,7 @@ cfi_frame_chain (struct frame_info *fi)
cfa = context->cfa;
unwind_tmp_obstack_free ();
-
+
return cfa;
}
@@ -1639,6 +1804,8 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
struct frame_state *fs;
+ unwind_tmp_obstack_init ();
+
fs = frame_state_alloc ();
fi->context = frame_obstack_alloc (sizeof (struct context));
UNWIND_CONTEXT (fi)->reg =
@@ -1658,6 +1825,7 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi)
frame_state_for (UNWIND_CONTEXT (fi), fs);
update_context (UNWIND_CONTEXT (fi), fs, 0);
}
+
unwind_tmp_obstack_free ();
}
@@ -1678,7 +1846,7 @@ cfi_get_ra (struct frame_info *fi)
void
cfi_get_saved_register (char *raw_buffer,
int *optimized,
- CORE_ADDR * addrp,
+ CORE_ADDR *addrp,
struct frame_info *frame,
int regnum, enum lval_type *lval)
{
@@ -1765,6 +1933,8 @@ cfi_virtual_frame_pointer (CORE_ADDR pc, int *frame_reg,
struct context *context;
struct frame_state *fs;
+ unwind_tmp_obstack_init ();
+
context = context_alloc ();
fs = frame_state_alloc ();
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6c2b542f634..0d96e1ff74d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -658,6 +658,10 @@ static struct complaint dwarf2_macro_spaces_in_definition =
{
"macro definition contains spaces in formal argument list:\n`%s'", 0, 0
};
+static struct complaint dwarf2_invalid_attrib_class =
+{
+ "invalid attribute class or form for '%s' in '%s'", 0, 0
+};
/* local function prototypes */
@@ -799,8 +803,7 @@ static void dwarf2_attach_fields_to_type (struct field_info *,
struct type *, struct objfile *);
static void dwarf2_add_member_fn (struct field_info *,
- struct die_info *, struct type *,
- struct objfile *objfile,
+ struct die_info *, struct objfile *objfile,
const struct comp_unit_head *);
static void dwarf2_attach_fn_fields_to_type (struct field_info *,
@@ -907,6 +910,8 @@ static void dwarf_decode_macros (struct line_header *, unsigned int,
char *, bfd *, const struct comp_unit_head *,
struct objfile *);
+static int attr_form_is_block (struct attribute *);
+
/* Try to locate the sections we need for DWARF 2 debugging
information and return true if we have enough to do something. */
@@ -1004,9 +1009,13 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
dwarf_abbrev_buffer = dwarf2_read_section (objfile,
dwarf_abbrev_offset,
dwarf_abbrev_size);
- dwarf_line_buffer = dwarf2_read_section (objfile,
- dwarf_line_offset,
- dwarf_line_size);
+
+ if (dwarf_line_offset)
+ dwarf_line_buffer = dwarf2_read_section (objfile,
+ dwarf_line_offset,
+ dwarf_line_size);
+ else
+ dwarf_line_buffer = NULL;
if (dwarf_str_offset)
dwarf_str_buffer = dwarf2_read_section (objfile,
@@ -1803,7 +1812,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
header, so we can only read it if we've read the header
successfully. */
attr = dwarf_attr (die, DW_AT_macro_info);
- if (attr)
+ if (attr && line_header)
{
unsigned int macro_offset = DW_UNSND (attr);
dwarf_decode_macros (line_header, macro_offset,
@@ -1871,7 +1880,24 @@ read_func_scope (struct die_info *die, struct objfile *objfile,
attr = dwarf_attr (die, DW_AT_frame_base);
if (attr)
{
- CORE_ADDR addr = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ CORE_ADDR addr;
+
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (attr))
+ {
+ addr = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ }
+ else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ addr = 0;
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_frame_base", name);
+ addr = 0;
+ }
+
if (isderef)
complain (&dwarf2_unsupported_at_frame_base, name);
else if (isreg)
@@ -2233,7 +2259,7 @@ dwarf2_attach_fields_to_type (struct field_info *fip, struct type *type,
static void
dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
- struct type *type, struct objfile *objfile,
+ struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
struct attribute *attr;
@@ -2299,23 +2325,13 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
if (die->type && TYPE_CODE (die->type) == TYPE_CODE_FUNC)
{
struct type *return_type = TYPE_TARGET_TYPE (die->type);
- struct type **arg_types;
int nparams = TYPE_NFIELDS (die->type);
- int iparams;
-
- /* Copy argument types from the subroutine type. */
- arg_types = (struct type **)
- TYPE_ALLOC (fnp->type, (nparams + 1) * sizeof (struct type *));
- for (iparams = 0; iparams < nparams; iparams++)
- arg_types[iparams] = TYPE_FIELD_TYPE (die->type, iparams);
-
- /* Set last entry in argument type vector. */
- if (TYPE_VARARGS (die->type))
- arg_types[nparams] = NULL;
- else
- arg_types[nparams] = dwarf2_fundamental_type (objfile, FT_VOID);
- smash_to_method_type (fnp->type, type, return_type, arg_types);
+ smash_to_method_type (fnp->type, die->type,
+ TYPE_TARGET_TYPE (die->type),
+ TYPE_FIELDS (die->type),
+ TYPE_NFIELDS (die->type),
+ TYPE_VARARGS (die->type));
/* Handle static member functions.
Dwarf2 has no clean way to discern C++ static and non-static
@@ -2359,7 +2375,22 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
/* Get index in virtual function table if it is a virtual member function. */
attr = dwarf_attr (die, DW_AT_vtable_elem_location);
if (attr)
- fnp->voffset = decode_locdesc (DW_BLOCK (attr), objfile, cu_header) + 2;
+ {
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (attr))
+ {
+ fnp->voffset = decode_locdesc (DW_BLOCK (attr), objfile, cu_header) + 2;
+ }
+ else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_vtable_elem_location",
+ fieldname);
+ }
+ }
}
/* Create the vector of member function fields, and attach it to the type. */
@@ -2485,7 +2516,7 @@ read_structure_scope (struct die_info *die, struct objfile *objfile,
{
/* C++ member function. */
process_die (child_die, objfile, cu_header);
- dwarf2_add_member_fn (&fi, child_die, type, objfile, cu_header);
+ dwarf2_add_member_fn (&fi, child_die, objfile, cu_header);
}
else if (child_die->tag == DW_TAG_inheritance)
{
@@ -2823,7 +2854,20 @@ read_common_block (struct die_info *die, struct objfile *objfile,
attr = dwarf_attr (die, DW_AT_location);
if (attr)
{
- base = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (attr))
+ {
+ base = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ }
+ else if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_location",
+ "common block member");
+ }
}
if (die->has_children)
{
@@ -3469,7 +3513,20 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
part_die->highpc = DW_ADDR (&attr);
break;
case DW_AT_location:
- part_die->locdesc = DW_BLOCK (&attr);
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (&attr))
+ {
+ part_die->locdesc = DW_BLOCK (&attr);
+ }
+ else if (attr.form == DW_FORM_data4 || attr.form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_location",
+ "partial symbol information");
+ }
break;
case DW_AT_language:
part_die->language = DW_UNSND (&attr);
@@ -3810,12 +3867,25 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
return retval;
}
-/* Reads the initial length from a section. The (draft) DWARF 2.1
+/* Read the initial length from a section. The (draft) DWARF 3
specification allows the initial length to take up either 4 bytes
or 12 bytes. If the first 4 bytes are 0xffffffff, then the next 8
bytes describe the length and all offsets will be 8 bytes in length
instead of 4.
+ An older, non-standard 64-bit format is also handled by this
+ function. The older format in question stores the initial length
+ as an 8-byte quantity without an escape value. Lengths greater
+ than 2^32 aren't very common which means that the initial 4 bytes
+ is almost always zero. Since a length value of zero doesn't make
+ sense for the 32-bit format, this initial zero can be considered to
+ be an escape value which indicates the presence of the older 64-bit
+ format. As written, the code can't detect (old format) lengths
+ greater than 4GB. If it becomes necessary to handle lengths somewhat
+ larger than 4GB, we could allow other small values (such as the
+ non-sensical values of 1, 2, and 3) to also be used as escape values
+ indicating the presence of the old format.
+
The value returned via bytes_read should be used to increment
the relevant pointer after calling read_initial_length().
@@ -3826,14 +3896,18 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
[ Note: read_initial_length() and read_offset() are based on the
document entitled "DWARF Debugging Information Format", revision
- 2.1, draft 4, dated July 20, 2000. This document was obtained
+ 3, draft 8, dated November 19, 2001. This document was obtained
from:
- http://reality.sgi.com/dehnert_engr/dwarf/dwarf2p1-draft4-000720.pdf
+ http://reality.sgiweb.org/davea/dwarf3-draft8-011125.pdf
This document is only a draft and is subject to change. (So beware.)
- - Kevin, Aug 4, 2000
+ Details regarding the older, non-standard 64-bit format were
+ determined empirically by examining 64-bit ELF files produced
+ by the SGI toolchain on an IRIX 6.5 machine.
+
+ - Kevin, July 16, 2002
] */
static LONGEST
@@ -3854,6 +3928,18 @@ read_initial_length (bfd *abfd, char *buf, struct comp_unit_head *cu_header,
cu_header->offset_size = 8;
}
}
+ else if (retval == 0)
+ {
+ /* Handle (non-standard) 64-bit DWARF2 formats such as that used
+ by IRIX. */
+ retval = bfd_get_64 (abfd, (bfd_byte *) buf);
+ *bytes_read = 8;
+ if (cu_header != NULL)
+ {
+ cu_header->initial_length_size = 8;
+ cu_header->offset_size = 8;
+ }
+ }
else
{
*bytes_read = 4;
@@ -4028,6 +4114,7 @@ set_cu_language (unsigned int lang)
cu_language = language_java;
break;
case DW_LANG_Ada83:
+ case DW_LANG_Ada95:
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
case DW_LANG_Pascal83:
@@ -4533,7 +4620,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
char *name;
struct attribute *attr = NULL;
struct attribute *attr2 = NULL;
- CORE_ADDR addr;
+ CORE_ADDR addr = 0;
name = dwarf2_linkage_name (die);
if (name)
@@ -4617,8 +4704,22 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
attr2 = dwarf_attr (die, DW_AT_external);
if (attr2 && (DW_UNSND (attr2) != 0))
{
- SYMBOL_VALUE_ADDRESS (sym) =
- decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (attr))
+ {
+ SYMBOL_VALUE_ADDRESS (sym) =
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ }
+ else if (attr->form == DW_FORM_data4
+ || attr->form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_location",
+ "external variable");
+ }
add_symbol_to_list (sym, &global_symbols);
/* In shared libraries the address of the variable
@@ -4641,8 +4742,23 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
}
else
{
- SYMBOL_VALUE (sym) = addr =
- decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ /* Support the .debug_loc offsets */
+ if (attr_form_is_block (attr))
+ {
+ SYMBOL_VALUE (sym) = addr =
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
+ }
+ else if (attr->form == DW_FORM_data4
+ || attr->form == DW_FORM_data8)
+ {
+ complain (&dwarf2_complex_location_expr);
+ }
+ else
+ {
+ complain (&dwarf2_invalid_attrib_class, "DW_AT_location",
+ "external variable");
+ addr = 0;
+ }
add_symbol_to_list (sym, list_in_scope);
if (optimized_out)
{
@@ -6246,12 +6362,6 @@ decode_locdesc (struct dwarf_block *blk, struct objfile *objfile,
isreg = 1;
unsnd = read_unsigned_leb128 (NULL, (data + i), &bytes_read);
i += bytes_read;
-#if defined(HARRIS_TARGET) && defined(_M88K)
- /* The Harris 88110 gdb ports have long kept their special reg
- numbers between their gp-regs and their x-regs. This is
- not how our dwarf is generated. Punt. */
- unsnd += 6;
-#endif
stack[++stacki] = unsnd;
break;
@@ -6493,7 +6603,7 @@ macro_start_file (int file, int line,
at all until we actually get a filename. */
if (! pending_macros)
pending_macros = new_macro_table (&objfile->symbol_obstack,
- &objfile->macro_cache);
+ objfile->macro_cache);
if (! current_file)
/* If we have no current file, then this must be the start_file
@@ -6811,3 +6921,15 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
}
}
}
+
+/* Check if the attribute's form is a DW_FORM_block*
+ if so return true else false. */
+static int
+attr_form_is_block (struct attribute *attr)
+{
+ return (attr == NULL ? 0 :
+ attr->form == DW_FORM_block1
+ || attr->form == DW_FORM_block2
+ || attr->form == DW_FORM_block4
+ || attr->form == DW_FORM_block);
+}
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index dc72f87661d..9c4201de1c3 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -186,9 +186,9 @@ typedef unsigned int DIE_REF; /* Reference to a DIE */
#define LCC_PRODUCER "NCR C/C++"
#endif
-#ifndef CHILL_PRODUCER
-#define CHILL_PRODUCER "GNU Chill "
-#endif
+/* OBSOLETE #ifndef CHILL_PRODUCER */
+/* OBSOLETE #define CHILL_PRODUCER "GNU Chill " */
+/* OBSOLETE #endif */
/* Flags to target_to_host() that tell whether or not the data object is
expected to be signed. Used, for example, when fetching a signed
@@ -621,9 +621,9 @@ set_cu_language (struct dieinfo *dip)
case LANG_C_PLUS_PLUS:
cu_language = language_cplus;
break;
- case LANG_CHILL:
- cu_language = language_chill;
- break;
+ /* OBSOLETE case LANG_CHILL: */
+ /* OBSOLETE cu_language = language_chill; */
+ /* OBSOLETE break; */
case LANG_MODULA2:
cu_language = language_m2;
break;
@@ -1822,8 +1822,8 @@ handle_producer (char *producer)
else
{
processing_gcc_compilation =
- STREQN (producer, GPLUS_PRODUCER, strlen (GPLUS_PRODUCER))
- || STREQN (producer, CHILL_PRODUCER, strlen (CHILL_PRODUCER));
+ STREQN (producer, GPLUS_PRODUCER, strlen (GPLUS_PRODUCER));
+ /* OBSOLETE || STREQN (producer, CHILL_PRODUCER, strlen (CHILL_PRODUCER)); */
}
/* Select a demangling style if we can identify the producer and if
diff --git a/gdb/elfread.c b/gdb/elfread.c
index e76cd0d4a35..7d37297c5f4 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -357,24 +357,14 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
|| ((sym->flags & BSF_LOCAL)
&& sym->name[0] == '$'
&& sym->name[1] == 'L'))
- /* Looks like a compiler-generated label. Skip it.
- The assembler should be skipping these (to keep
- executables small), but apparently with gcc on the
- delta m88k SVR4, it loses. So to have us check too
- should be harmless (but I encourage people to fix this
- in the assembler instead of adding checks here). */
+ /* Looks like a compiler-generated label. Skip
+ it. The assembler should be skipping these (to
+ keep executables small), but apparently with
+ gcc on the (OBSOLETE) delta m88k SVR4, it
+ loses. So to have us check too should be
+ harmless (but I encourage people to fix this in
+ the assembler instead of adding checks here). */
continue;
-#ifdef HARRIS_TARGET
- else if (sym->name[0] == '.' && sym->name[1] == '.')
- {
- /* Looks like a Harris compiler generated label for the
- purpose of marking instructions that are relevant to
- DWARF dies. The assembler can't get rid of these
- because they are relocatable addresses that the
- linker needs to resolve. */
- continue;
- }
-#endif
else
{
ms_type = mst_file_text;
diff --git a/gdb/eval.c b/gdb/eval.c
index 4ff210b08cf..33ec9438a04 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -186,8 +186,8 @@ get_label (register struct expression *exp, int *pos)
return NULL;
}
-/* This function evaluates tuples (in Chill) or brace-initializers
- (in C/C++) for structure types. */
+/* This function evaluates tuples (in (OBSOLETE) Chill) or
+ brace-initializers (in C/C++) for structure types. */
static struct value *
evaluate_struct_tuple (struct value *struct_val,
@@ -325,13 +325,11 @@ evaluate_struct_tuple (struct value *struct_val,
return struct_val;
}
-/* Recursive helper function for setting elements of array tuples for Chill.
- The target is ARRAY (which has bounds LOW_BOUND to HIGH_BOUND);
- the element value is ELEMENT;
- EXP, POS and NOSIDE are as usual.
- Evaluates index expresions and sets the specified element(s) of
- ARRAY to ELEMENT.
- Returns last index value. */
+/* Recursive helper function for setting elements of array tuples for
+ (OBSOLETE) Chill. The target is ARRAY (which has bounds LOW_BOUND
+ to HIGH_BOUND); the element value is ELEMENT; EXP, POS and NOSIDE
+ are as usual. Evaluates index expresions and sets the specified
+ element(s) of ARRAY to ELEMENT. Returns last index value. */
static LONGEST
init_array_element (struct value *array, struct value *element,
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index f0984878665..4e42d7e2b62 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -22,7 +22,6 @@
#include "defs.h"
#include "event-loop.h"
#include "event-top.h"
-#include "interps.h"
#ifdef HAVE_POLL
#if defined (HAVE_POLL_H)
@@ -394,23 +393,10 @@ start_event_loop (void)
longer any event sources registered. */
while (1)
{
- int gdb_result, interp_result;
-
- gdb_result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
- if (gdb_result < 0)
+ int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
+ if (result < 0)
break;
-
- interp_result = catch_errors (interpreter_do_one_event, 0, "", RETURN_MASK_ALL);
- if (interp_result < 0)
- {
- /* FIXME - kill the interpreter */
- }
-
- /* If we long-jumped out of do_one_event, we probably
- didn't get around to resetting the prompt, which leaves
- readline in a messed-up state. Reset it here. */
-
- if (gdb_result == 0)
+ if (result == 0)
{
/* FIXME: this should really be a call to a hook that is
interface specific, because interfaces can display the
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 878e769611a..86c658d030e 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -26,7 +26,6 @@
#include "terminal.h" /* for job_control */
#include "event-loop.h"
#include "event-top.h"
-#include "interps.h"
#include <signal.h>
/* For dont_repeat() */
@@ -253,7 +252,7 @@ display_gdb_prompt (char *new_prompt)
/* When an alternative interpreter has been installed, do not
display the comand prompt. */
- if (gdb_interpreter_display_prompt (new_prompt))
+ if (interpreter_p)
return;
if (target_executing && sync_execution)
@@ -515,8 +514,10 @@ command_handler (char *command)
(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
arg1->next = arg2;
arg2->next = NULL;
- arg1->data.integer = time_at_cmd_start;
- arg2->data.integer = space_at_cmd_start;
+ arg1->data.longint = time_at_cmd_start;
+#ifdef HAVE_SBRK
+ arg2->data.longint = space_at_cmd_start;
+#endif
add_continuation (command_line_handler_continuation, arg1);
}
@@ -682,7 +683,7 @@ command_line_handler (char *rl)
xfree (rl); /* Allocated in readline. */
- if (*(p - 1) == '\\')
+ if (p > linebuffer && *(p - 1) == '\\')
{
p--; /* Put on top of '\'. */
@@ -1112,31 +1113,14 @@ set_async_prompt (char *args, int from_tty, struct cmd_list_element *c)
PROMPT (0) = savestring (new_async_prompt, strlen (new_async_prompt));
}
-void
-_initialize_event_loop (void)
-{
- /* Tell gdb to use the cli_command_loop as the main loop. */
- if (event_loop_p && command_loop_hook == NULL)
- command_loop_hook = cli_command_loop;
-}
-
/* Set things up for readline to be invoked via the alternate
interface, i.e. via a callback function (rl_callback_read_char),
and hook up instream to the event loop. */
void
-gdb_setup_readline (void)
+_initialize_event_loop (void)
{
- /* This function is a noop for the async case. The assumption is that
- the async setup is ALL done in gdb_init, and we would only mess it up
- here. The async stuff should really go away over time. */
-
if (event_loop_p)
{
- gdb_stdout = stdio_fileopen (stdout);
- gdb_stderr = stdio_fileopen (stderr);
- gdb_stdlog = gdb_stderr; /* for moment */
- gdb_stdtarg = gdb_stderr; /* for moment */
-
/* If the input stream is connected to a terminal, turn on
editing. */
if (ISATTY (instream))
@@ -1169,6 +1153,9 @@ gdb_setup_readline (void)
register it with the event loop. */
input_fd = fileno (instream);
+ /* Tell gdb to use the cli_command_loop as the main loop. */
+ command_loop_hook = cli_command_loop;
+
/* Now we need to create the event sources for the input file
descriptor. */
/* At this point in time, this is the only event source that we
@@ -1179,31 +1166,3 @@ gdb_setup_readline (void)
add_file_handler (input_fd, stdin_event_handler, 0);
}
}
-
-/* Disable command input through the standard CLI channels. Used in
- the suspend proc for interpreters that use the standard gdb readline
- interface, like the cli & the mi. */
-
-void
-gdb_disable_readline (void)
-{
- if (event_loop_p)
- {
- /* FIXME - It is too heavyweight to delete and remake these
- every time you run an interpreter that needs readline.
- It is probably better to have the interpreters cache these,
- which in turn means that this needs to be moved into interpreter
- specific code. */
-
-#if 0
- ui_file_delete (gdb_stdout);
- ui_file_delete (gdb_stderr);
- gdb_stdlog = NULL;
- gdb_stdtarg = NULL;
-#endif
-
- rl_callback_handler_remove ();
- delete_file_handler (input_fd);
- }
-}
-
diff --git a/gdb/event-top.h b/gdb/event-top.h
index d8c0a963989..24044a57bab 100644
--- a/gdb/event-top.h
+++ b/gdb/event-top.h
@@ -71,8 +71,6 @@ struct prompts
FIXME: these should really go into top.h. */
extern void display_gdb_prompt (char *new_prompt);
-void gdb_setup_readline (void);
-void gdb_disable_readline (void);
extern void async_init_signals (void);
extern void set_async_editing_command (char *args, int from_tty,
struct cmd_list_element *c);
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 09e7db69b3a..9f3f1715321 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -217,8 +217,9 @@ print_subexp (register struct expression *exp, register int *pos,
}
else
{
- int is_chill = exp->language_defn->la_language == language_chill;
- fputs_filtered (is_chill ? " [" : " {", stream);
+ /* OBSOLETE int is_chill = exp->language_defn->la_language == language_chill; */
+ /* OBSOLETE fputs_filtered (is_chill ? " [" : " {", stream); */
+ fputs_filtered (" {", stream);
for (tem = 0; tem < nargs; tem++)
{
if (tem != 0)
@@ -227,7 +228,8 @@ print_subexp (register struct expression *exp, register int *pos,
}
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
}
- fputs_filtered (is_chill ? "]" : "}", stream);
+ /* OBSOLETE fputs_filtered (is_chill ? "]" : "}", stream); */
+ fputs_filtered ("}", stream);
}
return;
@@ -235,15 +237,17 @@ print_subexp (register struct expression *exp, register int *pos,
tem = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
- if (exp->language_defn->la_language == language_chill)
- {
- fputs_filtered (".", stream);
- fputs_filtered (&exp->elts[pc + 2].string, stream);
- fputs_filtered (exp->elts[*pos].opcode == OP_LABELED ? ", "
- : ": ",
- stream);
- }
- else
+#if 0
+ if (0 /* OBSOLETE exp->language_defn->la_language == language_chill */)
+ { /* OBSOLETE */
+ fputs_filtered (".", stream); /* OBSOLETE */
+ fputs_filtered (&exp->elts[pc + 2].string, stream); /* OBSOLETE */
+ fputs_filtered (exp->elts[*pos].opcode == OP_LABELED ? ", " /* OBSOLETE */
+ : ": ", /* OBSOLETE */
+ stream); /* OBSOLETE */
+ } /* OBSOLETE */
+ else /* OBSOLETE */
+#endif
{
/* Gcc support both these syntaxes. Unsure which is preferred. */
#if 1
diff --git a/gdb/expression.h b/gdb/expression.h
index 0fbab0357c5..34e002f3a28 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -109,10 +109,11 @@ enum exp_opcode
the second operand with itself that many times. */
BINOP_CONCAT,
- /* For Chill and Pascal. */
+ /* For (OBSOLETE) Chill (OBSOLETE) and Pascal. */
BINOP_IN, /* Returns 1 iff ARG1 IN ARG2. */
- /* This is the "colon operator" used various places in Chill. */
+ /* This is the "colon operator" used various places in (OBSOLETE)
+ Chill (OBSOLETE). */
BINOP_RANGE,
/* This must be the highest BINOP_ value, for expprint.c. */
@@ -121,12 +122,13 @@ enum exp_opcode
/* Operates on three values computed by following subexpressions. */
TERNOP_COND, /* ?: */
- /* A sub-string/sub-array. Chill syntax: OP1(OP2:OP3).
- Return elements OP2 through OP3 of OP1. */
+ /* A sub-string/sub-array. (OBSOLETE) Chill (OBSOLETE) syntax:
+ OP1(OP2:OP3). Return elements OP2 through OP3 of OP1. */
TERNOP_SLICE,
- /* A sub-string/sub-array. Chill syntax: OP1(OP2 UP OP3).
- Return OP3 elements of OP1, starting with element OP2. */
+ /* A sub-string/sub-array. (OBSOLETE) Chill (OBSOLETE) syntax:
+ OP1(OP2 UP OP3). Return OP3 elements of OP1, starting with
+ element OP2. */
TERNOP_SLICE_COUNT,
/* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
@@ -251,7 +253,7 @@ enum exp_opcode
UNOP_ODD,
UNOP_TRUNC,
- /* Chill builtin functions. */
+ /* (OBSOLETE) Chill (OBSOLETE) builtin functions. */
UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH, UNOP_CARD, UNOP_CHMAX, UNOP_CHMIN,
OP_BOOL, /* Modula-2 builtin BOOLEAN type */
@@ -281,12 +283,15 @@ enum exp_opcode
a string, which, of course, is variable length. */
OP_SCOPE,
- /* Used to represent named structure field values in brace initializers
- (or tuples as they are called in Chill).
- The gcc C syntax is NAME:VALUE or .NAME=VALUE, the Chill syntax is
- .NAME:VALUE. Multiple labels (as in the Chill syntax
- .NAME1,.NAME2:VALUE) is represented as if it were
- .NAME1:(.NAME2:VALUE) (though that is not valid Chill syntax).
+ /* Used to represent named structure field values in brace
+ initializers (or tuples as they are called in (OBSOLETE) Chill
+ (OBSOLETE)).
+
+ The gcc C syntax is NAME:VALUE or .NAME=VALUE, the (OBSOLETE)
+ Chill (OBSOLETE) syntax is .NAME:VALUE. Multiple labels (as in
+ the (OBSOLETE) Chill (OBSOLETE) syntax .NAME1,.NAME2:VALUE) is
+ represented as if it were .NAME1:(.NAME2:VALUE) (though that is
+ not valid (OBSOLETE) Chill (OBSOLETE) syntax).
The NAME is represented as for STRUCTOP_STRUCT; VALUE follows. */
OP_LABELED,
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index e11687726ef..a26f019fe96 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -102,9 +102,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yycheck f_yycheck
#ifndef YYDEBUG
-#define YYDEBUG 1 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
int yyparse (void);
static int yylex (void);
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 2beae0fed7f..2eba3912401 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -23,7 +23,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bfd.h"
#include "symtab.h"
#include "gdbtypes.h"
diff --git a/gdb/fbsd-proc.c b/gdb/fbsd-proc.c
index c68238dbece..6c47979650a 100644
--- a/gdb/fbsd-proc.c
+++ b/gdb/fbsd-proc.c
@@ -21,6 +21,7 @@
#include "defs.h"
#include "gdbcore.h"
#include "inferior.h"
+#include "gdb_string.h"
#include <sys/procfs.h>
#include <sys/types.h>
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 831ae4bc1b0..d2591321d75 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -47,12 +47,12 @@ you lose
#endif
LONGEST
-extract_signed_integer (void *addr, int len)
+extract_signed_integer (const void *addr, int len)
{
LONGEST retval;
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ const unsigned char *p;
+ const unsigned char *startaddr = addr;
+ const unsigned char *endaddr = startaddr + len;
if (len > (int) sizeof (LONGEST))
error ("\
@@ -81,12 +81,12 @@ That operation is not available on integers of more than %d bytes.",
}
ULONGEST
-extract_unsigned_integer (void *addr, int len)
+extract_unsigned_integer (const void *addr, int len)
{
ULONGEST retval;
- unsigned char *p;
- unsigned char *startaddr = (unsigned char *) addr;
- unsigned char *endaddr = startaddr + len;
+ const unsigned char *p;
+ const unsigned char *startaddr = addr;
+ const unsigned char *endaddr = startaddr + len;
if (len > (int) sizeof (ULONGEST))
error ("\
diff --git a/gdb/fr30-tdep.c b/gdb/fr30-tdep.c
index 09f886fed87..12e9f7ea313 100644
--- a/gdb/fr30-tdep.c
+++ b/gdb/fr30-tdep.c
@@ -1,601 +1,601 @@
-/* Target-dependent code for the Fujitsu FR30.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "obstack.h"
-#include "target.h"
-#include "value.h"
-#include "bfd.h"
-#include "gdb_string.h"
-#include "gdbcore.h"
-#include "symfile.h"
-#include "regcache.h"
-
-/* An expression that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. */
-int
-fr30_frameless_function_invocation (struct frame_info *fi)
-{
- int frameless;
- CORE_ADDR func_start, after_prologue;
- func_start = (get_pc_function_start ((fi)->pc) +
- FUNCTION_START_OFFSET);
- after_prologue = func_start;
- after_prologue = SKIP_PROLOGUE (after_prologue);
- frameless = (after_prologue == func_start);
- return frameless;
-}
-
-/* Function: pop_frame
- This routine gets called when either the user uses the `return'
- command, or the call dummy breakpoint gets hit. */
-
-void
-fr30_pop_frame (void)
-{
- struct frame_info *frame = get_current_frame ();
- int regnum;
- CORE_ADDR sp = read_register (SP_REGNUM);
-
- if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
- generic_pop_dummy_frame ();
- else
- {
- write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
-
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (frame->fsr.regs[regnum] != 0)
- {
- write_register (regnum,
- read_memory_unsigned_integer (frame->fsr.regs[regnum],
- REGISTER_RAW_SIZE (regnum)));
- }
- write_register (SP_REGNUM, sp + frame->framesize);
- }
- flush_cached_frames ();
-}
-
-
-/* Function: fr30_store_return_value
- Put a value where a caller expects to see it. Used by the 'return'
- command. */
-void
-fr30_store_return_value (struct type *type,
- char *valbuf)
-{
- /* Here's how the FR30 returns values (gleaned from gcc/config/
- fr30/fr30.h):
-
- If the return value is 32 bits long or less, it goes in r4.
-
- If the return value is 64 bits long or less, it goes in r4 (most
- significant word) and r5 (least significant word.
-
- If the function returns a structure, of any size, the caller
- passes the function an invisible first argument where the callee
- should store the value. But GDB doesn't let you do that anyway.
-
- If you're returning a value smaller than a word, it's not really
- necessary to zero the upper bytes of the register; the caller is
- supposed to ignore them. However, the FR30 typically keeps its
- values extended to the full register width, so we should emulate
- that. */
-
- /* The FR30 is big-endian, so if we return a small value (like a
- short or a char), we need to position it correctly within the
- register. We round the size up to a register boundary, and then
- adjust the offset so as to place the value at the right end. */
- int value_size = TYPE_LENGTH (type);
- int returned_size = (value_size + FR30_REGSIZE - 1) & ~(FR30_REGSIZE - 1);
- int offset = (REGISTER_BYTE (RETVAL_REG)
- + (returned_size - value_size));
- char *zeros = alloca (returned_size);
- memset (zeros, 0, returned_size);
-
- write_register_bytes (REGISTER_BYTE (RETVAL_REG), zeros, returned_size);
- write_register_bytes (offset, valbuf, value_size);
-}
-
-
-/* Function: skip_prologue
- Return the address of the first code past the prologue of the function. */
-
-CORE_ADDR
-fr30_skip_prologue (CORE_ADDR pc)
-{
- CORE_ADDR func_addr, func_end;
-
- /* See what the symbol table says */
-
- if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
- {
- struct symtab_and_line sal;
-
- sal = find_pc_line (func_addr, 0);
-
- if (sal.line != 0 && sal.end < func_end)
- {
- return sal.end;
- }
- }
-
-/* Either we didn't find the start of this function (nothing we can do),
- or there's no line info, or the line after the prologue is after
- the end of the function (there probably isn't a prologue). */
-
- return pc;
-}
-
-
-/* Function: push_arguments
- Setup arguments and RP for a call to the target. First four args
- go in FIRST_ARGREG -> LAST_ARGREG, subsequent args go on stack...
- Structs are passed by reference. XXX not right now Z.R.
- 64 bit quantities (doubles and long longs) may be split between
- the regs and the stack.
- When calling a function that returns a struct, a pointer to the struct
- is passed in as a secret first argument (always in FIRST_ARGREG).
-
- Stack space for the args has NOT been allocated: that job is up to us.
- */
-
-CORE_ADDR
-fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
-{
- int argreg;
- int argnum;
- int stack_offset;
- struct stack_arg
- {
- char *val;
- int len;
- int offset;
- };
- struct stack_arg *stack_args =
- (struct stack_arg *) alloca (nargs * sizeof (struct stack_arg));
- int nstack_args = 0;
-
- argreg = FIRST_ARGREG;
-
- /* the struct_return pointer occupies the first parameter-passing reg */
- if (struct_return)
- write_register (argreg++, struct_addr);
-
- stack_offset = 0;
-
- /* Process args from left to right. Store as many as allowed in
- registers, save the rest to be pushed on the stack */
- for (argnum = 0; argnum < nargs; argnum++)
- {
- char *val;
- struct value *arg = args[argnum];
- struct type *arg_type = check_typedef (VALUE_TYPE (arg));
- struct type *target_type = TYPE_TARGET_TYPE (arg_type);
- int len = TYPE_LENGTH (arg_type);
- enum type_code typecode = TYPE_CODE (arg_type);
- CORE_ADDR regval;
- int newarg;
-
- val = (char *) VALUE_CONTENTS (arg);
-
- {
- /* Copy the argument to general registers or the stack in
- register-sized pieces. Large arguments are split between
- registers and stack. */
- while (len > 0)
- {
- if (argreg <= LAST_ARGREG)
- {
- int partial_len = len < REGISTER_SIZE ? len : REGISTER_SIZE;
- regval = extract_address (val, partial_len);
-
- /* It's a simple argument being passed in a general
- register. */
- write_register (argreg, regval);
- argreg++;
- len -= partial_len;
- val += partial_len;
- }
- else
- {
- /* keep for later pushing */
- stack_args[nstack_args].val = val;
- stack_args[nstack_args++].len = len;
- break;
- }
- }
- }
- }
- /* now do the real stack pushing, process args right to left */
- while (nstack_args--)
- {
- sp -= stack_args[nstack_args].len;
- write_memory (sp, stack_args[nstack_args].val,
- stack_args[nstack_args].len);
- }
-
- /* Return adjusted stack pointer. */
- return sp;
-}
-
-void _initialize_fr30_tdep (void);
-
-void
-_initialize_fr30_tdep (void)
-{
- extern int print_insn_fr30 (bfd_vma, disassemble_info *);
- tm_print_insn = print_insn_fr30;
-}
-
-/* Function: check_prologue_cache
- Check if prologue for this frame's PC has already been scanned.
- If it has, copy the relevant information about that prologue and
- return non-zero. Otherwise do not copy anything and return zero.
-
- The information saved in the cache includes:
- * the frame register number;
- * the size of the stack frame;
- * the offsets of saved regs (relative to the old SP); and
- * the offset from the stack pointer to the frame pointer
-
- The cache contains only one entry, since this is adequate
- for the typical sequence of prologue scan requests we get.
- When performing a backtrace, GDB will usually ask to scan
- the same function twice in a row (once to get the frame chain,
- and once to fill in the extra frame information).
- */
-
-static struct frame_info prologue_cache;
-
-static int
-check_prologue_cache (struct frame_info *fi)
-{
- int i;
-
- if (fi->pc == prologue_cache.pc)
- {
- fi->framereg = prologue_cache.framereg;
- fi->framesize = prologue_cache.framesize;
- fi->frameoffset = prologue_cache.frameoffset;
- for (i = 0; i <= NUM_REGS; i++)
- fi->fsr.regs[i] = prologue_cache.fsr.regs[i];
- return 1;
- }
- else
- return 0;
-}
-
-
-/* Function: save_prologue_cache
- Copy the prologue information from fi to the prologue cache.
- */
-
-static void
-save_prologue_cache (struct frame_info *fi)
-{
- int i;
-
- prologue_cache.pc = fi->pc;
- prologue_cache.framereg = fi->framereg;
- prologue_cache.framesize = fi->framesize;
- prologue_cache.frameoffset = fi->frameoffset;
-
- for (i = 0; i <= NUM_REGS; i++)
- {
- prologue_cache.fsr.regs[i] = fi->fsr.regs[i];
- }
-}
-
-
-/* Function: scan_prologue
- Scan the prologue of the function that contains PC, and record what
- we find in PI. PI->fsr must be zeroed by the called. Returns the
- pc after the prologue. Note that the addresses saved in pi->fsr
- are actually just frame relative (negative offsets from the frame
- pointer). This is because we don't know the actual value of the
- frame pointer yet. In some circumstances, the frame pointer can't
- be determined till after we have scanned the prologue. */
-
-static void
-fr30_scan_prologue (struct frame_info *fi)
-{
- int sp_offset, fp_offset;
- CORE_ADDR prologue_start, prologue_end, current_pc;
-
- /* Check if this function is already in the cache of frame information. */
- if (check_prologue_cache (fi))
- return;
-
- /* Assume there is no frame until proven otherwise. */
- fi->framereg = SP_REGNUM;
- fi->framesize = 0;
- fi->frameoffset = 0;
-
- /* Find the function prologue. If we can't find the function in
- the symbol table, peek in the stack frame to find the PC. */
- if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end))
- {
- /* Assume the prologue is everything between the first instruction
- in the function and the first source line. */
- struct symtab_and_line sal = find_pc_line (prologue_start, 0);
-
- if (sal.line == 0) /* no line info, use current PC */
- prologue_end = fi->pc;
- else if (sal.end < prologue_end) /* next line begins after fn end */
- prologue_end = sal.end; /* (probably means no prologue) */
- }
- else
- {
- /* XXX Z.R. What now??? The following is entirely bogus */
- prologue_start = (read_memory_integer (fi->frame, 4) & 0x03fffffc) - 12;
- prologue_end = prologue_start + 40;
- }
-
- /* Now search the prologue looking for instructions that set up the
- frame pointer, adjust the stack pointer, and save registers. */
-
- sp_offset = fp_offset = 0;
- for (current_pc = prologue_start; current_pc < prologue_end; current_pc += 2)
- {
- unsigned int insn;
-
- insn = read_memory_unsigned_integer (current_pc, 2);
-
- if ((insn & 0xfe00) == 0x8e00) /* stm0 or stm1 */
- {
- int reg, mask = insn & 0xff;
-
- /* scan in one sweep - create virtual 16-bit mask from either insn's mask */
- if ((insn & 0x0100) == 0)
- {
- mask <<= 8; /* stm0 - move to upper byte in virtual mask */
- }
-
- /* Calculate offsets of saved registers (to be turned later into addresses). */
- for (reg = R4_REGNUM; reg <= R11_REGNUM; reg++)
- if (mask & (1 << (15 - reg)))
- {
- sp_offset -= 4;
- fi->fsr.regs[reg] = sp_offset;
- }
- }
- else if ((insn & 0xfff0) == 0x1700) /* st rx,@-r15 */
- {
- int reg = insn & 0xf;
-
- sp_offset -= 4;
- fi->fsr.regs[reg] = sp_offset;
- }
- else if ((insn & 0xff00) == 0x0f00) /* enter */
- {
- fp_offset = fi->fsr.regs[FP_REGNUM] = sp_offset - 4;
- sp_offset -= 4 * (insn & 0xff);
- fi->framereg = FP_REGNUM;
- }
- else if (insn == 0x1781) /* st rp,@-sp */
- {
- sp_offset -= 4;
- fi->fsr.regs[RP_REGNUM] = sp_offset;
- }
- else if (insn == 0x170e) /* st fp,@-sp */
- {
- sp_offset -= 4;
- fi->fsr.regs[FP_REGNUM] = sp_offset;
- }
- else if (insn == 0x8bfe) /* mov sp,fp */
- {
- fi->framereg = FP_REGNUM;
- }
- else if ((insn & 0xff00) == 0xa300) /* addsp xx */
- {
- sp_offset += 4 * (signed char) (insn & 0xff);
- }
- else if ((insn & 0xff0f) == 0x9b00 && /* ldi:20 xx,r0 */
- read_memory_unsigned_integer (current_pc + 4, 2)
- == 0xac0f) /* sub r0,sp */
- {
- /* large stack adjustment */
- sp_offset -= (((insn & 0xf0) << 12) | read_memory_unsigned_integer (current_pc + 2, 2));
- current_pc += 4;
- }
- else if (insn == 0x9f80 && /* ldi:32 xx,r0 */
- read_memory_unsigned_integer (current_pc + 6, 2)
- == 0xac0f) /* sub r0,sp */
- {
- /* large stack adjustment */
- sp_offset -=
- (read_memory_unsigned_integer (current_pc + 2, 2) << 16 |
- read_memory_unsigned_integer (current_pc + 4, 2));
- current_pc += 6;
- }
- }
-
- /* The frame size is just the negative of the offset (from the original SP)
- of the last thing thing we pushed on the stack. The frame offset is
- [new FP] - [new SP]. */
- fi->framesize = -sp_offset;
- fi->frameoffset = fp_offset - sp_offset;
-
- save_prologue_cache (fi);
-}
-
-/* Function: init_extra_frame_info
- Setup the frame's frame pointer, pc, and frame addresses for saved
- registers. Most of the work is done in scan_prologue().
-
- Note that when we are called for the last frame (currently active frame),
- that fi->pc and fi->frame will already be setup. However, fi->frame will
- be valid only if this routine uses FP. For previous frames, fi-frame will
- always be correct (since that is derived from fr30_frame_chain ()).
-
- We can be called with the PC in the call dummy under two circumstances.
- First, during normal backtracing, second, while figuring out the frame
- pointer just prior to calling the target function (see run_stack_dummy). */
-
-void
-fr30_init_extra_frame_info (struct frame_info *fi)
-{
- int reg;
-
- if (fi->next)
- fi->pc = FRAME_SAVED_PC (fi->next);
-
- memset (fi->fsr.regs, '\000', sizeof fi->fsr.regs);
-
- if (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. */
- fi->frame = generic_read_register_dummy (fi->pc, fi->frame, SP_REGNUM);
- fi->framesize = 0;
- fi->frameoffset = 0;
- return;
- }
- fr30_scan_prologue (fi);
-
- if (!fi->next) /* this is the innermost frame? */
- fi->frame = read_register (fi->framereg);
- else
- /* not the innermost frame */
- /* If we have an FP, the callee saved it. */
- if (fi->framereg == FP_REGNUM)
- if (fi->next->fsr.regs[fi->framereg] != 0)
- fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg], 4);
-
- /* Calculate actual addresses of saved registers using offsets determined
- by fr30_scan_prologue. */
- for (reg = 0; reg < NUM_REGS; reg++)
- if (fi->fsr.regs[reg] != 0)
- {
- fi->fsr.regs[reg] += fi->frame + fi->framesize - fi->frameoffset;
- }
-}
-
-/* Function: find_callers_reg
- Find REGNUM on the stack. Otherwise, it's in an active register.
- One thing we might want to do here is to check REGNUM against the
- clobber mask, and somehow flag it as invalid if it isn't saved on
- the stack somewhere. This would provide a graceful failure mode
- when trying to get the value of caller-saves registers for an inner
- frame. */
-
-CORE_ADDR
-fr30_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))
- return generic_read_register_dummy (fi->pc, fi->frame, regnum);
- else if (fi->fsr.regs[regnum] != 0)
- return read_memory_unsigned_integer (fi->fsr.regs[regnum],
- REGISTER_RAW_SIZE (regnum));
-
- return read_register (regnum);
-}
-
-
-/* Function: frame_chain
- Figure out the frame prior to FI. Unfortunately, this involves
- scanning the prologue of the caller, which will also be done
- shortly by fr30_init_extra_frame_info. For the dummy frame, we
- just return the stack pointer that was in use at the time the
- function call was made. */
-
-
-CORE_ADDR
-fr30_frame_chain (struct frame_info *fi)
-{
- CORE_ADDR fn_start, callers_pc, fp;
- struct frame_info caller_fi;
- int framereg;
-
- /* is this a dummy frame? */
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return fi->frame; /* dummy frame same as caller's frame */
-
- /* is caller-of-this a dummy frame? */
- callers_pc = FRAME_SAVED_PC (fi); /* find out who called us: */
- fp = fr30_find_callers_reg (fi, FP_REGNUM);
- if (PC_IN_CALL_DUMMY (callers_pc, fp, fp))
- return fp; /* dummy frame's frame may bear no relation to ours */
-
- if (find_pc_partial_function (fi->pc, 0, &fn_start, 0))
- if (fn_start == entry_point_address ())
- return 0; /* in _start fn, don't chain further */
-
- framereg = fi->framereg;
-
- /* If the caller is the startup code, we're at the end of the chain. */
- if (find_pc_partial_function (callers_pc, 0, &fn_start, 0))
- if (fn_start == entry_point_address ())
- return 0;
-
- memset (&caller_fi, 0, sizeof (caller_fi));
- caller_fi.pc = callers_pc;
- fr30_scan_prologue (&caller_fi);
- framereg = caller_fi.framereg;
-
- /* If the caller used a frame register, return its value.
- Otherwise, return the caller's stack pointer. */
- if (framereg == FP_REGNUM)
- return fr30_find_callers_reg (fi, framereg);
- else
- return fi->frame + fi->framesize;
-}
-
-/* Function: frame_saved_pc
- Find the caller of this frame. We do this by seeing if RP_REGNUM
- is saved in the stack anywhere, otherwise we get it from the
- registers. If the inner frame is a dummy frame, return its PC
- instead of RP, because that's where "caller" of the dummy-frame
- will be found. */
-
-CORE_ADDR
-fr30_frame_saved_pc (struct frame_info *fi)
-{
- if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
- return generic_read_register_dummy (fi->pc, fi->frame, PC_REGNUM);
- else
- return fr30_find_callers_reg (fi, RP_REGNUM);
-}
-
-/* Function: fix_call_dummy
- Pokes the callee function's address into the CALL_DUMMY assembly stub.
- Assumes that the CALL_DUMMY looks like this:
- jarl <offset24>, r31
- trap
- */
-
-int
-fr30_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs,
- struct value **args, struct type *type, int gcc_p)
-{
- long offset24;
-
- offset24 = (long) fun - (long) entry_point_address ();
- offset24 &= 0x3fffff;
- offset24 |= 0xff800000; /* jarl <offset24>, r31 */
-
- store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff);
- store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16);
- return 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 <offset24>, 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 <offset24>, 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 24cd9071437..3b17bf5abf0 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1,4 +1,4 @@
-/* Cache and manage the values of registers for GDB, the GNU debugger.
+/* Cache and manage frames for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
2001, 2002 Free Software Foundation, Inc.
@@ -26,6 +26,57 @@
#include "value.h"
#include "inferior.h" /* for inferior_ptid */
#include "regcache.h"
+#include "gdb_assert.h"
+
+/* 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)
+{
+ if (fi == NULL)
+ {
+ id->base = 0;
+ id->pc = 0;
+ }
+ else
+ {
+ id->base = FRAME_FP (fi);
+ id->pc = fi->pc;
+ }
+}
+
+struct frame_info *
+frame_find_by_id (struct frame_id id)
+{
+ struct frame_info *frame;
+
+ /* 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)
+ 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. */
+ 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;
+ }
+ return NULL;
+}
/* FIND_SAVED_REGISTER ()
@@ -43,10 +94,9 @@ find_saved_register (struct frame_info *frame, int regnum)
if (frame == NULL) /* No regs saved if want current frame */
return 0;
- /* Note that this next routine assumes that registers used in
- frame x will be saved only in the frame that x calls and
- frames interior to it. This is not true on the sparc, but the
- above macro takes care of it, so we should be all right. */
+ /* Note that the following loop assumes that registers used in
+ frame x will be saved only in the frame that x calls and frames
+ interior to it. */
while (1)
{
QUIT;
@@ -56,82 +106,106 @@ find_saved_register (struct frame_info *frame, int regnum)
frame = frame1;
FRAME_INIT_SAVED_REGS (frame1);
if (frame1->saved_regs[regnum])
- addr = frame1->saved_regs[regnum];
+ {
+ addr = frame1->saved_regs[regnum];
+ break;
+ }
}
return addr;
}
-/* DEFAULT_GET_SAVED_REGISTER ()
-
- Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
- variable was optimized out (and thus can't be fetched). Set *LVAL
- to lval_memory, lval_register, or not_lval, depending on whether
- the value was fetched from memory, from a register, or in a strange
- and non-modifiable way (e.g. a frame pointer which was calculated
- rather than fetched). Set *ADDRP to the address, either in memory
- on as a REGISTER_BYTE offset into the registers array.
-
- Note that this implementation never sets *LVAL to not_lval. But
- it can be replaced by defining GET_SAVED_REGISTER and supplying
- your own.
-
- The argument RAW_BUFFER must point to aligned memory. */
-
-static void
-default_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
+void
+frame_register_unwind (struct frame_info *frame, int regnum,
+ int *optimizedp, enum lval_type *lvalp,
+ CORE_ADDR *addrp, int *realnump, void *bufferp)
{
- CORE_ADDR addr;
+ struct frame_unwind_cache *cache;
+
+ /* Require all but BUFFERP to be valid. A NULL BUFFERP indicates
+ that the value proper does not need to be fetched. */
+ gdb_assert (optimizedp != NULL);
+ gdb_assert (lvalp != NULL);
+ gdb_assert (addrp != NULL);
+ gdb_assert (realnump != NULL);
+ /* gdb_assert (bufferp != NULL); */
+
+ /* NOTE: cagney/2002-04-14: It would be nice if, instead of a
+ special case, there was always an inner frame dedicated to the
+ hardware registers. Unfortunatly, there is too much unwind code
+ around that looks up/down the frame chain while making the
+ assumption that each frame level is using the same unwind code. */
+
+ if (frame == NULL)
+ {
+ /* We're in the inner-most frame, get the value direct from the
+ register cache. */
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ /* ULGH! Code uses the offset into the raw register byte array
+ as a way of identifying a register. */
+ *addrp = REGISTER_BYTE (regnum);
+ /* Should this code test ``register_cached (regnum) < 0'' and do
+ something like set realnum to -1 when the register isn't
+ available? */
+ *realnump = regnum;
+ if (bufferp)
+ read_register_gen (regnum, bufferp);
+ return;
+ }
+
+ /* Ask this frame to unwind its register. */
+ frame->register_unwind (frame, &frame->register_unwind_cache, regnum,
+ optimizedp, lvalp, addrp, realnump, bufferp);
+}
+
+
+void
+generic_unwind_get_saved_register (char *raw_buffer,
+ int *optimizedp,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lvalp)
+{
+ int optimizedx;
+ CORE_ADDR addrx;
+ int realnumx;
+ enum lval_type lvalx;
if (!target_has_registers)
error ("No registers.");
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
+ /* Keep things simple, ensure that all the pointers (except valuep)
+ are non NULL. */
+ if (optimizedp == NULL)
+ optimizedp = &optimizedx;
+ if (lvalp == NULL)
+ lvalp = &lvalx;
+ if (addrp == NULL)
+ addrp = &addrx;
+
+ /* Reached the the bottom (youngest, inner most) of the frame chain
+ (youngest, inner most) frame, go direct to the hardware register
+ cache (do not pass go, do not try to cache the value, ...). The
+ unwound value would have been cached in frame->next but that
+ doesn't exist. This doesn't matter as the hardware register
+ cache is stopping any unnecessary accesses to the target. */
+
+ /* NOTE: cagney/2002-04-14: It would be nice if, instead of a
+ special case, there was always an inner frame dedicated to the
+ hardware registers. Unfortunatly, there is too much unwind code
+ around that looks up/down the frame chain while making the
+ assumption that each frame level is using the same unwind code. */
+
+ if (frame == NULL)
+ frame_register_unwind (NULL, regnum, optimizedp, lvalp, addrp, &realnumx,
+ raw_buffer);
else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
+ frame_register_unwind (frame->next, regnum, optimizedp, lvalp, addrp,
+ &realnumx, raw_buffer);
}
-#if !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
- default_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
-#endif
-
void
get_saved_register (char *raw_buffer,
int *optimized,
diff --git a/gdb/frame.h b/gdb/frame.h
index f0631b01555..20ffff00daf 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -23,6 +23,29 @@
#if !defined (FRAME_H)
#define FRAME_H 1
+/* Return the location (and possibly value) of REGNUM for the previous
+ (older, up) frame. All parameters except VALUEP can be assumed to
+ be non NULL. When VALUEP is NULL, just the location of the
+ register should be returned.
+
+ UNWIND_CACHE is provided as mechanism for implementing a per-frame
+ local cache. It's initial value being NULL. Memory for that cache
+ should be allocated using frame_obstack_alloc().
+
+ Register window architectures (eg SPARC) should note that REGNUM
+ identifies the register for the previous frame. For instance, a
+ request for the value of "o1" for the previous frame would be found
+ in the register "i1" in this FRAME. */
+
+typedef void (frame_register_unwind_ftype) (struct frame_info *frame,
+ void **unwind_cache,
+ int regnum,
+ int *optimized,
+ enum lval_type *lvalp,
+ CORE_ADDR *addrp,
+ int *realnump,
+ void *valuep);
+
/* Describe the saved registers of a frame. */
#if defined (EXTRA_FRAME_INFO) || defined (FRAME_FIND_SAVED_REGS)
@@ -110,7 +133,12 @@ struct frame_info
/* If dwarf2 unwind frame informations is used, this structure holds all
related unwind data. */
- struct unwind_contect *context;
+ struct context *context;
+
+ /* See description above. Return the register value for the
+ previous frame. */
+ frame_register_unwind_ftype *register_unwind;
+ void *register_unwind_cache;
/* Pointers to the next (down, inner) and previous (up, outer)
frame_info's in the frame cache. */
@@ -222,6 +250,8 @@ extern struct symbol *get_frame_function (struct frame_info *);
extern CORE_ADDR get_frame_pc (struct frame_info *);
+extern CORE_ADDR frame_address_in_block (struct frame_info *);
+
extern CORE_ADDR get_pc_function_start (CORE_ADDR);
extern struct block *block_for_pc (CORE_ADDR);
@@ -246,7 +276,21 @@ extern void show_stack_frame (struct frame_info *);
extern void select_frame (struct frame_info *);
-extern void record_selected_frame (CORE_ADDR *, int *);
+/* Return an ID that can be used to re-find a frame. */
+
+struct frame_id
+{
+ /* The frame's address. This should be constant through out the
+ lifetime of a frame. */
+ CORE_ADDR base;
+ /* The frame's current PC. While this changes, the function that
+ the PC falls into, does not. */
+ CORE_ADDR pc;
+};
+
+extern void get_frame_id (struct frame_info *fi, struct frame_id *id);
+
+extern struct frame_info *frame_find_by_id (struct frame_id id);
extern void print_frame_info (struct frame_info *, int, int, int);
@@ -268,7 +312,13 @@ extern void generic_pop_dummy_frame (void);
extern int generic_pc_in_call_dummy (CORE_ADDR pc,
CORE_ADDR sp, CORE_ADDR fp);
-extern char *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
+
+/* NOTE: cagney/2002-06-26: Targets should no longer use this
+ function. Instead, the contents of a dummy frames registers can be
+ obtained by applying: frame_register_unwind to the dummy frame; or
+ get_saved_register to the next outer frame. */
+
+extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args,
@@ -278,6 +328,22 @@ extern void 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);
+
+/* Unwind the stack frame so that the value of REGNUM, in the previous
+ frame is returned. If VALUEP is NULL, don't fetch/compute the
+ value. Instead just return the location of the value. */
+
+extern void frame_register_unwind (struct frame_info *frame, int regnum,
+ int *optimizedp, enum lval_type *lvalp,
+ CORE_ADDR *addrp, int *realnump,
+ void *valuep);
+
extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
extern void get_saved_register (char *raw_buffer, int *optimized,
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
new file mode 100644
index 00000000000..933faa13612
--- /dev/null
+++ b/gdb/frv-tdep.c
@@ -0,0 +1,1173 @@
+/* Target-dependent code for the Fujitsu FR-V, for GDB, the GNU Debugger.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "symfile.h" /* for entry_point_address */
+#include "gdbcore.h"
+#include "arch-utils.h"
+#include "regcache.h"
+
+extern void _initialize_frv_tdep (void);
+
+static gdbarch_init_ftype frv_gdbarch_init;
+
+static gdbarch_register_name_ftype frv_register_name;
+static gdbarch_register_raw_size_ftype frv_register_raw_size;
+static gdbarch_register_virtual_size_ftype frv_register_virtual_size;
+static gdbarch_register_virtual_type_ftype frv_register_virtual_type;
+static gdbarch_register_byte_ftype frv_register_byte;
+static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc;
+static gdbarch_frame_chain_ftype frv_frame_chain;
+static gdbarch_frame_saved_pc_ftype frv_frame_saved_pc;
+static gdbarch_skip_prologue_ftype frv_skip_prologue;
+static gdbarch_frame_init_saved_regs_ftype frv_frame_init_saved_regs;
+static gdbarch_deprecated_extract_return_value_ftype frv_extract_return_value;
+static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_value_address;
+static gdbarch_use_struct_convention_ftype frv_use_struct_convention;
+static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation;
+static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info;
+static gdbarch_store_struct_return_ftype frv_store_struct_return;
+static gdbarch_push_arguments_ftype frv_push_arguments;
+static gdbarch_push_return_address_ftype frv_push_return_address;
+static gdbarch_pop_frame_ftype frv_pop_frame;
+static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call;
+
+static void frv_pop_frame_regular (struct frame_info *frame);
+
+/* Register numbers. You can change these as needed, but don't forget
+ to update the simulator accordingly. */
+enum {
+ /* The total number of registers we know exist. */
+ frv_num_regs = 147,
+
+ /* Register numbers 0 -- 63 are always reserved for general-purpose
+ registers. The chip at hand may have less. */
+ first_gpr_regnum = 0,
+ sp_regnum = 1,
+ fp_regnum = 2,
+ struct_return_regnum = 3,
+ last_gpr_regnum = 63,
+
+ /* Register numbers 64 -- 127 are always reserved for floating-point
+ registers. The chip at hand may have less. */
+ first_fpr_regnum = 64,
+ last_fpr_regnum = 127,
+
+ /* Register numbers 128 on up are always reserved for special-purpose
+ registers. */
+ first_spr_regnum = 128,
+ pc_regnum = 128,
+ psr_regnum = 129,
+ ccr_regnum = 130,
+ cccr_regnum = 131,
+ tbr_regnum = 135,
+ brr_regnum = 136,
+ dbar0_regnum = 137,
+ dbar1_regnum = 138,
+ dbar2_regnum = 139,
+ dbar3_regnum = 140,
+ lr_regnum = 145,
+ lcr_regnum = 146,
+ last_spr_regnum = 146
+};
+
+static LONGEST frv_call_dummy_words[] =
+{0};
+
+
+/* The contents of this structure can only be trusted after we've
+ frv_frame_init_saved_regs on the frame. */
+struct frame_extra_info
+ {
+ /* The offset from our frame pointer to our caller's stack
+ pointer. */
+ int fp_to_callers_sp_offset;
+
+ /* Non-zero if we've saved our return address on the stack yet.
+ Zero if it's still sitting in the link register. */
+ int lr_saved_on_stack;
+ };
+
+
+/* A structure describing a particular variant of the FRV.
+ We allocate and initialize one of these structures when we create
+ the gdbarch object for a variant.
+
+ At the moment, all the FR variants we support differ only in which
+ registers are present; the portable code of GDB knows that
+ registers whose names are the empty string don't exist, so the
+ `register_names' array captures all the per-variant information we
+ need.
+
+ in the future, if we need to have per-variant maps for raw size,
+ virtual type, etc., we should replace register_names with an array
+ of structures, each of which gives all the necessary info for one
+ register. Don't stick parallel arrays in here --- that's so
+ Fortran. */
+struct gdbarch_tdep
+{
+ /* How many general-purpose registers does this variant have? */
+ int num_gprs;
+
+ /* How many floating-point registers does this variant have? */
+ int num_fprs;
+
+ /* How many hardware watchpoints can it support? */
+ int num_hw_watchpoints;
+
+ /* How many hardware breakpoints can it support? */
+ int num_hw_breakpoints;
+
+ /* Register names. */
+ char **register_names;
+};
+
+#define CURRENT_VARIANT (gdbarch_tdep (current_gdbarch))
+
+
+/* Allocate a new variant structure, and set up default values for all
+ the fields. */
+static struct gdbarch_tdep *
+new_variant (void)
+{
+ struct gdbarch_tdep *var;
+ int r;
+ char buf[20];
+
+ var = xmalloc (sizeof (*var));
+ memset (var, 0, sizeof (*var));
+
+ var->num_gprs = 64;
+ var->num_fprs = 64;
+ var->num_hw_watchpoints = 0;
+ var->num_hw_breakpoints = 0;
+
+ /* By default, don't supply any general-purpose or floating-point
+ register names. */
+ var->register_names = (char **) xmalloc (frv_num_regs * sizeof (char *));
+ for (r = 0; r < frv_num_regs; r++)
+ var->register_names[r] = "";
+
+ /* Do, however, supply default names for the special-purpose
+ registers. */
+ for (r = first_spr_regnum; r <= last_spr_regnum; ++r)
+ {
+ sprintf (buf, "x%d", r);
+ var->register_names[r] = xstrdup (buf);
+ }
+
+ var->register_names[pc_regnum] = "pc";
+ var->register_names[lr_regnum] = "lr";
+ var->register_names[lcr_regnum] = "lcr";
+
+ var->register_names[psr_regnum] = "psr";
+ var->register_names[ccr_regnum] = "ccr";
+ var->register_names[cccr_regnum] = "cccr";
+ var->register_names[tbr_regnum] = "tbr";
+
+ /* Debug registers. */
+ var->register_names[brr_regnum] = "brr";
+ var->register_names[dbar0_regnum] = "dbar0";
+ var->register_names[dbar1_regnum] = "dbar1";
+ var->register_names[dbar2_regnum] = "dbar2";
+ var->register_names[dbar3_regnum] = "dbar3";
+
+ return var;
+}
+
+
+/* Indicate that the variant VAR has NUM_GPRS general-purpose
+ registers, and fill in the names array appropriately. */
+static void
+set_variant_num_gprs (struct gdbarch_tdep *var, int num_gprs)
+{
+ int r;
+
+ var->num_gprs = num_gprs;
+
+ for (r = 0; r < num_gprs; ++r)
+ {
+ char buf[20];
+
+ sprintf (buf, "gr%d", r);
+ var->register_names[first_gpr_regnum + r] = xstrdup (buf);
+ }
+}
+
+
+/* Indicate that the variant VAR has NUM_FPRS floating-point
+ registers, and fill in the names array appropriately. */
+static void
+set_variant_num_fprs (struct gdbarch_tdep *var, int num_fprs)
+{
+ int r;
+
+ var->num_fprs = num_fprs;
+
+ for (r = 0; r < num_fprs; ++r)
+ {
+ char buf[20];
+
+ sprintf (buf, "fr%d", r);
+ var->register_names[first_fpr_regnum + r] = xstrdup (buf);
+ }
+}
+
+
+static const char *
+frv_register_name (int reg)
+{
+ if (reg < 0)
+ return "?toosmall?";
+ if (reg >= frv_num_regs)
+ return "?toolarge?";
+
+ return CURRENT_VARIANT->register_names[reg];
+}
+
+
+static int
+frv_register_raw_size (int reg)
+{
+ return 4;
+}
+
+static int
+frv_register_virtual_size (int reg)
+{
+ return 4;
+}
+
+static struct type *
+frv_register_virtual_type (int reg)
+{
+ if (reg >= 64 && reg <= 127)
+ return builtin_type_float;
+ else
+ return builtin_type_int;
+}
+
+static int
+frv_register_byte (int reg)
+{
+ return (reg * 4);
+}
+
+static const unsigned char *
+frv_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenp)
+{
+ static unsigned char breakpoint[] = {0xc0, 0x70, 0x00, 0x01};
+ *lenp = sizeof (breakpoint);
+ return breakpoint;
+}
+
+static CORE_ADDR
+frv_frame_chain (struct frame_info *frame)
+{
+ CORE_ADDR saved_fp_addr;
+
+ if (frame->saved_regs && frame->saved_regs[fp_regnum] != 0)
+ saved_fp_addr = frame->saved_regs[fp_regnum];
+ else
+ /* Just assume it was saved in the usual place. */
+ saved_fp_addr = frame->frame;
+
+ return read_memory_integer (saved_fp_addr, 4);
+}
+
+static CORE_ADDR
+frv_frame_saved_pc (struct frame_info *frame)
+{
+ frv_frame_init_saved_regs (frame);
+
+ /* Perhaps the prologue analyzer recorded where it was stored.
+ (As of 14 Oct 2001, it never does.) */
+ if (frame->saved_regs && frame->saved_regs[pc_regnum] != 0)
+ return read_memory_integer (frame->saved_regs[pc_regnum], 4);
+
+ /* If the prologue analyzer tells us the link register was saved on
+ the stack, get it from there. */
+ if (frame->extra_info->lr_saved_on_stack)
+ return read_memory_integer (frame->frame + 8, 4);
+
+ /* Otherwise, it's still in LR.
+ However, if FRAME isn't the youngest frame, this is kind of
+ suspicious --- if this frame called somebody else, then its LR
+ has certainly been overwritten. */
+ if (! frame->next)
+ return read_register (lr_regnum);
+
+ /* By default, assume it's saved in the standard place, relative to
+ the frame pointer. */
+ return read_memory_integer (frame->frame + 8, 4);
+}
+
+
+/* Return true if REG is a caller-saves ("scratch") register,
+ false otherwise. */
+static int
+is_caller_saves_reg (int reg)
+{
+ return ((4 <= reg && reg <= 7)
+ || (14 <= reg && reg <= 15)
+ || (32 <= reg && reg <= 47));
+}
+
+
+/* Return true if REG is a callee-saves register, false otherwise. */
+static int
+is_callee_saves_reg (int reg)
+{
+ return ((16 <= reg && reg <= 31)
+ || (48 <= reg && reg <= 63));
+}
+
+
+/* Return true if REG is an argument register, false otherwise. */
+static int
+is_argument_reg (int reg)
+{
+ return (8 <= reg && reg <= 13);
+}
+
+
+/* Scan an FR-V prologue, starting at PC, until frame->PC.
+ If FRAME is non-zero, fill in its saved_regs with appropriate addresses.
+ We assume FRAME's saved_regs array has already been allocated and cleared.
+ Return the first PC value after the prologue.
+
+ Note that, for unoptimized code, we almost don't need this function
+ at all; all arguments and locals live on the stack, so we just need
+ the FP to find everything. The catch: structures passed by value
+ have their addresses living in registers; they're never spilled to
+ the stack. So if you ever want to be able to get to these
+ arguments in any frame but the top, you'll need to do this serious
+ prologue analysis. */
+static CORE_ADDR
+frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
+{
+ /* When writing out instruction bitpatterns, we use the following
+ letters to label instruction fields:
+ P - The parallel bit. We don't use this.
+ J - The register number of GRj in the instruction description.
+ K - The register number of GRk in the instruction description.
+ I - The register number of GRi.
+ S - a signed imediate offset.
+ U - an unsigned immediate offset.
+
+ The dots below the numbers indicate where hex digit boundaries
+ fall, to make it easier to check the numbers. */
+
+ /* Non-zero iff we've seen the instruction that initializes the
+ frame pointer for this function's frame. */
+ int fp_set = 0;
+
+ /* If fp_set is non_zero, then this is the distance from
+ the stack pointer to frame pointer: fp = sp + fp_offset. */
+ int fp_offset = 0;
+
+ /* Total size of frame prior to any alloca operations. */
+ int framesize = 0;
+
+ /* The number of the general-purpose register we saved the return
+ address ("link register") in, or -1 if we haven't moved it yet. */
+ int lr_save_reg = -1;
+
+ /* Non-zero iff we've saved the LR onto the stack. */
+ int lr_saved_on_stack = 0;
+
+ /* If gr_saved[i] is non-zero, then we've noticed that general
+ register i has been saved at gr_sp_offset[i] from the stack
+ pointer. */
+ char gr_saved[64];
+ int gr_sp_offset[64];
+
+ memset (gr_saved, 0, sizeof (gr_saved));
+
+ while (! frame || pc < frame->pc)
+ {
+ LONGEST op = read_memory_integer (pc, 4);
+
+ /* The tests in this chain of ifs should be in order of
+ decreasing selectivity, so that more particular patterns get
+ to fire before less particular patterns. */
+
+ /* Setting the FP from the SP:
+ ori sp, 0, fp
+ P 000010 0100010 000001 000000000000 = 0x04881000
+ 0 111111 1111111 111111 111111111111 = 0x7fffffff
+ . . . . . . . .
+ We treat this as part of the prologue. */
+ if ((op & 0x7fffffff) == 0x04881000)
+ {
+ fp_set = 1;
+ fp_offset = 0;
+ }
+
+ /* Move the link register to the scratch register grJ, before saving:
+ movsg lr, grJ
+ P 000100 0000011 010000 000111 JJJJJJ = 0x080d01c0
+ 0 111111 1111111 111111 111111 000000 = 0x7fffffc0
+ . . . . . . . .
+ We treat this as part of the prologue. */
+ else if ((op & 0x7fffffc0) == 0x080d01c0)
+ {
+ int gr_j = op & 0x3f;
+
+ /* If we're moving it to a scratch register, that's fine. */
+ if (is_caller_saves_reg (gr_j))
+ lr_save_reg = gr_j;
+ /* Otherwise it's not a prologue instruction that we
+ recognize. */
+ else
+ break;
+ }
+
+ /* To save multiple callee-saves registers on the stack, at
+ offset zero:
+
+ std grK,@(sp,gr0)
+ P KKKKKK 0000011 000001 000011 000000 = 0x000c10c0
+ 0 000000 1111111 111111 111111 111111 = 0x01ffffff
+
+ stq grK,@(sp,gr0)
+ P KKKKKK 0000011 000001 000100 000000 = 0x000c1100
+ 0 000000 1111111 111111 111111 111111 = 0x01ffffff
+ . . . . . . . .
+ We treat this as part of the prologue, and record the register's
+ saved address in the frame structure. */
+ else if ((op & 0x01ffffff) == 0x000c10c0
+ || (op & 0x01ffffff) == 0x000c1100)
+ {
+ int gr_k = ((op >> 25) & 0x3f);
+ int ope = ((op >> 6) & 0x3f);
+ int count;
+ int i;
+
+ /* Is it an std or an stq? */
+ if (ope == 0x03)
+ count = 2;
+ else
+ count = 4;
+
+ /* Is it really a callee-saves register? */
+ if (is_callee_saves_reg (gr_k))
+ {
+ for (i = 0; i < count; i++)
+ {
+ gr_saved[gr_k + i] = 1;
+ gr_sp_offset[gr_k + i] = 4 * i;
+ }
+ }
+ else
+ /* It's not a prologue instruction. */
+ break;
+ }
+
+ /* Adjusting the stack pointer. (The stack pointer is GR1.)
+ addi sp, S, sp
+ P 000001 0010000 000001 SSSSSSSSSSSS = 0x02401000
+ 0 111111 1111111 111111 000000000000 = 0x7ffff000
+ . . . . . . . .
+ We treat this as part of the prologue. */
+ else if ((op & 0x7ffff000) == 0x02401000)
+ {
+ /* Sign-extend the twelve-bit field.
+ (Isn't there a better way to do this?) */
+ int s = (((op & 0xfff) - 0x800) & 0xfff) - 0x800;
+
+ framesize -= s;
+ }
+
+ /* Setting the FP to a constant distance from the SP:
+ addi sp, S, fp
+ P 000010 0010000 000001 SSSSSSSSSSSS = 0x04401000
+ 0 111111 1111111 111111 000000000000 = 0x7ffff000
+ . . . . . . . .
+ We treat this as part of the prologue. */
+ else if ((op & 0x7ffff000) == 0x04401000)
+ {
+ /* Sign-extend the twelve-bit field.
+ (Isn't there a better way to do this?) */
+ int s = (((op & 0xfff) - 0x800) & 0xfff) - 0x800;
+ fp_set = 1;
+ fp_offset = s;
+ }
+
+ /* To spill an argument register to a scratch register:
+ ori GRi, 0, GRk
+ P KKKKKK 0100010 IIIIII 000000000000 = 0x00880000
+ 0 000000 1111111 000000 111111111111 = 0x01fc0fff
+ . . . . . . . .
+ For the time being, we treat this as a prologue instruction,
+ assuming that GRi is an argument register. This one's kind
+ of suspicious, because it seems like it could be part of a
+ legitimate body instruction. But we only come here when the
+ source info wasn't helpful, so we have to do the best we can.
+ Hopefully once GCC and GDB agree on how to emit line number
+ info for prologues, then this code will never come into play. */
+ else if ((op & 0x01fc0fff) == 0x00880000)
+ {
+ int gr_i = ((op >> 12) & 0x3f);
+
+ /* If the source isn't an arg register, then this isn't a
+ prologue instruction. */
+ if (! is_argument_reg (gr_i))
+ break;
+ }
+
+ /* To spill 16-bit values to the stack:
+ sthi GRk, @(fp, s)
+ P KKKKKK 1010001 000010 SSSSSSSSSSSS = 0x01442000
+ 0 000000 1111111 111111 000000000000 = 0x01fff000
+ . . . . . . . .
+ And for 8-bit values, we use STB instructions.
+ stbi GRk, @(fp, s)
+ P KKKKKK 1010000 000010 SSSSSSSSSSSS = 0x01402000
+ 0 000000 1111111 111111 000000000000 = 0x01fff000
+ . . . . . . . .
+ We check that GRk is really an argument register, and treat
+ all such as part of the prologue. */
+ else if ( (op & 0x01fff000) == 0x01442000
+ || (op & 0x01fff000) == 0x01402000)
+ {
+ int gr_k = ((op >> 25) & 0x3f);
+
+ if (! is_argument_reg (gr_k))
+ break; /* Source isn't an arg register. */
+ }
+
+ /* To save multiple callee-saves register on the stack, at a
+ non-zero offset:
+
+ stdi GRk, @(sp, s)
+ P KKKKKK 1010011 000001 SSSSSSSSSSSS = 0x014c1000
+ 0 000000 1111111 111111 000000000000 = 0x01fff000
+ . . . . . . . .
+ stqi GRk, @(sp, s)
+ P KKKKKK 1010100 000001 SSSSSSSSSSSS = 0x01501000
+ 0 000000 1111111 111111 000000000000 = 0x01fff000
+ . . . . . . . .
+ We treat this as part of the prologue, and record the register's
+ saved address in the frame structure. */
+ else if ((op & 0x01fff000) == 0x014c1000
+ || (op & 0x01fff000) == 0x01501000)
+ {
+ int gr_k = ((op >> 25) & 0x3f);
+ int count;
+ int i;
+
+ /* Is it a stdi or a stqi? */
+ if ((op & 0x01fff000) == 0x014c1000)
+ count = 2;
+ else
+ count = 4;
+
+ /* Is it really a callee-saves register? */
+ if (is_callee_saves_reg (gr_k))
+ {
+ /* Sign-extend the twelve-bit field.
+ (Isn't there a better way to do this?) */
+ int s = (((op & 0xfff) - 0x800) & 0xfff) - 0x800;
+
+ for (i = 0; i < count; i++)
+ {
+ gr_saved[gr_k + i] = 1;
+ gr_sp_offset[gr_k + i] = s + (4 * i);
+ }
+ }
+ else
+ /* It's not a prologue instruction. */
+ break;
+ }
+
+ /* Storing any kind of integer register at any constant offset
+ from any other register.
+
+ st GRk, @(GRi, gr0)
+ P KKKKKK 0000011 IIIIII 000010 000000 = 0x000c0080
+ 0 000000 1111111 000000 111111 111111 = 0x01fc0fff
+ . . . . . . . .
+ sti GRk, @(GRi, d12)
+ P KKKKKK 1010010 IIIIII SSSSSSSSSSSS = 0x01480000
+ 0 000000 1111111 000000 000000000000 = 0x01fc0000
+ . . . . . . . .
+ These could be almost anything, but a lot of prologue
+ instructions fall into this pattern, so let's decode the
+ instruction once, and then work at a higher level. */
+ else if (((op & 0x01fc0fff) == 0x000c0080)
+ || ((op & 0x01fc0000) == 0x01480000))
+ {
+ int gr_k = ((op >> 25) & 0x3f);
+ int gr_i = ((op >> 12) & 0x3f);
+ int offset;
+
+ /* Are we storing with gr0 as an offset, or using an
+ immediate value? */
+ if ((op & 0x01fc0fff) == 0x000c0080)
+ offset = 0;
+ else
+ offset = (((op & 0xfff) - 0x800) & 0xfff) - 0x800;
+
+ /* If the address isn't relative to the SP or FP, it's not a
+ prologue instruction. */
+ if (gr_i != sp_regnum && gr_i != fp_regnum)
+ break;
+
+ /* Saving the old FP in the new frame (relative to the SP). */
+ if (gr_k == fp_regnum && gr_i == sp_regnum)
+ ;
+
+ /* Saving callee-saves register(s) on the stack, relative to
+ the SP. */
+ else if (gr_i == sp_regnum
+ && is_callee_saves_reg (gr_k))
+ {
+ gr_saved[gr_k] = 1;
+ gr_sp_offset[gr_k] = offset;
+ }
+
+ /* Saving the scratch register holding the return address. */
+ else if (lr_save_reg != -1
+ && gr_k == lr_save_reg)
+ lr_saved_on_stack = 1;
+
+ /* Spilling int-sized arguments to the stack. */
+ else if (is_argument_reg (gr_k))
+ ;
+
+ /* It's not a store instruction we recognize, so this must
+ be the end of the prologue. */
+ else
+ break;
+ }
+
+ /* It's not any instruction we recognize, so this must be the end
+ of the prologue. */
+ else
+ break;
+
+ pc += 4;
+ }
+
+ if (frame)
+ {
+ frame->extra_info->lr_saved_on_stack = lr_saved_on_stack;
+
+ /* If we know the relationship between the stack and frame
+ pointers, record the addresses of the registers we noticed.
+ Note that we have to do this as a separate step at the end,
+ because instructions may save relative to the SP, but we need
+ their addresses relative to the FP. */
+ if (fp_set)
+ {
+ int i;
+
+ for (i = 0; i < 64; i++)
+ if (gr_saved[i])
+ frame->saved_regs[i] = (frame->frame
+ - fp_offset + gr_sp_offset[i]);
+
+ frame->extra_info->fp_to_callers_sp_offset = framesize - fp_offset;
+ }
+ }
+
+ return pc;
+}
+
+
+static CORE_ADDR
+frv_skip_prologue (CORE_ADDR pc)
+{
+ CORE_ADDR func_addr, func_end, new_pc;
+
+ new_pc = pc;
+
+ /* If the line table has entry for a line *within* the function
+ (i.e., not in the prologue, and not past the end), then that's
+ our location. */
+ if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ {
+ struct symtab_and_line sal;
+
+ sal = find_pc_line (func_addr, 0);
+
+ if (sal.line != 0 && sal.end < func_end)
+ {
+ new_pc = sal.end;
+ }
+ }
+
+ /* The FR-V prologue is at least five instructions long (twenty bytes).
+ If we didn't find a real source location past that, then
+ do a full analysis of the prologue. */
+ if (new_pc < pc + 20)
+ new_pc = frv_analyze_prologue (pc, 0);
+
+ return new_pc;
+}
+
+static void
+frv_frame_init_saved_regs (struct frame_info *frame)
+{
+ if (frame->saved_regs)
+ return;
+
+ frame_saved_regs_zalloc (frame);
+ frame->saved_regs[fp_regnum] = frame->frame;
+
+ /* Find the beginning of this function, so we can analyze its
+ prologue. */
+ {
+ CORE_ADDR func_addr, func_end;
+
+ if (find_pc_partial_function (frame->pc, NULL, &func_addr, &func_end))
+ frv_analyze_prologue (func_addr, frame);
+ }
+}
+
+/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
+ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
+ and TYPE is the type (which is known to be struct, union or array).
+
+ The frv returns all structs in memory. */
+
+static int
+frv_use_struct_convention (int gcc_p, struct type *type)
+{
+ return 1;
+}
+
+static void
+frv_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ memcpy (valbuf, (regbuf
+ + frv_register_byte (8)
+ + (TYPE_LENGTH (type) < 4 ? 4 - TYPE_LENGTH (type) : 0)),
+ TYPE_LENGTH (type));
+}
+
+static CORE_ADDR
+frv_extract_struct_value_address (char *regbuf)
+{
+ return extract_address (regbuf + frv_register_byte (struct_return_regnum),
+ 4);
+}
+
+static void
+frv_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (struct_return_regnum, addr);
+}
+
+static int
+frv_frameless_function_invocation (struct frame_info *frame)
+{
+ return frameless_look_for_prologue (frame);
+}
+
+static CORE_ADDR
+frv_saved_pc_after_call (struct frame_info *frame)
+{
+ return read_register (lr_regnum);
+}
+
+static void
+frv_init_extra_frame_info (int fromleaf, struct frame_info *frame)
+{
+ frame->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+ frame->extra_info->fp_to_callers_sp_offset = 0;
+ frame->extra_info->lr_saved_on_stack = 0;
+}
+
+#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
+#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
+
+static CORE_ADDR
+frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int argreg;
+ int argnum;
+ char *val;
+ char valbuf[4];
+ struct value *arg;
+ struct type *arg_type;
+ int len;
+ enum type_code typecode;
+ CORE_ADDR regval;
+ int stack_space;
+ int stack_offset;
+
+#if 0
+ printf("Push %d args at sp = %x, struct_return=%d (%x)\n",
+ nargs, (int) sp, struct_return, struct_addr);
+#endif
+
+ stack_space = 0;
+ for (argnum = 0; argnum < nargs; ++argnum)
+ stack_space += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 4);
+
+ stack_space -= (6 * 4);
+ if (stack_space > 0)
+ sp -= stack_space;
+
+ /* Make sure stack is dword aligned. */
+ sp = ROUND_DOWN (sp, 8);
+
+ stack_offset = 0;
+
+ argreg = 8;
+
+ if (struct_return)
+ write_register (struct_return_regnum, struct_addr);
+
+ for (argnum = 0; argnum < nargs; ++argnum)
+ {
+ arg = args[argnum];
+ arg_type = check_typedef (VALUE_TYPE (arg));
+ len = TYPE_LENGTH (arg_type);
+ typecode = TYPE_CODE (arg_type);
+
+ if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
+ {
+ store_address (valbuf, 4, VALUE_ADDRESS (arg));
+ typecode = TYPE_CODE_PTR;
+ len = 4;
+ val = valbuf;
+ }
+ else
+ {
+ val = (char *) VALUE_CONTENTS (arg);
+ }
+
+ while (len > 0)
+ {
+ int partial_len = (len < 4 ? len : 4);
+
+ if (argreg < 14)
+ {
+ regval = extract_address (val, partial_len);
+#if 0
+ printf(" Argnum %d data %x -> reg %d\n",
+ argnum, (int) regval, argreg);
+#endif
+ write_register (argreg, regval);
+ ++argreg;
+ }
+ else
+ {
+#if 0
+ printf(" Argnum %d data %x -> offset %d (%x)\n",
+ argnum, *((int *)val), stack_offset, (int) (sp + stack_offset));
+#endif
+ write_memory (sp + stack_offset, val, partial_len);
+ stack_offset += ROUND_UP(partial_len, 4);
+ }
+ len -= partial_len;
+ val += partial_len;
+ }
+ }
+ return sp;
+}
+
+static CORE_ADDR
+frv_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+ write_register (lr_regnum, CALL_DUMMY_ADDRESS ());
+ return sp;
+}
+
+static void
+frv_store_return_value (struct type *type, char *valbuf)
+{
+ int length = TYPE_LENGTH (type);
+ int reg8_offset = frv_register_byte (8);
+
+ if (length <= 4)
+ write_register_bytes (reg8_offset + (4 - length), valbuf, length);
+ else if (length == 8)
+ write_register_bytes (reg8_offset, valbuf, length);
+ else
+ internal_error (__FILE__, __LINE__,
+ "Don't know how to return a %d-byte value.", length);
+}
+
+static void
+frv_pop_frame (void)
+{
+ generic_pop_current_frame (frv_pop_frame_regular);
+}
+
+static void
+frv_pop_frame_regular (struct frame_info *frame)
+{
+ CORE_ADDR fp;
+ int regno;
+
+ fp = frame->frame;
+
+ frv_frame_init_saved_regs (frame);
+
+ write_register (pc_regnum, frv_frame_saved_pc (frame));
+ for (regno = 0; regno < frv_num_regs; ++regno)
+ {
+ if (frame->saved_regs[regno]
+ && regno != pc_regnum
+ && regno != sp_regnum)
+ {
+ write_register (regno,
+ read_memory_integer (frame->saved_regs[regno], 4));
+ }
+ }
+ write_register (sp_regnum, fp + frame->extra_info->fp_to_callers_sp_offset);
+ flush_cached_frames ();
+}
+
+
+static void
+frv_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+ CORE_ADDR *targ_addr, int *targ_len)
+{
+ *targ_addr = memaddr;
+ *targ_len = nr_bytes;
+}
+
+
+/* Hardware watchpoint / breakpoint support for the FR500
+ and FR400. */
+
+int
+frv_check_watch_resources (int type, int cnt, int ot)
+{
+ struct gdbarch_tdep *var = CURRENT_VARIANT;
+
+ /* Watchpoints not supported on simulator. */
+ if (strcmp (target_shortname, "sim") == 0)
+ return 0;
+
+ if (type == bp_hardware_breakpoint)
+ {
+ if (var->num_hw_breakpoints == 0)
+ return 0;
+ else if (cnt <= var->num_hw_breakpoints)
+ return 1;
+ }
+ else
+ {
+ if (var->num_hw_watchpoints == 0)
+ return 0;
+ else if (ot)
+ return -1;
+ else if (cnt <= var->num_hw_watchpoints)
+ return 1;
+ }
+ return -1;
+}
+
+
+CORE_ADDR
+frv_stopped_data_address (void)
+{
+ CORE_ADDR brr, dbar0, dbar1, dbar2, dbar3;
+
+ brr = read_register (brr_regnum);
+ dbar0 = read_register (dbar0_regnum);
+ dbar1 = read_register (dbar1_regnum);
+ dbar2 = read_register (dbar2_regnum);
+ dbar3 = read_register (dbar3_regnum);
+
+ if (brr & (1<<11))
+ return dbar0;
+ else if (brr & (1<<10))
+ return dbar1;
+ else if (brr & (1<<9))
+ return dbar2;
+ else if (brr & (1<<8))
+ return dbar3;
+ else
+ return 0;
+}
+
+static struct gdbarch *
+frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *var;
+
+ /* Check to see if we've already built an appropriate architecture
+ object for this executable. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches)
+ return arches->gdbarch;
+
+ /* Select the right tdep structure for this variant. */
+ var = new_variant ();
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_frv:
+ case bfd_mach_frvsimple:
+ case bfd_mach_fr500:
+ case bfd_mach_frvtomcat:
+ set_variant_num_gprs (var, 64);
+ set_variant_num_fprs (var, 64);
+ break;
+
+ case bfd_mach_fr400:
+ set_variant_num_gprs (var, 32);
+ set_variant_num_fprs (var, 32);
+ break;
+
+ default:
+ /* Never heard of this variant. */
+ return 0;
+ }
+
+ gdbarch = gdbarch_alloc (&info, var);
+
+ set_gdbarch_short_bit (gdbarch, 16);
+ set_gdbarch_int_bit (gdbarch, 32);
+ set_gdbarch_long_bit (gdbarch, 32);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_float_bit (gdbarch, 32);
+ set_gdbarch_double_bit (gdbarch, 64);
+ set_gdbarch_long_double_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 32);
+
+ set_gdbarch_num_regs (gdbarch, frv_num_regs);
+ set_gdbarch_sp_regnum (gdbarch, sp_regnum);
+ set_gdbarch_fp_regnum (gdbarch, fp_regnum);
+ set_gdbarch_pc_regnum (gdbarch, pc_regnum);
+
+ set_gdbarch_register_name (gdbarch, frv_register_name);
+ set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4);
+ set_gdbarch_register_byte (gdbarch, frv_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_register_virtual_size (gdbarch, frv_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_register_virtual_type (gdbarch, frv_register_virtual_type);
+
+ set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue);
+ set_gdbarch_breakpoint_from_pc (gdbarch, frv_breakpoint_from_pc);
+
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+ set_gdbarch_frameless_function_invocation (gdbarch, frv_frameless_function_invocation);
+
+ set_gdbarch_saved_pc_after_call (gdbarch, frv_saved_pc_after_call);
+
+ 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);
+
+ set_gdbarch_use_struct_convention (gdbarch, frv_use_struct_convention);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value);
+
+ set_gdbarch_store_struct_return (gdbarch, frv_store_struct_return);
+ set_gdbarch_deprecated_store_return_value (gdbarch, frv_store_return_value);
+ 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);
+ set_gdbarch_push_arguments (gdbarch, frv_push_arguments);
+ set_gdbarch_push_return_address (gdbarch, frv_push_return_address);
+ set_gdbarch_pop_frame (gdbarch, frv_pop_frame);
+
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_init_extra_frame_info (gdbarch, frv_init_extra_frame_info);
+
+ /* Settings that should be unnecessary. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
+ set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
+ set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
+ 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_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);
+
+ set_gdbarch_remote_translate_xfer_address
+ (gdbarch, frv_remote_translate_xfer_address);
+
+ /* Hardware watchpoint / breakpoint support. */
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_frv:
+ case bfd_mach_frvsimple:
+ case bfd_mach_fr500:
+ case bfd_mach_frvtomcat:
+ /* fr500-style hardware debugging support. */
+ var->num_hw_watchpoints = 4;
+ var->num_hw_breakpoints = 4;
+ break;
+
+ case bfd_mach_fr400:
+ /* fr400-style hardware debugging support. */
+ var->num_hw_watchpoints = 2;
+ var->num_hw_breakpoints = 4;
+ break;
+
+ default:
+ /* Otherwise, assume we don't have hardware debugging support. */
+ var->num_hw_watchpoints = 0;
+ var->num_hw_breakpoints = 0;
+ break;
+ }
+
+ return gdbarch;
+}
+
+void
+_initialize_frv_tdep (void)
+{
+ register_gdbarch_init (bfd_arch_frv, frv_gdbarch_init);
+
+ tm_print_insn = print_insn_frv;
+}
+
+
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 25d1ed70e24..155ebe09c8f 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -23,7 +23,6 @@
#include "inferior.h"
#include "gdbcore.h"
#include "elf-bfd.h"
-#include <sys/procfs.h>
#include "symfile.h"
#include "objfiles.h"
@@ -158,25 +157,14 @@ default_gcore_target (void)
return bfd_get_target (exec_bfd);
}
-/*
- * Default method for stack segment (preemptable by target).
- */
+/* Function: derive_stack_segment
-static int (*override_derive_stack_segment) (bfd_vma *, bfd_vma *);
-
-extern void
-preempt_derive_stack_segment (int (*override_func) (bfd_vma *, bfd_vma *))
-{
- override_derive_stack_segment = override_func;
-}
-
-/* Function: default_derive_stack_segment
Derive a reasonable stack segment by unwinding the target stack.
Returns 0 for failure, 1 for success. */
static int
-default_derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
+derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
{
bfd_vma tmp_vma;
struct frame_info *fi, *tmp_fi;
@@ -215,36 +203,15 @@ default_derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
return 1; /* success */
}
-static int
-derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
-{
- if (override_derive_stack_segment)
- return override_derive_stack_segment (bottom, top);
- else
- return default_derive_stack_segment (bottom, top);
-}
-
-/*
- * Default method for heap segment (preemptable by target).
- */
+/* Function: derive_heap_segment
-static int (*override_derive_heap_segment) (bfd *, bfd_vma *, bfd_vma *);
-
-extern void
-preempt_derive_heap_segment (int (*override_func) (bfd *,
- bfd_vma *, bfd_vma *))
-{
- override_derive_heap_segment = override_func;
-}
-
-/* Function: default_derive_heap_segment
Derive a reasonable heap segment by looking at sbrk and
the static data sections.
Returns 0 for failure, 1 for success. */
static int
-default_derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
+derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
{
bfd_vma top_of_data_memory = 0;
bfd_vma top_of_heap = 0;
@@ -308,15 +275,6 @@ default_derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
return 0; /* No additional heap space needs to be saved. */
}
-static int
-derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
-{
- if (override_derive_heap_segment)
- return override_derive_heap_segment (abfd, bottom, top);
- else
- return default_derive_heap_segment (abfd, bottom, top);
-}
-
/* ARGSUSED */
static void
make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c
index ada30a3ef5a..3acccf11dc7 100644
--- a/gdb/gdb-events.c
+++ b/gdb/gdb-events.c
@@ -119,6 +119,16 @@ architecture_changed_event (void)
current_event_hooks->architecture_changed ();
}
+void
+target_changed_event (void)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "target_changed_event\n");
+ if (!current_event_hooks->target_changed)
+ return;
+ current_event_hooks->target_changed ();
+}
+
#endif
#if WITH_GDB_EVENTS
@@ -134,6 +144,14 @@ set_gdb_event_hooks (struct gdb_events *vector)
}
#endif
+#if WITH_GDB_EVENTS
+void
+clear_gdb_event_hooks (void)
+{
+ set_gdb_event_hooks (&null_event_hooks);
+}
+#endif
+
enum gdb_event
{
breakpoint_create,
@@ -143,6 +161,7 @@ enum gdb_event
tracepoint_delete,
tracepoint_modify,
architecture_changed,
+ target_changed,
nr_gdb_events
};
@@ -266,6 +285,14 @@ queue_architecture_changed (void)
append (event);
}
+static void
+queue_target_changed (void)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = target_changed;
+ append (event);
+}
+
void
gdb_events_deliver (struct gdb_events *vector)
{
@@ -314,6 +341,9 @@ gdb_events_deliver (struct gdb_events *vector)
case architecture_changed:
vector->architecture_changed ();
break;
+ case target_changed:
+ vector->target_changed ();
+ break;
}
delivering_events = event->next;
xfree (event);
@@ -333,6 +363,7 @@ _initialize_gdb_events (void)
queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
queue_event_hooks.architecture_changed = queue_architecture_changed;
+ queue_event_hooks.target_changed = queue_target_changed;
#endif
c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h
index 5f7fc6b5a55..daba6a4463a 100644
--- a/gdb/gdb-events.h
+++ b/gdb/gdb-events.h
@@ -59,6 +59,7 @@ typedef void (gdb_events_tracepoint_create_ftype) (int number);
typedef void (gdb_events_tracepoint_delete_ftype) (int number);
typedef void (gdb_events_tracepoint_modify_ftype) (int number);
typedef void (gdb_events_architecture_changed_ftype) (void);
+typedef void (gdb_events_target_changed_ftype) (void);
/* gdb-events: object. */
@@ -72,6 +73,7 @@ struct gdb_events
gdb_events_tracepoint_delete_ftype *tracepoint_delete;
gdb_events_tracepoint_modify_ftype *tracepoint_modify;
gdb_events_architecture_changed_ftype *architecture_changed;
+ gdb_events_target_changed_ftype *target_changed;
};
@@ -85,6 +87,7 @@ extern void tracepoint_create_event (int number);
extern void tracepoint_delete_event (int number);
extern void tracepoint_modify_event (int number);
extern void architecture_changed_event (void);
+extern void target_changed_event (void);
/* When GDB_EVENTS are not being used, completly disable them. */
@@ -97,6 +100,7 @@ extern void architecture_changed_event (void);
#define tracepoint_delete_event(number) 0
#define tracepoint_modify_event(number) 0
#define architecture_changed_event() 0
+#define target_changed_event() 0
#endif
/* Install custom gdb-events hooks. */
@@ -105,6 +109,9 @@ extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
/* Deliver any pending events. */
extern void gdb_events_deliver (struct gdb_events *vector);
+/* Clear event handlers */
+extern void clear_gdb_event_hooks (void);
+
#if !WITH_GDB_EVENTS
#define set_gdb_events(x) 0
#define set_gdb_event_hooks(x) 0
diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh
index 9965f05577f..e92a71460ec 100755
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -65,6 +65,7 @@ f:void:tracepoint_create:int number:number
f:void:tracepoint_delete:int number:number
f:void:tracepoint_modify:int number:number
f:void:architecture_changed:void
+f:void:target_changed:void
#*:void:annotate_starting_hook:void
#*:void:annotate_stopped_hook:void
#*:void:annotate_signalled_hook:void
@@ -87,8 +88,6 @@ f:void:architecture_changed:void
#*:void:readline_begin_hook:char *format, ...:format
#*:char *:readline_hook:char *prompt:prompt
#*:void:readline_end_hook:void
-#*:void:register_changed_hook:int regno:regno
-#*:void:memory_changed_hook:CORE_ADDR addr, int len:addr, len
#*:void:context_hook:int num:num
#*:int:target_wait_hook:int pid, struct target_waitstatus *status:pid, status
#*:void:call_command_hook:struct cmd_list_element *c, char *cmd, int from_tty:c, cmd, from_tty
@@ -267,6 +266,9 @@ extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
/* Deliver any pending events. */
extern void gdb_events_deliver (struct gdb_events *vector);
+/* Clear event handlers */
+extern void clear_gdb_event_hooks (void);
+
#if !WITH_GDB_EVENTS
#define set_gdb_events(x) 0
#define set_gdb_event_hooks(x) 0
@@ -393,6 +395,18 @@ cat <<EOF
#endif
EOF
+# Clear hooks function
+echo ""
+cat <<EOF
+#if WITH_GDB_EVENTS
+void
+clear_gdb_event_hooks (void)
+{
+ set_gdb_event_hooks (&null_event_hooks);
+}
+#endif
+EOF
+
# event type
echo ""
cat <<EOF
diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh
index 1e727fe2309..0d0829a4a13 100755
--- a/gdb/gdb_indent.sh
+++ b/gdb/gdb_indent.sh
@@ -54,7 +54,10 @@ esac
# Run indent per GDB specs
-types="-T FILE `cat *.h | sed -n \
+types="\
+-T FILE \
+-T prgregset_t -T fpregset_t -T gregset_t \
+`cat *.h | sed -n \
-e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
-e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
-e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \
diff --git a/gdb/config/romp/xm-rtbsd.h b/gdb/gdb_locale.h
index e7918163ee2..0d8909200ec 100644
--- a/gdb/config/romp/xm-rtbsd.h
+++ b/gdb/gdb_locale.h
@@ -1,6 +1,5 @@
-/* Definitions to host GDB on an IBM RT/PC running BSD Unix.
- Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
- Contributed by David Wood @ New York University (wood@lab.ultra.nyu.edu).
+/* GDB-friendly replacement for <locale.h>.
+ Copyright 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,19 +18,29 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This OS has the wait structure */
-#define HAVE_WAIT_STRUCT
-
-#ifdef HOSTING_ONLY
-/*
- * This next two defines are to get GDB up and running as a host to
- * do remote debugging. I know there is a gdb for the RT, but there wasn't
- * an xconfig/rt* file.
- */
-#define KERNEL_U_ADDR_BSD /* This may be correct, but hasn't been tested */
-#define REGISTER_U_ADDR(a,b,c) \
- (printf("GDB can not debug IBM RT/PC BSD executables (yet)\n"),\
- quit(),0)
+#ifndef GDB_LOCALE_H
+#define GDB_LOCALE_H
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define _(String) gettext (String)
+# ifdef gettext_noop
+# define N_(String) gettext_noop (String)
+# else
+# define N_(String) (String)
+# endif
#else
-#include "GDB for the RT is not included in the distribution"
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define textdomain(Domainname) while (0) /* nothing */
+# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+# define _(String) (String)
+# define N_(String) (String)
#endif
+
+#endif /* GDB_LOCALE_H */
diff --git a/gdb/config/i386/xm-i386gnu.h b/gdb/gdb_obstack.h
index 711aeebccfb..237830e1768 100644
--- a/gdb/config/i386/xm-i386gnu.h
+++ b/gdb/gdb_obstack.h
@@ -1,6 +1,6 @@
-/* Definitions to make GDB run on the GNU Hurd on an Intel 386
- Copyright 1986, 1987, 1989, 1991, 1996, 2000
- Free Software Foundation, Inc.
+/* Obstack wrapper for GDB.
+
+ Copyright 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,7 +19,14 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
+#if !defined (GDB_OBSTACK_H)
+#define GDB_OBSTACK_H 1
+
+#include "obstack.h"
+
+/* Unless explicitly specified, GDB obstacks always use xmalloc() and
+ xfree(). */
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free xfree
-/* Do implement the attach and detach commands. */
-#define ATTACH_DETACH 1
+#endif
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 6990953c0c8..e930642f15f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -62,13 +62,13 @@
#include "floatformat.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
#include "gdb-events.h"
/* Static function declarations */
static void verify_gdbarch (struct gdbarch *gdbarch);
static void alloc_gdbarch_data (struct gdbarch *);
-static void init_gdbarch_data (struct gdbarch *);
static void free_gdbarch_data (struct gdbarch *);
static void init_gdbarch_swap (struct gdbarch *);
static void clear_gdbarch_swap (struct gdbarch *);
@@ -87,6 +87,8 @@ int gdbarch_debug = GDBARCH_DEBUG;
struct gdbarch
{
+ /* Has this architecture been fully initialized? */
+ int initialized_p;
/* basic architectural information */
const struct bfd_arch_info * bfd_arch_info;
int byte_order;
@@ -145,8 +147,8 @@ struct gdbarch
gdbarch_read_sp_ftype *read_sp;
gdbarch_write_sp_ftype *write_sp;
gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
- gdbarch_register_read_ftype *register_read;
- gdbarch_register_write_ftype *register_write;
+ gdbarch_pseudo_register_read_ftype *pseudo_register_read;
+ gdbarch_pseudo_register_write_ftype *pseudo_register_write;
int num_regs;
int num_pseudo_regs;
int sp_regnum;
@@ -170,7 +172,9 @@ struct gdbarch
int max_register_virtual_size;
gdbarch_register_virtual_type_ftype *register_virtual_type;
gdbarch_do_registers_info_ftype *do_registers_info;
+ gdbarch_print_registers_info_ftype *print_registers_info;
gdbarch_print_float_info_ftype *print_float_info;
+ gdbarch_print_vector_info_ftype *print_vector_info;
gdbarch_register_sim_regno_ftype *register_sim_regno;
gdbarch_register_bytes_ok_ftype *register_bytes_ok;
gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
@@ -202,20 +206,21 @@ struct gdbarch
gdbarch_convert_register_p_ftype *convert_register_p;
gdbarch_register_to_value_ftype *register_to_value;
gdbarch_value_to_register_ftype *value_to_register;
- gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
- gdbarch_store_pseudo_register_ftype *store_pseudo_register;
gdbarch_pointer_to_address_ftype *pointer_to_address;
gdbarch_address_to_pointer_ftype *address_to_pointer;
gdbarch_integer_to_address_ftype *integer_to_address;
gdbarch_return_value_on_stack_ftype *return_value_on_stack;
- gdbarch_extract_return_value_ftype *extract_return_value;
gdbarch_push_arguments_ftype *push_arguments;
gdbarch_push_dummy_frame_ftype *push_dummy_frame;
gdbarch_push_return_address_ftype *push_return_address;
gdbarch_pop_frame_ftype *pop_frame;
gdbarch_store_struct_return_ftype *store_struct_return;
+ gdbarch_extract_return_value_ftype *extract_return_value;
gdbarch_store_return_value_ftype *store_return_value;
+ gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
+ gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
+ gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
gdbarch_use_struct_convention_ftype *use_struct_convention;
gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs;
gdbarch_init_extra_frame_info_ftype *init_extra_frame_info;
@@ -253,6 +258,7 @@ struct gdbarch
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+ gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
@@ -269,6 +275,7 @@ extern const struct bfd_arch_info bfd_default_arch_struct;
struct gdbarch startup_gdbarch =
{
+ 1, /* Always initialized. */
/* basic architecture information */
&bfd_default_arch_struct,
BFD_ENDIAN_BIG,
@@ -312,13 +319,18 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- 0,
+ generic_register_byte,
generic_register_size,
0,
generic_register_size,
0,
0,
0,
+ default_print_registers_info,
+ 0,
+ 0,
+ 0,
+ 0,
0,
0,
0,
@@ -344,7 +356,6 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- generic_get_saved_register,
0,
0,
0,
@@ -416,14 +427,13 @@ struct gdbarch *current_gdbarch = &startup_gdbarch;
/* Do any initialization needed for a non-multiarch configuration
after the _initialize_MODULE functions have been run. */
void
-initialize_non_multiarch ()
+initialize_non_multiarch (void)
{
alloc_gdbarch_data (&startup_gdbarch);
/* Ensure that all swap areas are zeroed so that they again think
they are starting from scratch. */
clear_gdbarch_swap (&startup_gdbarch);
init_gdbarch_swap (&startup_gdbarch);
- init_gdbarch_data (&startup_gdbarch);
}
@@ -482,13 +492,13 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->register_name = legacy_register_name;
current_gdbarch->register_size = -1;
current_gdbarch->register_bytes = -1;
+ current_gdbarch->register_byte = generic_register_byte;
current_gdbarch->register_raw_size = generic_register_size;
current_gdbarch->max_register_raw_size = -1;
current_gdbarch->register_virtual_size = generic_register_size;
current_gdbarch->max_register_virtual_size = -1;
- current_gdbarch->do_registers_info = do_registers_info;
- current_gdbarch->print_float_info = default_print_float_info;
- current_gdbarch->register_sim_regno = default_register_sim_regno;
+ current_gdbarch->print_registers_info = default_print_registers_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;
@@ -503,6 +513,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
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->get_saved_register = generic_unwind_get_saved_register;
current_gdbarch->register_convertible = generic_register_convertible_not;
current_gdbarch->convert_register_p = legacy_convert_register_p;
current_gdbarch->register_to_value = legacy_register_to_value;
@@ -511,6 +522,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
current_gdbarch->push_arguments = default_push_arguments;
+ current_gdbarch->extract_return_value = legacy_extract_return_value;
+ current_gdbarch->store_return_value = legacy_store_return_value;
current_gdbarch->use_struct_convention = generic_use_struct_convention;
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
@@ -522,7 +535,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
current_gdbarch->frame_args_skip = -1;
current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
- current_gdbarch->frame_chain_valid = func_frame_chain_valid;
+ current_gdbarch->frame_chain_valid = generic_func_frame_chain_valid;
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;
@@ -530,6 +543,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+ current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
@@ -595,8 +609,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of read_sp, invalid_p == 0 */
/* Skip verify of write_sp, invalid_p == 0 */
/* Skip verify of virtual_frame_pointer, invalid_p == 0 */
- /* Skip verify of register_read, has predicate */
- /* Skip verify of register_write, has predicate */
+ /* Skip verify of pseudo_register_read, has predicate */
+ /* Skip verify of pseudo_register_write, has predicate */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->num_regs == -1))
fprintf_unfiltered (log, "\n\tnum_regs");
@@ -619,9 +633,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->register_bytes == -1))
fprintf_unfiltered (log, "\n\tregister_bytes");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->register_byte == 0))
- fprintf_unfiltered (log, "\n\tregister_byte");
+ /* Skip verify of register_byte, invalid_p == 0 */
/* Skip verify of register_raw_size, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->max_register_raw_size == -1))
@@ -633,8 +645,10 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->register_virtual_type == 0))
fprintf_unfiltered (log, "\n\tregister_virtual_type");
- /* Skip verify of do_registers_info, invalid_p == 0 */
- /* Skip verify of print_float_info, invalid_p == 0 */
+ /* Skip verify of do_registers_info, has predicate */
+ /* Skip verify of print_registers_info, invalid_p == 0 */
+ /* Skip verify of print_float_info, has predicate */
+ /* Skip verify of print_vector_info, has predicate */
/* Skip verify of register_sim_regno, invalid_p == 0 */
/* Skip verify of register_bytes_ok, has predicate */
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
@@ -681,24 +695,17 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of init_frame_pc_first, invalid_p == 0 */
/* Skip verify of init_frame_pc, invalid_p == 0 */
/* Skip verify of coerce_float_to_double, invalid_p == 0 */
- if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->get_saved_register == 0))
- fprintf_unfiltered (log, "\n\tget_saved_register");
+ /* Skip verify of get_saved_register, invalid_p == 0 */
/* Skip verify of register_convertible, invalid_p == 0 */
/* Skip verify of register_convert_to_virtual, invalid_p == 0 */
/* Skip verify of register_convert_to_raw, invalid_p == 0 */
/* Skip verify of convert_register_p, invalid_p == 0 */
/* Skip verify of register_to_value, invalid_p == 0 */
/* Skip verify of value_to_register, invalid_p == 0 */
- /* Skip verify of fetch_pseudo_register, has predicate */
- /* Skip verify of store_pseudo_register, has predicate */
/* Skip verify of pointer_to_address, invalid_p == 0 */
/* Skip verify of address_to_pointer, invalid_p == 0 */
/* Skip verify of integer_to_address, has predicate */
/* Skip verify of return_value_on_stack, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->extract_return_value == 0))
- fprintf_unfiltered (log, "\n\textract_return_value");
/* Skip verify of push_arguments, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->push_dummy_frame == 0))
@@ -710,10 +717,10 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->store_struct_return == 0))
fprintf_unfiltered (log, "\n\tstore_struct_return");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->store_return_value == 0))
- fprintf_unfiltered (log, "\n\tstore_return_value");
+ /* Skip verify of extract_return_value, invalid_p == 0 */
+ /* Skip verify of store_return_value, invalid_p == 0 */
/* Skip verify of extract_struct_value_address, has predicate */
+ /* Skip verify of deprecated_extract_struct_value_address, has predicate */
/* Skip verify of use_struct_convention, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->frame_init_saved_regs == 0))
@@ -777,6 +784,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+ /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
/* Skip verify of pc_in_sigtramp, invalid_p == 0 */
/* Skip verify of in_function_epilogue_p, invalid_p == 0 */
/* Skip verify of construct_inferior_arguments, invalid_p == 0 */
@@ -813,12 +821,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->in_function_epilogue_p);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: register_read = 0x%08lx\n",
- (long) current_gdbarch->register_read);
+ "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
+ (long) current_gdbarch->pseudo_register_read);
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: register_write = 0x%08lx\n",
- (long) current_gdbarch->register_write);
+ "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
+ (long) current_gdbarch->pseudo_register_write);
#ifdef ADDRESS_TO_POINTER
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1038,6 +1046,45 @@ 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_EXTRACT_RETURN_VALUE
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
+ XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "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
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
+ XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "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_STORE_RETURN_VALUE
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
+ XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = 0x%08lx\n",
+ (long) current_gdbarch->deprecated_store_return_value
+ /*DEPRECATED_STORE_RETURN_VALUE ()*/);
+#endif
#ifdef DO_REGISTERS_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1118,8 +1165,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
- XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
+ "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
+ XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -1130,8 +1177,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
- XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
+ "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
+ XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
"gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
@@ -1146,20 +1193,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %d\n",
EXTRA_STACK_ALIGNMENT_NEEDED);
#endif
-#ifdef FETCH_PSEUDO_REGISTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "FETCH_PSEUDO_REGISTER(regnum)",
- XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
- (long) current_gdbarch->fetch_pseudo_register
- /*FETCH_PSEUDO_REGISTER ()*/);
-#endif
#ifdef FIX_CALL_DUMMY
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1397,6 +1430,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->in_solib_call_trampoline
/*IN_SOLIB_CALL_TRAMPOLINE ()*/);
#endif
+#ifdef IN_SOLIB_RETURN_TRAMPOLINE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
+ XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = 0x%08lx\n",
+ (long) current_gdbarch->in_solib_return_trampoline
+ /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
+#endif
#ifdef MAX_REGISTER_RAW_SIZE
fprintf_unfiltered (file,
"gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
@@ -1533,20 +1577,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->prepare_to_proceed
/*PREPARE_TO_PROCEED ()*/);
#endif
-#ifdef PRINT_FLOAT_INFO
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "PRINT_FLOAT_INFO()",
- XSTRING (PRINT_FLOAT_INFO ()));
-#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: PRINT_FLOAT_INFO = 0x%08lx\n",
- (long) current_gdbarch->print_float_info
- /*PRINT_FLOAT_INFO ()*/);
-#endif
+ "gdbarch_dump: print_float_info = 0x%08lx\n",
+ (long) current_gdbarch->print_float_info);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: print_registers_info = 0x%08lx\n",
+ (long) current_gdbarch->print_registers_info);
+ 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
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1905,27 +1947,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->stack_align
/*STACK_ALIGN ()*/);
#endif
-#ifdef STORE_PSEUDO_REGISTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "STORE_PSEUDO_REGISTER(regnum)",
- XSTRING (STORE_PSEUDO_REGISTER (regnum)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
- (long) current_gdbarch->store_pseudo_register
- /*STORE_PSEUDO_REGISTER ()*/);
-#endif
#ifdef STORE_RETURN_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "STORE_RETURN_VALUE(type, valbuf)",
- XSTRING (STORE_RETURN_VALUE (type, valbuf)));
+ "STORE_RETURN_VALUE(type, regcache, valbuf)",
+ XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -2532,55 +2560,55 @@ set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
}
int
-gdbarch_register_read_p (struct gdbarch *gdbarch)
+gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->register_read != 0;
+ return gdbarch->pseudo_register_read != 0;
}
void
-gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
+gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->register_read == 0)
+ if (gdbarch->pseudo_register_read == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_register_read invalid");
+ "gdbarch: gdbarch_pseudo_register_read invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_register_read called\n");
- gdbarch->register_read (gdbarch, regnum, buf);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
+ gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
}
void
-set_gdbarch_register_read (struct gdbarch *gdbarch,
- gdbarch_register_read_ftype register_read)
+set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
+ gdbarch_pseudo_register_read_ftype pseudo_register_read)
{
- gdbarch->register_read = register_read;
+ gdbarch->pseudo_register_read = pseudo_register_read;
}
int
-gdbarch_register_write_p (struct gdbarch *gdbarch)
+gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->register_write != 0;
+ return gdbarch->pseudo_register_write != 0;
}
void
-gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
+gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->register_write == 0)
+ if (gdbarch->pseudo_register_write == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_register_write invalid");
+ "gdbarch: gdbarch_pseudo_register_write invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_register_write called\n");
- gdbarch->register_write (gdbarch, regnum, buf);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
+ gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
}
void
-set_gdbarch_register_write (struct gdbarch *gdbarch,
- gdbarch_register_write_ftype register_write)
+set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
+ gdbarch_pseudo_register_write_ftype pseudo_register_write)
{
- gdbarch->register_write = register_write;
+ gdbarch->pseudo_register_write = pseudo_register_write;
}
int
@@ -2816,7 +2844,7 @@ set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
}
-char *
+const char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
gdb_assert (gdbarch != NULL);
@@ -2987,6 +3015,13 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
gdbarch->register_virtual_type = register_virtual_type;
}
+int
+gdbarch_do_registers_info_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->do_registers_info != 0;
+}
+
void
gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
{
@@ -3007,7 +3042,33 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
}
void
-gdbarch_print_float_info (struct gdbarch *gdbarch)
+gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->print_registers_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_registers_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
+ gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
+}
+
+void
+set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
+ gdbarch_print_registers_info_ftype print_registers_info)
+{
+ gdbarch->print_registers_info = print_registers_info;
+}
+
+int
+gdbarch_print_float_info_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->print_float_info != 0;
+}
+
+void
+gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->print_float_info == 0)
@@ -3015,7 +3076,7 @@ gdbarch_print_float_info (struct gdbarch *gdbarch)
"gdbarch: gdbarch_print_float_info invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
- gdbarch->print_float_info ();
+ gdbarch->print_float_info (gdbarch, file, frame, args);
}
void
@@ -3026,6 +3087,32 @@ set_gdbarch_print_float_info (struct gdbarch *gdbarch,
}
int
+gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->print_vector_info != 0;
+}
+
+void
+gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->print_vector_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_vector_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
+ gdbarch->print_vector_info (gdbarch, file, frame, args);
+}
+
+void
+set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
+ gdbarch_print_vector_info_ftype print_vector_info)
+{
+ gdbarch->print_vector_info = print_vector_info;
+}
+
+int
gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
{
gdb_assert (gdbarch != NULL);
@@ -3618,58 +3705,6 @@ set_gdbarch_value_to_register (struct gdbarch *gdbarch,
gdbarch->value_to_register = value_to_register;
}
-int
-gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->fetch_pseudo_register != 0;
-}
-
-void
-gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch->fetch_pseudo_register == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_fetch_pseudo_register invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
- gdbarch->fetch_pseudo_register (regnum);
-}
-
-void
-set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
- gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
-{
- gdbarch->fetch_pseudo_register = fetch_pseudo_register;
-}
-
-int
-gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->store_pseudo_register != 0;
-}
-
-void
-gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch->store_pseudo_register == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_store_pseudo_register invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
- gdbarch->store_pseudo_register (regnum);
-}
-
-void
-set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
- gdbarch_store_pseudo_register_ftype store_pseudo_register)
-{
- gdbarch->store_pseudo_register = store_pseudo_register;
-}
-
CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
{
@@ -3753,25 +3788,6 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
gdbarch->return_value_on_stack = return_value_on_stack;
}
-void
-gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch->extract_return_value == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_extract_return_value invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
- gdbarch->extract_return_value (type, regbuf, valbuf);
-}
-
-void
-set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
- gdbarch_extract_return_value_ftype extract_return_value)
-{
- gdbarch->extract_return_value = extract_return_value;
-}
-
CORE_ADDR
gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
{
@@ -3875,7 +3891,26 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
}
void
-gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
+gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->extract_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_extract_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
+ gdbarch->extract_return_value (type, regcache, valbuf);
+}
+
+void
+set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
+ gdbarch_extract_return_value_ftype extract_return_value)
+{
+ gdbarch->extract_return_value = extract_return_value;
+}
+
+void
+gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->store_return_value == 0)
@@ -3883,7 +3918,7 @@ gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *va
"gdbarch: gdbarch_store_return_value invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
- gdbarch->store_return_value (type, valbuf);
+ gdbarch->store_return_value (type, regcache, valbuf);
}
void
@@ -3893,6 +3928,44 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
gdbarch->store_return_value = store_return_value;
}
+void
+gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->deprecated_extract_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_deprecated_extract_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
+ gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
+}
+
+void
+set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
+ gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
+{
+ gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
+}
+
+void
+gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->deprecated_store_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_deprecated_store_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
+ gdbarch->deprecated_store_return_value (type, valbuf);
+}
+
+void
+set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
+ gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
+{
+ gdbarch->deprecated_store_return_value = deprecated_store_return_value;
+}
+
int
gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
{
@@ -3901,7 +3974,7 @@ gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
}
CORE_ADDR
-gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
+gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->extract_struct_value_address == 0)
@@ -3909,7 +3982,7 @@ gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
"gdbarch: gdbarch_extract_struct_value_address invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
- return gdbarch->extract_struct_value_address (regbuf);
+ return gdbarch->extract_struct_value_address (regcache);
}
void
@@ -3920,6 +3993,32 @@ set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
}
int
+gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_extract_struct_value_address != 0;
+}
+
+CORE_ADDR
+gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->deprecated_extract_struct_value_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
+ return gdbarch->deprecated_extract_struct_value_address (regbuf);
+}
+
+void
+set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
+ gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
+{
+ gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
+}
+
+int
gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
{
gdb_assert (gdbarch != NULL);
@@ -4644,6 +4743,25 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
}
int
+gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->in_solib_return_trampoline == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_solib_return_trampoline invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
+ return gdbarch->in_solib_return_trampoline (pc, name);
+}
+
+void
+set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
+ gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
+{
+ gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
+}
+
+int
gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
{
gdb_assert (gdbarch != NULL);
@@ -4771,6 +4889,7 @@ set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
struct gdbarch_data
{
unsigned index;
+ int init_p;
gdbarch_data_init_ftype *init;
gdbarch_data_free_ftype *free;
};
@@ -4797,6 +4916,7 @@ register_gdbarch_data (gdbarch_data_init_ftype *init,
gdbarch_data_free_ftype *free)
{
struct gdbarch_data_registration **curr;
+ /* Append the new registraration. */
for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
@@ -4805,31 +4925,12 @@ register_gdbarch_data (gdbarch_data_init_ftype *init,
(*curr)->data = XMALLOC (struct gdbarch_data);
(*curr)->data->index = gdbarch_data_registry.nr++;
(*curr)->data->init = init;
+ (*curr)->data->init_p = 1;
(*curr)->data->free = free;
return (*curr)->data;
}
-/* Walk through all the registered users initializing each in turn. */
-
-static void
-init_gdbarch_data (struct gdbarch *gdbarch)
-{
- struct gdbarch_data_registration *rego;
- for (rego = gdbarch_data_registry.registrations;
- rego != NULL;
- rego = rego->next)
- {
- struct gdbarch_data *data = rego->data;
- gdb_assert (data->index < gdbarch->nr_data);
- if (data->init != NULL)
- {
- void *pointer = data->init (gdbarch);
- set_gdbarch_data (gdbarch, data, pointer);
- }
- }
-}
-
/* Create/delete the gdbarch data vector. */
static void
@@ -4862,7 +4963,7 @@ free_gdbarch_data (struct gdbarch *gdbarch)
}
-/* Initialize the current value of thee specified per-architecture
+/* Initialize the current value of the specified per-architecture
data-pointer. */
void
@@ -4871,8 +4972,11 @@ set_gdbarch_data (struct gdbarch *gdbarch,
void *pointer)
{
gdb_assert (data->index < gdbarch->nr_data);
- if (data->free != NULL && gdbarch->data[data->index] != NULL)
- data->free (gdbarch, gdbarch->data[data->index]);
+ if (gdbarch->data[data->index] != NULL)
+ {
+ gdb_assert (data->free != NULL);
+ data->free (gdbarch, gdbarch->data[data->index]);
+ }
gdbarch->data[data->index] = pointer;
}
@@ -4883,6 +4987,20 @@ void *
gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
{
gdb_assert (data->index < gdbarch->nr_data);
+ /* The data-pointer isn't initialized, call init() to get a value but
+ only if the architecture initializaiton has completed. Otherwise
+ punt - hope that the caller knows what they are doing. */
+ if (gdbarch->data[data->index] == NULL
+ && gdbarch->initialized_p)
+ {
+ /* Be careful to detect an initialization cycle. */
+ gdb_assert (data->init_p);
+ data->init_p = 0;
+ gdb_assert (data->init != NULL);
+ gdbarch->data[data->index] = data->init (gdbarch);
+ data->init_p = 1;
+ gdb_assert (gdbarch->data[data->index] != NULL);
+ }
return gdbarch->data[data->index];
}
@@ -5276,8 +5394,9 @@ gdbarch_update_p (struct gdbarch_info info)
rego->arches = this;
}
- /* Switch to this new architecture. Dump it out. */
+ /* Switch to this new architecture marking it initialized. */
current_gdbarch = new_gdbarch;
+ current_gdbarch->initialized_p = 1;
if (gdbarch_debug)
{
fprintf_unfiltered (gdb_stdlog,
@@ -5296,10 +5415,8 @@ gdbarch_update_p (struct gdbarch_info info)
called. */
init_gdbarch_swap (new_gdbarch);
- /* Initialize the per-architecture data-pointer of all parties that
- registered an interest in this architecture. CURRENT_GDBARCH
+ /* Initialize the per-architecture data. CURRENT_GDBARCH
must be updated before these modules are called. */
- init_gdbarch_data (new_gdbarch);
architecture_changed_event ();
if (gdbarch_debug)
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 9f45459c95f..b76bf4abfa0 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -46,6 +46,7 @@ struct frame_info;
struct value;
struct objfile;
struct minimal_symbol;
+struct regcache;
extern struct gdbarch *current_gdbarch;
@@ -414,17 +415,17 @@ extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-extern int gdbarch_register_read_p (struct gdbarch *gdbarch);
+extern int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch);
-typedef void (gdbarch_register_read_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
-extern void gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf);
-extern void set_gdbarch_register_read (struct gdbarch *gdbarch, gdbarch_register_read_ftype *register_read);
+typedef void (gdbarch_pseudo_register_read_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
+extern void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf);
+extern void set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype *pseudo_register_read);
-extern int gdbarch_register_write_p (struct gdbarch *gdbarch);
+extern int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
-typedef void (gdbarch_register_write_ftype) (struct gdbarch *gdbarch, int regnum, char *buf);
-extern void gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf);
-extern void set_gdbarch_register_write (struct gdbarch *gdbarch, gdbarch_register_write_ftype *register_write);
+typedef void (gdbarch_pseudo_register_write_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
+extern void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf);
+extern void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
extern int gdbarch_num_regs (struct gdbarch *gdbarch);
extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
@@ -658,8 +659,8 @@ extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_d
#define REGISTER_NAME(regnr) (legacy_register_name (regnr))
#endif
-typedef char * (gdbarch_register_name_ftype) (int regnr);
-extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
+typedef const char * (gdbarch_register_name_ftype) (int regnr);
+extern const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr);
extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_NAME)
#error "Non multi-arch definition of REGISTER_NAME"
@@ -692,6 +693,11 @@ extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_by
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE)
+#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr))
+#endif
+
typedef int (gdbarch_register_byte_ftype) (int reg_nr);
extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte);
@@ -772,9 +778,29 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
+#if defined (DO_REGISTERS_INFO)
+/* Legacy for systems yet to multi-arch DO_REGISTERS_INFO */
+#if !defined (DO_REGISTERS_INFO_P)
+#define DO_REGISTERS_INFO_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO_P)
+#define DO_REGISTERS_INFO_P() (0)
+#endif
+
+extern int gdbarch_do_registers_info_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DO_REGISTERS_INFO_P)
+#error "Non multi-arch definition of DO_REGISTERS_INFO"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO_P)
+#define DO_REGISTERS_INFO_P() (gdbarch_do_registers_info_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
-#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
+#define DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DO_REGISTERS_INFO"), 0)
#endif
typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
@@ -789,29 +815,28 @@ extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_r
#endif
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (PRINT_FLOAT_INFO)
-#define PRINT_FLOAT_INFO() (default_print_float_info ())
-#endif
+typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
+extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
+extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
+
+extern int gdbarch_print_float_info_p (struct gdbarch *gdbarch);
-typedef void (gdbarch_print_float_info_ftype) (void);
-extern void gdbarch_print_float_info (struct gdbarch *gdbarch);
+typedef void (gdbarch_print_float_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PRINT_FLOAT_INFO)
-#error "Non multi-arch definition of PRINT_FLOAT_INFO"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PRINT_FLOAT_INFO)
-#define PRINT_FLOAT_INFO() (gdbarch_print_float_info (current_gdbarch))
-#endif
-#endif
+
+extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
/* MAP a GDB RAW register number onto a simulator register number. See
also include/...-sim.h. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
-#define REGISTER_SIM_REGNO(reg_nr) (default_register_sim_regno (reg_nr))
+#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr))
#endif
typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
@@ -1184,18 +1209,19 @@ extern void set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, gdbarch
#endif
#endif
-/* GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the
- old code has strange #ifdef interaction. So far no one has found
- that default_get_saved_register() is the default they are after. */
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
+#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval))
+#endif
typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
#error "Non multi-arch definition of GET_SAVED_REGISTER"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
#endif
#endif
@@ -1302,88 +1328,6 @@ extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_valu
#endif
#endif
-/* This function is called when the value of a pseudo-register needs to
- be updated. Typically it will be defined on a per-architecture
- basis. */
-
-#if defined (FETCH_PSEUDO_REGISTER)
-/* Legacy for systems yet to multi-arch FETCH_PSEUDO_REGISTER */
-#if !defined (FETCH_PSEUDO_REGISTER_P)
-#define FETCH_PSEUDO_REGISTER_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER_P)
-#define FETCH_PSEUDO_REGISTER_P() (0)
-#endif
-
-extern int gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER_P)
-#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER_P)
-#define FETCH_PSEUDO_REGISTER_P() (gdbarch_fetch_pseudo_register_p (current_gdbarch))
-#endif
-
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER)
-#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0)
-#endif
-
-typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
-extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum);
-extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_PSEUDO_REGISTER)
-#error "Non multi-arch definition of FETCH_PSEUDO_REGISTER"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_PSEUDO_REGISTER)
-#define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
-#endif
-#endif
-
-/* This function is called when the value of a pseudo-register needs to
- be set or stored. Typically it will be defined on a
- per-architecture basis. */
-
-#if defined (STORE_PSEUDO_REGISTER)
-/* Legacy for systems yet to multi-arch STORE_PSEUDO_REGISTER */
-#if !defined (STORE_PSEUDO_REGISTER_P)
-#define STORE_PSEUDO_REGISTER_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER_P)
-#define STORE_PSEUDO_REGISTER_P() (0)
-#endif
-
-extern int gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER_P)
-#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER_P)
-#define STORE_PSEUDO_REGISTER_P() (gdbarch_store_pseudo_register_p (current_gdbarch))
-#endif
-
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER)
-#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0)
-#endif
-
-typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
-extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum);
-extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_PSEUDO_REGISTER)
-#error "Non multi-arch definition of STORE_PSEUDO_REGISTER"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_PSEUDO_REGISTER)
-#define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
-#endif
-#endif
-
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
@@ -1472,18 +1416,6 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
-extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
-extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
-#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
-#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
-#endif
-#endif
-
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (PUSH_ARGUMENTS)
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (default_push_arguments (nargs, args, sp, struct_return, struct_addr))
@@ -1574,15 +1506,61 @@ extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_st
#endif
#endif
-typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf);
-extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
+#endif
+
+typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
+extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
+extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
+#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE)
+#define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf))
+#endif
+
+typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf);
+extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf);
extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STORE_RETURN_VALUE)
#error "Non multi-arch definition of STORE_RETURN_VALUE"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STORE_RETURN_VALUE)
-#define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf))
+#define STORE_RETURN_VALUE(type, regcache, valbuf) (gdbarch_store_return_value (current_gdbarch, type, regcache, valbuf))
+#endif
+#endif
+
+typedef void (gdbarch_deprecated_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf);
+extern void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf);
+extern void set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_RETURN_VALUE)
+#error "Non multi-arch definition of DEPRECATED_EXTRACT_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_RETURN_VALUE)
+#define DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_deprecated_extract_return_value (current_gdbarch, type, regbuf, valbuf))
+#endif
+#endif
+
+typedef void (gdbarch_deprecated_store_return_value_ftype) (struct type *type, char *valbuf);
+extern void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf);
+extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_RETURN_VALUE)
+#error "Non multi-arch definition of DEPRECATED_STORE_RETURN_VALUE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_RETURN_VALUE)
+#define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf))
#endif
#endif
@@ -1608,18 +1586,55 @@ extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
#endif
-typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf);
-extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
+typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
+extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
+#endif
+#endif
+
+#if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+/* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
+#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
+#endif
+
+extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#endif
+
+typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf);
+extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
+extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf))
#endif
#endif
@@ -1887,7 +1902,7 @@ extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chai
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FRAME_CHAIN_VALID)
-#define FRAME_CHAIN_VALID(chain, thisframe) (func_frame_chain_valid (chain, thisframe))
+#define FRAME_CHAIN_VALID(chain, thisframe) (generic_func_frame_chain_valid (chain, thisframe))
#endif
typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
@@ -2294,7 +2309,7 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s
/* For SVR4 shared libraries, each call goes through a small piece of
trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
- to nonzero if we are current stopped in one of these. */
+ to nonzero if we are currently stopped in one of these. */
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
@@ -2313,6 +2328,25 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar
#endif
#endif
+/* Some systems also have trampoline code for returning from shared libs. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name))
+#endif
+
+typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
+extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
+extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#error "Non multi-arch definition of IN_SOLIB_RETURN_TRAMPOLINE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_RETURN_TRAMPOLINE)
+#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
+#endif
+#endif
+
/* Sigtramp is a routine that the kernel calls (which then calls the
signal handler). On most machines it is a library routine that is
linked into the executable.
@@ -2591,20 +2625,15 @@ extern int gdbarch_update_p (struct gdbarch_info info);
for the reserved data-pointer is returned. That identifer should
be saved in a local static variable.
- The per-architecture data-pointer can be initialized in one of two
- ways: The value can be set explicitly using a call to
- set_gdbarch_data(); the value can be set implicitly using the value
- returned by a non-NULL INIT() callback. INIT(), when non-NULL is
- called after the basic architecture vector has been created.
+ The per-architecture data-pointer is either initialized explicitly
+ (set_gdbarch_data()) or implicitly (by INIT() via a call to
+ gdbarch_data()). FREE() is called to delete either an existing
+ data-pointer overridden by set_gdbarch_data() or when the
+ architecture object is being deleted.
When a previously created architecture is re-selected, the
per-architecture data-pointer for that previous architecture is
- restored. INIT() is not called.
-
- During initialization, multiple assignments of the data-pointer are
- allowed, non-NULL values are deleted by calling FREE(). If the
- architecture is deleted using gdbarch_free() all non-NULL data
- pointers are also deleted using FREE().
+ restored. INIT() is not re-called.
Multiple registrarants for any architecture are allowed (and
strongly encouraged). */
@@ -2701,7 +2730,7 @@ extern void initialize_current_architecture (void);
/* For non-multiarched targets, do any initialization of the default
gdbarch object necessary after the _initialize_MODULE functions
have run. */
-extern void initialize_non_multiarch ();
+extern void initialize_non_multiarch (void);
/* gdbarch trace variable */
extern int gdbarch_debug;
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index ebcb4238550..1ce71afa7c1 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -428,8 +428,8 @@ f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
# serious shakedown.
f::TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0
#
-M:::void:register_read:int regnum, char *buf:regnum, buf:
-M:::void:register_write:int regnum, char *buf:regnum, buf:
+M:::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf:
+M:::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf:
#
v:2:NUM_REGS:int:num_regs::::0:-1
# This macro gives the number of pseudo-registers that live in the
@@ -458,20 +458,23 @@ f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no
# to map one to one onto the sdb register numbers.
f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
-f:2:REGISTER_NAME:char *:register_name:int regnr:regnr:::legacy_register_name::0
+f:2:REGISTER_NAME:const char *:register_name:int regnr:regnr:::legacy_register_name::0
v:2:REGISTER_SIZE:int:register_size::::0:-1
v:2:REGISTER_BYTES:int:register_bytes::::0:-1
-f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
+f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte::0
f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
-f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
-f:2:PRINT_FLOAT_INFO:void:print_float_info:void::::default_print_float_info::0
+#
+F:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
+m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0
+M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
-f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::default_register_sim_regno::0
+f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes::0:0
f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
@@ -505,10 +508,7 @@ f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:froml
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
f:2:COERCE_FLOAT_TO_DOUBLE:int:coerce_float_to_double:struct type *formal, struct type *actual:formal, actual:::default_coerce_float_to_double::0
-# GET_SAVED_REGISTER is like DUMMY_FRAMES. It is at level one as the
-# old code has strange #ifdef interaction. So far no one has found
-# that default_get_saved_register() is the default they are after.
-f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval::generic_get_saved_register:0
+f:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval:::generic_unwind_get_saved_register::0
#
f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
@@ -517,29 +517,26 @@ f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int
f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum:regnum::0:legacy_convert_register_p::0
f:1:REGISTER_TO_VALUE:void:register_to_value:int regnum, struct type *type, char *from, char *to:regnum, type, from, to::0:legacy_register_to_value::0
f:1:VALUE_TO_REGISTER:void:value_to_register:struct type *type, int regnum, char *from, char *to:type, regnum, from, to::0:legacy_value_to_register::0
-# This function is called when the value of a pseudo-register needs to
-# be updated. Typically it will be defined on a per-architecture
-# basis.
-F:2:FETCH_PSEUDO_REGISTER:void:fetch_pseudo_register:int regnum:regnum:
-# This function is called when the value of a pseudo-register needs to
-# be set or stored. Typically it will be defined on a
-# per-architecture basis.
-F:2:STORE_PSEUDO_REGISTER:void:store_pseudo_register:int regnum:regnum:
#
f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, void *buf:type, buf:::unsigned_pointer_to_address::0
f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
#
f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
-f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0
f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
f:2:POP_FRAME:void:pop_frame:void:-:::0
#
f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
-f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
-F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf:::0
+#
+f::EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
+f::STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0
+f::DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf
+f::DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
+#
+F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct regcache *regcache:regcache:::0
+F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:char *regbuf:regbuf:::0
f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
#
f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
@@ -567,7 +564,7 @@ f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
# XXXX - both default and alternate frame_chain_valid functions are
# deprecated. New code should use dummy frames and one of the generic
# functions.
-f:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe:::func_frame_chain_valid::0
+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
@@ -608,10 +605,16 @@ f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_a
F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
+
+
# For SVR4 shared libraries, each call goes through a small piece of
# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
-# to nonzero if we are current stopped in one of these.
+# to nonzero if we are currently stopped in one of these.
f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
+
+# Some systems also have trampoline code for returning from shared libs.
+f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0
+
# Sigtramp is a routine that the kernel calls (which then calls the
# signal handler). On most machines it is a library routine that is
# linked into the executable.
@@ -765,6 +768,7 @@ struct frame_info;
struct value;
struct objfile;
struct minimal_symbol;
+struct regcache;
extern struct gdbarch *current_gdbarch;
@@ -1082,20 +1086,15 @@ extern int gdbarch_update_p (struct gdbarch_info info);
for the reserved data-pointer is returned. That identifer should
be saved in a local static variable.
- The per-architecture data-pointer can be initialized in one of two
- ways: The value can be set explicitly using a call to
- set_gdbarch_data(); the value can be set implicitly using the value
- returned by a non-NULL INIT() callback. INIT(), when non-NULL is
- called after the basic architecture vector has been created.
+ The per-architecture data-pointer is either initialized explicitly
+ (set_gdbarch_data()) or implicitly (by INIT() via a call to
+ gdbarch_data()). FREE() is called to delete either an existing
+ data-pointer overridden by set_gdbarch_data() or when the
+ architecture object is being deleted.
When a previously created architecture is re-selected, the
per-architecture data-pointer for that previous architecture is
- restored. INIT() is not called.
-
- During initialization, multiple assignments of the data-pointer are
- allowed, non-NULL values are deleted by calling FREE(). If the
- architecture is deleted using gdbarch_free() all non-NULL data
- pointers are also deleted using FREE().
+ restored. INIT() is not re-called.
Multiple registrarants for any architecture are allowed (and
strongly encouraged). */
@@ -1192,7 +1191,7 @@ extern void initialize_current_architecture (void);
/* For non-multiarched targets, do any initialization of the default
gdbarch object necessary after the _initialize_MODULE functions
have run. */
-extern void initialize_non_multiarch ();
+extern void initialize_non_multiarch (void);
/* gdbarch trace variable */
extern int gdbarch_debug;
@@ -1243,13 +1242,13 @@ cat <<EOF
#include "floatformat.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
#include "gdb-events.h"
/* Static function declarations */
static void verify_gdbarch (struct gdbarch *gdbarch);
static void alloc_gdbarch_data (struct gdbarch *);
-static void init_gdbarch_data (struct gdbarch *);
static void free_gdbarch_data (struct gdbarch *);
static void init_gdbarch_swap (struct gdbarch *);
static void clear_gdbarch_swap (struct gdbarch *);
@@ -1271,6 +1270,8 @@ printf "/* Maintain the struct gdbarch object */\n"
printf "\n"
printf "struct gdbarch\n"
printf "{\n"
+printf " /* Has this architecture been fully initialized? */\n"
+printf " int initialized_p;\n"
printf " /* basic architectural information */\n"
function_list | while do_read
do
@@ -1343,6 +1344,7 @@ printf "extern const struct bfd_arch_info bfd_default_arch_struct;\n"
printf "\n"
printf "struct gdbarch startup_gdbarch =\n"
printf "{\n"
+printf " 1, /* Always initialized. */\n"
printf " /* basic architecture information */\n"
function_list | while do_read
do
@@ -1374,14 +1376,13 @@ struct gdbarch *current_gdbarch = &startup_gdbarch;
/* Do any initialization needed for a non-multiarch configuration
after the _initialize_MODULE functions have been run. */
void
-initialize_non_multiarch ()
+initialize_non_multiarch (void)
{
alloc_gdbarch_data (&startup_gdbarch);
/* Ensure that all swap areas are zeroed so that they again think
they are starting from scratch. */
clear_gdbarch_swap (&startup_gdbarch);
init_gdbarch_swap (&startup_gdbarch);
- init_gdbarch_data (&startup_gdbarch);
}
EOF
@@ -1747,6 +1748,7 @@ cat <<EOF
struct gdbarch_data
{
unsigned index;
+ int init_p;
gdbarch_data_init_ftype *init;
gdbarch_data_free_ftype *free;
};
@@ -1773,6 +1775,7 @@ register_gdbarch_data (gdbarch_data_init_ftype *init,
gdbarch_data_free_ftype *free)
{
struct gdbarch_data_registration **curr;
+ /* Append the new registraration. */
for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
@@ -1781,31 +1784,12 @@ register_gdbarch_data (gdbarch_data_init_ftype *init,
(*curr)->data = XMALLOC (struct gdbarch_data);
(*curr)->data->index = gdbarch_data_registry.nr++;
(*curr)->data->init = init;
+ (*curr)->data->init_p = 1;
(*curr)->data->free = free;
return (*curr)->data;
}
-/* Walk through all the registered users initializing each in turn. */
-
-static void
-init_gdbarch_data (struct gdbarch *gdbarch)
-{
- struct gdbarch_data_registration *rego;
- for (rego = gdbarch_data_registry.registrations;
- rego != NULL;
- rego = rego->next)
- {
- struct gdbarch_data *data = rego->data;
- gdb_assert (data->index < gdbarch->nr_data);
- if (data->init != NULL)
- {
- void *pointer = data->init (gdbarch);
- set_gdbarch_data (gdbarch, data, pointer);
- }
- }
-}
-
/* Create/delete the gdbarch data vector. */
static void
@@ -1838,7 +1822,7 @@ free_gdbarch_data (struct gdbarch *gdbarch)
}
-/* Initialize the current value of thee specified per-architecture
+/* Initialize the current value of the specified per-architecture
data-pointer. */
void
@@ -1847,8 +1831,11 @@ set_gdbarch_data (struct gdbarch *gdbarch,
void *pointer)
{
gdb_assert (data->index < gdbarch->nr_data);
- if (data->free != NULL && gdbarch->data[data->index] != NULL)
- data->free (gdbarch, gdbarch->data[data->index]);
+ if (gdbarch->data[data->index] != NULL)
+ {
+ gdb_assert (data->free != NULL);
+ data->free (gdbarch, gdbarch->data[data->index]);
+ }
gdbarch->data[data->index] = pointer;
}
@@ -1859,6 +1846,20 @@ void *
gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
{
gdb_assert (data->index < gdbarch->nr_data);
+ /* The data-pointer isn't initialized, call init() to get a value but
+ only if the architecture initializaiton has completed. Otherwise
+ punt - hope that the caller knows what they are doing. */
+ if (gdbarch->data[data->index] == NULL
+ && gdbarch->initialized_p)
+ {
+ /* Be careful to detect an initialization cycle. */
+ gdb_assert (data->init_p);
+ data->init_p = 0;
+ gdb_assert (data->init != NULL);
+ gdbarch->data[data->index] = data->init (gdbarch);
+ data->init_p = 1;
+ gdb_assert (gdbarch->data[data->index] != NULL);
+ }
return gdbarch->data[data->index];
}
@@ -2252,8 +2253,9 @@ gdbarch_update_p (struct gdbarch_info info)
rego->arches = this;
}
- /* Switch to this new architecture. Dump it out. */
+ /* Switch to this new architecture marking it initialized. */
current_gdbarch = new_gdbarch;
+ current_gdbarch->initialized_p = 1;
if (gdbarch_debug)
{
fprintf_unfiltered (gdb_stdlog,
@@ -2272,10 +2274,8 @@ gdbarch_update_p (struct gdbarch_info info)
called. */
init_gdbarch_swap (new_gdbarch);
- /* Initialize the per-architecture data-pointer of all parties that
- registered an interest in this architecture. CURRENT_GDBARCH
+ /* Initialize the per-architecture data. CURRENT_GDBARCH
must be updated before these modules are called. */
- init_gdbarch_data (new_gdbarch);
architecture_changed_event ();
if (gdbarch_debug)
diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in
index b6a32dba09f..56881c97476 100644
--- a/gdb/gdbinit.in
+++ b/gdb/gdbinit.in
@@ -10,9 +10,9 @@ commands
return
end
-dir @srcdir@
-dir .
dir @srcdir@/../mmalloc
dir @srcdir@/../libiberty
dir @srcdir@/../bfd
+dir @srcdir@
+dir .
set prompt (top-gdb)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
new file mode 100644
index 00000000000..c5365cf4e00
--- /dev/null
+++ b/gdb/gdbserver/ChangeLog
@@ -0,0 +1,412 @@
+2002-08-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
+
+2002-08-20 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (LDFLAGS): Allow the configure script to establish a
+ default for this.
+
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in: Make chill references obsolete.
+
+2002-07-24 Kevin Buettner <kevinb@redhat.com>
+
+ * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+
+2002-07-09 David O'Brien <obrien@FreeBSD.org>
+
+ * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
+ (perror_with_name, remote_close, remote_open, expect, play): Static.
+
+2002-07-04 Michal Ludvig <mludvig@suse.cz>
+
+ * linux-x86-64-low.c (x86_64_regmap): Make it an array of
+ byte offsets instead of an array of indexes.
+ (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
+
+2002-06-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * regcache.c: Add comment.
+
+2002-06-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * thread-db.c: New file.
+ * proc-service.c: New file.
+ * acinclude.m4: New file.
+ * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
+ proc-service.o, and thread-db.o.
+ (linux-low.o): Add USE_THREAD_DB.
+ * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
+ HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
+ * aclocal.m4: Regenerated.
+ * config.in: Regenerated.
+ * configure: Regenerated.
+ * configure.in: Check for proc_service.h, sys/procfs.h,
+ thread_db.h, and linux/elf.h headrs.
+ Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
+ PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB.
+ Check for -lthread_db and thread support.
+ * configure.srv: Enable thread_db support for ARM, i386, MIPS,
+ PowerPC, and SuperH.
+ * i387-fp.c: Constify arguments.
+ * i387-fp.h: Likewise.
+ * inferiors.c: (struct thread_info): Renamed from
+ `struct inferior_info'. Remove PID member. Use generic inferior
+ list header. All uses updated.
+ (inferiors, signal_pid): Removed.
+ (all_threads): New variable.
+ (get_thread): Define.
+ (add_inferior_to_list): New function.
+ (for_each_inferior): New function.
+ (change_inferior_id): New function.
+ (add_inferior): Removed.
+ (remove_inferior): New function.
+ (add_thread): New function.
+ (free_one_thread): New function.
+ (remove_thread): New function.
+ (clear_inferiors): Use for_each_inferior and free_one_thread.
+ (find_inferior): New function.
+ (find_inferior_id): New function.
+ (inferior_target_data): Update argument type.
+ (set_inferior_target_data): Likewise.
+ (inferior_regcache_data): Likewise.
+ (set_inferior_regcache_data): Likewise.
+ * linux-low.c (linux_bp_reinsert): Remove.
+ (all_processes, stopping_threads, using_thrads)
+ (struct pending_signals, debug_threads, pid_of): New.
+ (inferior_pid): Replace with macro.
+ (struct inferior_linux_data): Remove.
+ (get_stop_pc, add_process): New functions.
+ (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
+ Use add_process and add_thread.
+ (linux_attach_lwp): New function, based on old linux_attach. Use
+ add_process and add_thread. Set stop_expected for new threads.
+ (linux_attach): New function.
+ (linux_kill_one_process): New function.
+ (linux_kill): Kill all LWPs.
+ (linux_thread_alive): Use find_inferior_id.
+ (check_removed_breakpoints, status_pending_p): New functions.
+ (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
+ Update. Use WNOHANG. Wait for cloned processes also. Update process
+ struct for the found process.
+ (linux_wait_for_event): New function.
+ (linux_wait): Use it. Support LWPs.
+ (send_sigstop, wait_for_sigstop, stop_all_processes)
+ (linux_resume_one_process, linux_continue_one_process): New functions.
+ (linux_resume): Support LWPs.
+ (REGISTER_RAW_SIZE): Remove.
+ (fetch_register): Use register_size instead. Call supply_register.
+ (usr_store_inferior_registers): Likewise. Call collect_register.
+ Fix recursive case.
+ (regsets_fetch_inferior_registers): Improve error message.
+ (regsets_store_inferior_registers): Add debugging.
+ (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
+ (unstopped_p, linux_signal_pid): New functions.
+ (linux_target_ops): Add linux_signal_pid.
+ (linux_init_signals): New function.
+ (initialize_low): Call it. Initialize using_threads.
+ * regcache.c (inferior_regcache_data): Add valid
+ flag.
+ (get_regcache): Fetch registers lazily. Add fetch argument
+ and update all callers.
+ (regcache_invalidate_one, regcache_invalidate): New
+ functions.
+ (new_register_cache): Renamed from create_register_cache.
+ Return the new regcache.
+ (free_register_cache): Change argument to a void *.
+ (registers_to_string, registers_from_string): Call get_regcache
+ with fetch flag set.
+ (register_data): Make static. Pass fetch flag to get_regcache.
+ (supply_register): Call get_regcache with fetch flag clear.
+ (collect_register): Call get_regcache with fetch flag set.
+ (collect_register_as_string): New function.
+ * regcache.h: Update.
+ * remote-utils.c (putpkt): Flush after debug output and use
+ stderr.
+ Handle input interrupts while waiting for an ACK.
+ (input_interrupt): Use signal_pid method.
+ (getpkt): Flush after debug output and use stderr.
+ (outreg): Use collect_register_as_string.
+ (new_thread_notify, dead_thread_notify): New functions.
+ (prepare_resume_reply): Check using_threads. Set thread_from_wait
+ and general_thread.
+ (look_up_one_symbol): Flush after debug output.
+ * server.c (step_thread, server_waiting): New variables.
+ (start_inferior): Don't use signal_pid. Update call to mywait.
+ (attach_inferior): Update call to mywait.
+ (handle_query): Handle qfThreadInfo and qsThreadInfo.
+ (main): Don't fetch/store registers explicitly. Use
+ set_desired_inferior. Support proposed ``Hs'' packet. Update
+ calls to mywait.
+ * server.h: Update.
+ (struct inferior_list, struct_inferior_list_entry): New.
+ * target.c (set_desired_inferior): New.
+ (write_inferior_memory): Constify.
+ (mywait): New function.
+ * target.h: Update.
+ (struct target_ops): New signal_pid method.
+ (mywait): Removed macro, added prototype.
+
+ * linux-low.h (regset_func): Removed.
+ (regset_fill_func, regset_store_func): New.
+ (enum regset_type): New.
+ (struct regset_info): Add type field. Use new operation types.
+ (struct linux_target_ops): stop_pc renamed to get_pc.
+ Add decr_pc_after_break and breakpoint_at.
+ (get_process, get_thread_proess, get_process_thread)
+ (strut process_info, all_processes, linux_attach_lwp)
+ (thread_db_init): New.
+
+ * linux-arm-low.c (arm_get_pc, arm_set_pc,
+ arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
+ (the_low_target): Add new members.
+ * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
+ (i386_store_fpxregset): Constify.
+ (target_regsets): Add new kind identifier.
+ (i386_get_pc): Renamed from i386_stop_pc. Simplify.
+ (i386_set_pc): Add debugging.
+ (i386_breakpoint_at): New function.
+ (the_low_target): Add new members.
+ * linux-mips-low.c (mips_get_pc, mips_set_pc)
+ (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
+ (mips_breakpoint_at): New.
+ (the_low_target): Add new members.
+ * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
+ (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
+ (the_low_target): Add new members.
+ * linux-sh-low.c (sh_get_pc, sh_set_pc)
+ (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
+ (the_low_target): Add new members.
+ * linux-x86-64-low.c (target_regsets): Add new kind
+ identifier.
+
+2002-05-15 Daniel Jacobowitz <drow@mvista.com>
+
+ From Martin Pool <mbp@samba.org>:
+ * server.c (gdbserver_usage): New function.
+ (main): Call it.
+
+2002-05-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
+ stop_at -> stop_pc.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in: Remove obsolete code.
+
+2002-04-24 Michal Ludvig <mludvig@suse.cz>
+
+ * linux-low.c (regsets_fetch_inferior_registers),
+ (regsets_store_inferior_registers): Removed cast to int from
+ ptrace() calls.
+ * regcache.h: Added declaration of struct inferior_info.
+
+2002-04-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * inferiors.c (struct inferior_info): Add regcache_data.
+ (add_inferior): Call create_register_cache.
+ (clear_inferiors): Call free_register_cache.
+ (inferior_regcache_data, set_inferior_regcache_data): New functions.
+ * regcache.c (struct inferior_regcache_data): New.
+ (registers): Remove.
+ (get_regcache): New function.
+ (create_register_cache, free_register_cache): New functions.
+ (set_register_cache): Don't initialize the register cache here.
+ (registers_to_string, registers_from_string, register_data): Call
+ get_regcache.
+ * regcache.h: Add prototypes.
+ * server.h: Likewise.
+
+2002-04-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * mem-break.c: New file.
+ * mem-break.h: New file.
+ * Makefile.in: Add mem-break.o rule; update server.h
+ dependencies.
+ * inferiors.c (struct inferior_info): Add target_data
+ member.
+ (clear_inferiors): Free target_data member if set.
+ (inferior_target_data, set_inferior_target_data): New functions.
+ * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
+ (i386_stop_pc, i386_set_pc): New. Add to the_low_target.
+ * linux-low.c (linux_bp_reinsert): New variable.
+ (struct inferior_linux_data): New.
+ (linux_create_inferior): Use set_inferior_target_data.
+ (linux_attach): Likewise. Call add_inferior.
+ (linux_wait_for_one_inferior): New function.
+ (linux_wait): Call it.
+ (linux_write_memory): Add const.
+ (initialize_low): Call set_breakpoint_data.
+ * linux-low.h (struct linux_target_ops): Add breakpoint
+ handling members.
+ * server.c (attach_inferior): Remove extra add_inferior
+ call.
+ * server.h: Include mem-break.h. Update inferior.c
+ prototypes.
+ * target.c (read_inferior_memory)
+ (write_inferior_memory): New functions.
+ * target.h (read_inferior_memory)
+ (write_inferior_memory): Change macros to prototypes.
+ (struct target_ops): Update comments. Add const to write_memory
+ definition.
+
+2002-04-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-low.c (usr_store_inferior_registers): Support
+ registers which are allowed to fail to store.
+ * linux-low.h (linux_target_ops): Likewise.
+ * linux-ppc-low.c (ppc_regmap): Support FPSCR.
+ (ppc_cannot_store_register): FPSCR may not be storable.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * server.h: Include <string.h> if HAVE_STRING_H.
+ * ChangeLog: Correct paths in last ChangeLog entry.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-low.h: Remove obsolete prototypes.
+ (struct linux_target_ops): New.
+ (extern the_low_target): New.
+ * linux-low.c (num_regs, regmap): Remove declarations.
+ (register_addr): Use the_low_target explicitly.
+ (fetch_register): Likewise.
+ (usr_fetch_inferior_registers): Likewise.
+ (usr_store_inferior_registers): Likewise.
+ * linux-arm-low.c (num_regs): Remove.
+ (arm_num_regs): Define.
+ (arm_regmap): Renamed from regmap, made static.
+ (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (arm_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-i386-low.c (num_regs): Remove.
+ (i386_num_regs): Define.
+ (i386_regmap): Renamed from regmap, made static.
+ (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (i386_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-ia64-low.c (num_regs): Remove.
+ (ia64_num_regs): Define.
+ (ia64_regmap): Renamed from regmap, made static.
+ (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (ia64_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-m68k-low.c (num_regs): Remove.
+ (m68k_num_regs): Define.
+ (m68k_regmap): Renamed from regmap, made static.
+ (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (m68k_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-mips-low.c (num_regs): Remove.
+ (mips_num_regs): Define.
+ (mips_regmap): Renamed from regmap, made static.
+ (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (mips_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-ppc-low.c (num_regs): Remove.
+ (ppc_num_regs): Define.
+ (ppc_regmap): Renamed from regmap, made static.
+ (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (ppc_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-s390-low.c (num_regs): Remove.
+ (s390_num_regs): Define.
+ (s390_regmap): Renamed from regmap, made static.
+ (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (s390_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-sh-low.c (num_regs): Remove.
+ (sh_num_regs): Define.
+ (sh_regmap): Renamed from regmap, made static.
+ (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (sh_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
+ (the_low_target): New.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in: Add stamp-h target.
+ * configure.in: Create stamp-h.
+ * configure: Regenerated.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * inferiors.c: New file.
+ * target.c: New file.
+ * target.h: New file.
+ * Makefile.in: Add target.o and inferiors.o. Update
+ dependencies.
+ * linux-low.c (inferior_pid): New static variable,
+ moved from server.c.
+ (linux_create_inferior): Renamed from create_inferior.
+ Call add_inferior. Return 0 on success instead of a PID.
+ (linux_attach): Renamed from myattach.
+ (linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
+ (linux_thread_alive): Renamed from mythread_alive.
+ (linux_wait): Renamed from mywait. Call clear_inferiors () if the
+ child dies.
+ (linux_resume): Renamed from myresume. Add missing ``return 0''.
+ (regsets_store_inferior_registers): Correct error message.
+ Add missing ``return 0''.
+ (linux_fetch_registers): Renamed from fetch_inferior_registers.
+ (linux_store_registers): Renamed from store_inferior_registers.
+ (linux_read_memory): Renamed from read_inferior_memory.
+ (linux_write_memory): Renamed from write_inferior_memory.
+ (linux_target_ops): New structure.
+ (initialize_low): Call set_target_ops ().
+ * remote-utils.c (unhexify): New function.
+ (hexify): New function.
+ (input_interrupt): Send signals to ``signal_pid''.
+ * server.c (inferior_pid): Remove.
+ (start_inferior): Update create_inferior call.
+ (attach_inferior): Call add_inferior.
+ (handle_query): New function.
+ (main): Call handle_query for `q' packets.
+ * server.h: Include "target.h". Remove obsolete prototypes.
+ Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in: Add WARN_CFLAGS. Update configury
+ dependencies.
+ * configure.in: Check for <string.h>
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * gdbreplay.c: Include needed system headers.
+ (remote_open): Remove strchr prototype.
+ * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
+ * regcache.c (supply_register): Change buf argument to const void *.
+ (supply_register_by_name): Likewise.
+ (collect_register): Change buf argument to void *.
+ (collect_register_by_name): Likewise.
+ * regcache.h: Add missing prototypes.
+ * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
+ * server.c (handle_query): New function.
+ (attached): New static variable, moved out of main.
+ (main): Quiet longjmp clobber warnings.
+ * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
+ * utils.c (error): Remove NORETURN.
+ (fatal): Likewise.
+
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 2c8cd3366b4..46168d61624 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -102,6 +102,7 @@ INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
+LDFLAGS = @LDFLAGS@
# Perhaps should come from parent Makefile
VERSION = gdbserver-4.12.3
@@ -126,6 +127,7 @@ OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
utils.o \
mem-break.o \
$(DEPFILES)
+GDBSERVER_LIBS = @GDBSERVER_LIBS@
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
@@ -229,8 +231,9 @@ MAKEOVERRIDES=
## This is ugly, but I don't want GNU make to put these variables in
## the environment. Older makes will see this as a set of targets
## with no dependencies and no actions.
-unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
+# OBSOLETE unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
+gdb_proc_service_h = $(srcdir)/../gdb_proc_service.h $(srcdir)/../gregset.h
regdat_sh = $(srcdir)/../regformats/regdat.sh
regdef_h = $(srcdir)/../regformats/regdef.h
regcache_h = $(srcdir)/regcache.h
@@ -239,10 +242,12 @@ server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
inferiors.o: inferiors.c $(server_h)
mem-break.o: mem-break.c $(server_h)
+proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h)
regcache.o: regcache.c $(server_h) $(regdef_h)
remote-utils.o: remote-utils.c terminal.h $(server_h)
server.o: server.c $(server_h)
target.o: target.c $(server_h)
+thread-db.o: thread-db.c $(server_h) $(gdb_proc_service_h)
utils.o: utils.c $(server_h)
signals.o: ../signals/signals.c $(server_h)
@@ -253,6 +258,8 @@ i387-fp.o: i387-fp.c $(server_h)
linux_low_h = $(srcdir)/linux-low.h
linux-low.o: linux-low.c $(linux_low_h) $(server_h)
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
+
linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h)
diff --git a/gdb/gdbserver/acconfig.h b/gdb/gdbserver/acconfig.h
index 968feb8b436..f0464b0a280 100644
--- a/gdb/gdbserver/acconfig.h
+++ b/gdb/gdbserver/acconfig.h
@@ -7,3 +7,18 @@
/* Define if the target supports PTRACE_GETFPXREGS for extended
register access. */
#undef HAVE_PTRACE_GETFPXREGS
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Define if the prfpregset_t type is broken. */
+#undef PRFPREGSET_T_BROKEN
diff --git a/gdb/gdbserver/aclocal.m4 b/gdb/gdbserver/aclocal.m4
index 24b9ced2835..2fc6cf883da 100644
--- a/gdb/gdbserver/aclocal.m4
+++ b/gdb/gdbserver/aclocal.m4
@@ -10,91 +10,45 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
+dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE.
+sinclude(../../bfd/acinclude.m4)
-# serial 1
+AC_DEFUN([SRV_CHECK_THREAD_DB],
+[AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db],
+ [old_LIBS="$LIBS"
+ LIBS="$LIBS -lthread_db"
+ AC_TRY_LINK(
+ [void ps_pglobal_lookup() {}
+ void ps_pdread() {}
+ void ps_pdwrite() {}
+ void ps_lgetregs() {}
+ void ps_lsetregs() {}
+ void ps_lgetfpregs() {}
+ void ps_lsetfpregs() {}
+ void ps_getpid() {}],
+ [td_ta_new();],
+ [srv_cv_thread_db="-lthread_db"],
+ [srv_cv_thread_db=no
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so. This macro tries various
-# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it handles function prototypes correctly.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN(AM_PROG_CC_STDC,
-[AC_REQUIRE([AC_PROG_CC])
-AC_BEFORE([$0], [AC_C_INLINE])
-AC_BEFORE([$0], [AC_C_CONST])
-dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
-dnl a magic option to avoid problems with ANSI preprocessor commands
-dnl like #elif.
-dnl FIXME: can't do this because then AC_AIX won't work due to a
-dnl circular dependency.
-dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
-[#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-], [
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
-],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-if test -z "$am_cv_prog_cc_stdc"; then
- AC_MSG_RESULT([none needed])
-else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
-fi
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
+ if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then
+ thread_db="/lib/libthread_db.so.1"
+ else
+ thread_db='$prefix/lib/libthread_db.so.1'
+ fi
+ LIBS="$old_LIBS `eval echo "$thread_db"`"
+ AC_TRY_LINK(
+ [void ps_pglobal_lookup() {}
+ void ps_pdread() {}
+ void ps_pdwrite() {}
+ void ps_lgetregs() {}
+ void ps_lsetregs() {}
+ void ps_lgetfpregs() {}
+ void ps_lsetfpregs() {}
+ void ps_getpid() {}],
+ [td_ta_new();],
+ [srv_cv_thread_db="$thread_db"],
+ [srv_cv_thread_db=no])
+ LIBS="$old_LIBS"
+ ]])
+)])
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 9d553f220be..e5cb0a7db0b 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader 2.13. */
+/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -13,12 +13,24 @@
register access. */
#undef HAVE_PTRACE_GETFPXREGS
+/* Define if the prfpregset_t type is broken. */
+#undef PRFPREGSET_T_BROKEN
+
+/* Define if you have the <linux/elf.h> header file. */
+#undef HAVE_LINUX_ELF_H
+
+/* Define if you have the <proc_service.h> header file. */
+#undef HAVE_PROC_SERVICE_H
+
/* Define if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
/* Define if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H
@@ -27,3 +39,25 @@
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
+
+/* Define if you have the <thread_db.h> header file. */
+#undef HAVE_THREAD_DB_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
+
+/* Define if <sys/procfs.h> has psaddr_t. */
+#undef HAVE_PSADDR_T
+
+/* Define if <sys/procfs.h> has prgregset_t. */
+#undef HAVE_PRGREGSET_T
+
+/* Define if <sys/procfs.h> has prfpregset_t. */
+#undef HAVE_PRFPREGSET_T
+
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
+
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 758d48383f1..f88f4accdea 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -1105,7 +1105,7 @@ EOF
fi
-for ac_hdr in sgtty.h termio.h termios.h sys/reg.h string.h
+for ac_hdr in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1223,7 +1223,328 @@ EOF
fi
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
+if test "$ac_cv_header_sys_procfs_h" = yes; then
+ echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:1229: checking for lwpid_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1234 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+lwpid_t avar
+; return 0; }
+EOF
+if { (eval echo configure:1243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpid_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_lwpid_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWPID_T 1
+EOF
+
+ fi
+ 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:1265: checking for psaddr_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1270 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+psaddr_t avar
+; return 0; }
+EOF
+if { (eval echo configure:1279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psaddr_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_psaddr_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PSADDR_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
+
+ echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:1301: checking for prgregset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1306 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prgregset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:1315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prgregset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRGREGSET_T 1
+EOF
+
+ fi
+ 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:1337: checking for prfpregset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1342 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+prfpregset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:1351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_prfpregset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PRFPREGSET_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
+
+
+
+
+ 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:1377: 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
+ if test "$cross_compiling" = yes; then
+ gdb_cv_prfpregset_t_broken=yes
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1385 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+ int main ()
+ {
+ if (sizeof (prfpregset_t) == sizeof (void *))
+ return 1;
+ return 0;
+ }
+EOF
+if { (eval echo configure:1395: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ gdb_cv_prfpregset_t_broken=yes
+fi
+rm -fr conftest*
+fi
+
+fi
+
+ echo "$ac_t""$gdb_cv_prfpregset_t_broken" 1>&6
+ if test $gdb_cv_prfpregset_t_broken = yes; then
+ cat >> confdefs.h <<\EOF
+#define PRFPREGSET_T_BROKEN 1
+EOF
+
+ fi
+ fi
+
+ echo $ac_n "checking for elf_fpregset_t in sys/procfs.h""... $ac_c" 1>&6
+echo "configure:1419: checking for elf_fpregset_t in sys/procfs.h" >&5
+ if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_elf_fpregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1424 "configure"
+#include "confdefs.h"
+
+#define _SYSCALL32
+#include <sys/procfs.h>
+int main() {
+elf_fpregset_t avar
+; return 0; }
+EOF
+if { (eval echo configure:1433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_have_sys_procfs_type_elf_fpregset_t=no
+
+fi
+rm -f conftest*
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ELF_FPREGSET_T 1
+EOF
+
+ fi
+ echo "$ac_t""$bfd_cv_have_sys_procfs_type_elf_fpregset_t" 1>&6
+
+fi
+
+srv_thread_depfiles=
+srv_libs=
+USE_THREAD_DB=
+
+if test "$srv_linux_thread_db" = "yes"; then
+ echo $ac_n "checking for libthread_db""... $ac_c" 1>&6
+echo "configure:1462: checking for libthread_db" >&5
+if eval "test \"`echo '$''{'srv_cv_thread_db'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ old_LIBS="$LIBS"
+ LIBS="$LIBS -lthread_db"
+ cat > conftest.$ac_ext <<EOF
+#line 1469 "configure"
+#include "confdefs.h"
+void ps_pglobal_lookup() {}
+ void ps_pdread() {}
+ void ps_pdwrite() {}
+ void ps_lgetregs() {}
+ void ps_lsetregs() {}
+ void ps_lgetfpregs() {}
+ void ps_lsetfpregs() {}
+ void ps_getpid() {}
+int main() {
+td_ta_new();
+; return 0; }
+EOF
+if { (eval echo configure:1483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ srv_cv_thread_db="-lthread_db"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ srv_cv_thread_db=no
+
+ if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then
+ thread_db="/lib/libthread_db.so.1"
+ else
+ thread_db='$prefix/lib/libthread_db.so.1'
+ fi
+ LIBS="$old_LIBS `eval echo "$thread_db"`"
+ cat > conftest.$ac_ext <<EOF
+#line 1499 "configure"
+#include "confdefs.h"
+void ps_pglobal_lookup() {}
+ void ps_pdread() {}
+ void ps_pdwrite() {}
+ void ps_lgetregs() {}
+ void ps_lsetregs() {}
+ void ps_lgetfpregs() {}
+ void ps_lsetfpregs() {}
+ void ps_getpid() {}
+int main() {
+td_ta_new();
+; return 0; }
+EOF
+if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ srv_cv_thread_db="$thread_db"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ srv_cv_thread_db=no
+fi
+rm -f conftest*
+ LIBS="$old_LIBS"
+
+fi
+
+echo "$ac_t""$srv_cv_thread_db" 1>&6
+
+fi
+rm -f conftest*
+ if test "$srv_cv_thread_db" = no; then
+ echo "configure: warning: Could not find libthread_db." 1>&2
+ echo "configure: warning: Disabling thread support in gdbserver." 1>&2
+ srv_linux_thread_db=no
+ else
+ srv_libs="$srv_cv_thread_db"
+ fi
+fi
+
+if test "$srv_linux_thread_db" = "yes"; then
+ srv_thread_depfiles="thread-db.o proc-service.o"
+ USE_THREAD_DB="-DUSE_THREAD_DB"
+fi
+
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
+GDBSERVER_LIBS="$srv_libs"
+
+
@@ -1381,6 +1702,8 @@ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
s%@GDBSERVER_DEPFILES@%$GDBSERVER_DEPFILES%g
+s%@GDBSERVER_LIBS@%$GDBSERVER_LIBS%g
+s%@USE_THREAD_DB@%$USE_THREAD_DB%g
CEOF
EOF
diff --git a/gdb/gdbserver/configure.in b/gdb/gdbserver/configure.in
index db7e301934b..cb6feedb6f2 100644
--- a/gdb/gdbserver/configure.in
+++ b/gdb/gdbserver/configure.in
@@ -30,7 +30,8 @@ AC_PROG_INSTALL
AC_HEADER_STDC
-AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h)
+AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
+ proc_service.h sys/procfs.h thread_db.h linux/elf.h unistd.h)
. ${srcdir}/configure.srv
@@ -62,9 +63,67 @@ if test "${srv_linux_regsets}" = "yes"; then
fi
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
+if test "$ac_cv_header_sys_procfs_h" = yes; then
+ BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
+ BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
+
+ dnl Check for broken prfpregset_t type
+
+ dnl For Linux/i386, glibc 2.1.3 was released with a bogus
+ dnl prfpregset_t type (it's a typedef for the pointer to a struct
+ dnl instead of the struct itself). We detect this here, and work
+ dnl around it in gdb_proc_service.h.
+
+ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
+ AC_MSG_CHECKING(whether prfpregset_t type is broken)
+ AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
+ [AC_TRY_RUN([#include <sys/procfs.h>
+ int main ()
+ {
+ if (sizeof (prfpregset_t) == sizeof (void *))
+ return 1;
+ return 0;
+ }],
+ gdb_cv_prfpregset_t_broken=no,
+ gdb_cv_prfpregset_t_broken=yes,
+ gdb_cv_prfpregset_t_broken=yes)])
+ AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
+ if test $gdb_cv_prfpregset_t_broken = yes; then
+ AC_DEFINE(PRFPREGSET_T_BROKEN)
+ fi
+ fi
+
+ BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
+fi
+
+srv_thread_depfiles=
+srv_libs=
+USE_THREAD_DB=
+
+if test "$srv_linux_thread_db" = "yes"; then
+ SRV_CHECK_THREAD_DB
+ if test "$srv_cv_thread_db" = no; then
+ AC_WARN([Could not find libthread_db.])
+ AC_WARN([Disabling thread support in gdbserver.])
+ srv_linux_thread_db=no
+ else
+ srv_libs="$srv_cv_thread_db"
+ fi
+fi
+
+if test "$srv_linux_thread_db" = "yes"; then
+ srv_thread_depfiles="thread-db.o proc-service.o"
+ USE_THREAD_DB="-DUSE_THREAD_DB"
+fi
+
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
+GDBSERVER_LIBS="$srv_libs"
AC_SUBST(GDBSERVER_DEPFILES)
+AC_SUBST(GDBSERVER_LIBS)
+AC_SUBST(USE_THREAD_DB)
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 3268cd77207..28dc2aad1f6 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -21,11 +21,13 @@ case "${target}" in
arm*-*-linux*) srv_regobj=reg-arm.o
srv_tgtobj="linux-low.o linux-arm-low.o"
srv_linux_usrregs=yes
+ srv_linux_thread_db=yes
;;
i[3456]86-*-linux*) srv_regobj=reg-i386-linux.o
srv_tgtobj="linux-low.o linux-i386-low.o i387-fp.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
+ srv_linux_thread_db=yes
;;
ia64-*-linux*) srv_regobj=reg-ia64.o
srv_tgtobj="linux-low.o linux-ia64-low.o"
@@ -38,10 +40,12 @@ case "${target}" in
mips*-*-linux*) srv_regobj=reg-mips.o
srv_tgtobj="linux-low.o linux-mips-low.o"
srv_linux_usrregs=yes
+ srv_linux_thread_db=yes
;;
powerpc*-*-linux*) srv_regobj=reg-ppc.o
srv_tgtobj="linux-low.o linux-ppc-low.o"
srv_linux_usrregs=yes
+ srv_linux_thread_db=yes
;;
s390-*-linux*) srv_regobj=reg-s390.o
srv_tgtobj="linux-low.o linux-s390-low.o"
@@ -54,6 +58,7 @@ case "${target}" in
sh*-*-linux*) srv_regobj=reg-sh.o
srv_tgtobj="linux-low.o linux-sh-low.o"
srv_linux_usrregs=yes
+ srv_linux_thread_db=yes
;;
x86_64-*-linux*) srv_regobj=reg-x86-64.o
srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o"
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 65831b1d762..45242749a97 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -30,12 +30,16 @@
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
/* Sort of a hack... */
#define EOL (EOF - 1)
@@ -46,7 +50,7 @@ static int remote_desc;
as the file name for which the error was encountered.
Then return to command level. */
-void
+static void
perror_with_name (char *string)
{
#ifndef STDC_HEADERS
@@ -77,7 +81,7 @@ sync_error (FILE *fp, char *desc, int expect, int got)
exit (1);
}
-void
+static void
remote_close (void)
{
close (remote_desc);
@@ -86,7 +90,7 @@ remote_close (void)
/* Open a connection to a remote debugger.
NAME is the filename used for communication. */
-void
+static void
remote_open (char *name)
{
if (!strchr (name, ':'))
@@ -234,7 +238,7 @@ logchar (FILE *fp)
/* Accept input from gdb and match with chars from fp (after skipping one
blank) up until a \n is read from fp (which is not matched) */
-void
+static void
expect (FILE *fp)
{
int fromlog;
@@ -265,7 +269,7 @@ expect (FILE *fp)
/* Play data back to gdb from fp (after skipping leading blank) up until a
\n is read from fp (which is discarded and not sent to gdb). */
-void
+static void
play (FILE *fp)
{
int fromlog;
diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c
index 3d1d6a6fd5c..19a9929debc 100644
--- a/gdb/gdbserver/i387-fp.c
+++ b/gdb/gdbserver/i387-fp.c
@@ -20,6 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "server.h"
+#include "i387-fp.h"
int num_xmm_registers = 8;
@@ -108,7 +109,7 @@ i387_cache_to_fsave (void *buf)
}
void
-i387_fsave_to_cache (void *buf)
+i387_fsave_to_cache (const void *buf)
{
struct i387_fsave *fp = (struct i387_fsave *) buf;
int i;
@@ -240,7 +241,7 @@ i387_ftag (struct i387_fxsave *fp, int regno)
}
void
-i387_fxsave_to_cache (void *buf)
+i387_fxsave_to_cache (const void *buf)
{
struct i387_fxsave *fp = (struct i387_fxsave *) buf;
int i, top;
@@ -287,4 +288,3 @@ i387_fxsave_to_cache (void *buf)
val = (fp->fop) & 0x7FF;
supply_register_by_name ("fop", &val);
}
-
diff --git a/gdb/gdbserver/i387-fp.h b/gdb/gdbserver/i387-fp.h
index 90fe4ca6eb7..d28c4228830 100644
--- a/gdb/gdbserver/i387-fp.h
+++ b/gdb/gdbserver/i387-fp.h
@@ -23,10 +23,10 @@
#define I387_FP_H
void i387_cache_to_fsave (void *buf);
-void i387_fsave_to_cache (void *buf);
+void i387_fsave_to_cache (const void *buf);
void i387_cache_to_fxsave (void *buf);
-void i387_fxsave_to_cache (void *buf);
+void i387_fxsave_to_cache (const void *buf);
extern int num_xmm_registers;
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 774798deae3..68c91c4efa9 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -25,81 +25,175 @@
#include "server.h"
-struct inferior_info
+struct thread_info
{
- int pid;
+ struct inferior_list_entry entry;
void *target_data;
void *regcache_data;
- struct inferior_info *next;
};
-static struct inferior_info *inferiors;
-struct inferior_info *current_inferior;
-int signal_pid;
+struct inferior_list all_threads;
+
+struct thread_info *current_inferior;
+
+#define get_thread(inf) ((struct thread_info *)(inf))
+
+void
+add_inferior_to_list (struct inferior_list *list,
+ struct inferior_list_entry *new_inferior)
+{
+ new_inferior->next = NULL;
+ if (list->tail != NULL)
+ list->tail->next = new_inferior;
+ else
+ list->head = new_inferior;
+ list->tail = new_inferior;
+}
+
+void
+for_each_inferior (struct inferior_list *list,
+ void (*action) (struct inferior_list_entry *))
+{
+ struct inferior_list_entry *cur = list->head, *next;
+
+ while (cur != NULL)
+ {
+ next = cur->next;
+ (*action) (cur);
+ cur = next;
+ }
+}
void
-add_inferior (int pid)
+change_inferior_id (struct inferior_list *list,
+ int new_id)
{
- struct inferior_info *new_inferior
- = (struct inferior_info *) malloc (sizeof (*new_inferior));
+ if (list->head != list->tail)
+ error ("tried to change thread ID after multiple threads are created");
- memset (new_inferior, 0, sizeof (*new_inferior));
+ list->head->id = new_id;
+}
- new_inferior->pid = pid;
+void
+remove_inferior (struct inferior_list *list,
+ struct inferior_list_entry *entry)
+{
+ struct inferior_list_entry **cur;
- new_inferior->next = inferiors;
- inferiors = new_inferior;
+ if (list->head == entry)
+ {
+ list->head = entry->next;
+ if (list->tail == entry)
+ list->tail = list->head;
+ return;
+ }
+
+ cur = &list->head;
+ while (*cur && (*cur)->next != entry)
+ cur = &(*cur)->next;
+
+ if (*cur == NULL)
+ return;
+ (*cur)->next = entry->next;
+
+ if (list->tail == entry)
+ list->tail = *cur;
+}
+
+void
+add_thread (int thread_id, void *target_data)
+{
+ struct thread_info *new_thread
+ = (struct thread_info *) malloc (sizeof (*new_thread));
+
+ memset (new_thread, 0, sizeof (*new_thread));
+
+ new_thread->entry.id = thread_id;
+
+ add_inferior_to_list (&all_threads, & new_thread->entry);
+
if (current_inferior == NULL)
- current_inferior = inferiors;
+ current_inferior = new_thread;
- create_register_cache (new_inferior);
+ new_thread->target_data = target_data;
+ set_inferior_regcache_data (new_thread, new_register_cache ());
+}
- if (signal_pid == 0)
- signal_pid = pid;
+static void
+free_one_thread (struct inferior_list_entry *inf)
+{
+ struct thread_info *thread = get_thread (inf);
+ free_register_cache (inferior_regcache_data (thread));
+ free (thread);
+}
+
+void
+remove_thread (struct thread_info *thread)
+{
+ remove_inferior (&all_threads, (struct inferior_list_entry *) thread);
+ free_one_thread (&thread->entry);
}
void
clear_inferiors (void)
{
- struct inferior_info *inf = inferiors, *next_inf;
+ for_each_inferior (&all_threads, free_one_thread);
+
+ all_threads.head = all_threads.tail = NULL;
+}
+
+struct inferior_list_entry *
+find_inferior (struct inferior_list *list,
+ int (*func) (struct inferior_list_entry *, void *), void *arg)
+{
+ struct inferior_list_entry *inf = list->head;
- while (inf)
+ while (inf != NULL)
{
- next_inf = inf->next;
+ if ((*func) (inf, arg))
+ return inf;
+ inf = inf->next;
+ }
- if (inf->target_data)
- free (inf->target_data);
- if (inf->regcache_data)
- free_register_cache (inf);
+ return NULL;
+}
- free (inf);
- inf = next_inf;
+struct inferior_list_entry *
+find_inferior_id (struct inferior_list *list, int id)
+{
+ struct inferior_list_entry *inf = list->head;
+
+ while (inf != NULL)
+ {
+ if (inf->id == id)
+ return inf;
+ inf = inf->next;
}
- inferiors = NULL;
+ return NULL;
}
void *
-inferior_target_data (struct inferior_info *inferior)
+inferior_target_data (struct thread_info *inferior)
{
return inferior->target_data;
}
void
-set_inferior_target_data (struct inferior_info *inferior, void *data)
+set_inferior_target_data (struct thread_info *inferior, void *data)
{
inferior->target_data = data;
}
void *
-inferior_regcache_data (struct inferior_info *inferior)
+inferior_regcache_data (struct thread_info *inferior)
{
return inferior->regcache_data;
}
void
-set_inferior_regcache_data (struct inferior_info *inferior, void *data)
+set_inferior_regcache_data (struct thread_info *inferior, void *data)
{
inferior->regcache_data = data;
}
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 2958fdf3129..07e2792837c 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -45,9 +45,49 @@ arm_cannot_fetch_register (int regno)
return (regno >= arm_num_regs);
}
+static CORE_ADDR
+arm_get_pc ()
+{
+ unsigned long pc;
+ collect_register_by_name ("pc", &pc);
+ return pc;
+}
+
+static void
+arm_set_pc (CORE_ADDR pc)
+{
+ unsigned long newpc = pc;
+ supply_register_by_name ("pc", &newpc);
+}
+
+/* Correct in either endianness. We do not support Thumb yet. */
+static const unsigned long arm_breakpoint = 0xef9f0001;
+#define arm_breakpoint_len 4
+
+static int
+arm_breakpoint_at (CORE_ADDR where)
+{
+ unsigned long insn;
+
+ (*the_target->read_memory) (where, (char *) &insn, 4);
+ if (insn == arm_breakpoint)
+ return 1;
+
+ /* If necessary, recognize more trap instructions here. GDB only uses the
+ one. */
+ return 0;
+}
+
struct linux_target_ops the_low_target = {
arm_num_regs,
arm_regmap,
arm_cannot_fetch_register,
arm_cannot_store_register,
+ arm_get_pc,
+ arm_set_pc,
+ (const char *) &arm_breakpoint,
+ arm_breakpoint_len,
+ NULL,
+ 0,
+ arm_breakpoint_at,
};
diff --git a/gdb/gdbserver/linux-i386-low.c b/gdb/gdbserver/linux-i386-low.c
index 71264321341..b79b601ae8f 100644
--- a/gdb/gdbserver/linux-i386-low.c
+++ b/gdb/gdbserver/linux-i386-low.c
@@ -72,7 +72,7 @@ i386_fill_gregset (void *buf)
}
static void
-i386_store_gregset (void *buf)
+i386_store_gregset (const void *buf)
{
int i;
@@ -89,7 +89,7 @@ i386_fill_fpregset (void *buf)
}
static void
-i386_store_fpregset (void *buf)
+i386_store_fpregset (const void *buf)
{
i387_fsave_to_cache (buf);
}
@@ -101,7 +101,7 @@ i386_fill_fpxregset (void *buf)
}
static void
-i386_store_fpxregset (void *buf)
+i386_store_fpxregset (const void *buf)
{
i387_fxsave_to_cache (buf);
}
@@ -109,14 +109,17 @@ i386_store_fpxregset (void *buf)
struct regset_info target_regsets[] = {
{ PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
+ GENERAL_REGS,
i386_fill_gregset, i386_store_gregset },
#ifdef HAVE_PTRACE_GETFPXREGS
{ PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t),
+ EXTENDED_REGS,
i386_fill_fpxregset, i386_store_fpxregset },
#endif
{ PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
+ FP_REGS,
i386_fill_fpregset, i386_store_fpregset },
- { 0, 0, -1, NULL, NULL }
+ { 0, 0, -1, -1, NULL, NULL }
};
#endif /* HAVE_LINUX_REGSETS */
@@ -124,25 +127,38 @@ struct regset_info target_regsets[] = {
static const char i386_breakpoint[] = { 0xCC };
#define i386_breakpoint_len 1
+extern int debug_threads;
+
static CORE_ADDR
-i386_stop_pc ()
+i386_get_pc ()
{
unsigned long pc;
- /* Overkill */
- fetch_inferior_registers (0);
-
collect_register_by_name ("eip", &pc);
- return pc - 1;
+
+ if (debug_threads)
+ fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc);
+ return pc;
}
static void
i386_set_pc (CORE_ADDR newpc)
{
+ if (debug_threads)
+ fprintf (stderr, "set pc to %08lx\n", (long) newpc);
supply_register_by_name ("eip", &newpc);
+}
+
+static int
+i386_breakpoint_at (CORE_ADDR pc)
+{
+ unsigned char c;
+
+ read_inferior_memory (pc, &c, 1);
+ if (c == 0xCC)
+ return 1;
- /* Overkill */
- store_inferior_registers (0);
+ return 0;
}
struct linux_target_ops the_low_target = {
@@ -150,8 +166,11 @@ struct linux_target_ops the_low_target = {
i386_regmap,
i386_cannot_fetch_register,
i386_cannot_store_register,
- i386_stop_pc,
+ i386_get_pc,
i386_set_pc,
i386_breakpoint,
i386_breakpoint_len,
+ NULL,
+ 1,
+ i386_breakpoint_at,
};
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 6cfe0d5aea5..7048daf221e 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -35,9 +35,32 @@
#include <stdlib.h>
#include <unistd.h>
-static CORE_ADDR linux_bp_reinsert;
+/* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead,
+ however. This requires changing the ID in place when we go from !using_threads
+ to using_threads, immediately.
+ ``all_processes'' is keyed by the process ID - which on Linux is (presently)
+ the same as the LWP ID. */
+
+struct inferior_list all_processes;
+
+/* FIXME this is a bit of a hack, and could be removed. */
+int stopping_threads;
+
+/* FIXME make into a target method? */
+int using_threads;
+
+static void linux_resume_one_process (struct inferior_list_entry *entry,
+ int step, int signal);
static void linux_resume (int step, int signal);
+static void stop_all_processes (void);
+static int linux_wait_for_event (struct thread_info *child);
+
+struct pending_signals
+{
+ int signal;
+ struct pending_signals *prev;
+};
#define PTRACE_ARG3_TYPE long
#define PTRACE_XFER_TYPE long
@@ -48,12 +71,64 @@ static int use_regsets_p = 1;
extern int errno;
-static int inferior_pid;
+int debug_threads = 0;
+
+#define pid_of(proc) ((proc)->head.id)
+
+/* FIXME: Delete eventually. */
+#define inferior_pid (pid_of (get_thread_process (current_inferior)))
+
+/* This function should only be called if the process got a SIGTRAP.
+ The SIGTRAP could mean several things.
+
+ On i386, where decr_pc_after_break is non-zero:
+ If we were single-stepping this process using PTRACE_SINGLESTEP,
+ we will get only the one SIGTRAP (even if the instruction we
+ stepped over was a breakpoint). The value of $eip will be the
+ next instruction.
+ If we continue the process using PTRACE_CONT, we will get a
+ SIGTRAP when we hit a breakpoint. The value of $eip will be
+ the instruction after the breakpoint (i.e. needs to be
+ decremented). If we report the SIGTRAP to GDB, we must also
+ report the undecremented PC. If we cancel the SIGTRAP, we
+ must resume at the decremented PC.
+
+ (Presumably, not yet tested) On a non-decr_pc_after_break machine
+ with hardware or kernel single-step:
+ If we single-step over a breakpoint instruction, our PC will
+ point at the following instruction. If we continue and hit a
+ breakpoint instruction, our PC will point at the breakpoint
+ instruction. */
+
+static CORE_ADDR
+get_stop_pc (void)
+{
+ CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
+
+ if (get_thread_process (current_inferior)->stepping)
+ return stop_pc;
+ else
+ return stop_pc - the_low_target.decr_pc_after_break;
+}
-struct inferior_linux_data
+static void *
+add_process (int pid)
{
- int pid;
-};
+ struct process_info *process;
+
+ process = (struct process_info *) malloc (sizeof (*process));
+ memset (process, 0, sizeof (*process));
+
+ process->head.id = pid;
+
+ /* Default to tid == lwpid == pid. */
+ process->tid = pid;
+ process->lwpid = pid;
+
+ add_inferior_to_list (&all_processes, &process->head);
+
+ return process;
+}
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
@@ -61,7 +136,7 @@ struct inferior_linux_data
static int
linux_create_inferior (char *program, char **allargs)
{
- struct inferior_linux_data *tdata;
+ void *new_process;
int pid;
pid = fork ();
@@ -72,6 +147,8 @@ linux_create_inferior (char *program, char **allargs)
{
ptrace (PTRACE_TRACEME, 0, 0, 0);
+ signal (SIGRTMIN + 1, SIG_DFL);
+
execv (program, allargs);
fprintf (stderr, "Cannot exec %s: %s.\n", program,
@@ -80,22 +157,18 @@ linux_create_inferior (char *program, char **allargs)
_exit (0177);
}
- add_inferior (pid);
- tdata = (struct inferior_linux_data *) malloc (sizeof (*tdata));
- tdata->pid = pid;
- set_inferior_target_data (current_inferior, tdata);
+ new_process = add_process (pid);
+ add_thread (pid, new_process);
- /* FIXME remove */
- inferior_pid = pid;
return 0;
}
/* Attach to an inferior process. */
-static int
-linux_attach (int pid)
+void
+linux_attach_lwp (int pid, int tid)
{
- struct inferior_linux_data *tdata;
+ struct process_info *new_process;
if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
{
@@ -103,143 +176,712 @@ linux_attach (int pid)
errno < sys_nerr ? sys_errlist[errno] : "unknown error",
errno);
fflush (stderr);
- _exit (0177);
+
+ /* If we fail to attach to an LWP, just return. */
+ if (!using_threads)
+ _exit (0177);
+ return;
}
- add_inferior (pid);
- tdata = (struct inferior_linux_data *) malloc (sizeof (*tdata));
- tdata->pid = pid;
- set_inferior_target_data (current_inferior, tdata);
+ new_process = (struct process_info *) add_process (pid);
+ add_thread (tid, new_process);
+
+ /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH
+ brings it to a halt. We should ignore that SIGSTOP and resume the process
+ (unless this is the first process, in which case the flag will be cleared
+ in linux_attach).
+
+ On the other hand, if we are currently trying to stop all threads, we
+ should treat the new thread as if we had sent it a SIGSTOP. This works
+ because we are guaranteed that add_process added us to the end of the
+ list, and so the new thread has not yet reached wait_for_sigstop (but
+ will). */
+ if (! stopping_threads)
+ new_process->stop_expected = 1;
+}
+
+int
+linux_attach (int pid)
+{
+ struct process_info *process;
+
+ linux_attach_lwp (pid, pid);
+
+ /* Don't ignore the initial SIGSTOP if we just attached to this process. */
+ process = (struct process_info *) find_inferior_id (&all_processes, pid);
+ process->stop_expected = 0;
+
return 0;
}
/* Kill the inferior process. Make us have no inferior. */
static void
-linux_kill (void)
+linux_kill_one_process (struct inferior_list_entry *entry)
{
- if (inferior_pid == 0)
- return;
- ptrace (PTRACE_KILL, inferior_pid, 0, 0);
- wait (0);
- clear_inferiors ();
+ struct thread_info *thread = (struct thread_info *) entry;
+ struct process_info *process = get_thread_process (thread);
+ int wstat;
+
+ do
+ {
+ ptrace (PTRACE_KILL, pid_of (process), 0, 0);
+
+ /* Make sure it died. The loop is most likely unnecessary. */
+ wstat = linux_wait_for_event (thread);
+ } while (WIFSTOPPED (wstat));
}
/* Return nonzero if the given thread is still alive. */
+static void
+linux_kill (void)
+{
+ for_each_inferior (&all_threads, linux_kill_one_process);
+}
+
+static int
+linux_thread_alive (int tid)
+{
+ if (find_inferior_id (&all_threads, tid) != NULL)
+ return 1;
+ else
+ return 0;
+}
+
+/* Return nonzero if this process stopped at a breakpoint which
+ no longer appears to be inserted. Also adjust the PC
+ appropriately to resume where the breakpoint used to be. */
static int
-linux_thread_alive (int pid)
+check_removed_breakpoint (struct process_info *event_child)
{
+ CORE_ADDR stop_pc;
+ struct thread_info *saved_inferior;
+
+ if (event_child->pending_is_breakpoint == 0)
+ return 0;
+
+ if (debug_threads)
+ fprintf (stderr, "Checking for breakpoint.\n");
+
+ saved_inferior = current_inferior;
+ current_inferior = get_process_thread (event_child);
+
+ stop_pc = get_stop_pc ();
+
+ /* If the PC has changed since we stopped, then we shouldn't do
+ anything. This happens if, for instance, GDB handled the
+ decr_pc_after_break subtraction itself. */
+ if (stop_pc != event_child->pending_stop_pc)
+ {
+ if (debug_threads)
+ fprintf (stderr, "Ignoring, PC was changed.\n");
+
+ event_child->pending_is_breakpoint = 0;
+ current_inferior = saved_inferior;
+ return 0;
+ }
+
+ /* If the breakpoint is still there, we will report hitting it. */
+ if ((*the_low_target.breakpoint_at) (stop_pc))
+ {
+ if (debug_threads)
+ fprintf (stderr, "Ignoring, breakpoint is still present.\n");
+ current_inferior = saved_inferior;
+ return 0;
+ }
+
+ if (debug_threads)
+ fprintf (stderr, "Removed breakpoint.\n");
+
+ /* For decr_pc_after_break targets, here is where we perform the
+ decrement. We go immediately from this function to resuming,
+ and can not safely call get_stop_pc () again. */
+ if (the_low_target.set_pc != NULL)
+ (*the_low_target.set_pc) (stop_pc);
+
+ /* We consumed the pending SIGTRAP. */
+ event_child->status_pending_p = 0;
+ event_child->status_pending = 0;
+
+ current_inferior = saved_inferior;
return 1;
}
+/* Return 1 if this process has an interesting status pending. This function
+ may silently resume an inferior process. */
static int
-linux_wait_for_one_inferior (struct inferior_info *child)
+status_pending_p (struct inferior_list_entry *entry, void *dummy)
+{
+ struct process_info *process = (struct process_info *) entry;
+
+ if (process->status_pending_p)
+ if (check_removed_breakpoint (process))
+ {
+ /* This thread was stopped at a breakpoint, and the breakpoint
+ is now gone. We were told to continue (or step...) all threads,
+ so GDB isn't trying to single-step past this breakpoint.
+ So instead of reporting the old SIGTRAP, pretend we got to
+ the breakpoint just after it was removed instead of just
+ before; resume the process. */
+ linux_resume_one_process (&process->head, 0, 0);
+ return 0;
+ }
+
+ return process->status_pending_p;
+}
+
+static void
+linux_wait_for_process (struct process_info **childp, int *wstatp)
{
- struct inferior_linux_data *child_data = inferior_target_data (child);
- int pid, wstat;
+ int ret;
+ int to_wait_for = -1;
+
+ if (*childp != NULL)
+ to_wait_for = (*childp)->lwpid;
while (1)
{
- pid = waitpid (child_data->pid, &wstat, 0);
+ ret = waitpid (to_wait_for, wstatp, WNOHANG);
+
+ if (ret == -1)
+ {
+ if (errno != ECHILD)
+ perror_with_name ("waitpid");
+ }
+ else if (ret > 0)
+ break;
+
+ ret = waitpid (to_wait_for, wstatp, WNOHANG | __WCLONE);
+
+ if (ret == -1)
+ {
+ if (errno != ECHILD)
+ perror_with_name ("waitpid (WCLONE)");
+ }
+ else if (ret > 0)
+ break;
+
+ usleep (1000);
+ }
+
+ if (debug_threads
+ && (!WIFSTOPPED (*wstatp)
+ || (WSTOPSIG (*wstatp) != 32
+ && WSTOPSIG (*wstatp) != 33)))
+ fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp);
+
+ if (to_wait_for == -1)
+ *childp = (struct process_info *) find_inferior_id (&all_processes, ret);
+
+ (*childp)->stopped = 1;
+ (*childp)->pending_is_breakpoint = 0;
+
+ if (debug_threads
+ && WIFSTOPPED (*wstatp))
+ {
+ current_inferior = (struct thread_info *)
+ find_inferior_id (&all_threads, (*childp)->tid);
+ /* For testing only; i386_stop_pc prints out a diagnostic. */
+ if (the_low_target.get_pc != NULL)
+ get_stop_pc ();
+ }
+}
- if (pid != child_data->pid)
- perror_with_name ("wait");
+static int
+linux_wait_for_event (struct thread_info *child)
+{
+ CORE_ADDR stop_pc;
+ struct process_info *event_child;
+ int wstat;
+
+ /* Check for a process with a pending status. */
+ /* It is possible that the user changed the pending task's registers since
+ it stopped. We correctly handle the change of PC if we hit a breakpoint
+ (in check_removed_breakpoints); signals should be reported anyway. */
+ if (child == NULL)
+ {
+ event_child = (struct process_info *)
+ find_inferior (&all_processes, status_pending_p, NULL);
+ if (debug_threads && event_child)
+ fprintf (stderr, "Got a pending child %d\n", event_child->lwpid);
+ }
+ else
+ {
+ event_child = get_thread_process (child);
+ if (event_child->status_pending_p
+ && check_removed_breakpoint (event_child))
+ event_child = NULL;
+ }
- /* If this target supports breakpoints, see if we hit one. */
- if (the_low_target.stop_pc != NULL
- && WIFSTOPPED (wstat)
- && WSTOPSIG (wstat) == SIGTRAP)
+ if (event_child != NULL)
+ {
+ if (event_child->status_pending_p)
{
- CORE_ADDR stop_pc;
+ if (debug_threads)
+ fprintf (stderr, "Got an event from pending child %d (%04x)\n",
+ event_child->lwpid, event_child->status_pending);
+ wstat = event_child->status_pending;
+ event_child->status_pending_p = 0;
+ event_child->status_pending = 0;
+ current_inferior = get_process_thread (event_child);
+ return wstat;
+ }
+ }
+
+ /* We only enter this loop if no process has a pending wait status. Thus
+ any action taken in response to a wait status inside this loop is
+ responding as soon as we detect the status, not after any pending
+ events. */
+ while (1)
+ {
+ if (child == NULL)
+ event_child = NULL;
+ else
+ event_child = get_thread_process (child);
+
+ linux_wait_for_process (&event_child, &wstat);
+
+ if (event_child == NULL)
+ error ("event from unknown child");
- if (linux_bp_reinsert != 0)
+ current_inferior = (struct thread_info *)
+ find_inferior_id (&all_threads, event_child->tid);
+
+ if (using_threads)
+ {
+ /* Check for thread exit. */
+ if (! WIFSTOPPED (wstat))
{
- reinsert_breakpoint (linux_bp_reinsert);
- linux_bp_reinsert = 0;
- linux_resume (0, 0);
+ if (debug_threads)
+ fprintf (stderr, "Thread %d (LWP %d) exiting\n",
+ event_child->tid, event_child->head.id);
+
+ /* If the last thread is exiting, just return. */
+ if (all_threads.head == all_threads.tail)
+ return wstat;
+
+ dead_thread_notify (event_child->tid);
+
+ remove_inferior (&all_processes, &event_child->head);
+ free (event_child);
+ remove_thread (current_inferior);
+ current_inferior = (struct thread_info *) all_threads.head;
+
+ /* If we were waiting for this particular child to do something...
+ well, it did something. */
+ if (child != NULL)
+ return wstat;
+
+ /* Wait for a more interesting event. */
continue;
}
- fetch_inferior_registers (0);
- stop_pc = (*the_low_target.stop_pc) ();
+ if (WIFSTOPPED (wstat)
+ && WSTOPSIG (wstat) == SIGSTOP
+ && event_child->stop_expected)
+ {
+ if (debug_threads)
+ fprintf (stderr, "Expected stop.\n");
+ event_child->stop_expected = 0;
+ linux_resume_one_process (&event_child->head,
+ event_child->stepping, 0);
+ continue;
+ }
- if (check_breakpoints (stop_pc) != 0)
+ /* FIXME drow/2002-06-09: Get signal numbers from the inferior's
+ thread library? */
+ if (WIFSTOPPED (wstat)
+ && (WSTOPSIG (wstat) == SIGRTMIN
+ || WSTOPSIG (wstat) == SIGRTMIN + 1))
{
- if (the_low_target.set_pc != NULL)
- (*the_low_target.set_pc) (stop_pc);
+ if (debug_threads)
+ fprintf (stderr, "Ignored signal %d for %d (LWP %d).\n",
+ WSTOPSIG (wstat), event_child->tid,
+ event_child->head.id);
+ linux_resume_one_process (&event_child->head,
+ event_child->stepping,
+ WSTOPSIG (wstat));
+ continue;
+ }
+ }
- if (the_low_target.breakpoint_reinsert_addr == NULL)
- {
- linux_bp_reinsert = stop_pc;
- uninsert_breakpoint (stop_pc);
- linux_resume (1, 0);
- }
- else
- {
- reinsert_breakpoint_by_bp
- (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
- linux_resume (0, 0);
- }
+ /* If this event was not handled above, and is not a SIGTRAP, report
+ it. */
+ if (!WIFSTOPPED (wstat) || WSTOPSIG (wstat) != SIGTRAP)
+ return wstat;
- continue;
+ /* If this target does not support breakpoints, we simply report the
+ SIGTRAP; it's of no concern to us. */
+ if (the_low_target.get_pc == NULL)
+ return wstat;
+
+ stop_pc = get_stop_pc ();
+
+ /* bp_reinsert will only be set if we were single-stepping.
+ Notice that we will resume the process after hitting
+ a gdbserver breakpoint; single-stepping to/over one
+ is not supported (yet). */
+ if (event_child->bp_reinsert != 0)
+ {
+ if (debug_threads)
+ fprintf (stderr, "Reinserted breakpoint.\n");
+ reinsert_breakpoint (event_child->bp_reinsert);
+ event_child->bp_reinsert = 0;
+
+ /* Clear the single-stepping flag and SIGTRAP as we resume. */
+ linux_resume_one_process (&event_child->head, 0, 0);
+ continue;
+ }
+
+ if (debug_threads)
+ fprintf (stderr, "Hit a (non-reinsert) breakpoint.\n");
+
+ if (check_breakpoints (stop_pc) != 0)
+ {
+ /* We hit one of our own breakpoints. We mark it as a pending
+ breakpoint, so that check_removed_breakpoints () will do the PC
+ adjustment for us at the appropriate time. */
+ event_child->pending_is_breakpoint = 1;
+ event_child->pending_stop_pc = stop_pc;
+
+ /* Now we need to put the breakpoint back. We continue in the event
+ loop instead of simply replacing the breakpoint right away,
+ in order to not lose signals sent to the thread that hit the
+ breakpoint. Unfortunately this increases the window where another
+ thread could sneak past the removed breakpoint. For the current
+ use of server-side breakpoints (thread creation) this is
+ acceptable; but it needs to be considered before this breakpoint
+ mechanism can be used in more general ways. For some breakpoints
+ it may be necessary to stop all other threads, but that should
+ be avoided where possible.
+
+ If breakpoint_reinsert_addr is NULL, that means that we can
+ use PTRACE_SINGLESTEP on this platform. Uninsert the breakpoint,
+ mark it for reinsertion, and single-step.
+
+ Otherwise, call the target function to figure out where we need
+ our temporary breakpoint, create it, and continue executing this
+ process. */
+ if (the_low_target.breakpoint_reinsert_addr == NULL)
+ {
+ event_child->bp_reinsert = stop_pc;
+ uninsert_breakpoint (stop_pc);
+ linux_resume_one_process (&event_child->head, 1, 0);
+ }
+ else
+ {
+ reinsert_breakpoint_by_bp
+ (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
+ linux_resume_one_process (&event_child->head, 0, 0);
}
+
+ continue;
+ }
+
+ /* If we were single-stepping, we definitely want to report the
+ SIGTRAP. The single-step operation has completed, so also
+ clear the stepping flag; in general this does not matter,
+ because the SIGTRAP will be reported to the client, which
+ will give us a new action for this thread, but clear it for
+ consistency anyway. It's safe to clear the stepping flag
+ because the only consumer of get_stop_pc () after this point
+ is check_removed_breakpoints, and pending_is_breakpoint is not
+ set. It might be wiser to use a step_completed flag instead. */
+ if (event_child->stepping)
+ {
+ event_child->stepping = 0;
+ return wstat;
+ }
+
+ /* A SIGTRAP that we can't explain. It may have been a breakpoint.
+ Check if it is a breakpoint, and if so mark the process information
+ accordingly. This will handle both the necessary fiddling with the
+ PC on decr_pc_after_break targets and suppressing extra threads
+ hitting a breakpoint if two hit it at once and then GDB removes it
+ after the first is reported. Arguably it would be better to report
+ multiple threads hitting breakpoints simultaneously, but the current
+ remote protocol does not allow this. */
+ if ((*the_low_target.breakpoint_at) (stop_pc))
+ {
+ event_child->pending_is_breakpoint = 1;
+ event_child->pending_stop_pc = stop_pc;
}
return wstat;
}
+
/* NOTREACHED */
return 0;
}
-/* Wait for process, returns status */
+/* Wait for process, returns status. */
static unsigned char
linux_wait (char *status)
{
int w;
+ struct thread_info *child = NULL;
+
+retry:
+ /* If we were only supposed to resume one thread, only wait for
+ that thread - if it's still alive. If it died, however - which
+ can happen if we're coming from the thread death case below -
+ then we need to make sure we restart the other threads. We could
+ pick a thread at random or restart all; restarting all is less
+ arbitrary. */
+ if (cont_thread > 0)
+ {
+ child = (struct thread_info *) find_inferior_id (&all_threads,
+ cont_thread);
+
+ /* No stepping, no signal - unless one is pending already, of course. */
+ if (child == NULL)
+ linux_resume (0, 0);
+ }
enable_async_io ();
- w = linux_wait_for_one_inferior (current_inferior);
+ w = linux_wait_for_event (child);
+ stop_all_processes ();
disable_async_io ();
- if (WIFEXITED (w))
+ /* If we are waiting for a particular child, and it exited,
+ linux_wait_for_event will return its exit status. Similarly if
+ the last child exited. If this is not the last child, however,
+ do not report it as exited until there is a 'thread exited' response
+ available in the remote protocol. Instead, just wait for another event.
+ This should be safe, because if the thread crashed we will already
+ have reported the termination signal to GDB; that should stop any
+ in-progress stepping operations, etc.
+
+ Report the exit status of the last thread to exit. This matches
+ LinuxThreads' behavior. */
+
+ if (all_threads.head == all_threads.tail)
{
- fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
- *status = 'W';
- clear_inferiors ();
- return ((unsigned char) WEXITSTATUS (w));
+ if (WIFEXITED (w))
+ {
+ fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
+ *status = 'W';
+ clear_inferiors ();
+ return ((unsigned char) WEXITSTATUS (w));
+ }
+ else if (!WIFSTOPPED (w))
+ {
+ fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
+ clear_inferiors ();
+ *status = 'X';
+ return ((unsigned char) WTERMSIG (w));
+ }
}
- else if (!WIFSTOPPED (w))
+ else
{
- fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
- clear_inferiors ();
- *status = 'X';
- return ((unsigned char) WTERMSIG (w));
+ if (!WIFSTOPPED (w))
+ goto retry;
}
- fetch_inferior_registers (0);
-
*status = 'T';
return ((unsigned char) WSTOPSIG (w));
}
+static void
+send_sigstop (struct inferior_list_entry *entry)
+{
+ struct process_info *process = (struct process_info *) entry;
+
+ if (process->stopped)
+ return;
+
+ /* If we already have a pending stop signal for this process, don't
+ send another. */
+ if (process->stop_expected)
+ {
+ process->stop_expected = 0;
+ return;
+ }
+
+ if (debug_threads)
+ fprintf (stderr, "Sending sigstop to process %d\n", process->head.id);
+
+ kill (process->head.id, SIGSTOP);
+ process->sigstop_sent = 1;
+}
+
+static void
+wait_for_sigstop (struct inferior_list_entry *entry)
+{
+ struct process_info *process = (struct process_info *) entry;
+ struct thread_info *saved_inferior, *thread;
+ int wstat, saved_tid;
+
+ if (process->stopped)
+ return;
+
+ saved_inferior = current_inferior;
+ saved_tid = ((struct inferior_list_entry *) saved_inferior)->id;
+ thread = (struct thread_info *) find_inferior_id (&all_threads,
+ process->tid);
+ wstat = linux_wait_for_event (thread);
+
+ /* If we stopped with a non-SIGSTOP signal, save it for later
+ and record the pending SIGSTOP. If the process exited, just
+ return. */
+ if (WIFSTOPPED (wstat)
+ && WSTOPSIG (wstat) != SIGSTOP)
+ {
+ if (debug_threads)
+ fprintf (stderr, "Stopped with non-sigstop signal\n");
+ process->status_pending_p = 1;
+ process->status_pending = wstat;
+ process->stop_expected = 1;
+ }
+
+ if (linux_thread_alive (saved_tid))
+ current_inferior = saved_inferior;
+ else
+ {
+ if (debug_threads)
+ fprintf (stderr, "Previously current thread died.\n");
+
+ /* Set a valid thread as current. */
+ set_desired_inferior (0);
+ }
+}
+
+static void
+stop_all_processes (void)
+{
+ stopping_threads = 1;
+ for_each_inferior (&all_processes, send_sigstop);
+ for_each_inferior (&all_processes, wait_for_sigstop);
+ stopping_threads = 0;
+}
+
/* Resume execution of the inferior process.
If STEP is nonzero, single-step it.
If SIGNAL is nonzero, give it that signal. */
static void
-linux_resume (int step, int signal)
+linux_resume_one_process (struct inferior_list_entry *entry,
+ int step, int signal)
{
+ struct process_info *process = (struct process_info *) entry;
+ struct thread_info *saved_inferior;
+
+ if (process->stopped == 0)
+ return;
+
+ /* If we have pending signals or status, and a new signal, enqueue the
+ signal. Also enqueue the signal if we are waiting to reinsert a
+ breakpoint; it will be picked up again below. */
+ if (signal != 0
+ && (process->status_pending_p || process->pending_signals != NULL
+ || process->bp_reinsert != 0))
+ {
+ struct pending_signals *p_sig;
+ p_sig = malloc (sizeof (*p_sig));
+ p_sig->prev = process->pending_signals;
+ p_sig->signal = signal;
+ process->pending_signals = p_sig;
+ }
+
+ if (process->status_pending_p)
+ return;
+
+ saved_inferior = current_inferior;
+ current_inferior = get_process_thread (process);
+
+ if (debug_threads)
+ fprintf (stderr, "Resuming process %d (%s, signal %d, stop %s)\n", inferior_pid,
+ step ? "step" : "continue", signal,
+ process->stop_expected ? "expected" : "not expected");
+
+ /* This bit needs some thinking about. If we get a signal that
+ we must report while a single-step reinsert is still pending,
+ we often end up resuming the thread. It might be better to
+ (ew) allow a stack of pending events; then we could be sure that
+ the reinsert happened right away and not lose any signals.
+
+ Making this stack would also shrink the window in which breakpoints are
+ uninserted (see comment in linux_wait_for_process) but not enough for
+ complete correctness, so it won't solve that problem. It may be
+ worthwhile just to solve this one, however. */
+ if (process->bp_reinsert != 0)
+ {
+ if (debug_threads)
+ fprintf (stderr, " pending reinsert at %08lx", (long)process->bp_reinsert);
+ if (step == 0)
+ fprintf (stderr, "BAD - reinserting but not stepping.\n");
+ step = 1;
+
+ /* Postpone any pending signal. It was enqueued above. */
+ signal = 0;
+ }
+
+ check_removed_breakpoint (process);
+
+ if (debug_threads && the_low_target.get_pc != NULL)
+ {
+ fprintf (stderr, " ");
+ (long) (*the_low_target.get_pc) ();
+ }
+
+ /* If we have pending signals, consume one unless we are trying to reinsert
+ a breakpoint. */
+ if (process->pending_signals != NULL && process->bp_reinsert == 0)
+ {
+ struct pending_signals **p_sig;
+
+ p_sig = &process->pending_signals;
+ while ((*p_sig)->prev != NULL)
+ p_sig = &(*p_sig)->prev;
+
+ signal = (*p_sig)->signal;
+ free (*p_sig);
+ *p_sig = NULL;
+ }
+
+ regcache_invalidate_one ((struct inferior_list_entry *)
+ get_process_thread (process));
errno = 0;
- ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal);
+ process->stopped = 0;
+ process->stepping = step;
+ ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, process->lwpid, 0, signal);
+
+ current_inferior = saved_inferior;
if (errno)
perror_with_name ("ptrace");
}
+/* This function is called once per process other than the first
+ one. The first process we are told the signal to continue
+ with, and whether to step or continue; for all others, any
+ existing signals will be marked in status_pending_p to be
+ reported momentarily, and we preserve the stepping flag. */
+static void
+linux_continue_one_process (struct inferior_list_entry *entry)
+{
+ struct process_info *process;
-#ifdef HAVE_LINUX_USRREGS
+ process = (struct process_info *) entry;
+ linux_resume_one_process (entry, process->stepping, 0);
+}
+
+static void
+linux_resume (int step, int signal)
+{
+ struct process_info *process;
+
+ process = get_thread_process (current_inferior);
+
+ /* If the current process has a status pending, this signal will
+ be enqueued and sent later. */
+ linux_resume_one_process (&process->head, step, signal);
-#define REGISTER_RAW_SIZE(regno) register_size((regno))
+ if (cont_thread == 0 || cont_thread == -1)
+ for_each_inferior (&all_processes, linux_continue_one_process);
+}
+
+#ifdef HAVE_LINUX_USRREGS
int
register_addr (int regnum)
@@ -262,6 +904,7 @@ fetch_register (int regno)
{
CORE_ADDR regaddr;
register int i;
+ char *buf;
if (regno >= the_low_target.num_regs)
return;
@@ -271,10 +914,11 @@ fetch_register (int regno)
regaddr = register_addr (regno);
if (regaddr == -1)
return;
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ buf = alloca (register_size (regno));
+ for (i = 0; i < register_size (regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
- *(PTRACE_XFER_TYPE *) (register_data (regno) + i) =
+ *(PTRACE_XFER_TYPE *) (buf + i) =
ptrace (PTRACE_PEEKUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, 0);
regaddr += sizeof (PTRACE_XFER_TYPE);
if (errno != 0)
@@ -288,6 +932,8 @@ fetch_register (int regno)
goto error_exit;
}
}
+ supply_register (regno, buf);
+
error_exit:;
}
@@ -310,6 +956,7 @@ usr_store_inferior_registers (int regno)
{
CORE_ADDR regaddr;
int i;
+ char *buf;
if (regno >= 0)
{
@@ -323,11 +970,13 @@ usr_store_inferior_registers (int regno)
if (regaddr == -1)
return;
errno = 0;
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ buf = alloca (register_size (regno));
+ collect_register (regno, buf);
+ for (i = 0; i < register_size (regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
- *(int *) (register_data (regno) + i));
+ *(int *) (buf + i));
if (errno != 0)
{
if ((*the_low_target.cannot_store_register) (regno) == 0)
@@ -345,7 +994,7 @@ usr_store_inferior_registers (int regno)
}
else
for (regno = 0; regno < the_low_target.num_regs; regno++)
- store_inferior_registers (regno);
+ usr_store_inferior_registers (regno);
}
#endif /* HAVE_LINUX_USRREGS */
@@ -354,7 +1003,7 @@ usr_store_inferior_registers (int regno)
#ifdef HAVE_LINUX_REGSETS
static int
-regsets_fetch_inferior_registers (void)
+regsets_fetch_inferior_registers ()
{
struct regset_info *regset;
@@ -392,7 +1041,10 @@ regsets_fetch_inferior_registers (void)
}
else
{
- perror ("Warning: ptrace(regsets_fetch_inferior_registers)");
+ char s[256];
+ sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d",
+ inferior_pid);
+ perror (s);
}
}
regset->store_function (buf);
@@ -402,7 +1054,7 @@ regsets_fetch_inferior_registers (void)
}
static int
-regsets_store_inferior_registers (void)
+regsets_store_inferior_registers ()
{
struct regset_info *regset;
@@ -445,6 +1097,7 @@ regsets_store_inferior_registers (void)
}
}
regset ++;
+ free (buf);
}
return 0;
}
@@ -528,6 +1181,11 @@ linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
extern int errno;
+ if (debug_threads)
+ {
+ fprintf (stderr, "Writing %02x to %08lx\n", (unsigned)myaddr[0], (long)memaddr);
+ }
+
/* Fill start and end extra bytes of buffer with existing memory data. */
buffer[0] = ptrace (PTRACE_PEEKTEXT, inferior_pid,
@@ -562,7 +1220,40 @@ linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
static void
linux_look_up_symbols (void)
{
- /* Don't need to look up any symbols yet. */
+#ifdef USE_THREAD_DB
+ if (using_threads)
+ return;
+
+ using_threads = thread_db_init ();
+#endif
+}
+
+/* Return 1 if this process is not stopped. */
+static int
+unstopped_p (struct inferior_list_entry *entry, void *dummy)
+{
+ struct process_info *process = (struct process_info *) entry;
+
+ if (process->stopped)
+ return 0;
+
+ return 1;
+}
+
+static int
+linux_signal_pid ()
+{
+ struct inferior_list_entry *process;
+
+ process = find_inferior (&all_processes, unstopped_p, NULL);
+
+ if (process == NULL)
+ {
+ warning ("no unstopped process");
+ return inferior_pid;
+ }
+
+ return pid_of ((struct process_info *) process);
}
@@ -578,13 +1269,24 @@ static struct target_ops linux_target_ops = {
linux_read_memory,
linux_write_memory,
linux_look_up_symbols,
+ linux_signal_pid,
};
+static void
+linux_init_signals ()
+{
+ /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads
+ to find what the cancel signal actually is. */
+ signal (SIGRTMIN+1, SIG_IGN);
+}
+
void
initialize_low (void)
{
+ using_threads = 0;
set_target_ops (&linux_target_ops);
set_breakpoint_data (the_low_target.breakpoint,
the_low_target.breakpoint_len);
init_registers ();
+ linux_init_signals ();
}
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index b484982e15e..bae76b77bdc 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -19,12 +19,21 @@
Boston, MA 02111-1307, USA. */
#ifdef HAVE_LINUX_REGSETS
-typedef void (*regset_func) (void *);
+typedef void (*regset_fill_func) (void *);
+typedef void (*regset_store_func) (const void *);
+enum regset_type {
+ GENERAL_REGS,
+ FP_REGS,
+ EXTENDED_REGS,
+};
+
struct regset_info
{
int get_request, set_request;
int size;
- regset_func fill_function, store_function;
+ enum regset_type type;
+ regset_fill_func fill_function;
+ regset_store_func store_function;
};
extern struct regset_info target_regsets[];
#endif
@@ -39,11 +48,67 @@ struct linux_target_ops
store the register, and 2 if failure to store the register
is acceptable. */
int (*cannot_store_register) (int);
- CORE_ADDR (*stop_pc) (void);
+ CORE_ADDR (*get_pc) (void);
void (*set_pc) (CORE_ADDR newpc);
const char *breakpoint;
int breakpoint_len;
CORE_ADDR (*breakpoint_reinsert_addr) (void);
+
+
+ int decr_pc_after_break;
+ int (*breakpoint_at) (CORE_ADDR pc);
};
extern struct linux_target_ops the_low_target;
+
+#define get_process(inf) ((struct process_info *)(inf))
+#define get_thread_process(thr) (get_process (inferior_target_data (thr)))
+#define get_process_thread(proc) ((struct thread_info *) \
+ find_inferior_id (&all_threads, \
+ get_process (proc)->tid))
+
+struct process_info
+{
+ struct inferior_list_entry head;
+ int thread_known;
+ int lwpid;
+ int tid;
+
+ /* If this flag is set, the next SIGSTOP will be ignored (the process will
+ be immediately resumed). */
+ int stop_expected;
+
+ /* If this flag is set, the process is known to be stopped right now (stop
+ event already received in a wait()). */
+ int stopped;
+
+ /* If this flag is set, we have sent a SIGSTOP to this process and are
+ waiting for it to stop. */
+ int sigstop_sent;
+
+ /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet
+ been reported. */
+ int status_pending_p;
+ int status_pending;
+
+ /* If this flag is set, the pending status is a (GDB-placed) breakpoint. */
+ int pending_is_breakpoint;
+ CORE_ADDR pending_stop_pc;
+
+ /* If this is non-zero, it is a breakpoint to be reinserted at our next
+ stop (SIGTRAP stops only). */
+ CORE_ADDR bp_reinsert;
+
+ /* If this flag is set, the last continue operation on this process
+ was a single-step. */
+ int stepping;
+
+ /* If this is non-zero, it points to a chain of signals which need to
+ be delivered to this process. */
+ struct pending_signals *pending_signals;
+};
+extern struct inferior_list all_processes;
+
+void linux_attach_lwp (int pid, int tid);
+
+int thread_db_init (void);
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index f721ec94eeb..51e74cef140 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -96,9 +96,60 @@ mips_cannot_store_register (int regno)
return 0;
}
+static CORE_ADDR
+mips_get_pc ()
+{
+ unsigned long pc;
+ collect_register_by_name ("pc", &pc);
+ return pc;
+}
+
+static void
+mips_set_pc (CORE_ADDR pc)
+{
+ unsigned long newpc = pc;
+ supply_register_by_name ("pc", &newpc);
+}
+
+/* Correct in either endianness. */
+static const unsigned long mips_breakpoint = 0x0005000d;
+#define mips_breakpoint_len 4
+
+/* We only place breakpoints in empty marker functions, and thread locking
+ is outside of the function. So rather than importing software single-step,
+ we can just run until exit. */
+static CORE_ADDR
+mips_reinsert_addr ()
+{
+ unsigned long pc;
+ collect_register_by_name ("ra", &pc);
+ return pc;
+}
+
+static int
+mips_breakpoint_at (CORE_ADDR where)
+{
+ unsigned long insn;
+
+ (*the_target->read_memory) (where, (char *) &insn, 4);
+ if (insn == mips_breakpoint)
+ return 1;
+
+ /* If necessary, recognize more trap instructions here. GDB only uses the
+ one. */
+ return 0;
+}
+
struct linux_target_ops the_low_target = {
mips_num_regs,
mips_regmap,
mips_cannot_fetch_register,
mips_cannot_store_register,
+ mips_get_pc,
+ mips_set_pc,
+ (const char *) &mips_breakpoint,
+ mips_breakpoint_len,
+ mips_reinsert_addr,
+ 0,
+ mips_breakpoint_at,
};
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 7cb315a304a..2bb0f50034e 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -64,9 +64,53 @@ ppc_cannot_fetch_register (int regno)
return 0;
}
+static CORE_ADDR
+ppc_get_pc (void)
+{
+ unsigned long pc;
+
+ collect_register_by_name ("pc", &pc);
+ return (CORE_ADDR) pc;
+}
+
+static void
+ppc_set_pc (CORE_ADDR pc)
+{
+ unsigned long newpc = pc;
+
+ supply_register_by_name ("pc", &newpc);
+}
+
+/* Correct in either endianness. Note that this file is
+ for PowerPC only, not PowerPC64.
+ This instruction is "twge r2, r2", which GDB uses as a software
+ breakpoint. */
+static const unsigned long ppc_breakpoint = 0x7d821008;
+#define ppc_breakpoint_len 4
+
+static int
+ppc_breakpoint_at (CORE_ADDR where)
+{
+ unsigned long insn;
+
+ (*the_target->read_memory) (where, (char *) &insn, 4);
+ if (insn == ppc_breakpoint)
+ return 1;
+ /* If necessary, recognize more trap instructions here. GDB only uses the
+ one. */
+ return 0;
+}
+
struct linux_target_ops the_low_target = {
ppc_num_regs,
ppc_regmap,
ppc_cannot_fetch_register,
ppc_cannot_store_register,
+ ppc_get_pc,
+ ppc_set_pc,
+ (const char *) &ppc_breakpoint,
+ ppc_breakpoint_len,
+ NULL,
+ 0,
+ ppc_breakpoint_at,
};
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index cdc390d2332..ee84561f17c 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -57,9 +57,49 @@ sh_cannot_fetch_register (int regno)
return 0;
}
+static CORE_ADDR
+sh_get_pc ()
+{
+ unsigned long pc;
+ collect_register_by_name ("pc", &pc);
+ return pc;
+}
+
+static void
+sh_set_pc (CORE_ADDR pc)
+{
+ unsigned long newpc = pc;
+ supply_register_by_name ("pc", &newpc);
+}
+
+/* Correct in either endianness, obviously. */
+static const unsigned short sh_breakpoint = 0xc3c3;
+#define sh_breakpoint_len 2
+
+static int
+sh_breakpoint_at (CORE_ADDR where)
+{
+ unsigned short insn;
+
+ (*the_target->read_memory) (where, (char *) &insn, 2);
+ if (insn == sh_breakpoint)
+ return 1;
+
+ /* If necessary, recognize more trap instructions here. GDB only uses the
+ one. */
+ return 0;
+}
+
struct linux_target_ops the_low_target = {
sh_num_regs,
sh_regmap,
sh_cannot_fetch_register,
sh_cannot_store_register,
+ sh_get_pc,
+ sh_set_pc,
+ (const char *) &sh_breakpoint,
+ sh_breakpoint_len,
+ NULL,
+ 0,
+ sh_breakpoint_at,
};
diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c
index e1248904aba..4ee1ae48190 100644
--- a/gdb/gdbserver/linux-x86-64-low.c
+++ b/gdb/gdbserver/linux-x86-64-low.c
@@ -28,17 +28,17 @@
#include <sys/procfs.h>
#include <sys/ptrace.h>
-#define X86_64_NUM_GREGS 22
-
-static int x86_64_regmap[X86_64_NUM_GREGS] = {
- RAX, RBX, RCX, RDX,
- RSI, RDI, RBP, RSP,
- R8, R9, R10, R11,
- R12, R13, R14, R15,
- RIP, EFLAGS,
- DS, ES, FS, GS
+static int x86_64_regmap[] = {
+ RAX * 8, RBX * 8, RCX * 8, RDX * 8,
+ RSI * 8, RDI * 8, RBP * 8, RSP * 8,
+ R8 * 8, R9 * 8, R10 * 8, R11 * 8,
+ R12 * 8, R13 * 8, R14 * 8, R15 * 8,
+ RIP * 8, EFLAGS * 8, CS * 8, SS * 8,
+ DS * 8, ES * 8, FS * 8, GS * 8
};
+#define X86_64_NUM_GREGS (sizeof(x86_64_regmap)/sizeof(int))
+
static void
x86_64_fill_gregset (void *buf)
{
@@ -49,7 +49,7 @@ x86_64_fill_gregset (void *buf)
}
static void
-x86_64_store_gregset (void *buf)
+x86_64_store_gregset (const void *buf)
{
int i;
@@ -64,17 +64,19 @@ x86_64_fill_fpregset (void *buf)
}
static void
-x86_64_store_fpregset (void *buf)
+x86_64_store_fpregset (const void *buf)
{
i387_fxsave_to_cache (buf);
}
struct regset_info target_regsets[] = {
{ PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
+ GENERAL_REGS,
x86_64_fill_gregset, x86_64_store_gregset },
{ PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t),
+ FP_REGS,
x86_64_fill_fpregset, x86_64_store_fpregset },
- { 0, 0, -1, NULL, NULL }
+ { 0, 0, -1, -1, NULL, NULL }
};
struct linux_target_ops the_low_target = {
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index 701d09232f8..be3b3a7f33e 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -25,8 +25,13 @@
#include <stdlib.h>
#include <string.h>
+/* The private data for the register cache. Note that we have one
+ per inferior; this is primarily for simplicity, as the performance
+ benefit is minimal. */
+
struct inferior_regcache_data
{
+ int registers_valid;
char *registers;
};
@@ -38,7 +43,7 @@ static int num_registers;
const char **gdbserver_expedite_regs;
static struct inferior_regcache_data *
-get_regcache (struct inferior_info *inf)
+get_regcache (struct thread_info *inf, int fetch)
{
struct inferior_regcache_data *regcache;
@@ -47,17 +52,50 @@ get_regcache (struct inferior_info *inf)
if (regcache == NULL)
fatal ("no register cache");
+ /* FIXME - fetch registers for INF */
+ if (fetch && regcache->registers_valid == 0)
+ {
+ fetch_inferior_registers (0);
+ regcache->registers_valid = 1;
+ }
+
return regcache;
}
+void
+regcache_invalidate_one (struct inferior_list_entry *entry)
+{
+ struct thread_info *thread = (struct thread_info *) entry;
+ struct inferior_regcache_data *regcache;
+
+ regcache = (struct inferior_regcache_data *) inferior_regcache_data (thread);
+
+ if (regcache->registers_valid)
+ {
+ struct thread_info *saved_inferior = current_inferior;
+
+ current_inferior = thread;
+ store_inferior_registers (-1);
+ current_inferior = saved_inferior;
+ }
+
+ regcache->registers_valid = 0;
+}
+
+void
+regcache_invalidate ()
+{
+ for_each_inferior (&all_threads, regcache_invalidate_one);
+}
+
int
registers_length (void)
{
return 2 * register_bytes;
}
-void
-create_register_cache (struct inferior_info *inferior)
+void *
+new_register_cache (void)
{
struct inferior_regcache_data *regcache;
@@ -67,15 +105,19 @@ create_register_cache (struct inferior_info *inferior)
if (regcache->registers == NULL)
fatal ("Could not allocate register cache.");
- set_inferior_regcache_data (inferior, regcache);
+ regcache->registers_valid = 0;
+
+ return regcache;
}
void
-free_register_cache (struct inferior_info *inferior)
+free_register_cache (void *regcache_p)
{
- free (get_regcache (current_inferior)->registers);
- free (get_regcache (current_inferior));
- set_inferior_regcache_data (inferior, NULL);
+ struct inferior_regcache_data *regcache
+ = (struct inferior_regcache_data *) regcache_p;
+
+ free (regcache->registers);
+ free (regcache);
}
void
@@ -99,7 +141,7 @@ set_register_cache (struct reg *regs, int n)
void
registers_to_string (char *buf)
{
- char *registers = get_regcache (current_inferior)->registers;
+ char *registers = get_regcache (current_inferior, 1)->registers;
convert_int_to_ascii (registers, buf, register_bytes);
}
@@ -108,7 +150,7 @@ void
registers_from_string (char *buf)
{
int len = strlen (buf);
- char *registers = get_regcache (current_inferior)->registers;
+ char *registers = get_regcache (current_inferior, 1)->registers;
if (len != register_bytes * 2)
{
@@ -155,10 +197,10 @@ register_size (int n)
return reg_defs[n].size / 8;
}
-char *
-register_data (int n)
+static char *
+register_data (int n, int fetch)
{
- char *registers = get_regcache (current_inferior)->registers;
+ char *registers = get_regcache (current_inferior, fetch)->registers;
return registers + (reg_defs[n].offset / 8);
}
@@ -166,7 +208,7 @@ register_data (int n)
void
supply_register (int n, const void *buf)
{
- memcpy (register_data (n), buf, register_size (n));
+ memcpy (register_data (n, 0), buf, register_size (n));
}
void
@@ -178,7 +220,13 @@ supply_register_by_name (const char *name, const void *buf)
void
collect_register (int n, void *buf)
{
- memcpy (buf, register_data (n), register_size (n));
+ memcpy (buf, register_data (n, 1), register_size (n));
+}
+
+void
+collect_register_as_string (int n, char *buf)
+{
+ convert_int_to_ascii (register_data (n, 1), buf, register_size (n));
}
void
diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h
index 362288ee049..930bd9cbfe6 100644
--- a/gdb/gdbserver/regcache.h
+++ b/gdb/gdbserver/regcache.h
@@ -21,15 +21,20 @@
#ifndef REGCACHE_H
#define REGCACHE_H
-struct inferior_info;
+struct inferior_list_entry;
/* Create a new register cache for INFERIOR. */
-void create_register_cache (struct inferior_info *inferior);
+void *new_register_cache (void);
/* Release all memory associated with the register cache for INFERIOR. */
-void free_register_cache (struct inferior_info *inferior);
+void free_register_cache (void *regcache);
+
+/* Invalidate cached registers for one or all threads. */
+
+void regcache_invalidate_one (struct inferior_list_entry *);
+void regcache_invalidate (void);
/* Convert all registers to a string in the currently specified remote
format. */
@@ -48,8 +53,6 @@ int registers_length (void);
struct reg *find_register_by_number (int n);
-char *register_data (int n);
-
int register_size (int n);
int find_regno (const char *name);
@@ -62,6 +65,8 @@ void supply_register_by_name (const char *name, const void *buf);
void collect_register (int n, void *buf);
+void collect_register_as_string (int n, char *buf);
+
void collect_register_by_name (const char *name, void *buf);
#endif /* REGCACHE_H */
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 14734f161bd..c610c4c0e7c 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -42,6 +42,10 @@ struct ui_file *gdb_stdlog;
static int remote_desc;
+/* FIXME headerize? */
+extern int using_threads;
+extern int debug_threads;
+
/* Open a connection to a remote debugger.
NAME is the filename used for communication. */
@@ -296,10 +300,17 @@ putpkt (char *buf)
}
if (remote_debug)
- printf ("putpkt (\"%s\"); [looking for ack]\n", buf2);
+ {
+ fprintf (stderr, "putpkt (\"%s\"); [looking for ack]\n", buf2);
+ fflush (stderr);
+ }
cc = read (remote_desc, buf3, 1);
if (remote_debug)
- printf ("[received '%c' (0x%x)]\n", buf3[0], buf3[0]);
+ {
+ fprintf (stderr, "[received '%c' (0x%x)]\n", buf3[0], buf3[0]);
+ fflush (stderr);
+ }
+
if (cc <= 0)
{
if (cc == 0)
@@ -310,6 +321,10 @@ putpkt (char *buf)
free (buf2);
return -1;
}
+
+ /* Check for an input interrupt while we're here. */
+ if (buf3[0] == '\003')
+ kill ((*the_target->signal_pid) (), SIGINT);
}
while (buf3[0] != '+');
@@ -346,7 +361,7 @@ input_interrupt (int unused)
return;
}
- kill (signal_pid, SIGINT);
+ kill ((*the_target->signal_pid) (), SIGINT);
}
}
@@ -411,7 +426,11 @@ getpkt (char *buf)
if (c == '$')
break;
if (remote_debug)
- printf ("[getpkt: discarding char '%c']\n", c);
+ {
+ fprintf (stderr, "[getpkt: discarding char '%c']\n", c);
+ fflush (stderr);
+ }
+
if (c < 0)
return -1;
}
@@ -441,12 +460,19 @@ getpkt (char *buf)
}
if (remote_debug)
- printf ("getpkt (\"%s\"); [sending ack] \n", buf);
+ {
+ fprintf (stderr, "getpkt (\"%s\"); [sending ack] \n", buf);
+ fflush (stderr);
+ }
write (remote_desc, "+", 1);
if (remote_debug)
- printf ("[sent ack]\n");
+ {
+ fprintf (stderr, "[sent ack]\n");
+ fflush (stderr);
+ }
+
return bp - buf;
}
@@ -499,8 +525,6 @@ convert_ascii_to_int (char *from, char *to, int n)
static char *
outreg (int regno, char *buf)
{
- int regsize = register_size (regno);
-
if ((regno >> 12) != 0)
*buf++ = tohex ((regno >> 12) & 0xf);
if ((regno >> 8) != 0)
@@ -508,14 +532,47 @@ outreg (int regno, char *buf)
*buf++ = tohex ((regno >> 4) & 0xf);
*buf++ = tohex (regno & 0xf);
*buf++ = ':';
- convert_int_to_ascii (register_data (regno), buf, regsize);
- buf += 2 * regsize;
+ collect_register_as_string (regno, buf);
+ buf += 2 * register_size (regno);
*buf++ = ';';
return buf;
}
void
+new_thread_notify (int id)
+{
+ char own_buf[256];
+
+ /* The `n' response is not yet part of the remote protocol. Do nothing. */
+ if (1)
+ return;
+
+ if (server_waiting == 0)
+ return;
+
+ sprintf (own_buf, "n%x", id);
+ disable_async_io ();
+ putpkt (own_buf);
+ enable_async_io ();
+}
+
+void
+dead_thread_notify (int id)
+{
+ char own_buf[256];
+
+ /* The `x' response is not yet part of the remote protocol. Do nothing. */
+ if (1)
+ return;
+
+ sprintf (own_buf, "x%x", id);
+ disable_async_io ();
+ putpkt (own_buf);
+ enable_async_io ();
+}
+
+void
prepare_resume_reply (char *buf, char status, unsigned char signo)
{
int nib, sig;
@@ -538,12 +595,23 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
regp ++;
}
- /* If the debugger hasn't used any thread features, don't burden it with
- threads. If we didn't check this, GDB 4.13 and older would choke. */
- if (cont_thread != 0)
+ /* Formerly, if the debugger had not used any thread features we would not
+ burden it with a thread status response. This was for the benefit of
+ GDB 4.13 and older. However, in recent GDB versions the check
+ (``if (cont_thread != 0)'') does not have the desired effect because of
+ sillyness in the way that the remote protocol handles specifying a thread.
+ Since thread support relies on qSymbol support anyway, assume GDB can handle
+ threads. */
+
+ if (using_threads)
{
+ /* FIXME right place to set this? */
+ thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id;
+ if (debug_threads)
+ fprintf (stderr, "Writing resume reply for %d\n\n", thread_from_wait);
if (old_thread_from_wait != thread_from_wait)
{
+ general_thread = thread_from_wait;
sprintf (buf, "thread:%x;", thread_from_wait);
buf += strlen (buf);
old_thread_from_wait = thread_from_wait;
@@ -620,7 +688,11 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp)
{
/* Malformed response. */
if (remote_debug)
- fprintf (stderr, "Malformed response to qSymbol, ignoring.\n");
+ {
+ fprintf (stderr, "Malformed response to qSymbol, ignoring.\n");
+ fflush (stderr);
+ }
+
return -1;
}
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index a31547c9b39..b674ed0070f 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -23,9 +23,12 @@
int cont_thread;
int general_thread;
+int step_thread;
int thread_from_wait;
int old_thread_from_wait;
int extended_protocol;
+int server_waiting;
+
jmp_buf toplevel;
static unsigned char
@@ -33,11 +36,12 @@ start_inferior (char *argv[], char *statusptr)
{
/* FIXME Check error? Or turn to void. */
create_inferior (argv[0], argv);
- /* FIXME Print pid properly. */
- fprintf (stderr, "Process %s created; pid = %d\n", argv[0], signal_pid);
+
+ fprintf (stderr, "Process %s created; pid = %d\n", argv[0],
+ all_threads.head->id);
/* Wait till we are at 1st instruction in program, return signal number. */
- return mywait (statusptr);
+ return mywait (statusptr, 0);
}
static int
@@ -48,7 +52,7 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
if (myattach (pid) != 0)
return -1;
- *sigptr = mywait (statusptr);
+ *sigptr = mywait (statusptr, 0);
return 0;
}
@@ -59,6 +63,8 @@ extern int remote_debug;
void
handle_query (char *own_buf)
{
+ static struct inferior_list_entry *thread_ptr;
+
if (strcmp ("qSymbol::", own_buf) == 0)
{
if (the_target->look_up_symbols != NULL)
@@ -68,6 +74,29 @@ handle_query (char *own_buf)
return;
}
+ if (strcmp ("qfThreadInfo", own_buf) == 0)
+ {
+ thread_ptr = all_threads.head;
+ sprintf (own_buf, "m%x", thread_ptr->id);
+ thread_ptr = thread_ptr->next;
+ return;
+ }
+
+ if (strcmp ("qsThreadInfo", own_buf) == 0)
+ {
+ if (thread_ptr != NULL)
+ {
+ sprintf (own_buf, "m%x", thread_ptr->id);
+ thread_ptr = thread_ptr->next;
+ return;
+ }
+ else
+ {
+ sprintf (own_buf, "l");
+ return;
+ }
+ }
+
/* Otherwise we didn't know what packet it was. Say we didn't
understand it. */
own_buf[0] = 0;
@@ -188,12 +217,16 @@ main (int argc, char *argv[])
case 'g':
general_thread = strtol (&own_buf[2], NULL, 16);
write_ok (own_buf);
- fetch_inferior_registers (0);
+ set_desired_inferior (1);
break;
case 'c':
cont_thread = strtol (&own_buf[2], NULL, 16);
write_ok (own_buf);
break;
+ case 's':
+ step_thread = strtol (&own_buf[2], NULL, 16);
+ write_ok (own_buf);
+ break;
default:
/* Silently ignore it so that gdb can extend the protocol
without compatibility headaches. */
@@ -202,11 +235,12 @@ main (int argc, char *argv[])
}
break;
case 'g':
+ set_desired_inferior (1);
registers_to_string (own_buf);
break;
case 'G':
+ set_desired_inferior (1);
registers_from_string (&own_buf[1]);
- store_inferior_registers (-1);
write_ok (own_buf);
break;
case 'm':
@@ -227,8 +261,9 @@ main (int argc, char *argv[])
signal = target_signal_to_host (sig);
else
signal = 0;
+ set_desired_inferior (0);
myresume (0, signal);
- signal = mywait (&status);
+ signal = mywait (&status, 1);
prepare_resume_reply (own_buf, status, signal);
break;
case 'S':
@@ -237,18 +272,21 @@ main (int argc, char *argv[])
signal = target_signal_to_host (sig);
else
signal = 0;
+ set_desired_inferior (0);
myresume (1, signal);
- signal = mywait (&status);
+ signal = mywait (&status, 1);
prepare_resume_reply (own_buf, status, signal);
break;
case 'c':
+ set_desired_inferior (0);
myresume (0, 0);
- signal = mywait (&status);
+ signal = mywait (&status, 1);
prepare_resume_reply (own_buf, status, signal);
break;
case 's':
+ set_desired_inferior (0);
myresume (1, 0);
- signal = mywait (&status);
+ signal = mywait (&status, 1);
prepare_resume_reply (own_buf, status, signal);
break;
case 'k':
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 32b90b5bcc7..746502b3d63 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -54,8 +54,21 @@
least the size of a (void *). */
typedef long long CORE_ADDR;
-/* Opaque inferior process information. */
-struct inferior_info;
+/* Generic information for tracking a list of ``inferiors'' - threads,
+ processes, etc. */
+struct inferior_list
+{
+ struct inferior_list_entry *head;
+ struct inferior_list_entry *tail;
+};
+struct inferior_list_entry
+{
+ int id;
+ struct inferior_list_entry *next;
+};
+
+/* Opaque type for user-visible threads. */
+struct thread_info;
#include "regcache.h"
#include "gdb/signals.h"
@@ -67,27 +80,41 @@ struct inferior_info;
void initialize_low ();
-/* Target-specific variables */
-
-extern char *registers;
-
/* From inferiors.c. */
-extern struct inferior_info *current_inferior;
-extern int signal_pid;
-void add_inferior (int pid);
+extern struct inferior_list all_threads;
+void add_inferior_to_list (struct inferior_list *list,
+ struct inferior_list_entry *new_inferior);
+void for_each_inferior (struct inferior_list *list,
+ void (*action) (struct inferior_list_entry *));
+extern struct thread_info *current_inferior;
+void remove_inferior (struct inferior_list *list,
+ struct inferior_list_entry *entry);
+void remove_thread (struct thread_info *thread);
+void add_thread (int thread_id, void *target_data);
void clear_inferiors (void);
-void *inferior_target_data (struct inferior_info *);
-void set_inferior_target_data (struct inferior_info *, void *);
-void *inferior_regcache_data (struct inferior_info *);
-void set_inferior_regcache_data (struct inferior_info *, void *);
+struct inferior_list_entry *find_inferior
+ (struct inferior_list *,
+ int (*func) (struct inferior_list_entry *,
+ void *),
+ void *arg);
+struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
+ int id);
+void *inferior_target_data (struct thread_info *);
+void set_inferior_target_data (struct thread_info *, void *);
+void *inferior_regcache_data (struct thread_info *);
+void set_inferior_regcache_data (struct thread_info *, void *);
+void change_inferior_id (struct inferior_list *list,
+ int new_id);
/* Public variables in server.c */
extern int cont_thread;
extern int general_thread;
+extern int step_thread;
extern int thread_from_wait;
extern int old_thread_from_wait;
+extern int server_waiting;
extern jmp_buf toplevel;
@@ -103,6 +130,8 @@ void enable_async_io (void);
void disable_async_io (void);
void convert_ascii_to_int (char *from, char *to, int n);
void convert_int_to_ascii (char *from, char *to, int n);
+void new_thread_notify (int id);
+void dead_thread_notify (int id);
void prepare_resume_reply (char *buf, char status, unsigned char sig);
void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 53a4c1ef55a..1c2860a11e9 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -26,6 +26,38 @@
struct target_ops *the_target;
void
+set_desired_inferior (int use_general)
+{
+ struct thread_info *found;
+
+ if (use_general == 1)
+ {
+ found = (struct thread_info *) find_inferior_id (&all_threads,
+ general_thread);
+ }
+ else
+ {
+ found = NULL;
+
+ /* If we are continuing any (all) thread(s), use step_thread
+ to decide which thread to step and/or send the specified
+ signal to. */
+ if (step_thread > 0 && (cont_thread == 0 || cont_thread == -1))
+ found = (struct thread_info *) find_inferior_id (&all_threads,
+ step_thread);
+
+ if (found == NULL)
+ found = (struct thread_info *) find_inferior_id (&all_threads,
+ cont_thread);
+ }
+
+ if (found == NULL)
+ current_inferior = (struct thread_info *) all_threads.head;
+ else
+ current_inferior = found;
+}
+
+void
read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
(*the_target->read_memory) (memaddr, myaddr, len);
@@ -33,10 +65,41 @@ read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
}
int
-write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len)
+{
+ /* Lacking cleanups, there is some potential for a memory leak if the
+ write fails and we go through error(). Make sure that no more than
+ one buffer is ever pending by making BUFFER static. */
+ static char *buffer = 0;
+ int res;
+
+ if (buffer != NULL)
+ free (buffer);
+
+ buffer = malloc (len);
+ memcpy (buffer, myaddr, len);
+ check_mem_write (memaddr, buffer, len);
+ res = (*the_target->write_memory) (memaddr, buffer, len);
+ free (buffer);
+ buffer = NULL;
+
+ return res;
+}
+
+unsigned char
+mywait (char *statusp, int connected_wait)
{
- check_mem_write (memaddr, myaddr, len);
- return (*the_target->write_memory) (memaddr, myaddr, len);
+ unsigned char ret;
+
+ if (connected_wait)
+ server_waiting = 1;
+
+ ret = (*the_target->wait) (statusp);
+
+ if (connected_wait)
+ server_waiting = 0;
+
+ return ret;
}
void
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 6d06b9fd4ab..c6aeee6f562 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -104,6 +104,11 @@ struct target_ops
symbols. */
void (*look_up_symbols) (void);
+
+ /* Return the PID we should send a signal to. Used for asynchronous
+ interrupts (user hitting Control-C). */
+
+ int (*signal_pid) (void);
};
extern struct target_ops *the_target;
@@ -125,17 +130,18 @@ void set_target_ops (struct target_ops *);
#define myresume(step,signo) \
(*the_target->resume) (step, signo)
-#define mywait(statusp) \
- (*the_target->wait) (statusp)
-
#define fetch_inferior_registers(regno) \
(*the_target->fetch_registers) (regno)
#define store_inferior_registers(regno) \
(*the_target->store_registers) (regno)
+unsigned char mywait (char *statusp, int connected_wait);
+
void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
-int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
+int write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len);
+
+void set_desired_inferior (int id);
#endif /* TARGET_H */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 0f757f5a122..6ebbf2db1b6 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -92,6 +92,8 @@ struct type *builtin_type_v8qi;
struct type *builtin_type_v8hi;
struct type *builtin_type_v4hi;
struct type *builtin_type_v2si;
+struct type *builtin_type_vec64;
+struct type *builtin_type_vec64i;
struct type *builtin_type_vec128;
struct type *builtin_type_vec128i;
struct type *builtin_type_ieee_single_big;
@@ -130,7 +132,7 @@ static void add_mangled_type (struct extra *, struct type *);
static void cfront_mangle_name (struct type *, int, int);
#endif
static void print_bit_vector (B_TYPE *, int);
-static void print_arg_types (struct type **, int);
+static void print_arg_types (struct field *, int, int);
static void dump_fn_fieldlists (struct type *, int);
static void print_cplus_stuff (struct type *, int);
static void virtual_base_list_aux (struct type *dclass);
@@ -579,7 +581,6 @@ allocate_stub_method (struct type *type)
TYPE_OBJFILE (type));
TYPE_TARGET_TYPE (mtype) = type;
/* _DOMAIN_TYPE (mtype) = unknown yet */
- /* _ARG_TYPES (mtype) = unknown yet */
return (mtype);
}
@@ -820,6 +821,64 @@ init_vector_type (struct type *elt_type, int n)
}
static struct type *
+build_builtin_type_vec64 (void)
+{
+ /* Construct a type for the 64 bit registers. The type we're
+ building is this: */
+#if 0
+ union __gdb_builtin_type_vec64
+ {
+ int64_t uint64;
+ float v2_float[2];
+ int32_t v2_int32[2];
+ int16_t v4_int16[4];
+ int8_t v8_int8[8];
+ };
+#endif
+
+ struct type *t;
+
+ t = init_composite_type ("__gdb_builtin_type_vec64", TYPE_CODE_UNION);
+ append_composite_type_field (t, "uint64", builtin_type_int64);
+ append_composite_type_field (t, "v2_float", builtin_type_v2_float);
+ append_composite_type_field (t, "v2_int32", builtin_type_v2_int32);
+ append_composite_type_field (t, "v4_int16", builtin_type_v4_int16);
+ append_composite_type_field (t, "v8_int8", builtin_type_v8_int8);
+
+ TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+ TYPE_NAME (t) = "builtin_type_vec64";
+ return t;
+}
+
+static struct type *
+build_builtin_type_vec64i (void)
+{
+ /* Construct a type for the 64 bit registers. The type we're
+ building is this: */
+#if 0
+ union __gdb_builtin_type_vec64i
+ {
+ int64_t uint64;
+ int32_t v2_int32[2];
+ int16_t v4_int16[4];
+ int8_t v8_int8[8];
+ };
+#endif
+
+ struct type *t;
+
+ t = init_composite_type ("__gdb_builtin_type_vec64i", TYPE_CODE_UNION);
+ append_composite_type_field (t, "uint64", builtin_type_int64);
+ append_composite_type_field (t, "v2_int32", builtin_type_v2_int32);
+ append_composite_type_field (t, "v4_int16", builtin_type_v4_int16);
+ append_composite_type_field (t, "v8_int8", builtin_type_v8_int8);
+
+ TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+ TYPE_NAME (t) = "builtin_type_vec64i";
+ return t;
+}
+
+static struct type *
build_builtin_type_vec128 (void)
{
/* Construct a type for the 128 bit registers. The type we're
@@ -844,6 +903,8 @@ build_builtin_type_vec128 (void)
append_composite_type_field (t, "v8_int16", builtin_type_v8_int16);
append_composite_type_field (t, "v16_int8", builtin_type_v16_int8);
+ TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+ TYPE_NAME (t) = "builtin_type_vec128";
return t;
}
@@ -862,6 +923,8 @@ build_builtin_type_vec128i (void)
append_composite_type_field (t, "v2_int64", builtin_type_v2_int64);
append_composite_type_field (t, "uint128", builtin_type_int128);
+ TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR;
+ TYPE_NAME (t) = "builtin_type_vec128i";
return t;
}
@@ -900,7 +963,8 @@ smash_to_member_type (struct type *type, struct type *domain,
void
smash_to_method_type (struct type *type, struct type *domain,
- struct type *to_type, struct type **args)
+ struct type *to_type, struct field *args,
+ int nargs, int varargs)
{
struct objfile *objfile;
@@ -910,7 +974,10 @@ smash_to_method_type (struct type *type, struct type *domain,
TYPE_OBJFILE (type) = objfile;
TYPE_TARGET_TYPE (type) = to_type;
TYPE_DOMAIN_TYPE (type) = domain;
- TYPE_ARG_TYPES (type) = args;
+ TYPE_FIELDS (type) = args;
+ TYPE_NFIELDS (type) = nargs;
+ if (varargs)
+ TYPE_FLAGS (type) |= TYPE_FLAG_VARARGS;
TYPE_LENGTH (type) = 1; /* In practice, this is never needed. */
TYPE_CODE (type) = TYPE_CODE_METHOD;
}
@@ -1614,7 +1681,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
DMGL_PARAMS | DMGL_ANSI);
char *argtypetext, *p;
int depth = 0, argcount = 1;
- struct type **argtypes;
+ struct field *argtypes;
struct type *mtype;
/* Make sure we got back a function string that we can use. */
@@ -1647,11 +1714,14 @@ check_stub_method (struct type *type, int method_id, int signature_id)
p += 1;
}
- /* We need two more slots: one for the THIS pointer, and one for the
- NULL [...] or void [end of arglist]. */
+ /* If we read one argument and it was ``void'', don't count it. */
+ if (strncmp (argtypetext, "(void)", 6) == 0)
+ argcount -= 1;
- argtypes = (struct type **)
- TYPE_ALLOC (type, (argcount + 2) * sizeof (struct type *));
+ /* We need one extra slot, for the THIS pointer. */
+
+ argtypes = (struct field *)
+ TYPE_ALLOC (type, (argcount + 1) * sizeof (struct field));
p = argtypetext;
/* Add THIS pointer for non-static methods. */
@@ -1660,7 +1730,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
argcount = 0;
else
{
- argtypes[0] = lookup_pointer_type (type);
+ argtypes[0].type = lookup_pointer_type (type);
argcount = 1;
}
@@ -1671,10 +1741,12 @@ check_stub_method (struct type *type, int method_id, int signature_id)
{
if (depth <= 0 && (*p == ',' || *p == ')'))
{
- /* Avoid parsing of ellipsis, they will be handled below. */
- if (strncmp (argtypetext, "...", p - argtypetext) != 0)
+ /* Avoid parsing of ellipsis, they will be handled below.
+ Also avoid ``void'' as above. */
+ if (strncmp (argtypetext, "...", p - argtypetext) != 0
+ && strncmp (argtypetext, "void", p - argtypetext) != 0)
{
- argtypes[argcount] =
+ argtypes[argcount].type =
safe_parse_type (argtypetext, p - argtypetext);
argcount += 1;
}
@@ -1694,25 +1766,19 @@ check_stub_method (struct type *type, int method_id, int signature_id)
}
}
- if (p[-2] != '.') /* Not '...' */
- {
- argtypes[argcount] = builtin_type_void; /* List terminator */
- }
- else
- {
- argtypes[argcount] = NULL; /* Ellist terminator */
- }
-
- xfree (demangled_name);
-
TYPE_FN_FIELD_PHYSNAME (f, signature_id) = mangled_name;
/* Now update the old "stub" type into a real type. */
mtype = TYPE_FN_FIELD_TYPE (f, signature_id);
TYPE_DOMAIN_TYPE (mtype) = type;
- TYPE_ARG_TYPES (mtype) = argtypes;
+ TYPE_FIELDS (mtype) = argtypes;
+ TYPE_NFIELDS (mtype) = argcount;
TYPE_FLAGS (mtype) &= ~TYPE_FLAG_STUB;
TYPE_FN_FIELD_STUB (f, signature_id) = 0;
+ if (p[-2] == '.')
+ TYPE_FLAGS (mtype) |= TYPE_FLAG_VARARGS;
+
+ xfree (demangled_name);
}
const struct cplus_struct_type cplus_struct_default;
@@ -1886,21 +1952,23 @@ is_integral_type (struct type *t)
|| (TYPE_CODE (t) == TYPE_CODE_BOOL)));
}
-/* Chill varying string and arrays are represented as follows:
+/* (OBSOLETE) Chill (OBSOLETE) varying string and arrays are
+ represented as follows:
struct { int __var_length; ELEMENT_TYPE[MAX_SIZE] __var_data};
- Return true if TYPE is such a Chill varying type. */
+ Return true if TYPE is such a (OBSOLETE) Chill (OBSOLETE) varying
+ type. */
-int
-chill_varying_type (struct type *type)
-{
- if (TYPE_CODE (type) != TYPE_CODE_STRUCT
- || TYPE_NFIELDS (type) != 2
- || strcmp (TYPE_FIELD_NAME (type, 0), "__var_length") != 0)
- return 0;
- return 1;
-}
+/* OBSOLETE int */
+/* OBSOLETE chill_varying_type (struct type *type) */
+/* OBSOLETE { */
+/* OBSOLETE if (TYPE_CODE (type) != TYPE_CODE_STRUCT */
+/* OBSOLETE || TYPE_NFIELDS (type) != 2 */
+/* OBSOLETE || strcmp (TYPE_FIELD_NAME (type, 0), "__var_length") != 0) */
+/* OBSOLETE return 0; */
+/* OBSOLETE return 1; */
+/* OBSOLETE } */
/* Check whether BASE is an ancestor or base class or DCLASS
Return 1 if so, and 0 if not.
@@ -2703,25 +2771,18 @@ print_bit_vector (B_TYPE *bits, int nbits)
}
}
-/* The args list is a strange beast. It is either terminated by a NULL
- pointer for varargs functions, or by a pointer to a TYPE_CODE_VOID
- type for normal fixed argcount functions. (FIXME someday)
- Also note the first arg should be the "this" pointer, we may not want to
- include it since we may get into a infinitely recursive situation. */
+/* Note the first arg should be the "this" pointer, we may not want to
+ include it since we may get into a infinitely recursive situation. */
static void
-print_arg_types (struct type **args, int spaces)
+print_arg_types (struct field *args, int nargs, int spaces)
{
if (args != NULL)
{
- while (*args != NULL)
- {
- recursive_dump_type (*args, spaces + 2);
- if (TYPE_CODE (*args++) == TYPE_CODE_VOID)
- {
- break;
- }
- }
+ int i;
+
+ for (i = 0; i < nargs; i++)
+ recursive_dump_type (args[i].type, spaces + 2);
}
}
@@ -2766,7 +2827,9 @@ dump_fn_fieldlists (struct type *type, int spaces)
gdb_print_host_address (TYPE_FN_FIELD_ARGS (f, overload_idx), gdb_stdout);
printf_filtered ("\n");
- print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx), spaces);
+ print_arg_types (TYPE_FN_FIELD_ARGS (f, overload_idx),
+ TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (f, overload_idx)),
+ spaces);
printfi_filtered (spaces + 8, "fcontext ");
gdb_print_host_address (TYPE_FN_FIELD_FCONTEXT (f, overload_idx),
gdb_stdout);
@@ -3108,14 +3171,6 @@ recursive_dump_type (struct type *type, int spaces)
printfi_filtered (spaces, "vptr_fieldno %d\n", TYPE_VPTR_FIELDNO (type));
switch (TYPE_CODE (type))
{
- case TYPE_CODE_METHOD:
- case TYPE_CODE_FUNC:
- printfi_filtered (spaces, "arg_types ");
- gdb_print_host_address (TYPE_ARG_TYPES (type), gdb_stdout);
- puts_filtered ("\n");
- print_arg_types (TYPE_ARG_TYPES (type), spaces);
- break;
-
case TYPE_CODE_STRUCT:
printfi_filtered (spaces, "cplus_stuff ");
gdb_print_host_address (TYPE_CPLUS_SPECIFIC (type), gdb_stdout);
@@ -3333,7 +3388,9 @@ build_gdbtypes (void)
builtin_type_v4_int16 = init_vector_type (builtin_type_int16, 4);
builtin_type_v8_int8 = init_vector_type (builtin_type_int8, 8);
- /* Vector types. */
+ /* Vector types. */
+ builtin_type_vec64 = build_builtin_type_vec64 ();
+ builtin_type_vec64i = build_builtin_type_vec64i ();
builtin_type_vec128 = build_builtin_type_vec128 ();
builtin_type_vec128i = build_builtin_type_vec128i ();
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 9233bac2bb7..5c41398aabb 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -101,13 +101,14 @@ enum type_code
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
/* A string type which is like an array of character but prints
- differently (at least for CHILL). It does not contain a length
- field as Pascal strings (for many Pascals, anyway) do; if we want
- to deal with such strings, we should use a new type code. */
+ differently (at least for (OBSOLETE) CHILL (OBSOLETE)). It
+ does not contain a length field as Pascal strings (for many
+ Pascals, anyway) do; if we want to deal with such strings, we
+ should use a new type code. */
TYPE_CODE_STRING,
- /* String of bits; like TYPE_CODE_SET but prints differently (at least
- for CHILL). */
+ /* String of bits; like TYPE_CODE_SET but prints differently (at
+ least for (OBSOLETE) CHILL (OBSOLETE)). */
TYPE_CODE_BITSTRING,
/* Unknown type. The length field is valid if we were able to
@@ -240,10 +241,8 @@ enum type_code
#define TYPE_FLAG_DATA_SPACE (1 << 10)
#define TYPE_DATA_SPACE(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_FLAG_DATA_SPACE)
-/* FIXME: Kludge to mark a varargs function type for C++ member
- function argument processing. Currently only used in dwarf2read.c,
- but put it here so we won't accidentally overload the bit with
- another flag. */
+/* FIXME drow/2002-06-03: Only used for methods, but applies as well
+ to functions. */
#define TYPE_FLAG_VARARGS (1 << 11)
#define TYPE_VARARGS(t) (TYPE_FLAGS (t) & TYPE_FLAG_VARARGS)
@@ -354,7 +353,7 @@ struct main_type
For range types, there are two "fields",
the minimum and maximum values (both inclusive).
For enum types, each possible value is described by one "field".
- For a function type, a "field" for each parameter type.
+ For a function or method type, a "field" for each parameter.
For C++ classes, there is one field for each base class (if it is
a derived class) plus one field for each class data member. Member
functions are recorded elsewhere.
@@ -383,7 +382,7 @@ struct main_type
CORE_ADDR physaddr;
char *physname;
- /* For a function type, this is 1 if the argument is marked
+ /* For a function or member type, this is 1 if the argument is marked
artificial. Artificial arguments should not be shown to the
user. */
int artificial;
@@ -400,13 +399,14 @@ struct main_type
int bitsize;
/* In a struct or union type, type of this field.
- In a function type, type of this argument.
+ In a function or member type, type of this argument.
In an array type, the domain-type of the array. */
struct type *type;
/* Name of field, value or argument.
- NULL for range bounds and array domains. */
+ NULL for range bounds, array domains, and member function
+ arguments. */
char *name;
@@ -438,14 +438,6 @@ struct main_type
union type_specific
{
- /* ARG_TYPES is for TYPE_CODE_METHOD.
- Contains the type of each argument, ending with a void type
- after the last argument for normal member functions or a NULL
- pointer after the last argument for functions with variable
- arguments. */
-
- struct type **arg_types;
-
/* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
cplus_struct_default, a default static instance of a struct
cplus_struct_type. */
@@ -785,7 +777,6 @@ extern void allocate_cplus_struct_type (struct type *);
#define TYPE_NINSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->ninstantiations
#define TYPE_DECLARED_TYPE(thistype) TYPE_CPLUS_SPECIFIC(thistype)->declared_type
#define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific
-#define TYPE_ARG_TYPES(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.arg_types
#define TYPE_CPLUS_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff
#define TYPE_FLOATFORMAT(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.floatformat
#define TYPE_BASECLASS(thistype,index) TYPE_MAIN_TYPE(thistype)->fields[index].type
@@ -863,7 +854,7 @@ extern void allocate_cplus_struct_type (struct type *);
#define TYPE_FN_FIELD(thisfn, n) (thisfn)[n]
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n) (thisfn)[n].physname
#define TYPE_FN_FIELD_TYPE(thisfn, n) (thisfn)[n].type
-#define TYPE_FN_FIELD_ARGS(thisfn, n) TYPE_ARG_TYPES ((thisfn)[n].type)
+#define TYPE_FN_FIELD_ARGS(thisfn, n) TYPE_FIELDS ((thisfn)[n].type)
#define TYPE_FN_FIELD_CONST(thisfn, n) ((thisfn)[n].is_const)
#define TYPE_FN_FIELD_VOLATILE(thisfn, n) ((thisfn)[n].is_volatile)
#define TYPE_FN_FIELD_PRIVATE(thisfn, n) ((thisfn)[n].is_private)
@@ -961,6 +952,10 @@ extern struct type *builtin_type_v8hi;
extern struct type *builtin_type_v4hi;
extern struct type *builtin_type_v2si;
+/* Type for 64 bit vectors. */
+extern struct type *builtin_type_vec64;
+extern struct type *builtin_type_vec64i;
+
/* Type for 128 bit vectors. */
extern struct type *builtin_type_vec128;
extern struct type *builtin_type_vec128i;
@@ -1004,13 +999,13 @@ extern struct type *builtin_type_m2_card;
extern struct type *builtin_type_m2_real;
extern struct type *builtin_type_m2_bool;
-/* Chill types */
+/* OBSOLETE Chill types */
-extern struct type *builtin_type_chill_bool;
-extern struct type *builtin_type_chill_char;
-extern struct type *builtin_type_chill_long;
-extern struct type *builtin_type_chill_ulong;
-extern struct type *builtin_type_chill_real;
+/* OBSOLETE extern struct type *builtin_type_chill_bool; */
+/* OBSOLETE extern struct type *builtin_type_chill_char; */
+/* OBSOLETE extern struct type *builtin_type_chill_long; */
+/* OBSOLETE extern struct type *builtin_type_chill_ulong; */
+/* OBSOLETE extern struct type *builtin_type_chill_real; */
/* Fortran (F77) types */
@@ -1088,8 +1083,9 @@ extern struct type *make_type_with_address_space (struct type *type,
extern struct type *lookup_member_type (struct type *, struct type *);
extern void
-smash_to_method_type (struct type *, struct type *, struct type *,
- struct type **);
+smash_to_method_type (struct type *type, struct type *domain,
+ struct type *to_type, struct field *args,
+ int nargs, int varargs);
extern void
smash_to_member_type (struct type *, struct type *, struct type *);
@@ -1118,7 +1114,7 @@ extern struct type *create_string_type (struct type *, struct type *);
extern struct type *create_set_type (struct type *, struct type *);
-extern int chill_varying_type (struct type *);
+/* OBSOLETE extern int chill_varying_type (struct type *); */
extern struct type *lookup_unsigned_typename (char *);
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index 2b086c57f5e..fb31c44529f 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -189,7 +189,6 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
struct type *rtti_type;
CORE_ADDR coreptr;
struct value *vp;
- int using_enclosing = 0;
long top_offset = 0;
char rtti_type_name[256];
CORE_ADDR vtbl;
@@ -244,25 +243,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
if (VALUE_ADDRESS (value_field (v, TYPE_VPTR_FIELDNO (known_type))) == 0)
return NULL;
- /*
- If we are enclosed by something that isn't us, adjust the
- address properly and set using_enclosing.
- */
- if (VALUE_ENCLOSING_TYPE(v) != VALUE_TYPE(v))
- {
- struct value *tempval;
- int bitpos = TYPE_BASECLASS_BITPOS (known_type,
- TYPE_VPTR_FIELDNO (known_type));
- tempval=value_field (v, TYPE_VPTR_FIELDNO(known_type));
- VALUE_ADDRESS(tempval) += bitpos / 8;
- vtbl=value_as_address (tempval);
- using_enclosing=1;
- }
- else
- {
- vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
- using_enclosing=0;
- }
+ vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
/* Try to find a symbol that is the vtable */
minsym=lookup_minimal_symbol_by_pc(vtbl);
@@ -304,8 +285,6 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
if (full)
*full=1;
}
- if (using_enc)
- *using_enc=using_enclosing;
return rtti_type;
}
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index e86af89d557..fbab8af0a18 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -25,6 +25,7 @@
#include "cp-abi.h"
#include "demangle.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
static struct cp_abi_ops gnu_v3_abi_ops;
@@ -173,7 +174,7 @@ build_gdb_vtable_type (struct gdbarch *arch)
gdb_gnu_v3_abi_vtable' object to the vtable's "address point"
(i.e., where objects' virtual table pointers point). */
static int
-vtable_address_point_offset ()
+vtable_address_point_offset (void)
{
struct type *vtable_type = gdbarch_data (current_gdbarch,
vtable_type_gdbarch_data);
@@ -374,15 +375,11 @@ gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
{
struct type *vtable_type = gdbarch_data (current_gdbarch,
vtable_type_gdbarch_data);
- struct type *basetype = TYPE_BASECLASS (type, index);
- struct value *full_object, *vbase_object, *orig_object;
- struct value *vtable, *orig_typeinfo, *orig_base_info;
- struct type *orig_type, *vbasetype;
+ struct value *vtable;
+ struct type *vbasetype;
struct value *offset_val, *vbase_array;
CORE_ADDR vtable_address;
long int cur_base_offset, base_offset;
- int to_top;
- int baseclasses, i;
/* If it isn't a virtual base, this is easy. The offset is in the
type definition. */
@@ -405,15 +402,22 @@ gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
/ ((int) TYPE_LENGTH (builtin_type_void_data_ptr));
/* We're now looking for the cur_base_offset'th entry (negative index)
- in the vcall_and_vbase_offsets array. */
-
- orig_object = value_at_lazy (type, address, NULL);
- vbasetype = TYPE_VPTR_BASETYPE (VALUE_TYPE (orig_object));
- vbase_object = value_cast (vbasetype, orig_object);
-
- vtable_address
- = value_as_address (value_field (vbase_object,
- TYPE_VPTR_FIELDNO (vbasetype)));
+ in the vcall_and_vbase_offsets array. We used to cast the object to
+ its TYPE_VPTR_BASETYPE, and reference the vtable as TYPE_VPTR_FIELDNO;
+ however, that cast can not be done without calling baseclass_offset again
+ if the TYPE_VPTR_BASETYPE is a virtual base class, as described in the
+ v3 C++ ABI Section 2.4.I.2.b. Fortunately the ABI guarantees that the
+ vtable pointer will be located at the beginning of the object, so we can
+ bypass the casting. Verify that the TYPE_VPTR_FIELDNO is in fact at the
+ start of whichever baseclass it resides in, as a sanity measure. */
+
+ vbasetype = TYPE_VPTR_BASETYPE (type);
+ if (TYPE_FIELD_BITPOS (vbasetype, TYPE_VPTR_FIELDNO (vbasetype)) != 0)
+ error ("Illegal vptr offset in class %s",
+ TYPE_NAME (vbasetype) ? TYPE_NAME (vbasetype) : "<unknown>");
+
+ vtable_address = value_as_address (value_at_lazy (builtin_type_void_data_ptr,
+ address, NULL));
vtable = value_at_lazy (vtable_type,
vtable_address - vtable_address_point_offset (),
NULL);
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index b12897fda9d..f992d4bd6b9 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -27,7 +27,6 @@
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "dis-asm.h"
#include "gdbcmd.h"
@@ -142,7 +141,7 @@ h8300_skip_prologue (CORE_ADDR start_pc)
}
int
-gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info *info)
+gdb_print_insn_h8300 (bfd_vma memaddr, disassemble_info * info)
{
if (h8300smode)
return print_insn_h8300s (memaddr, info);
@@ -227,7 +226,7 @@ h8300_frame_find_saved_regs (struct frame_info *fi,
of the instruction. */
CORE_ADDR
-NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD *pword1)
+NEXT_PROLOGUE_INSN (CORE_ADDR addr, CORE_ADDR lim, INSN_WORD * pword1)
{
char buf[2];
if (addr < lim + 8)
@@ -390,14 +389,16 @@ examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
/* Locals are always reffed based from the fp */
fi->locals_pointer = after_prolog_fp;
/* The PC is at a known place */
- fi->from_pc = read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
+ fi->from_pc =
+ read_memory_unsigned_integer (after_prolog_fp + BINWORD, BINWORD);
/* Rememeber any others too */
in_frame[PC_REGNUM] = 0;
if (have_fp)
/* We keep the old FP in the SP spot */
- fsr->regs[SP_REGNUM] = read_memory_unsigned_integer (fsr->regs[6], BINWORD);
+ fsr->regs[SP_REGNUM] =
+ read_memory_unsigned_integer (fsr->regs[6], BINWORD);
else
fsr->regs[SP_REGNUM] = after_prolog_fp + auto_depth;
@@ -531,8 +532,7 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
sp = sp & ~stack_align;
/* Now make sure there's space on the stack */
- for (argnum = 0, stack_alloc = 0;
- argnum < nargs; argnum++)
+ for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + stack_align)
& ~stack_align);
sp -= stack_alloc; /* make room on stack for args */
@@ -563,8 +563,9 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
else
val = (char *) VALUE_CONTENTS (args[argnum]);
- if (len > (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM) ||
- (len > wordsize && (len & stack_align) != 0))
+ if (len >
+ (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM)
+ || (len > wordsize && (len & stack_align) != 0))
{ /* passed on the stack */
write_memory (sp + stack_offset, val,
len < wordsize ? wordsize : len);
@@ -573,7 +574,8 @@ h8300_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* NOTE WELL!!!!! This is not an "else if" clause!!!
That's because some *&^%$ things get passed on the stack
AND in the registers! */
- if (len <= (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM))
+ if (len <=
+ (ARGLAST_REGNUM + 1 - argreg) * REGISTER_RAW_SIZE (ARG0_REGNUM))
while (len > 0)
{ /* there's room in registers */
regval = extract_address (val, wordsize);
@@ -805,8 +807,7 @@ _initialize_h8300m (void)
{
add_prefix_cmd ("machine", no_class, set_machine,
"set the machine type",
- &setmemorylist, "set machine ", 0,
- &setlist);
+ &setmemorylist, "set machine ", 0, &setlist);
add_cmd ("h8300", class_support, h8300_command,
"Set machine to be H8/300.", &setmemorylist);
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index 04ba7067630..0696c4ea540 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -27,7 +27,6 @@
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "gdbcmd.h"
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 98869a8eb12..4cc5f18c477 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -3959,26 +3959,9 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
/* But mark it as NULL if the method was incompletely processed
We'll fix this up later when the method is fully processed */
if (TYPE_INCOMPLETE (memtype))
- {
- fn_p->field.fn_fields[ix].type = NULL;
- }
+ fn_p->field.fn_fields[ix].type = NULL;
else
- {
- fn_p->field.fn_fields[ix].type = memtype;
-
- /* The argument list */
- TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type).arg_types
- = (struct type **) obstack_alloc (&objfile->type_obstack,
- (sizeof (struct type *)
- * (TYPE_NFIELDS (memtype)
- + 1)));
- for (i = 0; i < TYPE_NFIELDS (memtype); i++)
- TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type)
- .arg_types[i] = TYPE_FIELDS (memtype)[i].type;
- /* void termination */
- TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type)
- .arg_types[TYPE_NFIELDS (memtype)] = builtin_type_void;
- }
+ fn_p->field.fn_fields[ix].type = memtype;
/* For virtual functions, fill in the voffset field with the
* virtual table offset. (This is just copied over from the
@@ -4055,7 +4038,6 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
list = new;
list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
- FIELD_BITSIZE (list->field) = -1; /* indicates static member */
SET_FIELD_PHYSNAME (list->field, 0); /* initialize to empty */
memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
@@ -4455,14 +4437,6 @@ fixup_class_method_type (struct type *class, struct type *method,
{
/* Set the method type */
TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j) = method;
- /* The argument list */
- TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types
- = (struct type **) obstack_alloc (&objfile->type_obstack,
- sizeof (struct type *) * (TYPE_NFIELDS (method) + 1));
- for (k = 0; k < TYPE_NFIELDS (method); k++)
- TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types[k] = TYPE_FIELDS (method)[k].type;
- /* void termination */
- TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types[TYPE_NFIELDS (method)] = builtin_type_void;
/* Break out of both loops -- only one method to fix up in a class */
goto finish;
@@ -4916,21 +4890,18 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
struct type *retvaltype;
int nargs;
int i;
- struct type **args_type;
class_type = hpread_type_lookup (dn_bufp->dptrmem.pointsto,
objfile);
functype = hpread_type_lookup (dn_bufp->dptrmem.memtype,
objfile);
retvaltype = TYPE_TARGET_TYPE (functype);
nargs = TYPE_NFIELDS (functype);
- args_type = (struct type **) xmalloc ((nargs + 1) * sizeof (struct type *));
- for (i = 0; i < nargs; i++)
- {
- args_type[i] = TYPE_FIELD_TYPE (functype, i);
- }
- args_type[nargs] = NULL;
ptrmemtype = alloc_type (objfile);
- smash_to_method_type (ptrmemtype, class_type, retvaltype, args_type);
+
+ smash_to_method_type (ptrmemtype, class_type, retvaltype,
+ TYPE_FIELDS (functype),
+ TYPE_NFIELDS (functype),
+ 0);
return make_pointer_type (ptrmemtype, NULL);
}
break;
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index e20e894113e..fe610211f8e 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -62,6 +62,9 @@
/* Defines for XMM0_REGNUM etc. */
#include "i386-tdep.h"
+/* Defines I386_LINUX_ORIG_EAX_REGNUM. */
+#include "i386-linux-tdep.h"
+
/* Prototypes for local functions. */
static void dummy_sse_values (void);
@@ -168,7 +171,7 @@ kernel_u_size (void)
#endif
/* Registers we shouldn't try to fetch. */
-#define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= NUM_GREGS)
+#define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= I386_NUM_GREGS)
/* Fetch one register. */
@@ -234,7 +237,7 @@ old_fetch_inferior_registers (int regno)
}
/* Registers we shouldn't try to store. */
-#define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= NUM_GREGS)
+#define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= I386_NUM_GREGS)
/* Store one register. */
@@ -308,10 +311,11 @@ supply_gregset (elf_gregset_t *gregsetp)
elf_greg_t *regp = (elf_greg_t *) gregsetp;
int i;
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
supply_register (i, (char *) (regp + regmap[i]));
- supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
+ if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
+ supply_register (I386_LINUX_ORIG_EAX_REGNUM, (char *) (regp + ORIG_EAX));
}
/* Fill register REGNO (if it is a general-purpose register) in
@@ -324,11 +328,12 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
elf_greg_t *regp = (elf_greg_t *) gregsetp;
int i;
- for (i = 0; i < NUM_GREGS; i++)
- if ((regno == -1 || regno == i))
+ for (i = 0; i < I386_NUM_GREGS; i++)
+ if (regno == -1 || regno == i)
regcache_collect (i, regp + regmap[i]);
- if (regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
+ && I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
regcache_collect (I386_LINUX_ORIG_EAX_REGNUM, regp + ORIG_EAX);
}
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 9592decee19..a833fb59838 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -33,9 +33,12 @@
#include "solib-svr4.h" /* For struct link_map_offsets. */
+#include "i386-tdep.h"
+#include "i386-linux-tdep.h"
+
/* Return the name of register REG. */
-char *
+static const char *
i386_linux_register_name (int reg)
{
/* Deal with the extra "orig_eax" pseudo register. */
@@ -44,27 +47,6 @@ i386_linux_register_name (int reg)
return i386_register_name (reg);
}
-
-int
-i386_linux_register_byte (int reg)
-{
- /* Deal with the extra "orig_eax" pseudo register. */
- if (reg == I386_LINUX_ORIG_EAX_REGNUM)
- return (i386_register_byte (I386_LINUX_ORIG_EAX_REGNUM - 1)
- + i386_register_raw_size (I386_LINUX_ORIG_EAX_REGNUM - 1));
-
- return i386_register_byte (reg);
-}
-
-int
-i386_linux_register_raw_size (int reg)
-{
- /* Deal with the extra "orig_eax" pseudo register. */
- if (reg == I386_LINUX_ORIG_EAX_REGNUM)
- return 4;
-
- return i386_register_raw_size (reg);
-}
/* Recognizing signal handler frames. */
@@ -224,8 +206,8 @@ i386_linux_rt_sigtramp_start (CORE_ADDR pc)
/* Return whether PC is in a GNU/Linux sigtramp routine. */
-int
-i386_linux_in_sigtramp (CORE_ADDR pc, char *name)
+static int
+i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
if (name)
return STREQ ("__restore", name) || STREQ ("__restore_rt", name);
@@ -237,7 +219,7 @@ i386_linux_in_sigtramp (CORE_ADDR pc, char *name)
/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
address of the associated sigcontext structure. */
-CORE_ADDR
+static CORE_ADDR
i386_linux_sigcontext_addr (struct frame_info *frame)
{
CORE_ADDR pc;
@@ -283,103 +265,9 @@ i386_linux_sigcontext_addr (struct frame_info *frame)
return 0;
}
-/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
-#define LINUX_SIGCONTEXT_PC_OFFSET (56)
-
-/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
- saved program counter. */
-
-static CORE_ADDR
-i386_linux_sigtramp_saved_pc (struct frame_info *frame)
-{
- CORE_ADDR addr;
- addr = i386_linux_sigcontext_addr (frame);
- return read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 4);
-}
-
-/* Offset to saved SP in sigcontext, from <asm/sigcontext.h>. */
-#define LINUX_SIGCONTEXT_SP_OFFSET (28)
-
-/* Assuming FRAME is for a GNU/Linux sigtramp routine, return the
- saved stack pointer. */
-
-static CORE_ADDR
-i386_linux_sigtramp_saved_sp (struct frame_info *frame)
-{
- CORE_ADDR addr;
- addr = i386_linux_sigcontext_addr (frame);
- return read_memory_integer (addr + LINUX_SIGCONTEXT_SP_OFFSET, 4);
-}
-
-/* Signal trampolines don't have a meaningful frame. As in
- "i386/tm-i386.h", the frame pointer value we use is actually the
- frame pointer of the calling 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.
-
- 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 should work in most cases except in horrible situations where
- a signal occurs just as we enter a function but before the frame
- has been set up. */
-
-#define FRAMELESS_SIGNAL(frame) \
- ((frame)->next != NULL \
- && (frame)->next->signal_handler_caller \
- && frameless_look_for_prologue (frame))
-
-CORE_ADDR
-i386_linux_frame_chain (struct frame_info *frame)
-{
- if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame))
- return frame->frame;
-
- if (! inside_entry_file (frame->pc))
- return read_memory_unsigned_integer (frame->frame, 4);
-
- return 0;
-}
-
-/* Return the saved program counter for FRAME. */
-
-CORE_ADDR
-i386_linux_frame_saved_pc (struct frame_info *frame)
-{
- if (frame->signal_handler_caller)
- return i386_linux_sigtramp_saved_pc (frame);
-
- if (FRAMELESS_SIGNAL (frame))
- {
- CORE_ADDR sp = i386_linux_sigtramp_saved_sp (frame->next);
- return read_memory_unsigned_integer (sp, 4);
- }
-
- return read_memory_unsigned_integer (frame->frame + 4, 4);
-}
-
-/* Immediately after a function call, return the saved pc. */
-
-CORE_ADDR
-i386_linux_saved_pc_after_call (struct frame_info *frame)
-{
- if (frame->signal_handler_caller)
- return i386_linux_sigtramp_saved_pc (frame);
-
- return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
-}
-
/* Set the program counter for process PTID to PC. */
-void
+static void
i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid)
{
write_register_pid (PC_REGNUM, pc, ptid);
@@ -496,7 +384,7 @@ i386_linux_skip_solib_resolver (CORE_ADDR pc)
from a GDB that was not built on an GNU/Linux x86 host (for cross
debugging). */
-struct link_map_offsets *
+static struct link_map_offsets *
i386_linux_svr4_fetch_link_map_offsets (void)
{
static struct link_map_offsets lmo;
@@ -528,3 +416,50 @@ i386_linux_svr4_fetch_link_map_offsets (void)
return lmp;
}
+
+
+static void
+i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* GNU/Linux uses ELF. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* We support the SSE registers on GNU/Linux. */
+ tdep->num_xmm_regs = I386_NUM_XREGS - 1;
+ /* set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS); */
+
+ /* Since we have the extra "orig_eax" register on GNU/Linux, we have
+ to adjust a few things. */
+
+ set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
+ set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS + 1);
+ set_gdbarch_register_name (gdbarch, i386_linux_register_name);
+ set_gdbarch_register_bytes (gdbarch, I386_SSE_SIZEOF_REGS + 4);
+
+ tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
+
+ tdep->sigcontext_addr = i386_linux_sigcontext_addr;
+ tdep->sc_pc_offset = 14 * 4; /* From <asm/sigcontext.h>. */
+ tdep->sc_sp_offset = 7 * 4;
+
+ /* When the i386 Linux kernel calls a signal handler, the return
+ address points to a bit of code on the stack. This function is
+ used to identify this bit of code as a signal trampoline in order
+ to support backtracing through calls to signal handlers. */
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386_linux_pc_in_sigtramp);
+
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ i386_linux_svr4_fetch_link_map_offsets);
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern void _initialize_i386_linux_tdep (void);
+
+void
+_initialize_i386_linux_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LINUX,
+ i386_linux_init_abi);
+}
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index adf220bba73..53a81a463eb 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -230,6 +230,14 @@ i386_cleanup_dregs (void)
dr_status_mirror = 0;
}
+/* Reset all debug registers at each new startup
+ to avoid missing watchpoints after restart. */
+void
+child_post_startup_inferior (ptid_t ptid)
+{
+ i386_cleanup_dregs ();
+}
+
/* Print the values of the mirrored debug registers.
This is called when maint_show_dr is non-zero. To set that
up, type "maint show-debug-regs" at GDB's prompt. */
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index 206e85cfe72..c72a7ed1df8 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "value.h"
#include "i386-tdep.h"
@@ -43,8 +44,13 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Signal trampolines are different from SVR4, in fact they're
rather similar to BSD. */
set_gdbarch_pc_in_sigtramp (gdbarch, i386_sol2_pc_in_sigtramp);
- tdep->sigtramp_saved_pc = i386bsd_sigtramp_saved_pc;
+ tdep->sigcontext_addr = i386bsd_sigcontext_addr;
tdep->sc_pc_offset = 36 + 14 * 4;
+ tdep->sc_sp_offset = 36 + 17 * 4;
+
+ /* Assume that the prototype flag can be trusted. */
+ set_gdbarch_coerce_float_to_double (gdbarch,
+ standard_coerce_float_to_double);
}
@@ -65,7 +71,7 @@ void _initialize_i386_sol2_tdep (void);
void
_initialize_i386_sol2_tdep (void)
{
- /* Register and ELF OS ABI sniffer for Solaris 2 binaries. */
+ /* Register an ELF OS ABI sniffer for Solaris 2 binaries. */
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
i386_sol2_osabi_sniffer);
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 54746eeb865..8684fce684d 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -25,8 +25,10 @@
#include "frame.h"
#include "inferior.h"
#include "gdbcore.h"
+#include "objfiles.h"
#include "target.h"
#include "floatformat.h"
+#include "symfile.h"
#include "symtab.h"
#include "gdbcmd.h"
#include "command.h"
@@ -36,9 +38,8 @@
#include "value.h"
#include "gdb_assert.h"
-#include "elf-bfd.h"
-
#include "i386-tdep.h"
+#include "i387-tdep.h"
/* Names of the registers. The first 10 registers match the register
numbering scheme used by GCC for stabs and DWARF. */
@@ -57,69 +58,42 @@ static char *i386_register_names[] =
"mxcsr"
};
-/* i386_register_offset[i] is the offset into the register file of the
- start of register number i. We initialize this from
- i386_register_size. */
-static int i386_register_offset[MAX_NUM_REGS];
-
-/* i386_register_size[i] is the number of bytes of storage in GDB's
- register array occupied by register i. */
-static int i386_register_size[MAX_NUM_REGS] = {
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 10, 10, 10, 10,
- 10, 10, 10, 10,
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 16, 16, 16, 16,
- 16, 16, 16, 16,
- 4
+/* MMX registers. */
+
+static char *i386_mmx_names[] =
+{
+ "mm0", "mm1", "mm2", "mm3",
+ "mm4", "mm5", "mm6", "mm7"
};
+static const int mmx_num_regs = (sizeof (i386_mmx_names)
+ / sizeof (i386_mmx_names[0]));
+#define MM0_REGNUM (NUM_REGS)
+
+static int
+mmx_regnum_p (int reg)
+{
+ return (reg >= MM0_REGNUM && reg < MM0_REGNUM + mmx_num_regs);
+}
/* Return the name of register REG. */
-char *
+const char *
i386_register_name (int reg)
{
if (reg < 0)
return NULL;
+ if (mmx_regnum_p (reg))
+ return i386_mmx_names[reg - MM0_REGNUM];
if (reg >= sizeof (i386_register_names) / sizeof (*i386_register_names))
return NULL;
return i386_register_names[reg];
}
-/* Return the offset into the register array of the start of register
- number REG. */
-int
-i386_register_byte (int reg)
-{
- return i386_register_offset[reg];
-}
-
-/* Return the number of bytes of storage in GDB's register array
- occupied by register REG. */
-
-int
-i386_register_raw_size (int reg)
-{
- return i386_register_size[reg];
-}
-
-/* Return the size in bytes of the virtual type of register REG. */
-
-int
-i386_register_virtual_size (int reg)
-{
- return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (reg));
-}
-
/* Convert stabs register number REG to the appropriate register
number used by GDB. */
-int
+static int
i386_stab_reg_to_regnum (int reg)
{
/* This implements what GCC calls the "default" register map. */
@@ -141,19 +115,17 @@ i386_stab_reg_to_regnum (int reg)
else if (reg >= 29 && reg <= 36)
{
/* MMX registers. */
- /* FIXME: kettenis/2001-07-28: Should we have the MMX registers
- as pseudo-registers? */
- return reg - 29 + FP0_REGNUM;
+ return reg - 29 + MM0_REGNUM;
}
/* This will hopefully provoke a warning. */
return NUM_REGS + NUM_PSEUDO_REGS;
}
-/* Convert Dwarf register number REG to the appropriate register
+/* Convert DWARF register number REG to the appropriate register
number used by GDB. */
-int
+static int
i386_dwarf_reg_to_regnum (int reg)
{
/* The DWARF register numbering includes %eip and %eflags, and
@@ -462,14 +434,54 @@ i386_get_frame_setup (CORE_ADDR pc)
return (-1);
}
+/* Signal trampolines don't have a meaningful frame. The frame
+ pointer value we use is actually the frame pointer of the calling
+ 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.
+
+ 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 should work in most cases except in horrible situations where
+ a signal occurs just as we enter a function but before the frame
+ has been set up. Incidentally, that's just what happens when we
+ call a function from GDB with a signal pending (there's a test in
+ the testsuite that makes this happen). Therefore we pretend that
+ we have a frameless function if we're stopped at the start of a
+ function. */
+
+/* Return non-zero if we're dealing with a frameless signal, that is,
+ a signal trampoline invoked from a frameless function. */
+
+static int
+i386_frameless_signal_p (struct frame_info *frame)
+{
+ return (frame->next && frame->next->signal_handler_caller
+ && (frameless_look_for_prologue (frame)
+ || frame->pc == get_pc_function_start (frame->pc)));
+}
+
/* Return the chain-pointer for FRAME. In the case of the i386, the
frame's nominal address is the address of a 4-byte word containing
the calling frame's address. */
-CORE_ADDR
+static CORE_ADDR
i386_frame_chain (struct frame_info *frame)
{
- if (frame->signal_handler_caller)
+ if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+ return frame->frame;
+
+ if (frame->signal_handler_caller
+ || i386_frameless_signal_p (frame))
return frame->frame;
if (! inside_entry_file (frame->pc))
@@ -482,7 +494,7 @@ i386_frame_chain (struct frame_info *frame)
not have a from on the stack associated with it. If it does not,
return non-zero, otherwise return zero. */
-int
+static int
i386_frameless_function_invocation (struct frame_info *frame)
{
if (frame->signal_handler_caller)
@@ -491,41 +503,68 @@ i386_frameless_function_invocation (struct frame_info *frame)
return frameless_look_for_prologue (frame);
}
+/* Assuming FRAME is for a sigtramp routine, return the saved program
+ counter. */
+
+static CORE_ADDR
+i386_sigtramp_saved_pc (struct frame_info *frame)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ CORE_ADDR addr;
+
+ addr = tdep->sigcontext_addr (frame);
+ return read_memory_unsigned_integer (addr + tdep->sc_pc_offset, 4);
+}
+
+/* Assuming FRAME is for a sigtramp routine, return the saved stack
+ pointer. */
+
+static CORE_ADDR
+i386_sigtramp_saved_sp (struct frame_info *frame)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ CORE_ADDR addr;
+
+ addr = tdep->sigcontext_addr (frame);
+ return read_memory_unsigned_integer (addr + tdep->sc_sp_offset, 4);
+}
+
/* Return the saved program counter for FRAME. */
-CORE_ADDR
+static CORE_ADDR
i386_frame_saved_pc (struct frame_info *frame)
{
- /* FIXME: kettenis/2001-05-09: Conditionalizing the next bit of code
- on SIGCONTEXT_PC_OFFSET and I386V4_SIGTRAMP_SAVED_PC should be
- considered a temporary hack. I plan to come up with something
- better when we go multi-arch. */
-#if defined (SIGCONTEXT_PC_OFFSET) || defined (I386V4_SIGTRAMP_SAVED_PC)
+ if (PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+ return generic_read_register_dummy (frame->pc, frame->frame,
+ PC_REGNUM);
+
if (frame->signal_handler_caller)
- return sigtramp_saved_pc (frame);
-#endif
+ return i386_sigtramp_saved_pc (frame);
- return read_memory_unsigned_integer (frame->frame + 4, 4);
-}
+ if (i386_frameless_signal_p (frame))
+ {
+ CORE_ADDR sp = i386_sigtramp_saved_sp (frame->next);
+ return read_memory_unsigned_integer (sp, 4);
+ }
-CORE_ADDR
-i386go32_frame_saved_pc (struct frame_info *frame)
-{
- return read_memory_integer (frame->frame + 4, 4);
+ return read_memory_unsigned_integer (frame->frame + 4, 4);
}
/* Immediately after a function call, return the saved pc. */
-CORE_ADDR
+static CORE_ADDR
i386_saved_pc_after_call (struct frame_info *frame)
{
+ if (frame->signal_handler_caller)
+ return i386_sigtramp_saved_pc (frame);
+
return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
}
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
-int
+static int
i386_frame_num_args (struct frame_info *fi)
{
#if 1
@@ -622,12 +661,11 @@ i386_frame_num_args (struct frame_info *fi)
If the setup sequence is at the end of the function, then the next
instruction will be a branch back to the start. */
-void
+static void
i386_frame_init_saved_regs (struct frame_info *fip)
{
long locals = -1;
unsigned char op;
- CORE_ADDR dummy_bottom;
CORE_ADDR addr;
CORE_ADDR pc;
int i;
@@ -637,23 +675,6 @@ i386_frame_init_saved_regs (struct frame_info *fip)
frame_saved_regs_zalloc (fip);
- /* If the frame is the end of a dummy, compute where the beginning
- would be. */
- dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
-
- /* Check if the PC points in the stack, in a dummy frame. */
- if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
- {
- /* All registers were saved by push_call_dummy. */
- addr = fip->frame;
- for (i = 0; i < NUM_REGS; i++)
- {
- addr -= REGISTER_RAW_SIZE (i);
- fip->saved_regs[i] = addr;
- }
- return;
- }
-
pc = get_pc_function_start (fip->pc);
if (pc != 0)
locals = i386_get_frame_setup (pc);
@@ -682,8 +703,8 @@ i386_frame_init_saved_regs (struct frame_info *fip)
/* Return PC of first real instruction. */
-int
-i386_skip_prologue (int pc)
+static CORE_ADDR
+i386_skip_prologue (CORE_ADDR pc)
{
unsigned char op;
int i;
@@ -765,53 +786,43 @@ i386_skip_prologue (int pc)
return (codestream_tell ());
}
-void
-i386_push_dummy_frame (void)
-{
- CORE_ADDR sp = read_register (SP_REGNUM);
- CORE_ADDR fp;
- int regnum;
- char regbuf[MAX_REGISTER_RAW_SIZE];
+/* Use the program counter to determine the contents and size of a
+ breakpoint instruction. Return a pointer to a string of bytes that
+ encode a breakpoint instruction, store the length of the string in
+ *LEN and optionally adjust *PC to point to the correct memory
+ location for inserting the breakpoint.
- sp = push_word (sp, read_register (PC_REGNUM));
- sp = push_word (sp, read_register (FP_REGNUM));
- fp = sp;
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- {
- read_register_gen (regnum, regbuf);
- sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
- }
- write_register (SP_REGNUM, sp);
- write_register (FP_REGNUM, fp);
+ On the i386 we have a single breakpoint that fits in a single byte
+ and can be inserted anywhere. */
+
+static const unsigned char *
+i386_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static unsigned char break_insn[] = { 0xcc }; /* int 3 */
+
+ *len = sizeof (break_insn);
+ return break_insn;
}
-/* Insert the (relative) function address into the call sequence
- stored at DYMMY. */
+/* Push the return address (pointing to the call dummy) onto the stack
+ and return the new value for the stack pointer. */
-void
-i386_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
- struct value **args, struct type *type, int gcc_p)
+static CORE_ADDR
+i386_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- int from, to, delta, loc;
+ char buf[4];
- loc = (int)(read_register (SP_REGNUM) - CALL_DUMMY_LENGTH);
- from = loc + 5;
- to = (int)(fun);
- delta = to - from;
-
- *((char *)(dummy) + 1) = (delta & 0xff);
- *((char *)(dummy) + 2) = ((delta >> 8) & 0xff);
- *((char *)(dummy) + 3) = ((delta >> 16) & 0xff);
- *((char *)(dummy) + 4) = ((delta >> 24) & 0xff);
+ store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ());
+ write_memory (sp - 4, buf, 4);
+ return sp - 4;
}
-void
-i386_pop_frame (void)
+static void
+i386_do_pop_frame (struct frame_info *frame)
{
- struct frame_info *frame = get_current_frame ();
CORE_ADDR fp;
int regnum;
- char regbuf[MAX_REGISTER_RAW_SIZE];
+ char regbuf[I386_MAX_REGISTER_SIZE];
fp = FRAME_FP (frame);
i386_frame_init_saved_regs (frame);
@@ -823,8 +834,7 @@ i386_pop_frame (void)
if (addr)
{
read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum));
- write_register_bytes (REGISTER_BYTE (regnum), regbuf,
- REGISTER_RAW_SIZE (regnum));
+ write_register_gen (regnum, regbuf);
}
}
write_register (FP_REGNUM, read_memory_integer (fp, 4));
@@ -832,54 +842,46 @@ i386_pop_frame (void)
write_register (SP_REGNUM, fp + 8);
flush_cached_frames ();
}
-
-
-#ifdef GET_LONGJMP_TARGET
-/* FIXME: Multi-arching does not set JB_PC and JB_ELEMENT_SIZE yet.
- Fill in with dummy value to enable compilation. */
-#ifndef JB_PC
-#define JB_PC 0
-#endif /* JB_PC */
-
-#ifndef JB_ELEMENT_SIZE
-#define JB_ELEMENT_SIZE 4
-#endif /* JB_ELEMENT_SIZE */
+static void
+i386_pop_frame (void)
+{
+ generic_pop_current_frame (i386_do_pop_frame);
+}
+
/* Figure out where the longjmp will land. Slurp the args out of the
stack. We expect the first arg to be a pointer to the jmp_buf
- structure from which we extract the pc (JB_PC) that we will land
- at. The pc is copied into PC. This routine returns true on
+ structure from which we extract the address that we will land at.
+ This address is copied into PC. This routine returns true on
success. */
-int
-get_longjmp_target (CORE_ADDR *pc)
+static int
+i386_get_longjmp_target (CORE_ADDR *pc)
{
- char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
+ char buf[4];
CORE_ADDR sp, jb_addr;
+ int jb_pc_offset = gdbarch_tdep (current_gdbarch)->jb_pc_offset;
- sp = read_register (SP_REGNUM);
-
- if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack. */
- buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
+ /* If JB_PC_OFFSET is -1, we have no way to find out where the
+ longjmp will land. */
+ if (jb_pc_offset == -1)
return 0;
- jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-
- if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
+ sp = read_register (SP_REGNUM);
+ if (target_read_memory (sp + 4, buf, 4))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ jb_addr = extract_address (buf, 4);
+ if (target_read_memory (jb_addr + jb_pc_offset, buf, 4))
+ return 0;
+ *pc = extract_address (buf, 4);
return 1;
}
-
-#endif /* GET_LONGJMP_TARGET */
-CORE_ADDR
+static CORE_ADDR
i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
@@ -897,7 +899,7 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
-void
+static void
i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
{
/* Do nothing. Everything was already done by i386_push_arguments. */
@@ -913,21 +915,24 @@ i386_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
function return value of TYPE, and copy that, in virtual format,
into VALBUF. */
-void
-i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+static void
+i386_extract_return_value (struct type *type, struct regcache *regcache,
+ void *dst)
{
+ bfd_byte *valbuf = dst;
int len = TYPE_LENGTH (type);
+ char buf[I386_MAX_REGISTER_SIZE];
if (TYPE_CODE (type) == TYPE_CODE_STRUCT
&& TYPE_NFIELDS (type) == 1)
{
- i386_extract_return_value (TYPE_FIELD_TYPE (type, 0), regbuf, valbuf);
+ i386_extract_return_value (TYPE_FIELD_TYPE (type, 0), regcache, valbuf);
return;
}
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
- if (NUM_FREGS == 0)
+ if (FP0_REGNUM == 0)
{
warning ("Cannot find floating-point return value.");
memset (valbuf, 0, len);
@@ -938,8 +943,8 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
its contents to the desired type. This is probably not
exactly how it would happen on the target itself, but it is
the best we can do. */
- convert_typed_floating (&regbuf[REGISTER_BYTE (FP0_REGNUM)],
- builtin_type_i387_ext, valbuf, type);
+ regcache_raw_read (regcache, FP0_REGNUM, buf);
+ convert_typed_floating (buf, builtin_type_i387_ext, valbuf, type);
}
else
{
@@ -947,13 +952,16 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
if (len <= low_size)
- memcpy (valbuf, &regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)], len);
+ {
+ regcache_raw_read (regcache, LOW_RETURN_REGNUM, buf);
+ memcpy (valbuf, buf, len);
+ }
else if (len <= (low_size + high_size))
{
- memcpy (valbuf,
- &regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)], low_size);
- memcpy (valbuf + low_size,
- &regbuf[REGISTER_BYTE (HIGH_RETURN_REGNUM)], len - low_size);
+ regcache_raw_read (regcache, LOW_RETURN_REGNUM, buf);
+ memcpy (valbuf, buf, low_size);
+ regcache_raw_read (regcache, HIGH_RETURN_REGNUM, buf);
+ memcpy (valbuf + low_size, buf, len - low_size);
}
else
internal_error (__FILE__, __LINE__,
@@ -964,7 +972,7 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Write into the appropriate registers a function return value stored
in VALBUF of type TYPE, given in virtual format. */
-void
+static void
i386_store_return_value (struct type *type, char *valbuf)
{
int len = TYPE_LENGTH (type);
@@ -981,7 +989,7 @@ i386_store_return_value (struct type *type, char *valbuf)
unsigned int fstat;
char buf[FPU_REG_RAW_SIZE];
- if (NUM_FREGS == 0)
+ if (FP0_REGNUM == 0)
{
warning ("Cannot set floating-point return value.");
return;
@@ -996,8 +1004,7 @@ i386_store_return_value (struct type *type, char *valbuf)
not exactly how it would happen on the target itself, but
it is the best we can do. */
convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext);
- write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf,
- FPU_REG_RAW_SIZE);
+ write_register_gen (FP0_REGNUM, buf);
/* Set the top of the floating-point register stack to 7. The
actual value doesn't really matter, but 7 is what a normal
@@ -1036,11 +1043,52 @@ i386_store_return_value (struct type *type, char *valbuf)
the address in which a function should return its structure value,
as a CORE_ADDR. */
-CORE_ADDR
-i386_extract_struct_value_address (char *regbuf)
+static CORE_ADDR
+i386_extract_struct_value_address (struct regcache *regcache)
+{
+ /* NOTE: cagney/2002-08-12: Replaced a call to
+ regcache_raw_read_as_address() with a call to
+ regcache_cooked_read_unsigned(). The old, ...as_address function
+ was eventually calling extract_unsigned_integer (via
+ extract_address) to unpack the registers value. The below is
+ doing an unsigned extract so that it is functionally equivalent.
+ The read needs to be cooked as, otherwise, it will never
+ correctly return the value of a register in the [NUM_REGS
+ .. NUM_REGS+NUM_PSEUDO_REGS) range. */
+ ULONGEST val;
+ regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val);
+ return val;
+}
+
+
+/* This is the variable that is set with "set struct-convention", and
+ its legitimate values. */
+static const char default_struct_convention[] = "default";
+static const char pcc_struct_convention[] = "pcc";
+static const char reg_struct_convention[] = "reg";
+static const char *valid_conventions[] =
{
- return extract_address (&regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)],
- REGISTER_RAW_SIZE (LOW_RETURN_REGNUM));
+ default_struct_convention,
+ pcc_struct_convention,
+ reg_struct_convention,
+ NULL
+};
+static const char *struct_convention = default_struct_convention;
+
+static int
+i386_use_struct_convention (int gcc_p, struct type *type)
+{
+ enum struct_return struct_return;
+
+ if (struct_convention == default_struct_convention)
+ struct_return = gdbarch_tdep (current_gdbarch)->struct_return;
+ else if (struct_convention == pcc_struct_convention)
+ struct_return = pcc_struct_return;
+ else
+ struct_return = reg_struct_return;
+
+ return generic_use_struct_convention (struct_return == reg_struct_return,
+ type);
}
@@ -1048,7 +1096,7 @@ i386_extract_struct_value_address (char *regbuf)
register REGNUM. Perhaps %esi and %edi should go here, but
potentially they could be used for things other than address. */
-struct type *
+static struct type *
i386_register_virtual_type (int regnum)
{
if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
@@ -1060,16 +1108,71 @@ i386_register_virtual_type (int regnum)
if (IS_SSE_REGNUM (regnum))
return builtin_type_vec128i;
+ if (mmx_regnum_p (regnum))
+ return builtin_type_vec64i;
+
return builtin_type_int;
}
+/* Map a cooked register onto a raw register or memory. For the i386,
+ the MMX registers need to be mapped onto floating point registers. */
+
+static int
+mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
+{
+ int mmxi;
+ ULONGEST fstat;
+ int tos;
+ int fpi;
+ mmxi = regnum - MM0_REGNUM;
+ regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat);
+ tos = (fstat >> 11) & 0x7;
+ fpi = (mmxi + tos) % 8;
+ return (FP0_REGNUM + fpi);
+}
+
+static void
+i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, void *buf)
+{
+ if (mmx_regnum_p (regnum))
+ {
+ char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
+ regcache_raw_read (regcache, fpnum, mmx_buf);
+ /* Extract (always little endian). */
+ memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ regcache_raw_read (regcache, regnum, buf);
+}
+
+static void
+i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, const void *buf)
+{
+ if (mmx_regnum_p (regnum))
+ {
+ char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum);
+ /* Read ... */
+ regcache_raw_read (regcache, fpnum, mmx_buf);
+ /* ... Modify ... (always little endian). */
+ memcpy (mmx_buf, buf, REGISTER_RAW_SIZE (regnum));
+ /* ... Write. */
+ regcache_raw_write (regcache, fpnum, mmx_buf);
+ }
+ else
+ regcache_raw_write (regcache, regnum, buf);
+}
+
/* Return true iff register REGNUM'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 that SSE
registers need conversion. Even if we can't find a counterexample,
this is still sloppy. */
-int
+static int
i386_register_convertible (int regnum)
{
return IS_FP_REGNUM (regnum);
@@ -1078,7 +1181,7 @@ i386_register_convertible (int regnum)
/* Convert data from raw format for register REGNUM in buffer FROM to
virtual format with type TYPE in buffer TO. */
-void
+static void
i386_register_convert_to_virtual (int regnum, struct type *type,
char *from, char *to)
{
@@ -1101,7 +1204,7 @@ i386_register_convert_to_virtual (int regnum, struct type *type,
/* Convert data from virtual format with type TYPE in buffer FROM to
raw format for register REGNUM in buffer TO. */
-void
+static void
i386_register_convert_to_raw (struct type *type, int regnum,
char *from, char *to)
{
@@ -1122,34 +1225,6 @@ i386_register_convert_to_raw (struct type *type, int regnum,
}
-#ifdef I386V4_SIGTRAMP_SAVED_PC
-/* Get saved user PC for sigtramp from the pushed ucontext on the
- stack for all three variants of SVR4 sigtramps. */
-
-CORE_ADDR
-i386v4_sigtramp_saved_pc (struct frame_info *frame)
-{
- CORE_ADDR saved_pc_offset = 4;
- char *name = NULL;
-
- find_pc_partial_function (frame->pc, &name, NULL, NULL);
- if (name)
- {
- if (STREQ (name, "_sigreturn"))
- saved_pc_offset = 132 + 14 * 4;
- else if (STREQ (name, "_sigacthandler"))
- saved_pc_offset = 80 + 14 * 4;
- else if (STREQ (name, "sigvechandler"))
- saved_pc_offset = 120 + 14 * 4;
- }
-
- if (frame->next)
- return read_memory_integer (frame->next->frame + saved_pc_offset, 4);
- return read_memory_integer (read_register (SP_REGNUM) + saved_pc_offset, 4);
-}
-#endif /* I386V4_SIGTRAMP_SAVED_PC */
-
-
#ifdef STATIC_TRANSFORM_NAME
/* SunPRO encodes the static variables. This is not related to C++
mangling, it is done for C too. */
@@ -1179,7 +1254,7 @@ sunpro_static_transform_name (char *name)
/* Stuff for WIN32 PE style DLL's but is pretty generic really. */
CORE_ADDR
-skip_trampoline_code (CORE_ADDR pc, char *name)
+i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name)
{
if (pc && read_memory_unsigned_integer (pc, 2) == 0x25ff) /* jmp *(dest) */
{
@@ -1199,6 +1274,16 @@ skip_trampoline_code (CORE_ADDR pc, char *name)
}
+/* Return non-zero if PC and NAME show that we are in a signal
+ trampoline. */
+
+static int
+i386_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ return (name && strcmp ("_sigtramp", name) == 0);
+}
+
+
/* We have two flavours of disassembly. The machinery on this page
deals with switching between those. */
@@ -1213,229 +1298,140 @@ gdb_print_insn_i386 (bfd_vma memaddr, disassemble_info *info)
or intel_flavor. */
internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
-
-/* This table matches the indices assigned to enum i386_abi. Keep
- them in sync. */
-static const char * const i386_abi_names[] =
-{
- "<unknown>",
- "SVR4",
- "NetBSD",
- "GNU/Linux",
- "GNU/Hurd",
- "Solaris",
- "FreeBSD",
- NULL
-};
+/* There are a few i386 architecture variants that differ only
+ slightly from the generic i386 target. For now, we don't give them
+ their own source file, but include them here. As a consequence,
+ they'll always be included. */
-#define ABI_TAG_OS_GNU_LINUX I386_ABI_LINUX
-#define ABI_TAG_OS_GNU_HURD I386_ABI_HURD
-#define ABI_TAG_OS_GNU_SOLARIS I386_ABI_INVALID
-#define ABI_TAG_OS_FREEBSD I386_ABI_FREEBSD
-#define ABI_TAG_OS_NETBSD I386_ABI_NETBSD
+/* System V Release 4 (SVR4). */
-static void
-process_note_sections (bfd *abfd, asection *sect, void *obj)
+static int
+i386_svr4_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
- int *abi = obj;
- const char *name;
- unsigned int sectsize;
-
- name = bfd_get_section_name (abfd, sect);
- sectsize = bfd_section_size (abfd, sect);
-
- if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
- {
- unsigned int name_length, data_length, note_type;
- char *note;
-
- /* If the section is larger than this, it's probably not what we
- are looking for. */
- if (sectsize > 128)
- sectsize = 128;
-
- note = alloca (sectsize);
-
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
+ return (name && (strcmp ("_sigreturn", name) == 0
+ || strcmp ("_sigacthandler", name) == 0
+ || strcmp ("sigvechandler", name) == 0));
+}
- name_length = bfd_h_get_32 (abfd, note);
- data_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
+/* Get address of the pushed ucontext (sigcontext) on the stack for
+ all three variants of SVR4 sigtramps. */
- if (name_length == 4 && data_length == 16
- && note_type == NT_GNU_ABI_TAG
- && strcmp (note + 12, "GNU") == 0)
- {
- int abi_tag_os = bfd_h_get_32 (abfd, note + 16);
+static CORE_ADDR
+i386_svr4_sigcontext_addr (struct frame_info *frame)
+{
+ int sigcontext_offset = -1;
+ char *name = NULL;
- /* The case numbers are from abi-tags in glibc. */
- switch (abi_tag_os)
- {
- case GNU_ABI_TAG_LINUX:
- *abi = ABI_TAG_OS_GNU_LINUX;
- break;
-
- case GNU_ABI_TAG_HURD:
- *abi = ABI_TAG_OS_GNU_HURD;
- break;
-
- case GNU_ABI_TAG_SOLARIS:
- *abi = ABI_TAG_OS_GNU_SOLARIS;
- break;
-
- default:
- internal_error
- (__FILE__, __LINE__,
- "process_note_abi_sections: unknown ABI OS tag %d",
- abi_tag_os);
- break;
- }
- }
- else if (name_length == 8 && data_length == 4
- && note_type == NT_FREEBSD_ABI_TAG
- && strcmp (note + 12, "FreeBSD") == 0)
- *abi = ABI_TAG_OS_FREEBSD;
- }
- /* NetBSD uses a similar trick. */
- else if (strcmp (name, ".note.netbsd.ident") == 0 && sectsize > 0)
+ find_pc_partial_function (frame->pc, &name, NULL, NULL);
+ if (name)
{
- unsigned int name_length, desc_length, note_type;
- char *note;
-
- /* If the section is larger than this, it's probably not what we are
- looking for. */
- if (sectsize > 128)
- sectsize = 128;
-
- note = alloca (sectsize);
-
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
+ if (strcmp (name, "_sigreturn") == 0)
+ sigcontext_offset = 132;
+ else if (strcmp (name, "_sigacthandler") == 0)
+ sigcontext_offset = 80;
+ else if (strcmp (name, "sigvechandler") == 0)
+ sigcontext_offset = 120;
+ }
- name_length = bfd_h_get_32 (abfd, note);
- desc_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
+ gdb_assert (sigcontext_offset != -1);
- if (name_length == 7 && desc_length == 4
- && note_type == NT_NETBSD_IDENT
- && strcmp (note + 12, "NetBSD") == 0)
- *abi = ABI_TAG_OS_NETBSD;
- }
+ if (frame->next)
+ return frame->next->frame + sigcontext_offset;
+ return read_register (SP_REGNUM) + sigcontext_offset;
}
+
+
+/* DJGPP. */
static int
-i386_elf_abi_from_note (bfd *abfd)
+i386_go32_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
- enum i386_abi abi = I386_ABI_UNKNOWN;
-
- bfd_map_over_sections (abfd, process_note_sections, &abi);
+ /* DJGPP doesn't have any special frames for signal handlers. */
+ return 0;
+}
+
- return abi;
+/* Generic ELF. */
+
+void
+i386_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ /* We typically use stabs-in-ELF with the DWARF register numbering. */
+ set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
}
-static enum i386_abi
-i386_elf_abi (bfd *abfd)
+/* System V Release 4 (SVR4). */
+
+void
+i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- int elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- /* The fact that the EI_OSABI byte is set to ELFOSABI_NONE doesn't
- necessarily mean that this is a System V ELF binary. To further
- distinguish between binaries for differens operating systems,
- check for vendor-specific note elements. */
- if (elfosabi == ELFOSABI_NONE)
- {
- enum i386_abi abi = i386_elf_abi_from_note (abfd);
+ /* System V Release 4 uses ELF. */
+ i386_elf_init_abi (info, gdbarch);
- if (abi != I386_ABI_UNKNOWN)
- return abi;
+ /* System V Release 4 has shared libraries. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
- /* FreeBSD folks are naughty; they stored the string "FreeBSD"
- in the padding of the e_ident field of the ELF header. */
- if (strcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD") == 0)
- return I386_ABI_FREEBSD;
- }
+ /* FIXME: kettenis/20020511: Why do we override this function here? */
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
- switch (elfosabi)
- {
- case ELFOSABI_NONE:
- return I386_ABI_SVR4;
- case ELFOSABI_FREEBSD:
- return I386_ABI_FREEBSD;
- }
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp);
+ tdep->sigcontext_addr = i386_svr4_sigcontext_addr;
+ tdep->sc_pc_offset = 14 * 4;
+ tdep->sc_sp_offset = 7 * 4;
- return I386_ABI_UNKNOWN;
+ tdep->jb_pc_offset = 20;
}
-struct i386_abi_handler
+/* DJGPP. */
+
+static void
+i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct i386_abi_handler *next;
- enum i386_abi abi;
- void (*init_abi)(struct gdbarch_info, struct gdbarch *);
-};
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-struct i386_abi_handler *i386_abi_handler_list = NULL;
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386_go32_pc_in_sigtramp);
-void
-i386_gdbarch_register_os_abi (enum i386_abi abi,
- void (*init_abi)(struct gdbarch_info,
- struct gdbarch *))
+ tdep->jb_pc_offset = 36;
+}
+
+/* NetWare. */
+
+static void
+i386_nw_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct i386_abi_handler **handler_p;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- for (handler_p = &i386_abi_handler_list; *handler_p != NULL;
- handler_p = &(*handler_p)->next)
- {
- if ((*handler_p)->abi == abi)
- {
- internal_error
- (__FILE__, __LINE__,
- "i386_gdbarch_register_abi: A handler for this ABI variant "
- "(%d) has already been registered", (int) abi);
- /* If user wants to continue, override previous definition. */
- (*handler_p)->init_abi = init_abi;
- return;
- }
- }
- (*handler_p)
- = (struct i386_abi_handler *) xmalloc (sizeof (struct i386_abi_handler));
- (*handler_p)->next = NULL;
- (*handler_p)->abi = abi;
- (*handler_p)->init_abi = init_abi;
+ /* FIXME: kettenis/20020511: Why do we override this function here? */
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
+
+ tdep->jb_pc_offset = 24;
}
+
-struct gdbarch *
+static struct gdbarch *
i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch_tdep *tdep;
struct gdbarch *gdbarch;
- enum i386_abi abi = I386_ABI_UNKNOWN;
- struct i386_abi_handler *abi_handler;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
+ /* Try to determine the OS ABI of the object we're loading. */
if (info.abfd != NULL)
- {
- switch (bfd_get_flavour (info.abfd))
- {
- case bfd_target_elf_flavour:
- abi= i386_elf_abi (info.abfd);
- break;
-
- default:
- /* Not sure what to do here, leave the ABI as unknown. */
- break;
- }
- }
+ 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 ABI selection matches. */
+ /* Make sure the OS ABI selection matches. */
tdep = gdbarch_tdep (arches->gdbarch);
- if (tdep && tdep->abi == abi)
+ if (tdep && tdep->osabi == osabi)
return arches->gdbarch;
}
@@ -1443,70 +1439,160 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = XMALLOC (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
- tdep->abi = abi;
+ tdep->osabi = osabi;
+
+ /* The i386 default settings don't include the SSE registers.
+ FIXME: kettenis/20020614: They do include the FPU registers for
+ now, which probably is not quite right. */
+ tdep->num_xmm_regs = 0;
+
+ tdep->jb_pc_offset = -1;
+ tdep->struct_return = pcc_struct_return;
+ tdep->sigtramp_start = 0;
+ tdep->sigtramp_end = 0;
+ tdep->sigcontext_addr = NULL;
+ tdep->sc_pc_offset = -1;
+ tdep->sc_sp_offset = -1;
+
+ /* The format used for `long double' on almost all i386 targets is
+ the i387 extended floating-point format. In fact, of all targets
+ in the GCC 2.95 tree, only OSF/1 does it different, and insists
+ on having a `long double' that's not `long' at all. */
+ set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
+
+ /* Although the i386 extended floating-point has only 80 significant
+ bits, a `long double' actually takes up 96, probably to enforce
+ alignment. */
+ set_gdbarch_long_double_bit (gdbarch, 96);
+
+ /* NOTE: tm-i386aix.h, tm-i386bsd.h, tm-i386os9k.h, tm-ptx.h,
+ tm-symmetry.h currently override this. Sigh. */
+ set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
+
+ set_gdbarch_sp_regnum (gdbarch, 4);
+ set_gdbarch_fp_regnum (gdbarch, 5);
+ set_gdbarch_pc_regnum (gdbarch, 8);
+ set_gdbarch_ps_regnum (gdbarch, 9);
+ set_gdbarch_fp0_regnum (gdbarch, 16);
+
+ /* Use the "default" register numbering scheme for stabs and COFF. */
+ set_gdbarch_stab_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum);
+ set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum);
+
+ /* Use the DWARF register numbering scheme for DWARF and DWARF 2. */
+ set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
- /* FIXME: kettenis/2001-11-24: Although not all IA-32 processors
- have the SSE registers, it's easier to set the default to 8. */
- tdep->num_xmm_regs = 8;
+ /* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to
+ be in use on any of the supported i386 targets. */
- set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+ set_gdbarch_register_name (gdbarch, i386_register_name);
+ set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
+ set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE);
+ set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE);
+ set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type);
+
+ set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
+
+ 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, ON_STACK);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 5);
+ 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_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_register_convertible (gdbarch, i386_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch,
+ 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_push_arguments (gdbarch, i386_push_arguments);
- set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
- /* NOTE: tm-i386nw.h and tm-i386v4.h override this. */
- set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
+ /* "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. */
+ set_gdbarch_parm_boundary (gdbarch, 32);
- /* NOTE: tm-i386aix.h, tm-i386bsd.h, tm-i386os9k.h, tm-linux.h,
- tm-ptx.h, tm-symmetry.h currently override this. Sigh. */
- set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SSE_REGS);
+ set_gdbarch_extract_return_value (gdbarch, i386_extract_return_value);
+ set_gdbarch_push_arguments (gdbarch, i386_push_arguments);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_push_return_address (gdbarch, i386_push_return_address);
+ set_gdbarch_pop_frame (gdbarch, i386_pop_frame);
+ set_gdbarch_store_struct_return (gdbarch, i386_store_struct_return);
+ set_gdbarch_deprecated_store_return_value (gdbarch, i386_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ i386_extract_struct_value_address);
+ set_gdbarch_use_struct_convention (gdbarch, i386_use_struct_convention);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, i386_frame_init_saved_regs);
+ set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue);
+
+ /* Stack grows downward. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_breakpoint_from_pc (gdbarch, i386_breakpoint_from_pc);
+ set_gdbarch_decr_pc_after_break (gdbarch, 1);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ /* The following redefines make backtracing through sigtramp work.
+ They manufacture a fake sigtramp frame and obtain the saved pc in
+ sigtramp from the sigcontext structure which is pushed by the
+ kernel on the user stack, along with a pointer to it. */
+
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ i386_frameless_function_invocation);
+ 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);
+
+ /* Wire in the MMX registers. */
+ set_gdbarch_num_pseudo_regs (gdbarch, mmx_num_regs);
+ set_gdbarch_pseudo_register_read (gdbarch, i386_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, i386_pseudo_register_write);
/* Hook in ABI-specific overrides, if they have been registered. */
- if (abi == I386_ABI_UNKNOWN)
- {
- /* Don't complain about not knowing the ABI variant if we don't
- have an inferior. */
- if (info.abfd)
- fprintf_filtered
- (gdb_stderr, "GDB doesn't recognize the ABI of the inferior. "
- "Attempting to continue with the default i386 settings");
- }
- else
- {
- for (abi_handler = i386_abi_handler_list; abi_handler != NULL;
- abi_handler = abi_handler->next)
- if (abi_handler->abi == abi)
- break;
+ gdbarch_init_osabi (info, gdbarch, osabi);
- if (abi_handler)
- abi_handler->init_abi (info, gdbarch);
- else
- {
- /* We assume that if GDB_MULTI_ARCH is less than
- GDB_MULTI_ARCH_TM that an ABI variant can be supported by
- overriding definitions in this file. */
- if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- fprintf_filtered
- (gdb_stderr,
- "A handler for the ABI variant \"%s\" is not built into this "
- "configuration of GDB. "
- "Attempting to continue with the default i386 settings",
- i386_abi_names[abi]);
- }
- }
-
return gdbarch;
}
+static enum gdb_osabi
+i386_coff_osabi_sniffer (bfd *abfd)
+{
+ if (strcmp (bfd_get_target (abfd), "coff-go32-exe") == 0
+ || strcmp (bfd_get_target (abfd), "coff-go32") == 0)
+ return GDB_OSABI_GO32;
+
+ return GDB_OSABI_UNKNOWN;
+}
+
+static enum gdb_osabi
+i386_nlm_osabi_sniffer (bfd *abfd)
+{
+ return GDB_OSABI_NETWARE;
+}
+
+
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_i386_tdep (void);
@@ -1515,19 +1601,6 @@ _initialize_i386_tdep (void)
{
register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init);
- /* Initialize the table saying where each register starts in the
- register file. */
- {
- int i, offset;
-
- offset = 0;
- for (i = 0; i < MAX_NUM_REGS; i++)
- {
- i386_register_offset[i] = offset;
- offset += i386_register_size[i];
- }
- }
-
tm_print_insn = gdb_print_insn_i386;
tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach;
@@ -1544,4 +1617,30 @@ and the default value is \"att\".",
&setlist);
add_show_from_set (new_cmd, &showlist);
}
+
+ /* Add the variable that controls the convention for returning
+ structs. */
+ {
+ struct cmd_list_element *new_cmd;
+
+ new_cmd = add_set_enum_cmd ("struct-convention", no_class,
+ valid_conventions,
+ &struct_convention, "\
+Set the convention for returning small structs, valid values \
+are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".",
+ &setlist);
+ add_show_from_set (new_cmd, &showlist);
+ }
+
+ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
+ i386_coff_osabi_sniffer);
+ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_nlm_flavour,
+ i386_nlm_osabi_sniffer);
+
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SVR4,
+ i386_svr4_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_GO32,
+ i386_go32_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETWARE,
+ i386_nw_init_abi);
}
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 0bdbb057e2f..30128d9341a 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -1,5 +1,5 @@
/* Target-dependent code for GDB, the GNU debugger.
- Copyright 2001
+ Copyright 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,6 +22,8 @@
#ifndef I386_TDEP_H
#define I386_TDEP_H
+#include "osabi.h"
+
/* GDB's i386 target supports both the 32-bit Intel Architecture
(IA-32) and the 64-bit AMD x86-64 architecture. Internally it uses
a similar register layout for both.
@@ -40,30 +42,39 @@
differs and is determined by the num_xmm_regs member of `struct
gdbarch_tdep'. */
-/* ABI variants that we know about. */
-enum i386_abi
-{
- I386_ABI_UNKNOWN = 0,
-
- /* ELF */
- I386_ABI_SVR4, /* This is the default. */
- I386_ABI_NETBSD,
- I386_ABI_LINUX,
- I386_ABI_HURD,
- I386_ABI_SOLARIS,
- I386_ABI_FREEBSD,
+/* Convention for returning structures. */
- I386_ABI_INVALID = -1
+enum struct_return
+{
+ pcc_struct_return, /* Return "short" structures in memory. */
+ reg_struct_return /* Return "short" structures in registers. */
};
/* i386 architecture specific information. */
struct gdbarch_tdep
{
/* ABI. */
- enum i386_abi abi;
+ enum gdb_osabi osabi;
/* Number of SSE registers. */
int num_xmm_regs;
+
+ /* Offset of saved PC in jmp_buf. */
+ int jb_pc_offset;
+
+ /* Convention for returning structures. */
+ enum struct_return struct_return;
+
+ /* Address range where sigtramp lives. */
+ CORE_ADDR sigtramp_start;
+ CORE_ADDR sigtramp_end;
+
+ /* Get address of sigcontext for sigtramp. */
+ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
+
+ /* Offset of saved PC and SP in `struct sigcontext'. */
+ int sc_pc_offset;
+ int sc_sp_offset;
};
/* Floating-point registers. */
@@ -103,7 +114,7 @@ struct gdbarch_tdep
#define FOP_REGNUM (FPC_REGNUM + 7)
/* Return non-zero if N corresponds to a FPU data registers. */
-#define FP_REGNUM_P(n) (FP0_REGNUM <= (n) && (n) < FPC_REGNUM)
+#define FP_REGNUM_P(n) (FP0_REGNUM && FP0_REGNUM <= (n) && (n) < FPC_REGNUM)
/* Return non-zero if N corresponds to a FPU control register. */
#define FPC_REGNUM_P(n) (FPC_REGNUM <= (n) && (n) < XMM0_REGNUM)
@@ -129,8 +140,40 @@ struct gdbarch_tdep
#define IS_FPU_CTRL_REGNUM(n) FPC_REGNUM_P (n)
#define IS_SSE_REGNUM(n) SSE_REGNUM_P (n)
-void i386_gdbarch_register_os_abi (enum i386_abi,
- void (*init_abi)(struct gdbarch_info,
- struct gdbarch *));
+#define I386_NUM_GREGS 16
+#define I386_NUM_FREGS 16
+#define I386_NUM_XREGS 9
+
+#define I386_SSE_NUM_REGS (I386_NUM_GREGS + I386_NUM_FREGS \
+ + I386_NUM_XREGS)
+
+/* Sizes of individual register sets. These cover the entire register
+ file, so summing up the sizes of those portions actually present
+ yields REGISTER_BYTES. */
+#define I386_SIZEOF_GREGS (I386_NUM_GREGS * 4)
+#define I386_SIZEOF_FREGS (8 * 10 + 8 * 4)
+#define I386_SIZEOF_XREGS (8 * 16 + 4)
+
+#define I386_SSE_SIZEOF_REGS (I386_SIZEOF_GREGS + I386_SIZEOF_FREGS \
+ + I386_SIZEOF_XREGS)
+
+/* Size of the largest register. */
+#define I386_MAX_REGISTER_SIZE 16
+
+/* Functions exported from i386-tdep.c. */
+extern CORE_ADDR i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name);
+
+/* Return the name of register REG. */
+extern char const *i386_register_name (int reg);
+
+/* Initialize a basic ELF architecture variant. */
+extern void i386_elf_init_abi (struct gdbarch_info, struct gdbarch *);
+
+/* Initialize a SVR4 architecture variant. */
+extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
+
+/* Functions exported from i386bsd-tdep.c. */
+
+extern CORE_ADDR i386bsd_sigcontext_addr (struct frame_info *frame);
#endif /* i386-tdep.h */
diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c
index 2d8d7b9c710..3cca5e43fe1 100644
--- a/gdb/i386aix-nat.c
+++ b/gdb/i386aix-nat.c
@@ -1,377 +1,377 @@
-/* Intel 386 native support.
- Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "language.h"
-#include "gdbcore.h"
-#include "regcache.h"
-
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/file.h>
-#include "gdb_stat.h"
-
-#include <stddef.h>
-#include <sys/ptrace.h>
-
-/* Does AIX define this in <errno.h>? */
-extern int errno;
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
-
-#include "floatformat.h"
-
-#include "target.h"
-
-static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
-
-
-/* this table must line up with REGISTER_NAMES in tm-i386v.h */
-/* symbols like 'EAX' come from <sys/reg.h> */
-static int regmap[] =
-{
- EAX, ECX, EDX, EBX,
- USP, EBP, ESI, EDI,
- EIP, EFL, CS, SS,
- DS, ES, FS, GS,
-};
-
-/* blockend is the value of u.u_ar0, and points to the
- * place where GS is stored
- */
-
-int
-i386_register_u_addr (int blockend, int regnum)
-{
-#if 0
- /* this will be needed if fp registers are reinstated */
- /* for now, you can look at them with 'info float'
- * sys5 wont let you change them with ptrace anyway
- */
- if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM)
- {
- int ubase, fpstate;
- struct user u;
- ubase = blockend + 4 * (SS + 1) - KSTKSZ;
- fpstate = ubase + ((char *) &u.u_fpstate - (char *) &u);
- return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM));
- }
- else
-#endif
- return (blockend + 4 * regmap[regnum]);
-
-}
-
-/* The code below only work on the aix ps/2 (i386-ibm-aix) -
- * mtranle@paris - Sat Apr 11 10:34:12 1992
- */
-
-struct env387
-{
- unsigned short control;
- unsigned short r0;
- unsigned short status;
- unsigned short r1;
- unsigned short tag;
- unsigned short r2;
- unsigned long eip;
- unsigned short code_seg;
- unsigned short opcode;
- unsigned long operand;
- unsigned short operand_seg;
- unsigned short r3;
- unsigned char regs[8][10];
-};
-
-static
-print_387_status (unsigned short status, struct env387 *ep)
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
- unsigned char *p;
-
- bothstatus = ((status != 0) && (ep->status != 0));
- if (status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("u: ");
- print_387_status_word (status);
- }
-
- if (ep->status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("e: ");
- print_387_status_word (ep->status);
- }
-
- print_387_control_word (ep->control);
- printf_unfiltered ("last exception: ");
- printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode));
- printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg));
- printf_unfiltered ("%s; ", local_hex_string (ep->eip));
- printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg));
- printf_unfiltered (":%s\n", local_hex_string (ep->operand));
-
- top = ((ep->status >> 11) & 7);
-
- printf_unfiltered ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep->tag >> ((7 - fpreg) * 2)) & 3)
- {
- case 0:
- printf_unfiltered ("valid ");
- break;
- case 1:
- printf_unfiltered ("zero ");
- break;
- case 2:
- printf_unfiltered ("trap ");
- break;
- case 3:
- printf_unfiltered ("empty ");
- break;
- }
- for (i = 9; i >= 0; i--)
- printf_unfiltered ("%02x", ep->regs[fpreg][i]);
-
- i387_to_double ((char *) ep->regs[fpreg], (char *) &val);
- printf_unfiltered (" %#g\n", val);
- }
-}
-
-static struct env387 core_env387;
-
-void
-i386_float_info (void)
-{
- struct env387 fps;
- int fpsaved = 0;
- /* We need to reverse the order of the registers. Apparently AIX stores
- the highest-numbered ones first. */
- struct env387 fps_fixed;
- int i;
-
- if (! ptid_equal (inferior_ptid, null_ptid))
- {
- char buf[10];
- unsigned short status;
-
- ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf,
- offsetof (struct env387, status));
- memcpy (&status, buf, sizeof (status));
- fpsaved = status;
- }
- else
- {
- if ((fpsaved = core_env387.status) != 0)
- memcpy (&fps, &core_env387, sizeof (fps));
- }
-
- if (fpsaved == 0)
- {
- printf_unfiltered ("no floating point status saved\n");
- return;
- }
-
- if (! ptid_equal (inferior_ptid, null_ptid))
- {
- int offset;
- for (offset = 0; offset < sizeof (fps); offset += 10)
- {
- char buf[10];
- ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf, offset);
- memcpy ((char *) &fps.control + offset, buf,
- MIN (10, sizeof (fps) - offset));
- }
- }
- fps_fixed = fps;
- for (i = 0; i < 8; ++i)
- memcpy (fps_fixed.regs[i], fps.regs[7 - i], 10);
- print_387_status (0, &fps_fixed);
-}
-
-/* Fetch one register. */
-static void
-fetch_register (int regno)
-{
- char buf[MAX_REGISTER_RAW_SIZE];
- if (regno < FP0_REGNUM)
- *(int *) buf = ptrace (PT_READ_GPR, PIDGET (inferior_ptid),
- PT_REG (regmap[regno]), 0, 0);
- else
- ptrace (PT_READ_FPR, PIDGET (inferior_ptid), buf,
- (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
- supply_register (regno, buf);
-}
-
-void
-fetch_inferior_registers (int regno)
-{
- if (regno < 0)
- for (regno = 0; regno < NUM_REGS; regno++)
- fetch_register (regno);
- else
- fetch_register (regno);
-}
-
-/* store one register */
-static void
-store_register (int regno)
-{
- char buf[80];
- errno = 0;
- if (regno < FP0_REGNUM)
- ptrace (PT_WRITE_GPR, PIDGET (inferior_ptid), PT_REG (regmap[regno]),
- *(int *) &registers[REGISTER_BYTE (regno)], 0);
- else
- ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid),
- &registers[REGISTER_BYTE (regno)],
- (regno - FP0_REGNUM) * 10 + offsetof (struct env387, regs));
-
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-void
-store_inferior_registers (int regno)
-{
- if (regno < 0)
- for (regno = 0; regno < NUM_REGS; regno++)
- store_register (regno);
- else
- store_register (regno);
-}
-
-#ifndef CD_AX /* defined in sys/i386/coredump.h */
-#define CD_AX 0
-#define CD_BX 1
-#define CD_CX 2
-#define CD_DX 3
-#define CD_SI 4
-#define CD_DI 5
-#define CD_BP 6
-#define CD_SP 7
-#define CD_FL 8
-#define CD_IP 9
-#define CD_CS 10
-#define CD_DS 11
-#define CD_ES 12
-#define CD_FS 13
-#define CD_GS 14
-#define CD_SS 15
-#endif
-
-/*
- * The order here in core_regmap[] has to be the same as in
- * regmap[] above.
- */
-static int core_regmap[] =
-{
- CD_AX, CD_CX, CD_DX, CD_BX,
- CD_SP, CD_BP, CD_SI, CD_DI,
- CD_IP, CD_FL, CD_CS, CD_SS,
- CD_DS, CD_ES, CD_FS, CD_GS,
-};
-
-/* Provide registers to GDB from a core file.
-
- CORE_REG_SECT points to an array of bytes, which were obtained from
- a core file which BFD thinks might contain register contents.
- CORE_REG_SIZE is its size.
-
- WHICH says which register set corelow suspects this is:
- 0 --- the general-purpose register set
- 2 --- the floating-point register set
-
- REG_ADDR isn't used. */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr)
-{
-
- if (which == 0)
- {
- /* Integer registers */
-
-#define cd_regs(n) ((int *)core_reg_sect)[n]
-#define regs(n) *((int *) &registers[REGISTER_BYTE (n)])
-
- int i;
- for (i = 0; i < FP0_REGNUM; i++)
- regs (i) = cd_regs (core_regmap[i]);
- }
- else if (which == 2)
- {
- /* Floating point registers */
-
- if (core_reg_size >= sizeof (core_env387))
- memcpy (&core_env387, core_reg_sect, core_reg_size);
- else
- fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
- }
-}
-
-
-/* Register that we are able to handle i386aix core file formats.
- FIXME: is this really bfd_target_unknown_flavour? */
-
-static struct core_fns i386aix_core_fns =
-{
- bfd_target_unknown_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
-
-void
-_initialize_core_i386aix (void)
-{
- add_core_fns (&i386aix_core_fns);
-}
+// 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 <sys/types.h>
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE #include <sys/param.h>
+// OBSOLETE #include <sys/dir.h>
+// OBSOLETE #include <signal.h>
+// OBSOLETE #include <sys/user.h>
+// OBSOLETE #include <sys/ioctl.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE
+// OBSOLETE #include <sys/file.h>
+// OBSOLETE #include "gdb_stat.h"
+// OBSOLETE
+// OBSOLETE #include <stddef.h>
+// OBSOLETE #include <sys/ptrace.h>
+// OBSOLETE
+// OBSOLETE /* Does AIX define this in <errno.h>? */
+// OBSOLETE extern int errno;
+// OBSOLETE
+// OBSOLETE #ifdef HAVE_SYS_REG_H
+// OBSOLETE #include <sys/reg.h>
+// 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 <sys/reg.h> */
+// 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 *) &registers[REGISTER_BYTE (regno)], 0);
+// OBSOLETE else
+// OBSOLETE ptrace (PT_WRITE_FPR, PIDGET (inferior_ptid),
+// OBSOLETE &registers[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 *) &registers[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/i386b-nat.c b/gdb/i386b-nat.c
index be8fd4508d4..3c8a17c2719 100644
--- a/gdb/i386b-nat.c
+++ b/gdb/i386b-nat.c
@@ -21,57 +21,6 @@
#include "defs.h"
-#ifdef FETCH_INFERIOR_REGISTERS
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#include <machine/frame.h>
-#include "inferior.h"
-#include "gdbcore.h" /* for registers_fetched() */
-#include "regcache.h"
-
-void
-fetch_inferior_registers (int regno)
-{
- struct reg inferior_registers;
-
- ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_registers, 0);
- memcpy (&registers[REGISTER_BYTE (0)], &inferior_registers, 4 * NUM_REGS);
- registers_fetched ();
-}
-
-void
-store_inferior_registers (int regno)
-{
- struct reg inferior_registers;
-
- memcpy (&inferior_registers, &registers[REGISTER_BYTE (0)], 4 * NUM_REGS);
- ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_registers, 0);
-}
-
-struct md_core
-{
- struct reg intreg;
- struct fpreg freg;
-};
-
-void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
- CORE_ADDR ignore)
-{
- struct md_core *core_reg = (struct md_core *) core_reg_sect;
-
- /* integer registers */
- memcpy (&registers[REGISTER_BYTE (0)], &core_reg->intreg,
- sizeof (struct reg));
- /* floating point registers */
- /* XXX */
-}
-
-#else
-
#include <machine/reg.h>
/* this table must line up with REGISTER_NAMES in tm-i386.h */
@@ -121,171 +70,3 @@ i386_register_u_addr (int blockend, int regnum)
else
return (blockend + 4 * sregmap[regnum]);
}
-
-#endif /* !FETCH_INFERIOR_REGISTERS */
-
-#ifdef FLOAT_INFO
-#include "expression.h"
-#include "language.h" /* for local_hex_string */
-#include "floatformat.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <a.out.h>
-
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/uio.h>
-#define curpcb Xcurpcb /* XXX avoid leaking declaration from pcb.h */
-#include <sys/user.h>
-#undef curpcb
-#include <sys/file.h>
-#include "gdb_stat.h"
-#include <sys/ptrace.h>
-
-extern void print_387_control_word (); /* i387-tdep.h */
-extern void print_387_status_word ();
-
-#define fpstate save87
-#define U_FPSTATE(u) u.u_pcb.pcb_savefpu
-
-struct env387
- {
- unsigned short control;
- unsigned short r0;
- unsigned short status;
- unsigned short r1;
- unsigned short tag;
- unsigned short r2;
- unsigned long eip;
- unsigned short code_seg;
- unsigned short opcode;
- unsigned long operand;
- unsigned short operand_seg;
- unsigned short r3;
- unsigned char regs[8][10];
- };
-
-static void
-print_387_status (unsigned short status, struct env387 *ep)
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
-
- bothstatus = ((status != 0) && (ep->status != 0));
- if (status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("u: ");
- print_387_status_word ((unsigned int) status);
- }
-
- if (ep->status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("e: ");
- print_387_status_word ((unsigned int) ep->status);
- }
-
- print_387_control_word ((unsigned int) ep->control);
- printf_unfiltered ("last exception: ");
- printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode));
- printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg));
- printf_unfiltered ("%s; ", local_hex_string (ep->eip));
- printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg));
- printf_unfiltered (":%s\n", local_hex_string (ep->operand));
-
- top = (ep->status >> 11) & 7;
-
- printf_unfiltered ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep->tag >> (fpreg * 2)) & 3)
- {
- case 0:
- printf_unfiltered ("valid ");
- break;
- case 1:
- printf_unfiltered ("zero ");
- break;
- case 2:
- printf_unfiltered ("trap ");
- break;
- case 3:
- printf_unfiltered ("empty ");
- break;
- }
- for (i = 9; i >= 0; i--)
- printf_unfiltered ("%02x", ep->regs[fpreg][i]);
-
- floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg],
- &val);
- printf_unfiltered (" %g\n", val);
- }
-}
-
-i386_float_info (void)
-{
- struct user u; /* just for address computations */
- int i;
- /* fpstate defined in <sys/user.h> */
- struct fpstate *fpstatep;
- char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
- unsigned int uaddr;
- char fpvalid;
- unsigned int rounded_addr;
- unsigned int rounded_size;
- /*extern int corechan; */
- int skip;
-
- uaddr = (char *) &U_FPSTATE (u) - (char *) &u;
- if (! ptid_equal (inferior_ptid, null_ptid))
- {
- int *ip;
-
- rounded_addr = uaddr & -sizeof (int);
- rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) +
- sizeof (int) - 1) / sizeof (int);
- skip = uaddr - rounded_addr;
-
- ip = (int *) buf;
- for (i = 0; i < rounded_size; i++)
- {
- *ip++ = ptrace (PT_READ_U, PIDGET (inferior_ptid),
- (caddr_t) rounded_addr, 0);
- rounded_addr += sizeof (int);
- }
- }
- else
- {
- printf ("float info: can't do a core file (yet)\n");
- return;
-#if 0
- if (lseek (corechan, uaddr, 0) < 0)
- perror_with_name ("seek on core file");
- if (myread (corechan, buf, sizeof (struct fpstate)) < 0)
- perror_with_name ("read from core file");
- skip = 0;
-#endif
- }
-
- print_387_status (0, (struct env387 *) buf);
-}
-
-int
-kernel_u_size (void)
-{
- return (sizeof (struct user));
-}
-
-#endif
diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c
index ad5a3013f34..8a3acd4cf58 100644
--- a/gdb/i386bsd-nat.c
+++ b/gdb/i386bsd-nat.c
@@ -43,6 +43,7 @@ typedef struct fpreg fpregset_t;
#endif
#include "gregset.h"
+#include "i386-tdep.h"
/* In older BSD versions we cannot get at some of the segment
@@ -125,7 +126,7 @@ supply_gregset (gregset_t *gregsetp)
{
int i;
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
{
if (CANNOT_FETCH_REGISTER (i))
supply_register (i, NULL);
@@ -143,7 +144,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
{
int i;
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
regcache_collect (i, REG_ADDR (gregsetp, i));
}
@@ -382,19 +383,59 @@ kernel_u_size (void)
return (sizeof (struct user));
}
-/* See i386bsd-tdep.c. */
-extern int i386bsd_sigcontext_pc_offset;
-
void
_initialize_i386bsd_nat (void)
{
+ int sc_pc_offset;
+ int sc_sp_offset;
+
/* To support the recognition of signal handlers, i386bsd-tdep.c
hardcodes some constants. Inclusion of this file means that we
are compiling a native debugger, which means that we can use the
system header files and sysctl(3) to get at the relevant
information. */
+#if defined (__FreeBSD_version) && __FreeBSD_version >= 400011
+ extern int i386fbsd4_sc_pc_offset;
+ extern int i386fbsd4_sc_sp_offset;
+#define SC_PC_OFFSET i386fbsd4_sc_pc_offset
+#define SC_SP_OFFSET i386fbsd4_sc_sp_offset
+#elif defined (NetBSD) || defined (__NetBSD_Version__) || defined (OpenBSD)
+ extern int i386nbsd_sc_pc_offset;
+ extern int i386nbsd_sc_sp_offset;
+#define SC_PC_OFFSET i386nbsd_sc_pc_offset
+#define SC_SP_OFFSET i386nbsd_sc_sp_offset
+#else
+ extern int i386bsd_sc_pc_offset;
+ extern int i386bsd_sc_sp_offset;
+#define SC_PC_OFFSET i386bsd_sc_pc_offset
+#define SC_SP_OFFSET i386bsd_sc_sp_offset
+#endif
+
/* Override the default value for the offset of the program counter
in the sigcontext structure. */
- i386bsd_sigcontext_pc_offset = offsetof (struct sigcontext, sc_pc);
+ sc_pc_offset = offsetof (struct sigcontext, sc_pc);
+
+ if (SC_PC_OFFSET != sc_pc_offset)
+ {
+ warning ("\
+offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>.",
+ sc_pc_offset, SC_PC_OFFSET);
+ }
+
+ SC_PC_OFFSET = sc_pc_offset;
+
+ /* Likewise for the stack pointer. */
+ sc_sp_offset = offsetof (struct sigcontext, sc_sp);
+
+ if (SC_SP_OFFSET != sc_sp_offset)
+ {
+ warning ("\
+offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>.",
+ sc_sp_offset, SC_SP_OFFSET);
+ }
+
+ SC_SP_OFFSET = sc_sp_offset;
}
diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c
index a01ed6b89e6..2edf3eaf107 100644
--- a/gdb/i386bsd-tdep.c
+++ b/gdb/i386bsd-tdep.c
@@ -1,5 +1,5 @@
/* Target-dependent code for i386 BSD's.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,35 +19,34 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "arch-utils.h"
#include "frame.h"
#include "gdbcore.h"
#include "regcache.h"
-/* Support for signal handlers. */
+#include "gdb_string.h"
-/* Range in which to find the signaltramp routine, traditionally found
- on the use stack, just below the user area. Initialized to values
- that work for NetBSD and FreeBSD. */
+#include "i386-tdep.h"
-CORE_ADDR i386bsd_sigtramp_start = 0xbfbfdf20;
-CORE_ADDR i386bsd_sigtramp_end = 0xbfbfdff0;
+/* Support for signal handlers. */
/* Return whether PC is in a BSD sigtramp routine. */
-int
-i386bsd_in_sigtramp (CORE_ADDR pc, char *name)
+static int
+i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
{
- return (pc >= i386bsd_sigtramp_start && pc < i386bsd_sigtramp_end);
-}
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-/* Offset in the sigcontext structure of the program counter.
- Initialized to the value from 4.4 BSD Lite. */
-int i386bsd_sigcontext_pc_offset = 20;
+ return (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end);
+}
/* Assuming FRAME is for a BSD sigtramp routine, return the address of
- the associated sigcontext structure. */
+ the associated sigcontext structure.
-static CORE_ADDR
+ Note: This function is used for Solaris 2 too, so don't make it
+ static. */
+
+CORE_ADDR
i386bsd_sigcontext_addr (struct frame_info *frame)
{
if (frame->next)
@@ -61,24 +60,198 @@ i386bsd_sigcontext_addr (struct frame_info *frame)
return read_memory_unsigned_integer (read_register (SP_REGNUM) + 8, 4);
}
-/* Assuming FRAME is for a BSD sigtramp routine, return the saved
- program counter. */
+/* Return the start address of the sigtramp routine. */
-static CORE_ADDR
-i386bsd_sigtramp_saved_pc (struct frame_info *frame)
+CORE_ADDR
+i386bsd_sigtramp_start (CORE_ADDR pc)
{
- CORE_ADDR addr;
- addr = i386bsd_sigcontext_addr (frame);
- return read_memory_unsigned_integer (addr + i386bsd_sigcontext_pc_offset, 4);
+ return gdbarch_tdep (current_gdbarch)->sigtramp_start;
}
-/* Return the saved program counter for FRAME. */
+/* Return the end address of the sigtramp routine. */
CORE_ADDR
-i386bsd_frame_saved_pc (struct frame_info *frame)
+i386bsd_sigtramp_end (CORE_ADDR pc)
+{
+ return gdbarch_tdep (current_gdbarch)->sigtramp_end;
+}
+
+
+/* Support for shared libraries. */
+
+/* Return non-zero if we are in a shared library trampoline code stub. */
+
+int
+i386bsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ return (name && !strcmp (name, "_DYNAMIC"));
+}
+
+/* Traditional BSD (4.3 BSD, still used for BSDI and 386BSD). */
+
+/* From <machine/signal.h>. */
+int i386bsd_sc_pc_offset = 20;
+int i386bsd_sc_sp_offset = 8;
+
+static void
+i386bsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
+
+ /* Assume SunOS-style shared libraries. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch,
+ i386bsd_aout_in_solib_call_trampoline);
+
+ tdep->jb_pc_offset = 0;
+
+ tdep->sigtramp_start = 0xfdbfdfc0;
+ tdep->sigtramp_end = 0xfdbfe000;
+ tdep->sigcontext_addr = i386bsd_sigcontext_addr;
+ tdep->sc_pc_offset = i386bsd_sc_pc_offset;
+ tdep->sc_sp_offset = i386bsd_sc_sp_offset;
+}
+
+/* NetBSD 1.0 or later. */
+
+CORE_ADDR i386nbsd_sigtramp_start = 0xbfbfdf20;
+CORE_ADDR i386nbsd_sigtramp_end = 0xbfbfdff0;
+
+/* From <machine/signal.h>. */
+int i386nbsd_sc_pc_offset = 44;
+int i386nbsd_sc_sp_offset = 56;
+
+static void
+i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Obviously NetBSD is BSD-based. */
+ i386bsd_init_abi (info, gdbarch);
+
+ /* NetBSD uses -freg-struct-return by default. */
+ tdep->struct_return = reg_struct_return;
+
+ /* NetBSD uses a different memory layout. */
+ tdep->sigtramp_start = i386nbsd_sigtramp_start;
+ tdep->sigtramp_end = i386nbsd_sigtramp_end;
+
+ /* NetBSD has a `struct sigcontext' that's different from the
+ origional 4.3 BSD. */
+ tdep->sc_pc_offset = i386nbsd_sc_pc_offset;
+ tdep->sc_sp_offset = i386nbsd_sc_sp_offset;
+}
+
+/* NetBSD ELF. */
+static void
+i386nbsdelf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* It's still NetBSD. */
+ i386nbsd_init_abi (info, gdbarch);
+
+ /* But ELF-based. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* NetBSD ELF uses SVR4-style shared libraries. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch,
+ generic_in_solib_call_trampoline);
+
+ /* NetBSD ELF uses -fpcc-struct-return by default. */
+ tdep->struct_return = pcc_struct_return;
+
+ /* We support the SSE registers on NetBSD ELF. */
+ tdep->num_xmm_regs = I386_NUM_XREGS - 1;
+ set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS
+ + I386_NUM_XREGS);
+}
+
+/* FreeBSD 3.0-RELEASE or later. */
+
+CORE_ADDR i386fbsd_sigtramp_start = 0xbfbfdf20;
+CORE_ADDR i386fbsd_sigtramp_end = 0xbfbfdff0;
+
+static void
+i386fbsdaout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Obviously FreeBSD is BSD-based. */
+ i386bsd_init_abi (info, gdbarch);
+
+ /* FreeBSD uses -freg-struct-return by default. */
+ tdep->struct_return = reg_struct_return;
+
+ /* FreeBSD uses a different memory layout. */
+ tdep->sigtramp_start = i386fbsd_sigtramp_start;
+ tdep->sigtramp_end = i386fbsd_sigtramp_end;
+}
+
+static void
+i386fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ /* It's almost identical to FreeBSD a.out. */
+ i386fbsdaout_init_abi (info, gdbarch);
+
+ /* Except that it uses ELF. */
+ i386_elf_init_abi (info, gdbarch);
+
+ /* FreeBSD ELF uses SVR4-style shared libraries. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch,
+ generic_in_solib_call_trampoline);
+}
+
+/* FreeBSD 4.0-RELEASE or later. */
+
+/* From <machine/signal.h>. */
+int i386fbsd4_sc_pc_offset = 76;
+int i386fbsd4_sc_sp_offset = 88;
+
+static void
+i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Inherit stuff from older releases. We assume that FreeBSD
+ 4.0-RELEASE always uses ELF. */
+ i386fbsd_init_abi (info, gdbarch);
+
+ /* FreeBSD 4.0 introduced a new `struct sigcontext'. */
+ tdep->sc_pc_offset = i386fbsd4_sc_pc_offset;
+ tdep->sc_sp_offset = i386fbsd4_sc_sp_offset;
+}
+
+
+static enum gdb_osabi
+i386bsd_aout_osabi_sniffer (bfd *abfd)
+{
+ if (strcmp (bfd_get_target (abfd), "a.out-i386-netbsd") == 0)
+ return GDB_OSABI_NETBSD_AOUT;
+
+ if (strcmp (bfd_get_target (abfd), "a.out-i386-freebsd") == 0)
+ return GDB_OSABI_FREEBSD_AOUT;
+
+ return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_i386bsd_tdep (void);
+
+void
+_initialize_i386bsd_tdep (void)
{
- if (frame->signal_handler_caller)
- return i386bsd_sigtramp_saved_pc (frame);
+ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour,
+ i386bsd_aout_osabi_sniffer);
- return read_memory_unsigned_integer (frame->frame + 4, 4);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_AOUT,
+ i386nbsd_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_ELF,
+ i386nbsdelf_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_AOUT,
+ i386fbsdaout_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_ELF,
+ i386fbsd4_init_abi);
}
diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c
index 1c19ac87eb4..a80d0a0af89 100644
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -1,5 +1,5 @@
/* Native-dependent code for FreeBSD/i386.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -79,7 +79,7 @@ _initialize_i386fbsd_nat (void)
{
/* FreeBSD provides a kern.ps_strings sysctl that we can use to
locate the sigtramp. That way we can still recognize a sigtramp
- if it's location is changed in a new kernel. Of course this is
+ if its location is changed in a new kernel. Of course this is
still based on the assumption that the sigtramp is placed
directly under the location where the program arguments and
environment can be found. */
@@ -89,13 +89,16 @@ _initialize_i386fbsd_nat (void)
int ps_strings;
size_t len;
+ extern CORE_ADDR i386fbsd_sigtramp_start;
+ extern CORE_ADDR i386fbsd_sigtramp_end;
+
mib[0] = CTL_KERN;
mib[1] = KERN_PS_STRINGS;
len = sizeof (ps_strings);
if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
{
- i386bsd_sigtramp_start = ps_strings - 128;
- i386bsd_sigtramp_end = ps_strings;
+ i386fbsd_sigtramp_start = ps_strings - 128;
+ i386fbsd_sigtramp_end = ps_strings;
}
}
#endif
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 329ef2fd17a..3fa99a34d88 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -99,7 +99,7 @@ void
supply_gregset (gdb_gregset_t *gregs)
{
int i;
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
supply_register (i, REG_ADDR (gregs, i));
}
@@ -124,7 +124,7 @@ gnu_fetch_registers (int regno)
error ("Can't fetch registers from thread %d: No such thread",
PIDGET (inferior_ptid));
- if (regno < NUM_GREGS || regno == -1)
+ if (regno < I386_NUM_GREGS || regno == -1)
{
thread_state_t state;
@@ -143,7 +143,7 @@ gnu_fetch_registers (int regno)
proc_debug (thread, "fetching all register");
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
supply_register (i, REG_ADDR (state, i));
thread->fetched_regs = ~0;
}
@@ -156,7 +156,7 @@ gnu_fetch_registers (int regno)
}
}
- if (regno >= NUM_GREGS || regno == -1)
+ if (regno >= I386_NUM_GREGS || regno == -1)
{
proc_debug (thread, "fetching floating-point registers");
@@ -211,7 +211,7 @@ gnu_store_registers (int regno)
error ("Couldn't store registers into thread %d: No such thread",
PIDGET (inferior_ptid));
- if (regno < NUM_GREGS || regno == -1)
+ if (regno < I386_NUM_GREGS || regno == -1)
{
thread_state_t state;
thread_state_data_t old_state;
@@ -238,7 +238,7 @@ gnu_store_registers (int regno)
{
int check_regno;
- for (check_regno = 0; check_regno < NUM_GREGS; check_regno++)
+ for (check_regno = 0; check_regno < I386_NUM_GREGS; check_regno++)
if ((thread->fetched_regs & (1 << check_regno))
&& memcpy (REG_ADDR (&old_state, check_regno),
REG_ADDR (state, check_regno),
@@ -265,7 +265,7 @@ gnu_store_registers (int regno)
proc_debug (thread, "storing all registers");
- for (i = 0; i < NUM_GREGS; i++)
+ for (i = 0; i < I386_NUM_GREGS; i++)
if (register_valid[i])
fill (state, i);
}
@@ -284,7 +284,7 @@ gnu_store_registers (int regno)
#undef fill
- if (regno >= NUM_GREGS || regno == -1)
+ if (regno >= I386_NUM_GREGS || regno == -1)
{
proc_debug (thread, "storing floating-point registers");
diff --git a/gdb/config/i386/tm-i386v.h b/gdb/i386gnu-tdep.c
index d524652e247..fa56428ec55 100644
--- a/gdb/config/i386/tm-i386v.h
+++ b/gdb/i386gnu-tdep.c
@@ -1,6 +1,5 @@
-/* Macro definitions for i386, Unix System V.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
- 2000, 2001 Free Software Foundation, Inc.
+/* Target-dependent code for the GNU Hurd.
+ Copyright 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,18 +18,26 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef TM_I386V_H
-#define TM_I386V_H 1
+#include "defs.h"
-/* First pick up the generic *86 target file. */
+#include "i386-tdep.h"
-#include "i386/tm-i386.h"
+static void
+i386gnu_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-/* Number of traps that happen between exec'ing the shell to run an
- inferior, and when we finally get to the inferior code. This is
- 2 on most implementations. Override here to 4. */
+ /* GNU uses ELF. */
+ i386_elf_init_abi (info, gdbarch);
-#undef START_INFERIOR_TRAPS_EXPECTED
-#define START_INFERIOR_TRAPS_EXPECTED 4
+ tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
+}
-#endif /* ifndef TM_I386V_H */
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern void _initialize_i386gnu_tdep (void);
+
+void
+_initialize_i386gnu_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_HURD, i386gnu_init_abi);
+}
diff --git a/gdb/i386ly-tdep.c b/gdb/i386ly-tdep.c
index 92b544deabd..69c37501d59 100644
--- a/gdb/i386ly-tdep.c
+++ b/gdb/i386ly-tdep.c
@@ -1,5 +1,5 @@
/* Target-dependent code for Intel 386 running LynxOS.
- Copyright 1993, 1996, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1993, 1996, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,27 +19,62 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "inferior.h"
-#include "target.h"
#include "gdbcore.h"
+#include "inferior.h"
#include "regcache.h"
+#include "target.h"
+
+#include "i386-tdep.h"
-/* Return the PC of the caller from the call frame. Assumes the subr prologue
- has already been executed, and the frame pointer setup. If this is the
- outermost frame, we check to see if we are in a system call by examining the
- previous instruction. If so, then the return PC is actually at SP+4 because
- system calls use a different calling sequence. */
+/* Return the PC of the caller from the call frame. Assumes the subr
+ prologue has already been executed, and the frame pointer setup.
+ If this is the outermost frame, we check to see if we are in a
+ system call by examining the previous instruction. If so, then the
+ return PC is actually at SP+4 because system calls use a different
+ calling sequence. */
-CORE_ADDR
+static CORE_ADDR
i386lynx_saved_pc_after_call (struct frame_info *frame)
{
char opcode[7];
static const unsigned char call_inst[] =
- {0x9a, 0, 0, 0, 0, 8, 0}; /* lcall 0x8,0x0 */
+ { 0x9a, 0, 0, 0, 0, 8, 0 }; /* lcall 0x8,0x0 */
- read_memory (frame->pc - 7, opcode, 7);
+ read_memory_nobpt (frame->pc - 7, opcode, 7);
if (memcmp (opcode, call_inst, 7) == 0)
- return read_memory_integer (read_register (SP_REGNUM) + 4, 4);
+ return read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
+
+ return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
+}
+
+
+/* LynxOS. */
+static void
+i386lynx_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ set_gdbarch_saved_pc_after_call (gdbarch, i386lynx_saved_pc_after_call);
+}
+
+
+static enum gdb_osabi
+i386lynx_coff_osabi_sniffer (bfd *abfd)
+{
+ if (strcmp (bfd_get_target (abfd), "coff-i386-lynx") == 0)
+ return GDB_OSABI_LYNXOS;
+
+ return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_i386lynx_tdep (void);
+
+void
+_initialize_i386bsd_tdep (void)
+{
+ gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
+ i386lynx_coff_osabi_sniffer);
- return read_memory_integer (read_register (SP_REGNUM), 4);
+ gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LYNXOS,
+ i386lynx_init_abi);
}
diff --git a/gdb/i386m3-nat.c b/gdb/i386m3-nat.c
index 8fbd1e8e81c..8cb51d51930 100644
--- a/gdb/i386m3-nat.c
+++ b/gdb/i386m3-nat.c
@@ -1,426 +1,426 @@
-/* Low level interface to I386 running mach 3.0.
- Copyright 1992, 1993, 1994, 1996, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "floatformat.h"
-#include "regcache.h"
-
-#include <stdio.h>
-
-#include <mach.h>
-#include <mach/message.h>
-#include <mach/exception.h>
-#include <mach_error.h>
-
-/* Hmmm... Should this not be here?
- * Now for i386_float_info() target_has_execution
- */
-#include <target.h>
-
-/* This mess is duplicated in bfd/i386mach3.h
-
- * This is an ugly way to hack around the incorrect
- * definition of UPAGES in i386/machparam.h.
- *
- * The definition should specify the size reserved
- * for "struct user" in core files in PAGES,
- * but instead it gives it in 512-byte core-clicks
- * for i386 and i860.
- */
-#include <sys/param.h>
-#if UPAGES == 16
-#define UAREA_SIZE ctob(UPAGES)
-#elif UPAGES == 2
-#define UAREA_SIZE (NBPG*UPAGES)
-#else
-FIXME ! !UPAGES is neither 2 nor 16
-#endif
-
-/* @@@ Should move print_387_status() to i387-tdep.c */
-extern void print_387_control_word (); /* i387-tdep.h */
-extern void print_387_status_word ();
-
-#define private static
-
-
-/* Find offsets to thread states at compile time.
- * If your compiler does not grok this, calculate offsets
- * offsets yourself and use them (or get a compatible compiler :-)
- */
-
-#define REG_OFFSET(reg) (int)(&((struct i386_thread_state *)0)->reg)
-
-/* at reg_offset[i] is the offset to the i386_thread_state
- * location where the gdb registers[i] is stored.
- */
-
-static int reg_offset[] =
-{
- REG_OFFSET (eax), REG_OFFSET (ecx), REG_OFFSET (edx), REG_OFFSET (ebx),
- REG_OFFSET (uesp), REG_OFFSET (ebp), REG_OFFSET (esi), REG_OFFSET (edi),
- REG_OFFSET (eip), REG_OFFSET (efl), REG_OFFSET (cs), REG_OFFSET (ss),
- REG_OFFSET (ds), REG_OFFSET (es), REG_OFFSET (fs), REG_OFFSET (gs)
-};
-
-#define REG_ADDRESS(state,regnum) ((char *)(state)+reg_offset[regnum])
-
-/* Fetch COUNT contiguous registers from thread STATE starting from REGNUM
- * Caller knows that the regs handled in one transaction are of same size.
- */
-#define FETCH_REGS(state, regnum, count) \
- memcpy (&registers[REGISTER_BYTE (regnum)], \
- REG_ADDRESS (state, regnum), \
- count*REGISTER_SIZE)
-
-/* Store COUNT contiguous registers to thread STATE starting from REGNUM */
-#define STORE_REGS(state, regnum, count) \
- memcpy (REG_ADDRESS (state, regnum), \
- &registers[REGISTER_BYTE (regnum)], \
- count*REGISTER_SIZE)
-
-/*
- * Fetch inferiors registers for gdb.
- * REGNO specifies which (as gdb views it) register, -1 for all.
- */
-
-void
-fetch_inferior_registers (int regno)
-{
- kern_return_t ret;
- thread_state_data_t state;
- unsigned int stateCnt = i386_THREAD_STATE_COUNT;
- int index;
-
- if (!MACH_PORT_VALID (current_thread))
- error ("fetch inferior registers: Invalid thread");
-
- if (must_suspend_thread)
- setup_thread (current_thread, 1);
-
- ret = thread_get_state (current_thread,
- i386_THREAD_STATE,
- state,
- &stateCnt);
-
- if (ret != KERN_SUCCESS)
- warning ("fetch_inferior_registers: %s ",
- mach_error_string (ret));
-#if 0
- /* It may be more effective to store validate all of them,
- * since we fetched them all anyway
- */
- else if (regno != -1)
- supply_register (regno, (char *) state + reg_offset[regno]);
-#endif
- else
- {
- for (index = 0; index < NUM_REGS; index++)
- supply_register (index, (char *) state + reg_offset[index]);
- }
-
- if (must_suspend_thread)
- setup_thread (current_thread, 0);
-}
-
-/* Store our register values back into the inferior.
- * If REGNO is -1, do this for all registers.
- * Otherwise, REGNO specifies which register
- *
- * On mach3 all registers are always saved in one call.
- */
-void
-store_inferior_registers (int regno)
-{
- kern_return_t ret;
- thread_state_data_t state;
- unsigned int stateCnt = i386_THREAD_STATE_COUNT;
- register int index;
-
- if (!MACH_PORT_VALID (current_thread))
- error ("store inferior registers: Invalid thread");
-
- if (must_suspend_thread)
- setup_thread (current_thread, 1);
-
- /* Fetch the state of the current thread */
- ret = thread_get_state (current_thread,
- i386_THREAD_STATE,
- state,
- &stateCnt);
-
- if (ret != KERN_SUCCESS)
- {
- warning ("store_inferior_registers (get): %s",
- mach_error_string (ret));
- if (must_suspend_thread)
- setup_thread (current_thread, 0);
- return;
- }
-
- /* move gdb's registers to thread's state
-
- * Since we save all registers anyway, save the ones
- * that gdb thinks are valid (e.g. ignore the regno
- * parameter)
- */
-#if 0
- if (regno != -1)
- STORE_REGS (state, regno, 1);
- else
-#endif
- {
- for (index = 0; index < NUM_REGS; index++)
- STORE_REGS (state, index, 1);
- }
-
- /* Write gdb's current view of register to the thread
- */
- ret = thread_set_state (current_thread,
- i386_THREAD_STATE,
- state,
- i386_THREAD_STATE_COUNT);
-
- if (ret != KERN_SUCCESS)
- warning ("store_inferior_registers (set): %s",
- mach_error_string (ret));
-
- if (must_suspend_thread)
- setup_thread (current_thread, 0);
-}
-
-
-
-/* Return the address in the core dump or inferior of register REGNO.
- * BLOCKEND should be the address of the end of the UPAGES area read
- * in memory, but it's not?
- *
- * Currently our UX server dumps the whole thread state to the
- * core file. If your UX does something else, adapt the routine
- * below to return the offset to the given register.
- *
- * Called by core-aout.c(fetch_core_registers)
- */
-
-CORE_ADDR
-register_addr (int regno, CORE_ADDR blockend)
-{
- CORE_ADDR addr;
-
- if (regno < 0 || regno >= NUM_REGS)
- error ("Invalid register number %d.", regno);
-
- /* UAREA_SIZE == 8 kB in i386 */
- addr = (unsigned int) REG_ADDRESS (UAREA_SIZE - sizeof (struct i386_thread_state), regno);
-
- return addr;
-}
-
-/* jtv@hut.fi: I copied and modified this 387 code from
- * gdb/i386-xdep.c. Modifications for Mach 3.0.
- *
- * i387 status dumper. See also i387-tdep.c
- */
-struct env387
-{
- unsigned short control;
- unsigned short r0;
- unsigned short status;
- unsigned short r1;
- unsigned short tag;
- unsigned short r2;
- unsigned long eip;
- unsigned short code_seg;
- unsigned short opcode;
- unsigned long operand;
- unsigned short operand_seg;
- unsigned short r3;
- unsigned char regs[8][10];
-};
-/* This routine is machine independent?
- * Should move it to i387-tdep.c but you need to export struct env387
- */
-private
-print_387_status (unsigned short status, struct env387 *ep)
-{
- int i;
- int bothstatus;
- int top;
- int fpreg;
- unsigned char *p;
-
- bothstatus = ((status != 0) && (ep->status != 0));
- if (status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("u: ");
- print_387_status_word (status);
- }
-
- if (ep->status != 0)
- {
- if (bothstatus)
- printf_unfiltered ("e: ");
- print_387_status_word (ep->status);
- }
-
- print_387_control_word (ep->control);
- printf_unfiltered ("last exception: ");
- printf_unfiltered ("opcode %s; ", local_hex_string (ep->opcode));
- printf_unfiltered ("pc %s:", local_hex_string (ep->code_seg));
- printf_unfiltered ("%s; ", local_hex_string (ep->eip));
- printf_unfiltered ("operand %s", local_hex_string (ep->operand_seg));
- printf_unfiltered (":%s\n", local_hex_string (ep->operand));
-
- top = (ep->status >> 11) & 7;
-
- printf_unfiltered ("regno tag msb lsb value\n");
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- double val;
-
- printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
-
- switch ((ep->tag >> (fpreg * 2)) & 3)
- {
- case 0:
- printf_unfiltered ("valid ");
- break;
- case 1:
- printf_unfiltered ("zero ");
- break;
- case 2:
- printf_unfiltered ("trap ");
- break;
- case 3:
- printf_unfiltered ("empty ");
- break;
- }
- for (i = 9; i >= 0; i--)
- printf_unfiltered ("%02x", ep->regs[fpreg][i]);
-
- floatformat_to_double (&floatformat_i387_ext, (char *) ep->regs[fpreg],
- &val);
- printf_unfiltered (" %g\n", val);
- }
- if (ep->r0)
- printf_unfiltered ("warning: reserved0 is %s\n", local_hex_string (ep->r0));
- if (ep->r1)
- printf_unfiltered ("warning: reserved1 is %s\n", local_hex_string (ep->r1));
- if (ep->r2)
- printf_unfiltered ("warning: reserved2 is %s\n", local_hex_string (ep->r2));
- if (ep->r3)
- printf_unfiltered ("warning: reserved3 is %s\n", local_hex_string (ep->r3));
-}
-
-/*
- * values that go into fp_kind (from <i386/fpreg.h>)
- */
-#define FP_NO 0 /* no fp chip, no emulator (no fp support) */
-#define FP_SW 1 /* no fp chip, using software emulator */
-#define FP_HW 2 /* chip present bit */
-#define FP_287 2 /* 80287 chip present */
-#define FP_387 3 /* 80387 chip present */
-
-typedef struct fpstate
-{
-#if 1
- unsigned char state[FP_STATE_BYTES]; /* "hardware" state */
-#else
- struct env387 state; /* Actually this */
-#endif
- int status; /* Duplicate status */
-}
- *fpstate_t;
-
-/* Mach 3 specific routines.
- */
-private boolean_t
-get_i387_state (struct fpstate *fstate)
-{
- kern_return_t ret;
- thread_state_data_t state;
- unsigned int fsCnt = i386_FLOAT_STATE_COUNT;
- struct i386_float_state *fsp;
-
- ret = thread_get_state (current_thread,
- i386_FLOAT_STATE,
- state,
- &fsCnt);
-
- if (ret != KERN_SUCCESS)
- {
- warning ("Can not get live floating point state: %s",
- mach_error_string (ret));
- return FALSE;
- }
-
- fsp = (struct i386_float_state *) state;
- /* The 387 chip (also 486 counts) or a software emulator? */
- if (!fsp->initialized || (fsp->fpkind != FP_387 && fsp->fpkind != FP_SW))
- return FALSE;
-
- /* Clear the target then copy thread's float state there.
- Make a copy of the status word, for some reason?
- */
- memset (fstate, 0, sizeof (struct fpstate));
-
- fstate->status = fsp->exc_status;
-
- memcpy (fstate->state, (char *) &fsp->hw_state, FP_STATE_BYTES);
-
- return TRUE;
-}
-
-private boolean_t
-get_i387_core_state (struct fpstate *fstate)
-{
- /* Not implemented yet. Core files do not contain float state. */
- return FALSE;
-}
-
-/*
- * This is called by "info float" command
- */
-void
-i386_mach3_float_info (void)
-{
- char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
- boolean_t valid = FALSE;
- fpstate_t fps;
-
- if (target_has_execution)
- valid = get_i387_state (buf);
-#if 0
- else if (WE HAVE CORE FILE) /* @@@@ Core files not supported */
- valid = get_i387_core_state (buf);
-#endif
-
- if (!valid)
- {
- warning ("no floating point status saved");
- return;
- }
-
- fps = (fpstate_t) buf;
-
- print_387_status (fps->status, (struct env387 *) fps->state);
-}
+// 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 <stdio.h>
+// OBSOLETE
+// OBSOLETE #include <mach.h>
+// OBSOLETE #include <mach/message.h>
+// OBSOLETE #include <mach/exception.h>
+// OBSOLETE #include <mach_error.h>
+// OBSOLETE
+// OBSOLETE /* Hmmm... Should this not be here?
+// OBSOLETE * Now for i386_float_info() target_has_execution
+// OBSOLETE */
+// OBSOLETE #include <target.h>
+// 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 <sys/param.h>
+// 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 (&registers[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 &registers[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 <i386/fpreg.h>)
+// 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
index 6d4980be4c6..ee696c4e695 100644
--- a/gdb/i386mach-nat.c
+++ b/gdb/i386mach-nat.c
@@ -1,172 +1,172 @@
-/* Native dependent code for Mach 386's for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 1999, 2000,
- 2001 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-
-#include <sys/file.h>
-#include "gdb_stat.h"
-#include <sys/core.h>
-
-static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
-
-void
-fetch_inferior_registers (int regno)
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
-
- registers_fetched ();
-
- ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_registers);
- ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-
- memcpy (registers, &inferior_registers, sizeof inferior_registers);
-
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
- inferior_fp_registers.f_st,
- sizeof inferior_fp_registers.f_st);
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &inferior_fp_registers.f_ctrl,
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-void
-store_inferior_registers (int regno)
-{
- struct regs inferior_registers;
- struct fp_state inferior_fp_registers;
-
- memcpy (&inferior_registers, registers, 20 * 4);
-
- memcpy (inferior_fp_registers.f_st, &registers[REGISTER_BYTE (FP0_REGNUM)],
- sizeof inferior_fp_registers.f_st);
- memcpy (&inferior_fp_registers.f_ctrl,
- &registers[REGISTER_BYTE (FPC_REGNUM)],
- sizeof inferior_fp_registers - sizeof inferior_fp_registers.f_st);
-
-#ifdef PTRACE_FP_BUG
- if (regno == FP_REGNUM || regno == -1)
- /* Storing the frame pointer requires a gross hack, in which an
- instruction that moves eax into ebp gets single-stepped. */
- {
- int stack = inferior_registers.r_reg[SP_REGNUM];
- int stuff = ptrace (PTRACE_PEEKDATA, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) stack);
- int reg = inferior_registers.r_reg[EAX];
- inferior_registers.r_reg[EAX] =
- inferior_registers.r_reg[FP_REGNUM];
- ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_registers);
- ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) stack, 0xc589);
- ptrace (PTRACE_SINGLESTEP, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) stack, 0);
- wait (0);
- ptrace (PTRACE_POKEDATA, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) stack, stuff);
- inferior_registers.r_reg[EAX] = reg;
- }
-#endif
- ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_registers);
- ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-}
-
-
-
-/* Provide registers to GDB from a core file.
-
- CORE_REG_SECT points to an array of bytes, which were obtained from
- a core file which BFD thinks might contain register contents.
- CORE_REG_SIZE is its size.
-
- WHICH says which register set corelow suspects this is:
- 0 --- the general-purpose register set
- 2 --- the floating-point register set
-
- REG_ADDR isn't used. */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr)
-{
- int val;
-
- switch (which)
- {
- case 0:
- case 1:
- memcpy (registers, core_reg_sect, core_reg_size);
- break;
-
- case 2:
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)],
- core_reg_sect,
- core_reg_size); /* FIXME, probably bogus */
-#ifdef FPC_REGNUM
- memcpy (&registers[REGISTER_BYTE (FPC_REGNUM)],
- &corestr.c_fpu.f_fpstatus.f_ctrl,
- sizeof corestr.c_fpu.f_fpstatus -
- sizeof corestr.c_fpu.f_fpstatus.f_st);
-#endif
- break;
- }
-}
-
-
-/* Register that we are able to handle i386mach core file formats.
- FIXME: is this really bfd_target_unknown_flavour? */
-
-static struct core_fns i386mach_core_fns =
-{
- bfd_target_unknown_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
-
-void
-_initialize_core_i386mach (void)
-{
- add_core_fns (&i386mach_core_fns);
-}
+// 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 <sys/param.h>
+// OBSOLETE #include <sys/dir.h>
+// OBSOLETE #include <sys/user.h>
+// OBSOLETE #include <signal.h>
+// OBSOLETE #include <sys/ioctl.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE
+// OBSOLETE #include <sys/ptrace.h>
+// OBSOLETE #include <machine/reg.h>
+// OBSOLETE
+// OBSOLETE #include <sys/file.h>
+// OBSOLETE #include "gdb_stat.h"
+// OBSOLETE #include <sys/core.h>
+// 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 (&registers[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE inferior_fp_registers.f_st,
+// OBSOLETE sizeof inferior_fp_registers.f_st);
+// OBSOLETE memcpy (&registers[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, &registers[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE sizeof inferior_fp_registers.f_st);
+// OBSOLETE memcpy (&inferior_fp_registers.f_ctrl,
+// OBSOLETE &registers[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 (&registers[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE core_reg_sect,
+// OBSOLETE core_reg_size); /* FIXME, probably bogus */
+// OBSOLETE #ifdef FPC_REGNUM
+// OBSOLETE memcpy (&registers[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 02ba77c7be9..634101ad35f 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -86,8 +86,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
}
static void
-fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which,
- CORE_ADDR ignore)
+fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
+ int which, CORE_ADDR ignore)
{
switch (which)
{
@@ -137,16 +137,6 @@ static struct core_fns i386nbsd_elfcore_fns =
NULL /* next */
};
-/* FIXME: should be multi-arch'd */
-int
-i386nbsd_aout_use_struct_convention (int gcc_p, struct type *type)
-{
- return !(TYPE_LENGTH (type) == 1
- || TYPE_LENGTH (type) == 2
- || TYPE_LENGTH (type) == 4
- || TYPE_LENGTH (type) == 8);
-}
-
void
_initialize_i386nbsd_tdep (void)
{
diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c
new file mode 100644
index 00000000000..17ef922b82a
--- /dev/null
+++ b/gdb/i386obsd-nat.c
@@ -0,0 +1,60 @@
+/* Native-dependent code for OpenBSD/i386.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
+/* Prevent warning from -Wmissing-prototypes. */
+void _initialize_i386obsd_nat (void);
+
+void
+_initialize_i386obsd_nat (void)
+{
+ /* OpenBSD provides a vm.psstrings sysctl that we can use to locate
+ the sigtramp. That way we can still recognize a sigtramp if its
+ location is changed in a new kernel. This is especially
+ important for OpenBSD, since it uses a different memory layout
+ than NetBSD, yet we cannot distinguish between the two.
+
+ Of course this is still based on the assumption that the sigtramp
+ is placed directly under the location where the program arguments
+ and environment can be found. */
+#ifdef VM_PSSTRINGS
+ {
+ struct _ps_strings _ps;
+ int mib[2];
+ size_t len;
+
+ extern CORE_ADDR i386nbsd_sigtramp_start;
+ extern CORE_ADDR i386nbsd_sigtramp_end;
+
+ mib[0] = CTL_VM;
+ mib[1] = VM_PSSTRINGS;
+ len = sizeof (_ps);
+ if (sysctl (mib, 2, &_ps, &len, NULL, 0) == 0)
+ {
+ i386nbsd_sigtramp_start = (CORE_ADDR)_ps.val - 128;
+ i386nbsd_sigtramp_end = (CORE_ADDR)_ps.val;
+ }
+ }
+#endif
+}
diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c
index 672ddfbf808..8180093c2ae 100644
--- a/gdb/i386v-nat.c
+++ b/gdb/i386v-nat.c
@@ -1,4 +1,4 @@
-/* Intel 386 native support for SYSV systems (pre-SVR4).
+/* Intel 386 native support for System V systems (pre-SVR4).
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
1999, 2000, 2002 Free Software Foundation, Inc.
@@ -46,20 +46,9 @@
#include <sys/ioctl.h>
#include <fcntl.h>
-
-/* FIXME: 1998-10-21/jsm: The following used to be just "#include
- <sys/debugreg.h>", but the the Linux kernel (version 2.1.x) and
- glibc 2.0.x are not in sync; including <sys/debugreg.h> will result
- in an error. With luck, these losers will get their act together
- and we can trash this hack in the near future. */
-
#ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
-#ifdef HAVE_ASM_DEBUGREG_H
-#include <asm/debugreg.h>
-#else
#include <sys/debugreg.h>
#endif
-#endif
#include <sys/file.h>
#include "gdb_stat.h"
@@ -73,8 +62,8 @@
#include "target.h"
-/* this table must line up with REGISTER_NAMES in tm-i386v.h */
-/* symbols like 'EAX' come from <sys/reg.h> */
+/* Mapping between the general-purpose registers in `struct user'
+ format and GDB's register array layout. */
static int regmap[] =
{
EAX, ECX, EDX, EBX,
@@ -83,37 +72,34 @@ static int regmap[] =
DS, ES, FS, GS,
};
-/* blockend is the value of u.u_ar0, and points to the
- * place where GS is stored
- */
+/* Support for the user struct. */
-int
-i386_register_u_addr (int blockend, int regnum)
+/* Return the address of register REGNUM. BLOCKEND is the value of
+ u.u_ar0, and points to the place where GS is stored. */
+
+CORE_ADDR
+register_u_addr (CORE_ADDR blockend, int regnum)
{
struct user u;
- int fpstate;
- int ubase;
+ CORE_ADDR fpstate;
- ubase = blockend;
- /* FIXME: Should have better way to test floating point range */
- if (regnum >= FP0_REGNUM && regnum <= (FP0_REGNUM + 7))
+ if (FP_REGNUM_P (regnum))
{
-#ifdef KSTKSZ /* SCO, and others? */
- ubase += 4 * (SS + 1) - KSTKSZ;
- fpstate = ubase + ((char *) &u.u_fps.u_fpstate - (char *) &u);
+#ifdef KSTKSZ /* SCO, and others? */
+ blockend += 4 * (SS + 1) - KSTKSZ;
+ fpstate = blockend + ((char *) &u.u_fps.u_fpstate - (char *) &u);
return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM));
#else
- fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u);
+ fpstate = blockend + ((char *) &u.i387.st_space - (char *) &u);
return (fpstate + 10 * (regnum - FP0_REGNUM));
#endif
}
- else
- {
- return (ubase + 4 * regmap[regnum]);
- }
+ return (blockend + 4 * regmap[regnum]);
}
-
+
+/* Return the size of the user struct. */
+
int
kernel_u_size (void)
{
diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c
index c67f1fb2f44..7de8c148034 100644
--- a/gdb/i386v4-nat.c
+++ b/gdb/i386v4-nat.c
@@ -1,5 +1,6 @@
-/* Native-dependent code for SVR4 Unix running on i386's, for GDB.
- Copyright 1988, 1989, 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2001
+/* Native-dependent code for SVR4 Unix running on i386's.
+ Copyright 1988, 1989, 1991, 1992, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -27,8 +28,9 @@
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
-#include "i387-tdep.h"
+#include "i386-tdep.h"
+#include "i387-tdep.h"
#ifdef HAVE_SYS_PROCFS_H
@@ -37,15 +39,16 @@
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
-/* The /proc interface divides the target machine's register set up into
- two different sets, the general register set (gregset) and the floating
- point register set (fpregset). For each set, there is an ioctl to get
- the current register set and another ioctl to set the current values.
+/* The `/proc' interface divides the target machine's register set up
+ into two different sets, the general purpose register set (gregset)
+ and the floating-point register set (fpregset). For each set,
+ there is an ioctl to get the current register set and another ioctl
+ to set the current values.
- The actual structure passed through the ioctl interface is, of course,
- naturally machine dependent, and is different for each set of registers.
- For the i386 for example, the general register set is typically defined
- by:
+ The actual structure passed through the ioctl interface is, of
+ course, naturally machine dependent, and is different for each set
+ of registers. For the i386 for example, the general-purpose
+ register set is typically defined by:
typedef int gregset_t[19]; (in <sys/regset.h>)
@@ -55,36 +58,38 @@
#define UESP 17
#define SS 18
- and the floating point set by:
-
- typedef struct fpregset
- {
- union
- {
- struct fpchip_state // fp extension state //
- {
- int state[27]; // 287/387 saved state //
- int status; // status word saved at exception //
- } fpchip_state;
- struct fp_emul_space // for emulators //
- {
- char fp_emul[246];
- char fp_epad[2];
- } fp_emul_space;
- int f_fpregs[62]; // union of the above //
- } fp_reg_set;
- long f_wregs[33]; // saved weitek state //
+ and the floating-point set by:
+
+ typedef struct fpregset {
+ union {
+ struct fpchip_state // fp extension state //
+ {
+ int state[27]; // 287/387 saved state //
+ int status; // status word saved at //
+ // exception //
+ } fpchip_state;
+ struct fp_emul_space // for emulators //
+ {
+ char fp_emul[246];
+ char fp_epad[2];
+ } fp_emul_space;
+ int f_fpregs[62]; // union of the above //
+ } fp_reg_set;
+ long f_wregs[33]; // saved weitek state //
} fpregset_t;
- These routines provide the packing and unpacking of gregset_t and
- fpregset_t formatted data.
+ Incidentally fpchip_state contains the FPU state in the same format
+ as used by the "fsave" instruction, and that's the only thing we
+ support here. I don't know how the emulator stores it state. The
+ Weitek stuff definitely isn't supported.
- */
+ The routines defined here, provide the packing and unpacking of
+ gregset_t and fpregset_t formatted data. */
#ifdef HAVE_GREGSET_T
-/* This is a duplicate of the table in i386-xdep.c. */
-
+/* Mapping between the general-purpose registers in `/proc'
+ format and GDB's register array layout. */
static int regmap[] =
{
EAX, ECX, EDX, EBX,
@@ -93,92 +98,63 @@ static int regmap[] =
DS, ES, FS, GS,
};
-/* Prototypes for local functions */
-
-void fill_gregset (gregset_t *, int);
-
-void supply_gregset (gregset_t *);
-
-void supply_fpregset (fpregset_t *);
-
-void fill_fpregset (fpregset_t *, int);
-
-
-/* FIXME: These routine absolutely depends upon (NUM_REGS - NUM_FREGS)
- being less than or equal to the number of registers that can be stored
- in a gregset_t. Note that with the current scheme there will typically
- be more registers actually stored in a gregset_t that what we know
- about. This is bogus and should be fixed. */
-
-/* Given a pointer to a general register set in /proc format (gregset_t *),
- unpack the register contents and supply them as gdb's idea of the current
- register values. */
+/* Fill GDB's register array with the general-purpose register values
+ in *GREGSETP. */
void
supply_gregset (gregset_t *gregsetp)
{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
- extern int regmap[];
-
- for (regi = 0; regi < (NUM_REGS - NUM_FREGS); regi++)
- {
- supply_register (regi, (char *) (regp + regmap[regi]));
- }
+ greg_t *regp = (greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < I386_NUM_GREGS; i++)
+ supply_register (i, (char *) (regp + regmap[i]));
}
+/* Fill register REGNO (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
void
fill_gregset (gregset_t *gregsetp, int regno)
{
- int regi;
- register greg_t *regp = (greg_t *) gregsetp;
- extern int regmap[];
-
- for (regi = 0; regi < (NUM_REGS - NUM_FREGS); regi++)
- {
- if ((regno == -1) || (regno == regi))
- {
- *(regp + regmap[regi]) = *(int *) &registers[REGISTER_BYTE (regi)];
- }
- }
+ greg_t *regp = (greg_t *) gregsetp;
+ int i;
+
+ for (i = 0; i < I386_NUM_GREGS; i++)
+ if (regno == -1 || regno == i)
+ regcache_collect (i, regp + regmap[i]);
}
#endif /* HAVE_GREGSET_T */
-#if defined (HAVE_FPREGSET_T)
-
-/* Given a pointer to a floating point register set in /proc format
- (fpregset_t *), unpack the register contents and supply them as gdb's
- idea of the current floating point register values. */
+#ifdef HAVE_FPREGSET_T
-/* FIXME: Assumes that fpregsetp contains an i387 FSAVE area. */
-#if !defined(FPREGSET_FSAVE_OFFSET)
-#define FPREGSET_FSAVE_OFFSET 0
-#endif
+/* Fill GDB's register array with the floating-point register values in
+ *FPREGSETP. */
void
supply_fpregset (fpregset_t *fpregsetp)
{
- if (NUM_FREGS == 0)
+ if (FP0_REGNUM == 0)
return;
- i387_supply_fsave ((char *) fpregsetp + FPREGSET_FSAVE_OFFSET);
+ i387_supply_fsave ((char *) fpregsetp);
}
-/* Given a pointer to a floating point register set in /proc format
- (fpregset_t *), update the register specified by REGNO from gdb's idea
- of the current floating point register set. If REGNO is -1, update
- them all. */
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
void
fill_fpregset (fpregset_t *fpregsetp, int regno)
{
- if (NUM_FREGS == 0)
+ if (FP0_REGNUM == 0)
return;
- i387_fill_fsave ((char *) fpregsetp + FPREGSET_FSAVE_OFFSET, regno);
+ i387_fill_fsave ((char *) fpregsetp, regno);
}
-#endif /* defined (HAVE_FPREGSET_T) */
+#endif /* HAVE_FPREGSET_T */
#endif /* HAVE_SYS_PROCFS_H */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 59b60d77a9d..daf1c6ff6ce 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -160,7 +160,7 @@ print_387_status_word (unsigned int status)
/* Print the floating point number specified by RAW. */
static void
-print_i387_value (char *raw)
+print_i387_value (char *raw, struct ui_file *file)
{
DOUBLEST value;
@@ -175,15 +175,15 @@ print_i387_value (char *raw)
to print the value, 1 position for the sign, 1 for the decimal
point, 19 for the digits and 6 for the exponent adds up to 27. */
#ifdef PRINTF_HAS_LONG_DOUBLE
- printf_filtered (" %-+27.19Lg", (long double) value);
+ fprintf_filtered (file, " %-+27.19Lg", (long double) value);
#else
- printf_filtered (" %-+27.19g", (double) value);
+ fprintf_filtered (file, " %-+27.19g", (double) value);
#endif
}
/* Print the classification for the register contents RAW. */
static void
-print_i387_ext (unsigned char *raw)
+print_i387_ext (unsigned char *raw, struct ui_file *file)
{
int sign;
int integer;
@@ -201,119 +201,124 @@ print_i387_ext (unsigned char *raw)
{
if (fraction[0] == 0x00000000 && fraction[1] == 0x00000000)
/* Infinity. */
- printf_filtered (" %cInf", (sign ? '-' : '+'));
+ fprintf_filtered (file, " %cInf", (sign ? '-' : '+'));
else if (sign && fraction[0] == 0x00000000 && fraction[1] == 0x40000000)
/* Real Indefinite (QNaN). */
- puts_unfiltered (" Real Indefinite (QNaN)");
+ fputs_unfiltered (" Real Indefinite (QNaN)", file);
else if (fraction[1] & 0x40000000)
/* QNaN. */
- puts_filtered (" QNaN");
+ fputs_filtered (" QNaN", file);
else
/* SNaN. */
- puts_filtered (" SNaN");
+ fputs_filtered (" SNaN", file);
}
else if (exponent < 0x7fff && exponent > 0x0000 && integer)
/* Normal. */
- print_i387_value (raw);
+ print_i387_value (raw, file);
else if (exponent == 0x0000)
{
/* Denormal or zero. */
- print_i387_value (raw);
+ print_i387_value (raw, file);
if (integer)
/* Pseudo-denormal. */
- puts_filtered (" Pseudo-denormal");
+ fputs_filtered (" Pseudo-denormal", file);
else if (fraction[0] || fraction[1])
/* Denormal. */
- puts_filtered (" Denormal");
+ fputs_filtered (" Denormal", file);
}
else
/* Unsupported. */
- puts_filtered (" Unsupported");
+ fputs_filtered (" Unsupported", file);
}
/* Print the status word STATUS. */
static void
-print_i387_status_word (unsigned int status)
+print_i387_status_word (unsigned int status, struct ui_file *file)
{
- printf_filtered ("Status Word: %s",
+ fprintf_filtered (file, "Status Word: %s",
local_hex_string_custom (status, "04"));
- puts_filtered (" ");
- printf_filtered (" %s", (status & 0x0001) ? "IE" : " ");
- printf_filtered (" %s", (status & 0x0002) ? "DE" : " ");
- printf_filtered (" %s", (status & 0x0004) ? "ZE" : " ");
- printf_filtered (" %s", (status & 0x0008) ? "OE" : " ");
- printf_filtered (" %s", (status & 0x0010) ? "UE" : " ");
- printf_filtered (" %s", (status & 0x0020) ? "PE" : " ");
- puts_filtered (" ");
- printf_filtered (" %s", (status & 0x0080) ? "ES" : " ");
- puts_filtered (" ");
- printf_filtered (" %s", (status & 0x0040) ? "SF" : " ");
- puts_filtered (" ");
- printf_filtered (" %s", (status & 0x0100) ? "C0" : " ");
- printf_filtered (" %s", (status & 0x0200) ? "C1" : " ");
- printf_filtered (" %s", (status & 0x0400) ? "C2" : " ");
- printf_filtered (" %s", (status & 0x4000) ? "C3" : " ");
-
- puts_filtered ("\n");
-
- printf_filtered (" TOP: %d\n", ((status >> 11) & 7));
+ fputs_filtered (" ", file);
+ fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0004) ? "ZE" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0008) ? "OE" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0010) ? "UE" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0020) ? "PE" : " ");
+ fputs_filtered (" ", file);
+ fprintf_filtered (file, " %s", (status & 0x0080) ? "ES" : " ");
+ fputs_filtered (" ", file);
+ fprintf_filtered (file, " %s", (status & 0x0040) ? "SF" : " ");
+ fputs_filtered (" ", file);
+ fprintf_filtered (file, " %s", (status & 0x0100) ? "C0" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0200) ? "C1" : " ");
+ fprintf_filtered (file, " %s", (status & 0x0400) ? "C2" : " ");
+ fprintf_filtered (file, " %s", (status & 0x4000) ? "C3" : " ");
+
+ fputs_filtered ("\n", file);
+
+ fprintf_filtered (file,
+ " TOP: %d\n", ((status >> 11) & 7));
}
/* Print the control word CONTROL. */
static void
-print_i387_control_word (unsigned int control)
+print_i387_control_word (unsigned int control, struct ui_file *file)
{
- printf_filtered ("Control Word: %s",
+ fprintf_filtered (file, "Control Word: %s",
local_hex_string_custom (control, "04"));
- puts_filtered (" ");
- printf_filtered (" %s", (control & 0x0001) ? "IM" : " ");
- printf_filtered (" %s", (control & 0x0002) ? "DM" : " ");
- printf_filtered (" %s", (control & 0x0004) ? "ZM" : " ");
- printf_filtered (" %s", (control & 0x0008) ? "OM" : " ");
- printf_filtered (" %s", (control & 0x0010) ? "UM" : " ");
- printf_filtered (" %s", (control & 0x0020) ? "PM" : " ");
+ fputs_filtered (" ", file);
+ fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " ");
+ fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " ");
+ fprintf_filtered (file, " %s", (control & 0x0004) ? "ZM" : " ");
+ fprintf_filtered (file, " %s", (control & 0x0008) ? "OM" : " ");
+ fprintf_filtered (file, " %s", (control & 0x0010) ? "UM" : " ");
+ fprintf_filtered (file, " %s", (control & 0x0020) ? "PM" : " ");
- puts_filtered ("\n");
+ fputs_filtered ("\n", file);
- puts_filtered (" PC: ");
+ fputs_filtered (" PC: ", file);
switch ((control >> 8) & 3)
{
case 0:
- puts_filtered ("Single Precision (24-bits)\n");
+ fputs_filtered ("Single Precision (24-bits)\n", file);
break;
case 1:
- puts_filtered ("Reserved\n");
+ fputs_filtered ("Reserved\n", file);
break;
case 2:
- puts_filtered ("Double Precision (53-bits)\n");
+ fputs_filtered ("Double Precision (53-bits)\n", file);
break;
case 3:
- puts_filtered ("Extended Precision (64-bits)\n");
+ fputs_filtered ("Extended Precision (64-bits)\n", file);
break;
}
- puts_filtered (" RC: ");
+ fputs_filtered (" RC: ", file);
switch ((control >> 10) & 3)
{
case 0:
- puts_filtered ("Round to nearest\n");
+ fputs_filtered ("Round to nearest\n", file);
break;
case 1:
- puts_filtered ("Round down\n");
+ fputs_filtered ("Round down\n", file);
break;
case 2:
- puts_filtered ("Round up\n");
+ fputs_filtered ("Round up\n", file);
break;
case 3:
- puts_filtered ("Round toward zero\n");
+ fputs_filtered ("Round toward zero\n", file);
break;
}
}
-/* Print out the i387 floating poin state. */
+/* Print out the i387 floating point state. Note that we ignore FRAME
+ in the code below. That's OK since floating-point registers are
+ never saved on the stack. */
+
void
-i387_float_info (void)
+i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
{
unsigned int fctrl;
unsigned int fstat;
@@ -343,50 +348,50 @@ i387_float_info (void)
int tag = (ftag >> (fpreg * 2)) & 3;
int i;
- printf_filtered ("%sR%d: ", fpreg == top ? "=>" : " ", fpreg);
+ fprintf_filtered (file, "%sR%d: ", fpreg == top ? "=>" : " ", fpreg);
switch (tag)
{
case 0:
- puts_filtered ("Valid ");
+ fputs_filtered ("Valid ", file);
break;
case 1:
- puts_filtered ("Zero ");
+ fputs_filtered ("Zero ", file);
break;
case 2:
- puts_filtered ("Special ");
+ fputs_filtered ("Special ", file);
break;
case 3:
- puts_filtered ("Empty ");
+ fputs_filtered ("Empty ", file);
break;
}
read_register_gen ((fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
- puts_filtered ("0x");
+ fputs_filtered ("0x", file);
for (i = 9; i >= 0; i--)
- printf_filtered ("%02x", raw[i]);
+ fprintf_filtered (file, "%02x", raw[i]);
if (tag != 3)
- print_i387_ext (raw);
+ print_i387_ext (raw, file);
- puts_filtered ("\n");
+ fputs_filtered ("\n", file);
}
puts_filtered ("\n");
- print_i387_status_word (fstat);
- print_i387_control_word (fctrl);
- printf_filtered ("Tag Word: %s\n",
- local_hex_string_custom (ftag, "04"));
- printf_filtered ("Instruction Pointer: %s:",
- local_hex_string_custom (fiseg, "02"));
- printf_filtered ("%s\n", local_hex_string_custom (fioff, "08"));
- printf_filtered ("Operand Pointer: %s:",
- local_hex_string_custom (foseg, "02"));
- printf_filtered ("%s\n", local_hex_string_custom (fooff, "08"));
- printf_filtered ("Opcode: %s\n",
- local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04"));
+ print_i387_status_word (fstat, file);
+ print_i387_control_word (fctrl, file);
+ fprintf_filtered (file, "Tag Word: %s\n",
+ local_hex_string_custom (ftag, "04"));
+ fprintf_filtered (file, "Instruction Pointer: %s:",
+ local_hex_string_custom (fiseg, "02"));
+ fprintf_filtered (file, "%s\n", local_hex_string_custom (fioff, "08"));
+ fprintf_filtered (file, "Operand Pointer: %s:",
+ local_hex_string_custom (foseg, "02"));
+ fprintf_filtered (file, "%s\n", local_hex_string_custom (fooff, "08"));
+ fprintf_filtered (file, "Opcode: %s\n",
+ local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04"));
}
/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h
index 5bfd06eb710..e29b19834d5 100644
--- a/gdb/i387-tdep.h
+++ b/gdb/i387-tdep.h
@@ -21,6 +21,13 @@
#ifndef I387_TDEP_H
#define I387_TDEP_H
+/* Print out the i387 floating point state. */
+
+extern void i387_print_float_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ const char *args);
+
/* Fill register REGNUM in GDB's register array with the appropriate
value from *FSAVE. This function masks off any of the reserved
bits in *FSAVE. */
diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c
index 98718a387a0..d059a7b68b9 100644
--- a/gdb/i960-tdep.c
+++ b/gdb/i960-tdep.c
@@ -1,1055 +1,1056 @@
-/* Target-machine dependent code for the Intel 960
-
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2001, 2002 Free Software Foundation, Inc.
-
- Contributed by Intel Corporation.
- examine_prologue and other parts contributed by Wind River Systems.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "value.h"
-#include "frame.h"
-#include "floatformat.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-
-static CORE_ADDR next_insn (CORE_ADDR memaddr,
- unsigned int *pword1, unsigned int *pword2);
-
-struct type *
-i960_register_type (int regnum)
-{
- if (regnum < FP0_REGNUM)
- return builtin_type_int32;
- else
- return builtin_type_i960_ext;
-}
-
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On i960, a structure is returned in registers g0-g3, if it will fit.
- If it's more than 16 bytes long, g13 pointed to it on entry. */
-
-int
-i960_use_struct_convention (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 16);
-}
-
-/* gdb960 is always running on a non-960 host. Check its characteristics.
- This routine must be called as part of gdb initialization. */
-
-static void
-check_host (void)
-{
- int i;
-
- static struct typestruct
- {
- int hostsize; /* Size of type on host */
- int i960size; /* Size of type on i960 */
- char *typename; /* Name of type, for error msg */
- }
- types[] =
- {
- {
- sizeof (short), 2, "short"
- }
- ,
- {
- sizeof (int), 4, "int"
- }
- ,
- {
- sizeof (long), 4, "long"
- }
- ,
- {
- sizeof (float), 4, "float"
- }
- ,
- {
- sizeof (double), 8, "double"
- }
- ,
- {
- sizeof (char *), 4, "pointer"
- }
- ,
- };
-#define TYPELEN (sizeof(types) / sizeof(struct typestruct))
-
- /* Make sure that host type sizes are same as i960
- */
- for (i = 0; i < TYPELEN; i++)
- {
- if (types[i].hostsize != types[i].i960size)
- {
- printf_unfiltered ("sizeof(%s) != %d: PROCEED AT YOUR OWN RISK!\n",
- types[i].typename, types[i].i960size);
- }
-
- }
-}
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" upon
- subroutine calls and thus there is no need to search more than one
- stack frame for it.
-
- On the i960, in fact, the name of this register in another frame is
- "mud" -- there is no overlap between the windows. Each window is
- simply saved into the stack (true for our purposes, after having been
- flushed; normally they reside on-chip and are restored from on-chip
- without ever going to memory). */
-
-static int
-register_in_window_p (int regnum)
-{
- return regnum <= R15_REGNUM;
-}
-
-/* i960_find_saved_register ()
-
- Return the address in which frame FRAME's value of register REGNUM
- has been saved in memory. Or return zero if it has not been saved.
- If REGNUM specifies the SP, the value we return is actually the SP
- value, not an address where it was saved. */
-
-static CORE_ADDR
-i960_find_saved_register (struct frame_info *frame, int regnum)
-{
- register struct frame_info *frame1 = NULL;
- register CORE_ADDR addr = 0;
-
- if (frame == NULL) /* No regs saved if want current frame */
- return 0;
-
- /* We assume that a register in a register window will only be saved
- in one place (since the name changes and/or disappears as you go
- towards inner frames), so we only call get_frame_saved_regs on
- the current frame. This is directly in contradiction to the
- usage below, which assumes that registers used in a frame must be
- saved in a lower (more interior) frame. This change is a result
- of working on a register window machine; get_frame_saved_regs
- always returns the registers saved within a frame, within the
- context (register namespace) of that frame. */
-
- /* However, note that we don't want this to return anything if
- nothing is saved (if there's a frame inside of this one). Also,
- callers to this routine asking for the stack pointer want the
- stack pointer saved for *this* frame; this is returned from the
- next frame. */
-
- if (register_in_window_p (regnum))
- {
- frame1 = get_next_frame (frame);
- if (!frame1)
- return 0; /* Registers of this frame are active. */
-
- /* Get the SP from the next frame in; it will be this
- current frame. */
- if (regnum != SP_REGNUM)
- frame1 = frame;
-
- FRAME_INIT_SAVED_REGS (frame1);
- return frame1->saved_regs[regnum]; /* ... which might be zero */
- }
-
- /* Note that this next routine assumes that registers used in
- frame x will be saved only in the frame that x calls and
- frames interior to it. This is not true on the sparc, but the
- above macro takes care of it, so we should be all right. */
- while (1)
- {
- QUIT;
- frame1 = get_next_frame (frame);
- if (frame1 == 0)
- break;
- frame = frame1;
- FRAME_INIT_SAVED_REGS (frame1);
- if (frame1->saved_regs[regnum])
- addr = frame1->saved_regs[regnum];
- }
-
- return addr;
-}
-
-/* i960_get_saved_register ()
-
- Find register number REGNUM relative to FRAME and put its (raw,
- target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
- variable was optimized out (and thus can't be fetched). Set *LVAL
- to lval_memory, lval_register, or not_lval, depending on whether
- the value was fetched from memory, from a register, or in a strange
- and non-modifiable way (e.g. a frame pointer which was calculated
- rather than fetched). Set *ADDRP to the address, either in memory
- on as a REGISTER_BYTE offset into the registers array.
-
- Note that this implementation never sets *LVAL to not_lval. But it
- can be replaced by defining GET_SAVED_REGISTER and supplying your
- own.
-
- The argument RAW_BUFFER must point to aligned memory. */
-
-void
-i960_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
-{
- CORE_ADDR addr;
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = i960_find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-
-/* Examine an i960 function prologue, recording the addresses at which
- registers are saved explicitly by the prologue code, and returning
- the address of the first instruction after the prologue (but not
- after the instruction at address LIMIT, as explained below).
-
- LIMIT places an upper bound on addresses of the instructions to be
- examined. If the prologue code scan reaches LIMIT, the scan is
- aborted and LIMIT is returned. This is used, when examining the
- prologue for the current frame, to keep examine_prologue () from
- claiming that a given register has been saved when in fact the
- instruction that saves it has not yet been executed. LIMIT is used
- at other times to stop the scan when we hit code after the true
- function prologue (e.g. for the first source line) which might
- otherwise be mistaken for function prologue.
-
- The format of the function prologue matched by this routine is
- derived from examination of the source to gcc960 1.21, particularly
- the routine i960_function_prologue (). A "regular expression" for
- the function prologue is given below:
-
- (lda LRn, g14
- mov g14, g[0-7]
- (mov 0, g14) | (lda 0, g14))?
-
- (mov[qtl]? g[0-15], r[4-15])*
- ((addo [1-31], sp, sp) | (lda n(sp), sp))?
- (st[qtl]? g[0-15], n(fp))*
-
- (cmpobne 0, g14, LFn
- mov sp, g14
- lda 0x30(sp), sp
- LFn: stq g0, (g14)
- stq g4, 0x10(g14)
- stq g8, 0x20(g14))?
-
- (st g14, n(fp))?
- (mov g13,r[4-15])?
- */
-
-/* Macros for extracting fields from i960 instructions. */
-
-#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
-#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
-
-#define REG_SRC1(insn) EXTRACT_FIELD (insn, 0, 5)
-#define REG_SRC2(insn) EXTRACT_FIELD (insn, 14, 5)
-#define REG_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEM_SRCDST(insn) EXTRACT_FIELD (insn, 19, 5)
-#define MEMA_OFFSET(insn) EXTRACT_FIELD (insn, 0, 12)
-
-/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
- is not the address of a valid instruction, the address of the next
- instruction beyond ADDR otherwise. *PWORD1 receives the first word
- of the instruction, and (for two-word instructions), *PWORD2 receives
- the second. */
-
-#define NEXT_PROLOGUE_INSN(addr, lim, pword1, pword2) \
- (((addr) < (lim)) ? next_insn (addr, pword1, pword2) : 0)
-
-static CORE_ADDR
-examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
- CORE_ADDR frame_addr, struct frame_saved_regs *fsr)
-{
- register CORE_ADDR next_ip;
- register int src, dst;
- register unsigned int *pcode;
- unsigned int insn1, insn2;
- int size;
- int within_leaf_prologue;
- CORE_ADDR save_addr;
- static unsigned int varargs_prologue_code[] =
- {
- 0x3507a00c, /* cmpobne 0x0, g14, LFn */
- 0x5cf01601, /* mov sp, g14 */
- 0x8c086030, /* lda 0x30(sp), sp */
- 0xb2879000, /* LFn: stq g0, (g14) */
- 0xb2a7a010, /* stq g4, 0x10(g14) */
- 0xb2c7a020 /* stq g8, 0x20(g14) */
- };
-
- /* Accept a leaf procedure prologue code fragment if present.
- Note that ip might point to either the leaf or non-leaf
- entry point; we look for the non-leaf entry point first: */
-
- within_leaf_prologue = 0;
- if ((next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2))
- && ((insn1 & 0xfffff000) == 0x8cf00000 /* lda LRx, g14 (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8cf03000)) /* lda LRx, g14 (MEMB) */
- {
- within_leaf_prologue = 1;
- next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2);
- }
-
- /* Now look for the prologue code at a leaf entry point: */
-
- if (next_ip
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && REG_SRCDST (insn1) <= G0_REGNUM + 7)
- {
- within_leaf_prologue = 1;
- if ((next_ip = NEXT_PROLOGUE_INSN (next_ip, limit, &insn1, &insn2))
- && (insn1 == 0x8cf00000 /* lda 0, g14 */
- || insn1 == 0x5cf01e00)) /* mov 0, g14 */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- within_leaf_prologue = 0;
- }
- }
-
- /* If something that looks like the beginning of a leaf prologue
- has been seen, but the remainder of the prologue is missing, bail.
- We don't know what we've got. */
-
- if (within_leaf_prologue)
- return (ip);
-
- /* Accept zero or more instances of "mov[qtl]? gx, ry", where y >= 4.
- This may cause us to mistake the moving of a register
- parameter to a local register for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved. */
-
- while (next_ip
- && (insn1 & 0xfc802fb0) == 0x5c000610
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- src = REG_SRC1 (insn1);
- size = EXTRACT_FIELD (insn1, 24, 2) + 1;
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "addo n, sp, sp" or "lda n(sp), sp". */
-
- if (next_ip &&
- ((insn1 & 0xffffffe0) == 0x59084800 /* addo n, sp, sp */
- || (insn1 & 0xfffff000) == 0x8c086000 /* lda n(sp), sp (MEMA) */
- || (insn1 & 0xfffffc60) == 0x8c087400)) /* lda n(sp), sp (MEMB) */
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or more instances of "st[qtl]? gx, n(fp)".
- This may cause us to mistake the copying of a register
- parameter to the frame for the saving of a callee-saved
- register, but that can't be helped, since with the
- "-fcall-saved" flag, any register can be made callee-saved.
- We can, however, refuse to accept a save of register g14,
- since that is matched explicitly below. */
-
- while (next_ip &&
- ((insn1 & 0xf787f000) == 0x9287e000 /* stl? gx, n(fp) (MEMA) */
- || (insn1 & 0xf787fc60) == 0x9287f400 /* stl? gx, n(fp) (MEMB) */
- || (insn1 & 0xef87f000) == 0xa287e000 /* st[tq] gx, n(fp) (MEMA) */
- || (insn1 & 0xef87fc60) == 0xa287f400) /* st[tq] gx, n(fp) (MEMB) */
- && ((src = MEM_SRCDST (insn1)) != G14_REGNUM))
- {
- save_addr = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- size = (insn1 & BITMASK (29, 1)) ? ((insn1 & BITMASK (28, 1)) ? 4 : 3)
- : ((insn1 & BITMASK (27, 1)) ? 2 : 1);
- while (size--)
- {
- fsr->regs[src++] = save_addr;
- save_addr += 4;
- }
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept the varargs prologue code if present. */
-
- size = sizeof (varargs_prologue_code) / sizeof (int);
- pcode = varargs_prologue_code;
- while (size-- && next_ip && *pcode++ == insn1)
- {
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept an optional "st g14, n(fp)". */
-
- if (next_ip &&
- ((insn1 & 0xfffff000) == 0x92f7e000 /* st g14, n(fp) (MEMA) */
- || (insn1 & 0xfffffc60) == 0x92f7f400)) /* st g14, n(fp) (MEMB) */
- {
- fsr->regs[G14_REGNUM] = frame_addr + ((insn1 & BITMASK (12, 1))
- ? insn2 : MEMA_OFFSET (insn1));
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
- }
-
- /* Accept zero or one instance of "mov g13, ry", where y >= 4.
- This is saving the address where a struct should be returned. */
-
- if (next_ip
- && (insn1 & 0xff802fbf) == 0x5c00061d
- && (dst = REG_SRCDST (insn1)) >= (R0_REGNUM + 4))
- {
- save_addr = frame_addr + ((dst - R0_REGNUM) * 4);
- fsr->regs[G0_REGNUM + 13] = save_addr;
- ip = next_ip;
-#if 0 /* We'll need this once there is a subsequent instruction examined. */
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn1, &insn2);
-#endif
- }
-
- return (ip);
-}
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. */
-
-CORE_ADDR
-i960_skip_prologue (CORE_ADDR ip)
-{
- struct frame_saved_regs saved_regs_dummy;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : 0xffffffff;
-
- return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy));
-}
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- We cache the result of doing this in the frame_obstack, since it is
- fairly expensive. */
-
-void
-frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
-{
- register CORE_ADDR next_addr;
- register CORE_ADDR *saved_regs;
- register int regnum;
- register struct frame_saved_regs *cache_fsr;
- CORE_ADDR ip;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- if (!fi->fsr)
- {
- cache_fsr = (struct frame_saved_regs *)
- frame_obstack_alloc (sizeof (struct frame_saved_regs));
- memset (cache_fsr, '\0', sizeof (struct frame_saved_regs));
- fi->fsr = cache_fsr;
-
- /* Find the start and end of the function prologue. If the PC
- is in the function prologue, we only consider the part that
- has executed already. */
-
- ip = get_pc_function_start (fi->pc);
- sal = find_pc_line (ip, 0);
- limit = (sal.end && sal.end < fi->pc) ? sal.end : fi->pc;
-
- examine_prologue (ip, limit, fi->frame, cache_fsr);
-
- /* Record the addresses at which the local registers are saved.
- Strictly speaking, we should only do this for non-leaf procedures,
- but no one will ever look at these values if it is a leaf procedure,
- since local registers are always caller-saved. */
-
- next_addr = (CORE_ADDR) fi->frame;
- saved_regs = cache_fsr->regs;
- for (regnum = R0_REGNUM; regnum <= R15_REGNUM; regnum++)
- {
- *saved_regs++ = next_addr;
- next_addr += 4;
- }
-
- cache_fsr->regs[FP_REGNUM] = cache_fsr->regs[PFP_REGNUM];
- }
-
- *fsr = *fi->fsr;
-
- /* Fetch the value of the sp from memory every time, since it
- is conceivable that it has changed since the cache was flushed.
- This unfortunately undoes much of the savings from caching the
- saved register values. I suggest adding an argument to
- get_frame_saved_regs () specifying the register number we're
- interested in (or -1 for all registers). This would be passed
- through to FRAME_FIND_SAVED_REGS (), permitting more efficient
- computation of saved register addresses (e.g., on the i960,
- we don't have to examine the prologue to find local registers).
- -- markf@wrs.com
- FIXME, we don't need to refetch this, since the cache is cleared
- every time the child process is restarted. If GDB itself
- modifies SP, it has to clear the cache by hand (does it?). -gnu */
-
- fsr->regs[SP_REGNUM] = read_memory_integer (fsr->regs[SP_REGNUM], 4);
-}
-
-/* Return the address of the argument block for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_args_address (struct frame_info *fi, int must_be_correct)
-{
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If g14 was saved in the frame by the function prologue code, return
- the saved value. If the frame is current and we are being sloppy,
- return the value of g14. Otherwise, return zero. */
-
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G14_REGNUM])
- ap = read_memory_integer (fsr.regs[G14_REGNUM], 4);
- else
- {
- if (must_be_correct)
- return 0; /* Don't cache this result */
- if (get_next_frame (fi))
- ap = 0;
- else
- ap = read_register (G14_REGNUM);
- if (ap == 0)
- ap = fi->frame;
- }
- fi->arg_pointer = ap; /* Cache it for next time */
- return ap;
-}
-
-/* Return the address of the return struct for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_struct_result_address (struct frame_info *fi)
-{
- struct frame_saved_regs fsr;
- CORE_ADDR ap;
-
- /* If the frame is non-current, check to see if g14 was saved in the
- frame by the function prologue code; return the saved value if so,
- zero otherwise. If the frame is current, return the value of g14.
-
- FIXME, shouldn't this use the saved value as long as we are past
- the function prologue, and only use the current value if we have
- no saved value and are at TOS? -- gnu@cygnus.com */
-
- if (get_next_frame (fi))
- {
- get_frame_saved_regs (fi, &fsr);
- if (fsr.regs[G13_REGNUM])
- ap = read_memory_integer (fsr.regs[G13_REGNUM], 4);
- else
- ap = 0;
- }
- else
- ap = read_register (G13_REGNUM);
-
- return ap;
-}
-
-/* Return address to which the currently executing leafproc will return,
- or 0 if IP, the value of the instruction pointer from the currently
- executing function, is not in a leafproc (or if we can't tell if it
- is).
-
- Do this by finding the starting address of the routine in which IP lies.
- If the instruction there is "mov g14, gx" (where x is in [0,7]), this
- is a leafproc and the return address is in register gx. Well, this is
- true unless the return address points at a RET instruction in the current
- procedure, which indicates that we have a 'dual entry' routine that
- has been entered through the CALL entry point. */
-
-CORE_ADDR
-leafproc_return (CORE_ADDR ip)
-{
- register struct minimal_symbol *msymbol;
- char *p;
- int dst;
- unsigned int insn1, insn2;
- CORE_ADDR return_addr;
-
- if ((msymbol = lookup_minimal_symbol_by_pc (ip)) != NULL)
- {
- if ((p = strchr (SYMBOL_NAME (msymbol), '.')) && STREQ (p, ".lf"))
- {
- if (next_insn (SYMBOL_VALUE_ADDRESS (msymbol), &insn1, &insn2)
- && (insn1 & 0xff87ffff) == 0x5c80161e /* mov g14, gx */
- && (dst = REG_SRCDST (insn1)) <= G0_REGNUM + 7)
- {
- /* Get the return address. If the "mov g14, gx"
- instruction hasn't been executed yet, read
- the return address from g14; otherwise, read it
- from the register into which g14 was moved. */
-
- return_addr =
- read_register ((ip == SYMBOL_VALUE_ADDRESS (msymbol))
- ? G14_REGNUM : dst);
-
- /* We know we are in a leaf procedure, but we don't know
- whether the caller actually did a "bal" to the ".lf"
- entry point, or a normal "call" to the non-leaf entry
- point one instruction before. In the latter case, the
- return address will be the address of a "ret"
- instruction within the procedure itself. We test for
- this below. */
-
- if (!next_insn (return_addr, &insn1, &insn2)
- || (insn1 & 0xff000000) != 0xa000000 /* ret */
- || lookup_minimal_symbol_by_pc (return_addr) != msymbol)
- return (return_addr);
- }
- }
- }
-
- return (0);
-}
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions.
- On the i960, the frame *is* set up immediately after the call,
- unless the function is a leaf procedure. */
-
-CORE_ADDR
-saved_pc_after_call (struct frame_info *frame)
-{
- CORE_ADDR saved_pc;
-
- saved_pc = leafproc_return (get_frame_pc (frame));
- if (!saved_pc)
- saved_pc = FRAME_SAVED_PC (frame);
-
- return saved_pc;
-}
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-
-void
-i960_pop_frame (void)
-{
- register struct frame_info *current_fi, *prev_fi;
- register int i;
- CORE_ADDR save_addr;
- CORE_ADDR leaf_return_addr;
- struct frame_saved_regs fsr;
- char local_regs_buf[16 * 4];
-
- current_fi = get_current_frame ();
-
- /* First, undo what the hardware does when we return.
- If this is a non-leaf procedure, restore local registers from
- the save area in the calling frame. Otherwise, load the return
- address obtained from leafproc_return () into the rip. */
-
- leaf_return_addr = leafproc_return (current_fi->pc);
- if (!leaf_return_addr)
- {
- /* Non-leaf procedure. Restore local registers, incl IP. */
- prev_fi = get_prev_frame (current_fi);
- read_memory (prev_fi->frame, local_regs_buf, sizeof (local_regs_buf));
- write_register_bytes (REGISTER_BYTE (R0_REGNUM), local_regs_buf,
- sizeof (local_regs_buf));
-
- /* Restore frame pointer. */
- write_register (FP_REGNUM, prev_fi->frame);
- }
- else
- {
- /* Leaf procedure. Just restore the return address into the IP. */
- write_register (RIP_REGNUM, leaf_return_addr);
- }
-
- /* Now restore any global regs that the current function had saved. */
- get_frame_saved_regs (current_fi, &fsr);
- for (i = G0_REGNUM; i < G14_REGNUM; i++)
- {
- save_addr = fsr.regs[i];
- if (save_addr != 0)
- write_register (i, read_memory_integer (save_addr, 4));
- }
-
- /* Flush the frame cache, create a frame for the new innermost frame,
- and make it the current frame. */
-
- flush_cached_frames ();
-}
-
-/* Given a 960 stop code (fault or trace), return the signal which
- corresponds. */
-
-enum target_signal
-i960_fault_to_signal (int fault)
-{
- switch (fault)
- {
- case 0:
- return TARGET_SIGNAL_BUS; /* parallel fault */
- case 1:
- return TARGET_SIGNAL_UNKNOWN;
- case 2:
- return TARGET_SIGNAL_ILL; /* operation fault */
- case 3:
- return TARGET_SIGNAL_FPE; /* arithmetic fault */
- case 4:
- return TARGET_SIGNAL_FPE; /* floating point fault */
-
- /* constraint fault. This appears not to distinguish between
- a range constraint fault (which should be SIGFPE) and a privileged
- fault (which should be SIGILL). */
- case 5:
- return TARGET_SIGNAL_ILL;
-
- case 6:
- return TARGET_SIGNAL_SEGV; /* virtual memory fault */
-
- /* protection fault. This is for an out-of-range argument to
- "calls". I guess it also could be SIGILL. */
- case 7:
- return TARGET_SIGNAL_SEGV;
-
- case 8:
- return TARGET_SIGNAL_BUS; /* machine fault */
- case 9:
- return TARGET_SIGNAL_BUS; /* structural fault */
- case 0xa:
- return TARGET_SIGNAL_ILL; /* type fault */
- case 0xb:
- return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
- case 0xc:
- return TARGET_SIGNAL_BUS; /* process fault */
- case 0xd:
- return TARGET_SIGNAL_SEGV; /* descriptor fault */
- case 0xe:
- return TARGET_SIGNAL_BUS; /* event fault */
- case 0xf:
- return TARGET_SIGNAL_UNKNOWN; /* reserved fault */
- case 0x10:
- return TARGET_SIGNAL_TRAP; /* single-step trace */
- case 0x11:
- return TARGET_SIGNAL_TRAP; /* branch trace */
- case 0x12:
- return TARGET_SIGNAL_TRAP; /* call trace */
- case 0x13:
- return TARGET_SIGNAL_TRAP; /* return trace */
- case 0x14:
- return TARGET_SIGNAL_TRAP; /* pre-return trace */
- case 0x15:
- return TARGET_SIGNAL_TRAP; /* supervisor call trace */
- case 0x16:
- return TARGET_SIGNAL_TRAP; /* breakpoint trace */
- default:
- return TARGET_SIGNAL_UNKNOWN;
- }
-}
-
-/****************************************/
-/* MEM format */
-/****************************************/
-
-struct tabent
-{
- char *name;
- char numops;
-};
-
-/* Return instruction length, either 4 or 8. When NOPRINT is non-zero
- (TRUE), don't output any text. (Actually, as implemented, if NOPRINT
- is 0, abort() is called.) */
-
-static int
-mem (unsigned long memaddr, unsigned long word1, unsigned long word2,
- int noprint)
-{
- int i, j;
- int len;
- int mode;
- int offset;
- const char *reg1, *reg2, *reg3;
-
- /* This lookup table is too sparse to make it worth typing in, but not
- * so large as to make a sparse array necessary. We allocate the
- * table at runtime, initialize all entries to empty, and copy the
- * real ones in from an initialization table.
- *
- * NOTE: In this table, the meaning of 'numops' is:
- * 1: single operand
- * 2: 2 operands, load instruction
- * -2: 2 operands, store instruction
- */
- static struct tabent *mem_tab = NULL;
-/* Opcodes of 0x8X, 9X, aX, bX, and cX must be in the table. */
-#define MEM_MIN 0x80
-#define MEM_MAX 0xcf
-#define MEM_SIZ ((MEM_MAX-MEM_MIN+1) * sizeof(struct tabent))
-
- static struct
- {
- int opcode;
- char *name;
- char numops;
- }
- mem_init[] =
- {
- 0x80, "ldob", 2,
- 0x82, "stob", -2,
- 0x84, "bx", 1,
- 0x85, "balx", 2,
- 0x86, "callx", 1,
- 0x88, "ldos", 2,
- 0x8a, "stos", -2,
- 0x8c, "lda", 2,
- 0x90, "ld", 2,
- 0x92, "st", -2,
- 0x98, "ldl", 2,
- 0x9a, "stl", -2,
- 0xa0, "ldt", 2,
- 0xa2, "stt", -2,
- 0xb0, "ldq", 2,
- 0xb2, "stq", -2,
- 0xc0, "ldib", 2,
- 0xc2, "stib", -2,
- 0xc8, "ldis", 2,
- 0xca, "stis", -2,
- 0, NULL, 0
- };
-
- if (mem_tab == NULL)
- {
- mem_tab = (struct tabent *) xmalloc (MEM_SIZ);
- memset (mem_tab, '\0', MEM_SIZ);
- for (i = 0; mem_init[i].opcode != 0; i++)
- {
- j = mem_init[i].opcode - MEM_MIN;
- mem_tab[j].name = mem_init[i].name;
- mem_tab[j].numops = mem_init[i].numops;
- }
- }
-
- i = ((word1 >> 24) & 0xff) - MEM_MIN;
- mode = (word1 >> 10) & 0xf;
-
- if ((mem_tab[i].name != NULL) /* Valid instruction */
- && ((mode == 5) || (mode >= 12)))
- { /* With 32-bit displacement */
- len = 8;
- }
- else
- {
- len = 4;
- }
-
- if (noprint)
- {
- return len;
- }
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
-}
-
-/* Read the i960 instruction at 'memaddr' and return the address of
- the next instruction after that, or 0 if 'memaddr' is not the
- address of a valid instruction. The first word of the instruction
- is stored at 'pword1', and the second word, if any, is stored at
- 'pword2'. */
-
-static CORE_ADDR
-next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2)
-{
- int len;
- char buf[8];
-
- /* Read the two (potential) words of the instruction at once,
- to eliminate the overhead of two calls to read_memory ().
- FIXME: Loses if the first one is readable but the second is not
- (e.g. last word of the segment). */
-
- read_memory (memaddr, buf, 8);
- *pword1 = extract_unsigned_integer (buf, 4);
- *pword2 = extract_unsigned_integer (buf + 4, 4);
-
- /* Divide instruction set into classes based on high 4 bits of opcode */
-
- switch ((*pword1 >> 28) & 0xf)
- {
- case 0x0:
- case 0x1: /* ctrl */
-
- case 0x2:
- case 0x3: /* cobr */
-
- case 0x5:
- case 0x6:
- case 0x7: /* reg */
- len = 4;
- break;
-
- case 0x8:
- case 0x9:
- case 0xa:
- case 0xb:
- case 0xc:
- len = mem (memaddr, *pword1, *pword2, 1);
- break;
-
- default: /* invalid instruction */
- len = 0;
- break;
- }
-
- if (len)
- return memaddr + len;
- else
- return 0;
-}
-
-/* 'start_frame' is a variable in the MON960 runtime startup routine
- that contains the frame pointer of the 'start' routine (the routine
- that calls 'main'). By reading its contents out of remote memory,
- we can tell where the frame chain ends: backtraces should halt before
- they display this frame. */
-
-int
-mon960_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
-{
- struct symbol *sym;
- struct minimal_symbol *msymbol;
-
- /* crtmon960.o is an assembler module that is assumed to be linked
- * first in an i80960 executable. It contains the true entry point;
- * it performs startup up initialization and then calls 'main'.
- *
- * 'sf' is the name of a variable in crtmon960.o that is set
- * during startup to the address of the first frame.
- *
- * 'a' is the address of that variable in 80960 memory.
- */
- static char sf[] = "start_frame";
- CORE_ADDR a;
-
-
- chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers
- contain return status info in them. */
- if (chain == 0)
- {
- return 0;
- }
-
- sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL,
- (struct symtab **) NULL);
- if (sym != 0)
- {
- a = SYMBOL_VALUE (sym);
- }
- else
- {
- msymbol = lookup_minimal_symbol (sf, NULL, NULL);
- if (msymbol == NULL)
- return 0;
- a = SYMBOL_VALUE_ADDRESS (msymbol);
- }
-
- return (chain != read_memory_integer (a, 4));
-}
-
-
-void
-_initialize_i960_tdep (void)
-{
- check_host ();
-
- tm_print_insn = print_insn_i960;
-}
+// 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-tdep.c b/gdb/ia64-tdep.c
index ab7e4674f75..18741944a5a 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -96,12 +96,11 @@ static gdbarch_frame_saved_pc_ftype ia64_frame_saved_pc;
static gdbarch_skip_prologue_ftype ia64_skip_prologue;
static gdbarch_frame_init_saved_regs_ftype ia64_frame_init_saved_regs;
static gdbarch_get_saved_register_ftype ia64_get_saved_register;
-static gdbarch_extract_return_value_ftype ia64_extract_return_value;
-static gdbarch_extract_struct_value_address_ftype ia64_extract_struct_value_address;
+static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value;
+static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address;
static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation;
static gdbarch_init_extra_frame_info_ftype ia64_init_extra_frame_info;
-static gdbarch_store_return_value_ftype ia64_store_return_value;
static gdbarch_store_struct_return_ftype ia64_store_struct_return;
static gdbarch_push_arguments_ftype ia64_push_arguments;
static gdbarch_push_return_address_ftype ia64_push_return_address;
@@ -243,7 +242,7 @@ struct gdbarch_tdep
#define FIND_GLOBAL_POINTER \
(gdbarch_tdep (current_gdbarch)->find_global_pointer)
-static char *
+static const char *
ia64_register_name (int reg)
{
return ia64_register_names[reg];
@@ -2190,11 +2189,11 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw);
set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention);
- set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value);
set_gdbarch_store_struct_return (gdbarch, ia64_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, ia64_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, ia64_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint);
set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 400ac552d2d..433332555e8 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -40,6 +40,7 @@
#include "ui-out.h"
#include "event-top.h"
#include "parser-defs.h"
+#include "regcache.h"
/* Functions exported for general use: */
@@ -969,7 +970,7 @@ breakpoint_auto_delete_contents (PTR arg)
will eventually be popped when we do hit the dummy end breakpoint). */
int
-run_stack_dummy (CORE_ADDR addr, char *buffer)
+run_stack_dummy (CORE_ADDR addr, struct regcache *buffer)
{
struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
int saved_async = 0;
@@ -1042,8 +1043,7 @@ run_stack_dummy (CORE_ADDR addr, char *buffer)
return 2;
/* On normal return, the stack dummy has been popped already. */
-
- memcpy (buffer, stop_registers, REGISTER_BYTES);
+ regcache_cpy_no_passthrough (buffer, stop_registers);
return 0;
}
@@ -1549,32 +1549,48 @@ path_command (char *dirname, int from_tty)
#ifdef REGISTER_NAMES
char *gdb_register_names[] = REGISTER_NAMES;
#endif
-/* Print out the machine register regnum. If regnum is -1,
- print all registers (fpregs == 1) or all non-float registers
- (fpregs == 0).
+/* Print out the machine register regnum. If regnum is -1, print all
+ registers (print_all == 1) or all non-float and non-vector
+ registers (print_all == 0).
For most machines, having all_registers_info() print the
- register(s) one per line is good enough. If a different format
- is required, (eg, for MIPS or Pyramid 90x, which both have
- lots of regs), or there is an existing convention for showing
- all the registers, define the macro DO_REGISTERS_INFO(regnum, fp)
- to provide that format. */
+ register(s) one per line is good enough. If a different format is
+ required, (eg, for MIPS or Pyramid 90x, which both have lots of
+ regs), or there is an existing convention for showing all the
+ registers, define the architecture method PRINT_REGISTERS_INFO to
+ provide that format. */
void
-do_registers_info (int regnum, int fpregs)
+default_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int print_all)
{
- register int i;
- int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ int i;
+ const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+
+ /* FIXME: cagney/2002-03-08: This should be deprecated. */
+ if (DO_REGISTERS_INFO_P ())
+ {
+ DO_REGISTERS_INFO (regnum, print_all);
+ return;
+ }
for (i = 0; i < numregs; i++)
{
- /* Decide between printing all regs, nonfloat regs, or specific reg. */
+ /* Decide between printing all regs, non-float / vector regs, or
+ specific reg. */
if (regnum == -1)
{
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs)
- continue;
+ if (!print_all)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
+ continue;
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)))
+ continue;
+ }
}
else
{
@@ -1587,16 +1603,19 @@ do_registers_info (int regnum, int fpregs)
if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
continue;
- fputs_filtered (REGISTER_NAME (i), gdb_stdout);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
+ fputs_filtered (REGISTER_NAME (i), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
/* Get the data in raw format. */
- if (! frame_register_read (selected_frame, i, raw_buffer))
+ if (! frame_register_read (frame, i, raw_buffer))
{
- printf_filtered ("*value not available*\n");
+ fprintf_filtered (file, "*value not available*\n");
continue;
}
+ /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
+ The function frame_register_read() should have returned the
+ pre-cooked register so no conversion is necessary. */
/* Convert raw data to virtual format if necessary. */
if (REGISTER_CONVERTIBLE (i))
{
@@ -1609,31 +1628,40 @@ do_registers_info (int regnum, int fpregs)
REGISTER_VIRTUAL_SIZE (i));
}
- /* If virtual format is floating, print it that way, and in raw hex. */
+ /* If virtual format is floating, print it that way, and in raw
+ hex. */
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
{
- register int j;
+ int j;
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
+ file, 0, 1, 0, Val_pretty_default);
- printf_filtered ("\t(raw 0x");
+ fprintf_filtered (file, "\t(raw 0x");
for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
{
- register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
- : REGISTER_RAW_SIZE (i) - 1 - j;
- printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
+ int idx;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ idx = j;
+ else
+ idx = REGISTER_RAW_SIZE (i) - 1 - j;
+ fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
}
- printf_filtered (")");
+ fprintf_filtered (file, ")");
}
- /* Else print as integer in hex and in decimal. */
else
{
+ /* Print the register in hex. */
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 'x', 1, 0, Val_pretty_default);
- printf_filtered ("\t");
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
+ /* If not a vector register, print it also according to its
+ natural format. */
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ {
+ printf_filtered ("\t");
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ gdb_stdout, 0, 1, 0, Val_pretty_default);
+ }
}
/* The SPARC wants to print even-numbered float regs as doubles
@@ -1642,7 +1670,7 @@ do_registers_info (int regnum, int fpregs)
PRINT_REGISTER_HOOK (i);
#endif
- printf_filtered ("\n");
+ fprintf_filtered (file, "\n");
}
}
@@ -1659,7 +1687,8 @@ registers_info (char *addr_exp, int fpregs)
if (!addr_exp)
{
- DO_REGISTERS_INFO (-1, fpregs);
+ gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
+ selected_frame, -1, fpregs);
return;
}
@@ -1684,7 +1713,8 @@ registers_info (char *addr_exp, int fpregs)
error ("%.*s: invalid register", (int) (end - addr_exp), addr_exp);
found:
- DO_REGISTERS_INFO (regnum, fpregs);
+ gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
+ selected_frame, regnum, fpregs);
addr_exp = end;
while (*addr_exp == ' ' || *addr_exp == '\t')
@@ -1704,6 +1734,41 @@ nofp_registers_info (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 0);
}
+
+static void
+print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
+{
+ if (gdbarch_print_vector_info_p (gdbarch))
+ gdbarch_print_vector_info (gdbarch, file, frame, args);
+ else
+ {
+ int regnum;
+ int printed_something = 0;
+
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (regnum)))
+ {
+ printed_something = 1;
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
+ }
+ }
+ if (!printed_something)
+ fprintf_filtered (file, "No vector information\n");
+ }
+}
+
+static void
+vector_info (char *args, int from_tty)
+{
+ print_vector_info (current_gdbarch, gdb_stdout, selected_frame, args);
+}
/*
@@ -1845,9 +1910,46 @@ interrupt_target_command (char *args, int from_tty)
/* ARGSUSED */
static void
-float_info (char *addr_exp, int from_tty)
+print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
+{
+ if (gdbarch_print_float_info_p (gdbarch))
+ gdbarch_print_float_info (gdbarch, file, frame, args);
+ else
+ {
+#ifdef FLOAT_INFO
+#if GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL
+#error "FLOAT_INFO defined in multi-arch"
+#endif
+ FLOAT_INFO;
+#else
+ int regnum;
+ int printed_something = 0;
+
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
+ {
+ printed_something = 1;
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
+ }
+ }
+ if (!printed_something)
+ fprintf_filtered (file, "\
+No floating-point info available for this processor.\n");
+#endif
+ }
+}
+
+static void
+float_info (char *args, int from_tty)
{
- PRINT_FLOAT_INFO ();
+ print_float_info (current_gdbarch, gdb_stdout, selected_frame, args);
}
/* ARGSUSED */
@@ -2042,6 +2144,9 @@ Register name as argument means describe only that register.");
add_info ("float", float_info,
"Print the status of the floating point unit\n");
+ add_info ("vector", vector_info,
+ "Print the status of the vector unit\n");
+
inferior_environ = make_environ ();
init_environ (inferior_environ);
}
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 2c05f35b3ce..e875e9cc186 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -24,6 +24,7 @@
#define INFERIOR_H 1
struct gdbarch;
+struct regcache;
/* For bpstat. */
#include "breakpoint.h"
@@ -153,7 +154,7 @@ extern void generic_mourn_inferior (void);
extern void terminal_ours (void);
-extern int run_stack_dummy (CORE_ADDR, char *);
+extern int run_stack_dummy (CORE_ADDR , struct regcache *);
extern CORE_ADDR read_pc (void);
@@ -204,7 +205,10 @@ extern void resume (int, enum target_signal);
/* From misc files */
-extern void do_registers_info (int, int);
+extern void default_print_registers_info (struct gdbarch *gdbarch,
+ struct ui_file *file,
+ struct frame_info *frame,
+ int regnum, int all);
extern void store_inferior_registers (int);
@@ -396,7 +400,7 @@ extern int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-extern char *stop_registers;
+extern struct regcache *stop_registers;
/* Nonzero if the child process in inferior_ptid was attached rather
than forked. */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index e9fea2a0ac7..b6c23425459 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -60,11 +60,7 @@ static int hook_stop_stub (void *);
static void delete_breakpoint_current_contents (void *);
static void set_follow_fork_mode_command (char *arg, int from_tty,
- struct cmd_list_element * c);
-
-static struct inferior_status *xmalloc_inferior_status (void);
-
-static void free_inferior_status (struct inferior_status *);
+ struct cmd_list_element *c);
static int restore_selected_frame (void *);
@@ -78,7 +74,7 @@ static void follow_fork (int parent_pid, int child_pid);
static void follow_vfork (int parent_pid, int child_pid);
static void set_schedlock_func (char *args, int from_tty,
- struct cmd_list_element * c);
+ struct cmd_list_element *c);
struct execution_control_state;
@@ -177,13 +173,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
#define SKIP_SOLIB_RESOLVER(pc) 0
#endif
-/* In some shared library schemes, the return path from a shared library
- call may need to go through a trampoline too. */
-
-#ifndef IN_SOLIB_RETURN_TRAMPOLINE
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc,name) 0
-#endif
-
/* This function returns TRUE if pc is the address of an instruction
that lies within the dynamic linker (such as the event hook, or the
dld itself).
@@ -219,7 +208,7 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
instruction. This macro should expand to a pointer to a function that
does that, or zero if we have no such function. If we don't have a
definition for it, we have to report an error. */
-#ifndef SKIP_PERMANENT_BREAKPOINT
+#ifndef SKIP_PERMANENT_BREAKPOINT
#define SKIP_PERMANENT_BREAKPOINT (default_skip_permanent_breakpoint)
static void
default_skip_permanent_breakpoint (void)
@@ -230,7 +219,7 @@ how to step past a permanent breakpoint on this architecture. Try using\n\
a command like `return' or `jump' to continue execution.");
}
#endif
-
+
/* Convert the #defines into values. This is temporary until wfi control
flow is completely sorted out. */
@@ -341,7 +330,7 @@ int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-char *stop_registers;
+struct regcache *stop_registers;
/* Nonzero if program stopped due to error trying to insert breakpoints. */
@@ -373,19 +362,19 @@ static struct target_waitstatus target_last_waitstatus;
followed at the next resume of the inferior, and not
immediately. */
static struct
+{
+ enum target_waitkind kind;
+ struct
{
- enum target_waitkind kind;
- struct
- {
- int parent_pid;
- int saw_parent_fork;
- int child_pid;
- int saw_child_fork;
- int saw_child_exec;
- }
- fork_event;
- char *execd_pathname;
+ 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
@@ -408,8 +397,7 @@ 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[] =
-{
+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
@@ -516,8 +504,7 @@ follow_inferior_fork (int parent_pid, int child_pid, int has_forked,
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))
+ 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
@@ -581,9 +568,7 @@ follow_inferior_fork (int parent_pid, int child_pid, int has_forked,
if (has_vforked)
{
target_post_follow_vfork (parent_pid,
- followed_parent,
- child_pid,
- followed_child);
+ followed_parent, child_pid, followed_child);
}
pending_follow.fork_event.saw_parent_fork = 0;
@@ -634,7 +619,7 @@ follow_exec (int pid, char *execd_pathname)
{
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
follow_vfork (PIDGET (inferior_ptid),
- pending_follow.fork_event.child_pid);
+ pending_follow.fork_event.child_pid);
follow_vfork_when_exec = 0;
saved_pid = PIDGET (inferior_ptid);
@@ -690,7 +675,7 @@ follow_exec (int pid, char *execd_pathname)
gdb_flush (gdb_stdout);
target_mourn_inferior ();
inferior_ptid = pid_to_ptid (saved_pid);
- /* Because mourn_inferior resets inferior_ptid. */
+ /* Because mourn_inferior resets inferior_ptid. */
push_target (tgt);
/* That a.out is now the one to use. */
@@ -738,8 +723,7 @@ static const char schedlock_off[] = "off";
static const char schedlock_on[] = "on";
static const char schedlock_step[] = "step";
static const char *scheduler_mode = schedlock_off;
-static const char *scheduler_enums[] =
-{
+static const char *scheduler_enums[] = {
schedlock_off,
schedlock_on,
schedlock_step,
@@ -761,8 +745,7 @@ set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
if (!target_can_lock_scheduler)
{
scheduler_mode = schedlock_off;
- error ("Target '%s' cannot support this command.",
- target_shortname);
+ error ("Target '%s' cannot support this command.", target_shortname);
}
}
@@ -795,7 +778,7 @@ resume (int step, enum target_signal sig)
step anyway. */
if (CANNOT_STEP_HW_WATCHPOINTS && step && breakpoints_inserted)
remove_hw_watchpoints ();
-
+
/* Normally, by the time we reach `resume', the breakpoints are either
removed or inserted, as appropriate. The exception is if we're sitting
@@ -827,7 +810,7 @@ resume (int step, enum target_signal sig)
case (TARGET_WAITKIND_FORKED):
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
follow_fork (PIDGET (inferior_ptid),
- pending_follow.fork_event.child_pid);
+ pending_follow.fork_event.child_pid);
break;
case (TARGET_WAITKIND_VFORKED):
@@ -836,7 +819,7 @@ resume (int step, enum target_signal sig)
pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
follow_vfork (PIDGET (inferior_ptid),
- pending_follow.fork_event.child_pid);
+ 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
@@ -866,7 +849,7 @@ resume (int step, enum target_signal sig)
{
ptid_t resume_ptid;
- resume_ptid = RESUME_ALL; /* Default */
+ resume_ptid = RESUME_ALL; /* Default */
if ((step || singlestep_breakpoints_inserted_p) &&
!breakpoints_inserted && breakpoint_here_p (read_pc ()))
@@ -880,17 +863,17 @@ resume (int step, enum target_signal sig)
}
if ((scheduler_mode == schedlock_on) ||
- (scheduler_mode == schedlock_step &&
+ (scheduler_mode == schedlock_step &&
(step || singlestep_breakpoints_inserted_p)))
{
/* User-settable 'scheduler' mode requires solo thread resume. */
- resume_ptid = inferior_ptid;
+ resume_ptid = inferior_ptid;
}
#ifdef CANNOT_STEP_BREAKPOINT
/* Most targets can step a breakpoint instruction, thus executing it
- normally. But if this one cannot, just continue and we will hit
- it anyway. */
+ normally. But if this one cannot, just continue and we will hit
+ it anyway. */
if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
step = 0;
#endif
@@ -1007,16 +990,9 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
trap_expected = 1;
else
{
- int temp = insert_breakpoints ();
- if (temp)
- {
- print_sys_errmsg ("insert_breakpoints", temp);
- error ("Cannot insert breakpoints.\n\
-The same program may be running in another process,\n\
-or you may have requested too many hardware\n\
-breakpoints and/or watchpoints.\n");
- }
-
+ insert_breakpoints ();
+ /* If we get here there was no call to error() in
+ insert breakpoints -- so they were inserted. */
breakpoints_inserted = 1;
}
@@ -1161,36 +1137,36 @@ enum inferior_stop_reason
locals in handle_inferior_event. */
struct execution_control_state
- {
- struct target_waitstatus ws;
- struct target_waitstatus *wp;
- int another_trap;
- int random_signal;
- CORE_ADDR stop_func_start;
- CORE_ADDR stop_func_end;
- char *stop_func_name;
- struct symtab_and_line sal;
- int remove_breakpoints_on_following_step;
- int current_line;
- struct symtab *current_symtab;
- int handling_longjmp; /* FIXME */
- ptid_t ptid;
- ptid_t saved_inferior_ptid;
- int update_step_sp;
- int stepping_through_solib_after_catch;
- bpstat stepping_through_solib_catchpoints;
- int enable_hw_watchpoints_after_wait;
- int stepping_through_sigtramp;
- int new_thread_event;
- struct target_waitstatus tmpstatus;
- enum infwait_states infwait_state;
- ptid_t waiton_ptid;
- int wait_some_more;
- };
-
-void init_execution_control_state (struct execution_control_state * ecs);
-
-void handle_inferior_event (struct execution_control_state * ecs);
+{
+ struct target_waitstatus ws;
+ struct target_waitstatus *wp;
+ int another_trap;
+ int random_signal;
+ CORE_ADDR stop_func_start;
+ CORE_ADDR stop_func_end;
+ char *stop_func_name;
+ struct symtab_and_line sal;
+ int remove_breakpoints_on_following_step;
+ int current_line;
+ struct symtab *current_symtab;
+ int handling_longjmp; /* FIXME */
+ ptid_t ptid;
+ ptid_t saved_inferior_ptid;
+ int update_step_sp;
+ int stepping_through_solib_after_catch;
+ bpstat stepping_through_solib_catchpoints;
+ int enable_hw_watchpoints_after_wait;
+ int stepping_through_sigtramp;
+ int new_thread_event;
+ struct target_waitstatus tmpstatus;
+ enum infwait_states infwait_state;
+ ptid_t waiton_ptid;
+ int wait_some_more;
+};
+
+void init_execution_control_state (struct execution_control_state *ecs);
+
+void handle_inferior_event (struct execution_control_state *ecs);
static void check_sigtramp2 (struct execution_control_state *ecs);
static void step_into_function (struct execution_control_state *ecs);
@@ -1198,7 +1174,8 @@ static void step_over_function (struct execution_control_state *ecs);
static void stop_stepping (struct execution_control_state *ecs);
static void prepare_to_wait (struct execution_control_state *ecs);
static void keep_going (struct execution_control_state *ecs);
-static void print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info);
+static void print_stop_reason (enum inferior_stop_reason stop_reason,
+ int stop_info);
/* Wait for control to return from inferior to debugger.
If inferior gets a signal, we may decide to start it up again
@@ -1275,7 +1252,7 @@ fetch_inferior_event (void *client_data)
if (!async_ecs->wait_some_more)
{
- old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint,
+ old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint,
&step_resume_breakpoint);
make_exec_cleanup (delete_breakpoint_current_contents,
&through_sigtramp_breakpoint);
@@ -1298,7 +1275,8 @@ fetch_inferior_event (void *client_data)
}
if (target_wait_hook)
- async_ecs->ptid = target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
+ async_ecs->ptid =
+ target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
else
async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp);
@@ -1308,8 +1286,8 @@ fetch_inferior_event (void *client_data)
if (!async_ecs->wait_some_more)
{
/* Do only the cleanups that have been added by this
- function. Let the continuations for the commands do the rest,
- if there are any. */
+ function. Let the continuations for the commands do the rest,
+ if there are any. */
do_exec_cleanups (old_cleanups);
normal_stop ();
if (step_multi && stop_step)
@@ -1350,7 +1328,8 @@ static void
check_for_old_step_resume_breakpoint (void)
{
if (step_resume_breakpoint)
- warning ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
+ warning
+ ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
}
/* Return the cached copy of the last pid/waitstatus returned by
@@ -1359,7 +1338,7 @@ check_for_old_step_resume_breakpoint (void)
target_wait()/target_wait_hook(). */
void
-get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
+get_last_target_status (ptid_t *ptidp, struct target_waitstatus *status)
{
*ptidp = target_last_wait_ptid;
*status = target_last_waitstatus;
@@ -1377,32 +1356,30 @@ context_switch (struct execution_control_state *ecs)
mishandling thread creation. */
if (in_thread_list (inferior_ptid) && in_thread_list (ecs->ptid))
- { /* Perform infrun state context switch: */
+ { /* Perform infrun state context switch: */
/* Save infrun state for the old thread. */
- save_infrun_state (inferior_ptid, prev_pc,
- prev_func_start, prev_func_name,
+ save_infrun_state (inferior_ptid, prev_pc,
+ prev_func_start, prev_func_name,
trap_expected, step_resume_breakpoint,
- through_sigtramp_breakpoint, step_range_start,
- step_range_end, step_frame_address,
+ through_sigtramp_breakpoint, step_range_start,
+ step_range_end, step_frame_address,
ecs->handling_longjmp, ecs->another_trap,
ecs->stepping_through_solib_after_catch,
ecs->stepping_through_solib_catchpoints,
ecs->stepping_through_sigtramp,
- ecs->current_line, ecs->current_symtab,
- step_sp);
+ ecs->current_line, ecs->current_symtab, step_sp);
/* Load infrun state for the new thread. */
- load_infrun_state (ecs->ptid, &prev_pc,
- &prev_func_start, &prev_func_name,
+ load_infrun_state (ecs->ptid, &prev_pc,
+ &prev_func_start, &prev_func_name,
&trap_expected, &step_resume_breakpoint,
- &through_sigtramp_breakpoint, &step_range_start,
- &step_range_end, &step_frame_address,
+ &through_sigtramp_breakpoint, &step_range_start,
+ &step_range_end, &step_frame_address,
&ecs->handling_longjmp, &ecs->another_trap,
&ecs->stepping_through_solib_after_catch,
&ecs->stepping_through_solib_catchpoints,
- &ecs->stepping_through_sigtramp,
- &ecs->current_line, &ecs->current_symtab,
- &step_sp);
+ &ecs->stepping_through_sigtramp,
+ &ecs->current_line, &ecs->current_symtab, &step_sp);
}
inferior_ptid = ecs->ptid;
}
@@ -1417,508 +1394,521 @@ handle_inferior_event (struct execution_control_state *ecs)
{
CORE_ADDR tmp;
int stepped_after_stopped_by_watchpoint;
+ int sw_single_step_trap_p = 0;
/* Cache the last pid/waitstatus. */
target_last_wait_ptid = ecs->ptid;
target_last_waitstatus = *ecs->wp;
- /* Keep this extra brace for now, minimizes diffs. */
- {
- switch (ecs->infwait_state)
- {
- case infwait_thread_hop_state:
- /* Cancel the waiton_ptid. */
- ecs->waiton_ptid = pid_to_ptid (-1);
- /* Fall thru to the normal_state case. */
-
- case infwait_normal_state:
- /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event
- is serviced in this loop, below. */
- if (ecs->enable_hw_watchpoints_after_wait)
- {
- TARGET_ENABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
- ecs->enable_hw_watchpoints_after_wait = 0;
- }
- stepped_after_stopped_by_watchpoint = 0;
- break;
+ switch (ecs->infwait_state)
+ {
+ case infwait_thread_hop_state:
+ /* Cancel the waiton_ptid. */
+ ecs->waiton_ptid = pid_to_ptid (-1);
+ /* Fall thru to the normal_state case. */
- case infwait_nullified_state:
- break;
+ case infwait_normal_state:
+ /* See comments where a TARGET_WAITKIND_SYSCALL_RETURN event
+ is serviced in this loop, below. */
+ if (ecs->enable_hw_watchpoints_after_wait)
+ {
+ TARGET_ENABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
+ ecs->enable_hw_watchpoints_after_wait = 0;
+ }
+ stepped_after_stopped_by_watchpoint = 0;
+ break;
- case infwait_nonstep_watch_state:
- insert_breakpoints ();
+ case infwait_nullified_state:
+ break;
- /* FIXME-maybe: is this cleaner than setting a flag? Does it
- handle things like signals arriving and other things happening
- in combination correctly? */
- stepped_after_stopped_by_watchpoint = 1;
- break;
- }
- ecs->infwait_state = infwait_normal_state;
+ case infwait_nonstep_watch_state:
+ insert_breakpoints ();
- flush_cached_frames ();
+ /* FIXME-maybe: is this cleaner than setting a flag? Does it
+ handle things like signals arriving and other things happening
+ in combination correctly? */
+ stepped_after_stopped_by_watchpoint = 1;
+ break;
+ }
+ ecs->infwait_state = infwait_normal_state;
- /* If it's a new process, add it to the thread database */
+ flush_cached_frames ();
- ecs->new_thread_event = (! ptid_equal (ecs->ptid, inferior_ptid)
- && ! in_thread_list (ecs->ptid));
+ /* If it's a new process, add it to the thread database */
- if (ecs->ws.kind != TARGET_WAITKIND_EXITED
- && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED
- && ecs->new_thread_event)
- {
- add_thread (ecs->ptid);
+ ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
+ && !in_thread_list (ecs->ptid));
+
+ if (ecs->ws.kind != TARGET_WAITKIND_EXITED
+ && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event)
+ {
+ add_thread (ecs->ptid);
- ui_out_text (uiout, "[New ");
- ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
- ui_out_text (uiout, "]\n");
+ ui_out_text (uiout, "[New ");
+ ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
+ ui_out_text (uiout, "]\n");
#if 0
- /* NOTE: This block is ONLY meant to be invoked in case of a
- "thread creation event"! If it is invoked for any other
- sort of event (such as a new thread landing on a breakpoint),
- the event will be discarded, which is almost certainly
- a bad thing!
-
- To avoid this, the low-level module (eg. target_wait)
- should call in_thread_list and add_thread, so that the
- new thread is known by the time we get here. */
-
- /* We may want to consider not doing a resume here in order
- to give the user a chance to play with the new thread.
- It might be good to make that a user-settable option. */
-
- /* At this point, all threads are stopped (happens
- automatically in either the OS or the native code).
- Therefore we need to continue all threads in order to
- make progress. */
-
- target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
+ /* NOTE: This block is ONLY meant to be invoked in case of a
+ "thread creation event"! If it is invoked for any other
+ sort of event (such as a new thread landing on a breakpoint),
+ the event will be discarded, which is almost certainly
+ a bad thing!
+
+ To avoid this, the low-level module (eg. target_wait)
+ should call in_thread_list and add_thread, so that the
+ new thread is known by the time we get here. */
+
+ /* We may want to consider not doing a resume here in order
+ to give the user a chance to play with the new thread.
+ It might be good to make that a user-settable option. */
+
+ /* At this point, all threads are stopped (happens
+ automatically in either the OS or the native code).
+ Therefore we need to continue all threads in order to
+ make progress. */
+
+ target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
#endif
- }
+ }
- switch (ecs->ws.kind)
- {
- case TARGET_WAITKIND_LOADED:
- /* Ignore gracefully during startup of the inferior, as it
- might be the shell which has just loaded some objects,
- otherwise add the symbols for the newly loaded objects. */
+ switch (ecs->ws.kind)
+ {
+ case TARGET_WAITKIND_LOADED:
+ /* Ignore gracefully during startup of the inferior, as it
+ might be the shell which has just loaded some objects,
+ otherwise add the symbols for the newly loaded objects. */
#ifdef SOLIB_ADD
- if (!stop_soon_quietly)
- {
- /* Remove breakpoints, SOLIB_ADD might adjust
- breakpoint addresses via breakpoint_re_set. */
- if (breakpoints_inserted)
- remove_breakpoints ();
-
- /* Check for any newly added shared libraries if we're
- supposed to be adding them automatically. Switch
- terminal for any messages produced by
- breakpoint_re_set. */
- target_terminal_ours_for_output ();
- SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
- target_terminal_inferior ();
+ if (!stop_soon_quietly)
+ {
+ /* Remove breakpoints, SOLIB_ADD might adjust
+ breakpoint addresses via breakpoint_re_set. */
+ if (breakpoints_inserted)
+ remove_breakpoints ();
- /* Reinsert breakpoints and continue. */
- if (breakpoints_inserted)
- insert_breakpoints ();
- }
+ /* Check for any newly added shared libraries if we're
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
+
+ /* Reinsert breakpoints and continue. */
+ if (breakpoints_inserted)
+ insert_breakpoints ();
+ }
#endif
- resume (0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
- case TARGET_WAITKIND_SPURIOUS:
- resume (0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
+ case TARGET_WAITKIND_SPURIOUS:
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
- case TARGET_WAITKIND_EXITED:
- target_terminal_ours (); /* Must do this before mourn anyway */
- print_stop_reason (EXITED, ecs->ws.value.integer);
-
- /* Record the exit code in the convenience variable $_exitcode, so
- that the user can inspect this again later. */
- set_internalvar (lookup_internalvar ("_exitcode"),
- value_from_longest (builtin_type_int,
- (LONGEST) ecs->ws.value.integer));
- gdb_flush (gdb_stdout);
- target_mourn_inferior ();
- singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
- stop_print_frame = 0;
- stop_stepping (ecs);
- return;
+ case TARGET_WAITKIND_EXITED:
+ target_terminal_ours (); /* Must do this before mourn anyway */
+ print_stop_reason (EXITED, ecs->ws.value.integer);
+
+ /* Record the exit code in the convenience variable $_exitcode, so
+ that the user can inspect this again later. */
+ set_internalvar (lookup_internalvar ("_exitcode"),
+ value_from_longest (builtin_type_int,
+ (LONGEST) ecs->ws.value.integer));
+ gdb_flush (gdb_stdout);
+ target_mourn_inferior ();
+ singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
+ stop_print_frame = 0;
+ stop_stepping (ecs);
+ return;
- case TARGET_WAITKIND_SIGNALLED:
- stop_print_frame = 0;
- stop_signal = ecs->ws.value.sig;
- target_terminal_ours (); /* Must do this before mourn anyway */
-
- /* Note: By definition of TARGET_WAITKIND_SIGNALLED, we shouldn't
- reach here unless the inferior is dead. However, for years
- target_kill() was called here, which hints that fatal signals aren't
- really fatal on some systems. If that's true, then some changes
- may be needed. */
- target_mourn_inferior ();
-
- print_stop_reason (SIGNAL_EXITED, stop_signal);
- singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
- stop_stepping (ecs);
- return;
+ case TARGET_WAITKIND_SIGNALLED:
+ stop_print_frame = 0;
+ stop_signal = ecs->ws.value.sig;
+ target_terminal_ours (); /* Must do this before mourn anyway */
- /* The following are the only cases in which we keep going;
- the above cases end in a continue or goto. */
- case TARGET_WAITKIND_FORKED:
- 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;
- }
+ /* Note: By definition of TARGET_WAITKIND_SIGNALLED, we shouldn't
+ reach here unless the inferior is dead. However, for years
+ target_kill() was called here, which hints that fatal signals aren't
+ really fatal on some systems. If that's true, then some changes
+ may be needed. */
+ target_mourn_inferior ();
- 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;
-
- /* 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;
-
- /* 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;
- }
+ print_stop_reason (SIGNAL_EXITED, stop_signal);
+ singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P() */
+ stop_stepping (ecs);
+ return;
- /* 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
- {
- 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;
- }
- }
+ /* The following are the only cases in which we keep going;
+ the above cases end in a continue or goto. */
+ case TARGET_WAITKIND_FORKED:
+ 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;
+ }
- 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;
-
- /* 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
- for the next exec event. */
- if (inferior_ignoring_leading_exec_events)
- {
- inferior_ignoring_leading_exec_events--;
- if (pending_follow.kind == TARGET_WAITKIND_VFORKED)
- ENSURE_VFORKING_PARENT_REMAINS_STOPPED (pending_follow.fork_event.parent_pid);
- target_resume (ecs->ptid, 0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
- }
- inferior_ignoring_leading_exec_events =
- target_reported_exec_events_per_exec_call () - 1;
-
- pending_follow.execd_pathname =
- 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;
- }
+ 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;
+
+ /* 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;
+
+ /* 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;
+ }
- /* 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);
- xfree (pending_follow.execd_pathname);
-
- 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;
-
- /* These syscall events are returned on HP-UX, as part of its
- implementation of page-protection-based "hardware" watchpoints.
- HP-UX has unfortunate interactions between page-protections and
- some system calls. Our solution is to disable hardware watches
- when a system call is entered, and reenable them when the syscall
- completes. The downside of this is that we may miss the precise
- point at which a watched piece of memory is modified. "Oh well."
-
- Note that we may have multiple threads running, which may each
- enter syscalls at roughly the same time. Since we don't have a
- good notion currently of whether a watched piece of memory is
- thread-private, we'd best not have any page-protections active
- when any thread is in a syscall. Thus, we only want to reenable
- hardware watches when no threads are in a syscall.
-
- Also, be careful not to try to gather much state about a thread
- that's in a syscall. It's frequently a losing proposition. */
- case TARGET_WAITKIND_SYSCALL_ENTRY:
- number_of_threads_in_syscalls++;
- if (number_of_threads_in_syscalls == 1)
- {
- TARGET_DISABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
- }
- resume (0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
+ /* 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
+ {
+ 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;
+ }
+ }
- /* Before examining the threads further, step this thread to
- get it entirely out of the syscall. (We get notice of the
- event when the thread is just on the verge of exiting a
- syscall. Stepping one instruction seems to get it back
- into user code.)
+ 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;
+
+ /* 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
+ for the next exec event. */
+ if (inferior_ignoring_leading_exec_events)
+ {
+ inferior_ignoring_leading_exec_events--;
+ if (pending_follow.kind == TARGET_WAITKIND_VFORKED)
+ ENSURE_VFORKING_PARENT_REMAINS_STOPPED (pending_follow.fork_event.
+ parent_pid);
+ target_resume (ecs->ptid, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+ inferior_ignoring_leading_exec_events =
+ target_reported_exec_events_per_exec_call () - 1;
+
+ pending_follow.execd_pathname =
+ 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;
+ }
- Note that although the logical place to reenable h/w watches
- is here, we cannot. We cannot reenable them before stepping
- the thread (this causes the next wait on the thread to hang).
+ /* 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);
+ xfree (pending_follow.execd_pathname);
- Nor can we enable them after stepping until we've done a wait.
- Thus, we simply set the flag ecs->enable_hw_watchpoints_after_wait
- here, which will be serviced immediately after the target
- is waited on. */
- case TARGET_WAITKIND_SYSCALL_RETURN:
- target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
+ 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;
+
+ /* These syscall events are returned on HP-UX, as part of its
+ implementation of page-protection-based "hardware" watchpoints.
+ HP-UX has unfortunate interactions between page-protections and
+ some system calls. Our solution is to disable hardware watches
+ when a system call is entered, and reenable them when the syscall
+ completes. The downside of this is that we may miss the precise
+ point at which a watched piece of memory is modified. "Oh well."
+
+ Note that we may have multiple threads running, which may each
+ enter syscalls at roughly the same time. Since we don't have a
+ good notion currently of whether a watched piece of memory is
+ thread-private, we'd best not have any page-protections active
+ when any thread is in a syscall. Thus, we only want to reenable
+ hardware watches when no threads are in a syscall.
+
+ Also, be careful not to try to gather much state about a thread
+ that's in a syscall. It's frequently a losing proposition. */
+ case TARGET_WAITKIND_SYSCALL_ENTRY:
+ number_of_threads_in_syscalls++;
+ if (number_of_threads_in_syscalls == 1)
+ {
+ TARGET_DISABLE_HW_WATCHPOINTS (PIDGET (inferior_ptid));
+ }
+ resume (0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
- if (number_of_threads_in_syscalls > 0)
- {
- number_of_threads_in_syscalls--;
- ecs->enable_hw_watchpoints_after_wait =
- (number_of_threads_in_syscalls == 0);
- }
- prepare_to_wait (ecs);
- return;
+ /* Before examining the threads further, step this thread to
+ get it entirely out of the syscall. (We get notice of the
+ event when the thread is just on the verge of exiting a
+ syscall. Stepping one instruction seems to get it back
+ into user code.)
- case TARGET_WAITKIND_STOPPED:
- stop_signal = ecs->ws.value.sig;
- break;
+ Note that although the logical place to reenable h/w watches
+ is here, we cannot. We cannot reenable them before stepping
+ the thread (this causes the next wait on the thread to hang).
- /* 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. */
- case TARGET_WAITKIND_IGNORE:
- ecs->wait_some_more = 1;
- return;
- }
+ Nor can we enable them after stepping until we've done a wait.
+ Thus, we simply set the flag ecs->enable_hw_watchpoints_after_wait
+ here, which will be serviced immediately after the target
+ is waited on. */
+ case TARGET_WAITKIND_SYSCALL_RETURN:
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
- /* We may want to consider not doing a resume here in order to give
- the user a chance to play with the new thread. It might be good
- to make that a user-settable option. */
+ if (number_of_threads_in_syscalls > 0)
+ {
+ number_of_threads_in_syscalls--;
+ ecs->enable_hw_watchpoints_after_wait =
+ (number_of_threads_in_syscalls == 0);
+ }
+ prepare_to_wait (ecs);
+ return;
- /* At this point, all threads are stopped (happens automatically in
- either the OS or the native code). Therefore we need to continue
- all threads in order to make progress. */
- if (ecs->new_thread_event)
- {
- target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
- }
+ case TARGET_WAITKIND_STOPPED:
+ stop_signal = ecs->ws.value.sig;
+ break;
- stop_pc = read_pc_pid (ecs->ptid);
+ /* 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. */
+ case TARGET_WAITKIND_IGNORE:
+ ecs->wait_some_more = 1;
+ return;
+ }
- /* See if a thread hit a thread-specific breakpoint that was meant for
- another thread. If so, then step that thread past the breakpoint,
- and continue it. */
+ /* We may want to consider not doing a resume here in order to give
+ the user a chance to play with the new thread. It might be good
+ to make that a user-settable option. */
- if (stop_signal == TARGET_SIGNAL_TRAP)
- {
- if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ /* At this point, all threads are stopped (happens automatically in
+ either the OS or the native code). Therefore we need to continue
+ all threads in order to make progress. */
+ if (ecs->new_thread_event)
+ {
+ target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+
+ stop_pc = read_pc_pid (ecs->ptid);
+
+ /* See if a thread hit a thread-specific breakpoint that was meant for
+ another thread. If so, then step that thread past the breakpoint,
+ and continue it. */
+
+ if (stop_signal == TARGET_SIGNAL_TRAP)
+ {
+ /* Check if a regular breakpoint has been hit before checking
+ for a potential single step breakpoint. Otherwise, GDB will
+ not see this breakpoint hit when stepping onto breakpoints. */
+ if (breakpoints_inserted
+ && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
+ {
ecs->random_signal = 0;
- else if (breakpoints_inserted
- && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
- {
- ecs->random_signal = 0;
- if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
- ecs->ptid))
- {
- int remove_status;
-
- /* Saw a breakpoint, but it was hit by the wrong thread.
- Just continue. */
- if (DECR_PC_AFTER_BREAK)
- write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid);
-
- remove_status = remove_breakpoints ();
- /* Did we fail to remove breakpoints? If so, try
- to set the PC past the bp. (There's at least
- one situation in which we can fail to remove
- the bp's: On HP-UX's that use ttrace, we can't
- change the address space of a vforking child
- process until the child exits (well, okay, not
- then either :-) or execs. */
- if (remove_status != 0)
- {
- /* FIXME! This is obviously non-portable! */
- write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4,
- ecs->ptid);
- /* We need to restart all the threads now,
- * unles we're running in scheduler-locked mode.
- * Use currently_stepping to determine whether to
- * step or continue.
- */
- /* FIXME MVS: is there any reason not to call resume()? */
- if (scheduler_mode == schedlock_on)
- target_resume (ecs->ptid,
- currently_stepping (ecs),
- TARGET_SIGNAL_0);
- else
- target_resume (RESUME_ALL,
- currently_stepping (ecs),
- TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
- }
- else
- { /* Single step */
- breakpoints_inserted = 0;
- if (!ptid_equal (inferior_ptid, ecs->ptid))
- context_switch (ecs);
- ecs->waiton_ptid = ecs->ptid;
- ecs->wp = &(ecs->ws);
- ecs->another_trap = 1;
-
- ecs->infwait_state = infwait_thread_hop_state;
- keep_going (ecs);
- registers_changed ();
- return;
- }
- }
- }
- }
- else
- ecs->random_signal = 1;
-
- /* See if something interesting happened to the non-current thread. If
- so, then switch to that thread, and eventually give control back to
- the user.
-
- Note that if there's any kind of pending follow (i.e., of a fork,
- vfork or exec), we don't want to do this now. Rather, we'll let
- the next resume handle it. */
- if (! ptid_equal (ecs->ptid, inferior_ptid) &&
- (pending_follow.kind == TARGET_WAITKIND_SPURIOUS))
- {
- int printed = 0;
+ if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
+ ecs->ptid))
+ {
+ int remove_status;
+
+ /* Saw a breakpoint, but it was hit by the wrong thread.
+ Just continue. */
+ if (DECR_PC_AFTER_BREAK)
+ write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK, ecs->ptid);
+
+ remove_status = remove_breakpoints ();
+ /* Did we fail to remove breakpoints? If so, try
+ to set the PC past the bp. (There's at least
+ one situation in which we can fail to remove
+ the bp's: On HP-UX's that use ttrace, we can't
+ change the address space of a vforking child
+ process until the child exits (well, okay, not
+ then either :-) or execs. */
+ if (remove_status != 0)
+ {
+ /* FIXME! This is obviously non-portable! */
+ write_pc_pid (stop_pc - DECR_PC_AFTER_BREAK + 4, ecs->ptid);
+ /* We need to restart all the threads now,
+ * unles we're running in scheduler-locked mode.
+ * Use currently_stepping to determine whether to
+ * step or continue.
+ */
+ /* FIXME MVS: is there any reason not to call resume()? */
+ if (scheduler_mode == schedlock_on)
+ target_resume (ecs->ptid,
+ currently_stepping (ecs), TARGET_SIGNAL_0);
+ else
+ target_resume (RESUME_ALL,
+ currently_stepping (ecs), TARGET_SIGNAL_0);
+ prepare_to_wait (ecs);
+ return;
+ }
+ else
+ { /* Single step */
+ breakpoints_inserted = 0;
+ if (!ptid_equal (inferior_ptid, ecs->ptid))
+ context_switch (ecs);
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->ws);
+ ecs->another_trap = 1;
+
+ ecs->infwait_state = infwait_thread_hop_state;
+ keep_going (ecs);
+ registers_changed ();
+ return;
+ }
+ }
+ }
+ else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ {
+ /* Readjust the stop_pc as it is off by DECR_PC_AFTER_BREAK
+ compared to the value it would have if the system stepping
+ capability was used. This allows the rest of the code in
+ this function to use this address without having to worry
+ whether software single step is in use or not. */
+ if (DECR_PC_AFTER_BREAK)
+ {
+ stop_pc -= DECR_PC_AFTER_BREAK;
+ write_pc_pid (stop_pc, ecs->ptid);
+ }
+
+ sw_single_step_trap_p = 1;
+ ecs->random_signal = 0;
+ }
+ }
+ else
+ ecs->random_signal = 1;
- /* If it's a random signal for a non-current thread, notify user
- if he's expressed an interest. */
- if (ecs->random_signal
- && signal_print[stop_signal])
- {
+ /* See if something interesting happened to the non-current thread. If
+ so, then switch to that thread, and eventually give control back to
+ the user.
+
+ Note that if there's any kind of pending follow (i.e., of a fork,
+ vfork or exec), we don't want to do this now. Rather, we'll let
+ the next resume handle it. */
+ if (!ptid_equal (ecs->ptid, inferior_ptid) &&
+ (pending_follow.kind == TARGET_WAITKIND_SPURIOUS))
+ {
+ int printed = 0;
+
+ /* If it's a random signal for a non-current thread, notify user
+ if he's expressed an interest. */
+ if (ecs->random_signal && signal_print[stop_signal])
+ {
/* ??rehrauer: I don't understand the rationale for this code. If the
inferior will stop as a result of this signal, then the act of handling
the stop ought to print a message that's couches the stoppage in user
@@ -1930,1018 +1920,1016 @@ handle_inferior_event (struct execution_control_state *ecs)
For now, remove the message altogether. */
#if 0
- printed = 1;
- target_terminal_ours_for_output ();
- printf_filtered ("\nProgram received signal %s, %s.\n",
- target_signal_to_name (stop_signal),
- target_signal_to_string (stop_signal));
- gdb_flush (gdb_stdout);
+ printed = 1;
+ target_terminal_ours_for_output ();
+ printf_filtered ("\nProgram received signal %s, %s.\n",
+ target_signal_to_name (stop_signal),
+ target_signal_to_string (stop_signal));
+ gdb_flush (gdb_stdout);
#endif
- }
+ }
- /* If it's not SIGTRAP and not a signal we want to stop for, then
- continue the thread. */
+ /* If it's not SIGTRAP and not a signal we want to stop for, then
+ continue the thread. */
- if (stop_signal != TARGET_SIGNAL_TRAP
- && !signal_stop[stop_signal])
- {
- if (printed)
- target_terminal_inferior ();
+ if (stop_signal != TARGET_SIGNAL_TRAP && !signal_stop[stop_signal])
+ {
+ if (printed)
+ target_terminal_inferior ();
- /* Clear the signal if it should not be passed. */
- if (signal_program[stop_signal] == 0)
- stop_signal = TARGET_SIGNAL_0;
+ /* Clear the signal if it should not be passed. */
+ if (signal_program[stop_signal] == 0)
+ stop_signal = TARGET_SIGNAL_0;
- target_resume (ecs->ptid, 0, stop_signal);
- prepare_to_wait (ecs);
- return;
- }
+ target_resume (ecs->ptid, 0, stop_signal);
+ prepare_to_wait (ecs);
+ return;
+ }
- /* It's a SIGTRAP or a signal we're interested in. Switch threads,
- and fall into the rest of wait_for_inferior(). */
+ /* It's a SIGTRAP or a signal we're interested in. Switch threads,
+ and fall into the rest of wait_for_inferior(). */
- context_switch (ecs);
+ context_switch (ecs);
- if (context_hook)
- context_hook (pid_to_thread_id (ecs->ptid));
+ if (context_hook)
+ context_hook (pid_to_thread_id (ecs->ptid));
- flush_cached_frames ();
- }
+ flush_cached_frames ();
+ }
- if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
- {
- /* Pull the single step breakpoints out of the target. */
- SOFTWARE_SINGLE_STEP (0, 0);
- singlestep_breakpoints_inserted_p = 0;
- }
+ if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+ {
+ /* Pull the single step breakpoints out of the target. */
+ SOFTWARE_SINGLE_STEP (0, 0);
+ singlestep_breakpoints_inserted_p = 0;
+ }
- /* If PC is pointing at a nullified instruction, then step beyond
- it so that the user won't be confused when GDB appears to be ready
- to execute it. */
+ /* If PC is pointing at a nullified instruction, then step beyond
+ it so that the user won't be confused when GDB appears to be ready
+ to execute it. */
- /* if (INSTRUCTION_NULLIFIED && currently_stepping (ecs)) */
- if (INSTRUCTION_NULLIFIED)
- {
- registers_changed ();
- target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
+ /* if (INSTRUCTION_NULLIFIED && currently_stepping (ecs)) */
+ if (INSTRUCTION_NULLIFIED)
+ {
+ registers_changed ();
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
- /* We may have received a signal that we want to pass to
- the inferior; therefore, we must not clobber the waitstatus
- in WS. */
+ /* We may have received a signal that we want to pass to
+ the inferior; therefore, we must not clobber the waitstatus
+ in WS. */
- ecs->infwait_state = infwait_nullified_state;
- ecs->waiton_ptid = ecs->ptid;
- ecs->wp = &(ecs->tmpstatus);
- prepare_to_wait (ecs);
- return;
- }
+ ecs->infwait_state = infwait_nullified_state;
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->tmpstatus);
+ prepare_to_wait (ecs);
+ return;
+ }
- /* It may not be necessary to disable the watchpoint to stop over
- it. For example, the PA can (with some kernel cooperation)
- single step over a watchpoint without disabling the watchpoint. */
- if (HAVE_STEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
- {
- resume (1, 0);
- prepare_to_wait (ecs);
- return;
- }
+ /* It may not be necessary to disable the watchpoint to stop over
+ it. For example, the PA can (with some kernel cooperation)
+ single step over a watchpoint without disabling the watchpoint. */
+ if (HAVE_STEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
+ {
+ resume (1, 0);
+ prepare_to_wait (ecs);
+ return;
+ }
- /* It is far more common to need to disable a watchpoint to step
- the inferior over it. FIXME. What else might a debug
- register or page protection watchpoint scheme need here? */
- if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
- {
- /* At this point, we are stopped at an instruction which has
- attempted to write to a piece of memory under control of
- a watchpoint. The instruction hasn't actually executed
- yet. If we were to evaluate the watchpoint expression
- now, we would get the old value, and therefore no change
- would seem to have occurred.
-
- In order to make watchpoints work `right', we really need
- to complete the memory write, and then evaluate the
- watchpoint expression. The following code does that by
- removing the watchpoint (actually, all watchpoints and
- breakpoints), single-stepping the target, re-inserting
- watchpoints, and then falling through to let normal
- single-step processing handle proceed. Since this
- includes evaluating watchpoints, things will come to a
- stop in the correct manner. */
-
- if (DECR_PC_AFTER_BREAK)
- write_pc (stop_pc - DECR_PC_AFTER_BREAK);
+ /* It is far more common to need to disable a watchpoint to step
+ the inferior over it. FIXME. What else might a debug
+ register or page protection watchpoint scheme need here? */
+ if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
+ {
+ /* At this point, we are stopped at an instruction which has
+ attempted to write to a piece of memory under control of
+ a watchpoint. The instruction hasn't actually executed
+ yet. If we were to evaluate the watchpoint expression
+ now, we would get the old value, and therefore no change
+ would seem to have occurred.
+
+ In order to make watchpoints work `right', we really need
+ to complete the memory write, and then evaluate the
+ watchpoint expression. The following code does that by
+ removing the watchpoint (actually, all watchpoints and
+ breakpoints), single-stepping the target, re-inserting
+ watchpoints, and then falling through to let normal
+ single-step processing handle proceed. Since this
+ includes evaluating watchpoints, things will come to a
+ stop in the correct manner. */
+
+ if (DECR_PC_AFTER_BREAK)
+ write_pc (stop_pc - DECR_PC_AFTER_BREAK);
- remove_breakpoints ();
- registers_changed ();
- target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); /* Single step */
+ remove_breakpoints ();
+ registers_changed ();
+ target_resume (ecs->ptid, 1, TARGET_SIGNAL_0); /* Single step */
- ecs->waiton_ptid = ecs->ptid;
- ecs->wp = &(ecs->ws);
- ecs->infwait_state = infwait_nonstep_watch_state;
- prepare_to_wait (ecs);
- return;
+ ecs->waiton_ptid = ecs->ptid;
+ ecs->wp = &(ecs->ws);
+ ecs->infwait_state = infwait_nonstep_watch_state;
+ prepare_to_wait (ecs);
+ return;
+ }
+
+ /* It may be possible to simply continue after a watchpoint. */
+ if (HAVE_CONTINUABLE_WATCHPOINT)
+ STOPPED_BY_WATCHPOINT (ecs->ws);
+
+ ecs->stop_func_start = 0;
+ ecs->stop_func_end = 0;
+ ecs->stop_func_name = 0;
+ /* Don't care about return value; stop_func_start and stop_func_name
+ will both be 0 if it doesn't work. */
+ find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+ &ecs->stop_func_start, &ecs->stop_func_end);
+ ecs->stop_func_start += FUNCTION_START_OFFSET;
+ ecs->another_trap = 0;
+ bpstat_clear (&stop_bpstat);
+ stop_step = 0;
+ stop_stack_dummy = 0;
+ stop_print_frame = 1;
+ ecs->random_signal = 0;
+ stopped_by_random_signal = 0;
+ breakpoints_failed = 0;
+
+ /* Look at the cause of the stop, and decide what to do.
+ The alternatives are:
+ 1) break; to really stop and return to the debugger,
+ 2) drop through to start up again
+ (set ecs->another_trap to 1 to single step once)
+ 3) set ecs->random_signal to 1, and the decision between 1 and 2
+ will be made according to the signal handling tables. */
+
+ /* First, distinguish signals caused by the debugger from signals
+ that have to do with the program's own actions.
+ Note that breakpoint insns may cause SIGTRAP or SIGILL
+ or SIGEMT, depending on the operating system version.
+ Here we detect when a SIGILL or SIGEMT is really a breakpoint
+ and change it to SIGTRAP. */
+
+ if (stop_signal == TARGET_SIGNAL_TRAP
+ || (breakpoints_inserted &&
+ (stop_signal == TARGET_SIGNAL_ILL
+ || stop_signal == TARGET_SIGNAL_EMT)) || stop_soon_quietly)
+ {
+ if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
+ {
+ stop_print_frame = 0;
+ stop_stepping (ecs);
+ return;
+ }
+ if (stop_soon_quietly)
+ {
+ stop_stepping (ecs);
+ return;
+ }
+
+ /* Don't even think about breakpoints
+ if just proceeded over a breakpoint.
+
+ However, if we are trying to proceed over a breakpoint
+ and end up in sigtramp, then through_sigtramp_breakpoint
+ will be set and we should check whether we've hit the
+ step breakpoint. */
+ if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected
+ && through_sigtramp_breakpoint == NULL)
+ bpstat_clear (&stop_bpstat);
+ else
+ {
+ /* See if there is a breakpoint at the current 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.
+
+ Therefore, pass TRUE if our reason for stopping is
+ something other than hitting a breakpoint. We do this by
+ checking that either: we detected earlier a software single
+ step trap or, 1) stepping is going on and 2) we didn't hit
+ a breakpoint in a signal handler without an intervening stop
+ in sigtramp, which is detected by a new stack pointer value
+ below any usual function calling stack adjustments. */
+ stop_bpstat =
+ bpstat_stop_status
+ (&stop_pc,
+ sw_single_step_trap_p
+ || (currently_stepping (ecs)
+ && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
+ && !(step_range_end
+ && INNER_THAN (read_sp (), (step_sp - 16)))));
+ /* Following in case break condition called a
+ function. */
+ stop_print_frame = 1;
+ }
+
+ if (stop_signal == TARGET_SIGNAL_TRAP)
+ ecs->random_signal
+ = !(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 ())))
+ || (step_range_end && step_resume_breakpoint == NULL));
+
+ else
+ {
+ ecs->random_signal = !(bpstat_explains_signal (stop_bpstat)
+ /* End of a stack dummy. Some systems (e.g. Sony
+ 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
+ (get_current_frame
+ ()))));
+ if (!ecs->random_signal)
+ stop_signal = TARGET_SIGNAL_TRAP;
+ }
+ }
+
+ /* When we reach this point, we've pretty much decided
+ that the reason for stopping must've been a random
+ (unexpected) signal. */
+
+ 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;
+ }
+ }
+
+ /* For the program's own signals, act according to
+ the signal handling tables. */
+
+ if (ecs->random_signal)
+ {
+ /* Signal not for debugging purposes. */
+ int printed = 0;
+
+ stopped_by_random_signal = 1;
+
+ if (signal_print[stop_signal])
+ {
+ printed = 1;
+ target_terminal_ours_for_output ();
+ print_stop_reason (SIGNAL_RECEIVED, stop_signal);
+ }
+ if (signal_stop[stop_signal])
+ {
+ stop_stepping (ecs);
+ return;
+ }
+ /* If not going to stop, give terminal back
+ if we took it away. */
+ else if (printed)
+ target_terminal_inferior ();
+
+ /* Clear the signal if it should not be passed. */
+ if (signal_program[stop_signal] == 0)
+ stop_signal = TARGET_SIGNAL_0;
+
+ /* I'm not sure whether this needs to be check_sigtramp2 or
+ whether it could/should be keep_going.
+
+ This used to jump to step_over_function if we are stepping,
+ which is wrong.
+
+ Suppose the user does a `next' over a function call, and while
+ that call is in progress, the inferior receives a signal for
+ which GDB does not stop (i.e., signal_stop[SIG] is false). In
+ that case, when we reach this point, there is already a
+ step-resume breakpoint established, right where it should be:
+ immediately after the function call the user is "next"-ing
+ over. If we call step_over_function now, two bad things
+ happen:
+
+ - we'll create a new breakpoint, at wherever the current
+ frame's return address happens to be. That could be
+ anywhere, depending on what function call happens to be on
+ the top of the stack at that point. Point is, it's probably
+ not where we need it.
+
+ - the existing step-resume breakpoint (which is at the correct
+ address) will get orphaned: step_resume_breakpoint will point
+ to the new breakpoint, and the old step-resume breakpoint
+ will never be cleaned up.
+
+ The old behavior was meant to help HP-UX single-step out of
+ sigtramps. It would place the new breakpoint at prev_pc, which
+ was certainly wrong. I don't know the details there, so fixing
+ this probably breaks that. As with anything else, it's up to
+ the HP-UX maintainer to furnish a fix that doesn't break other
+ platforms. --JimB, 20 May 1999 */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
+
+ /* Handle cases caused by hitting a breakpoint. */
+ {
+ CORE_ADDR jmp_buf_pc;
+ struct bpstat_what what;
+
+ what = bpstat_what (stop_bpstat);
+
+ if (what.call_dummy)
+ {
+ stop_stack_dummy = 1;
+#ifdef HP_OS_BUG
+ trap_expected_after_continue = 1;
+#endif
}
- /* It may be possible to simply continue after a watchpoint. */
- if (HAVE_CONTINUABLE_WATCHPOINT)
- STOPPED_BY_WATCHPOINT (ecs->ws);
-
- ecs->stop_func_start = 0;
- ecs->stop_func_end = 0;
- ecs->stop_func_name = 0;
- /* Don't care about return value; stop_func_start and stop_func_name
- will both be 0 if it doesn't work. */
- find_pc_partial_function (stop_pc, &ecs->stop_func_name,
- &ecs->stop_func_start, &ecs->stop_func_end);
- ecs->stop_func_start += FUNCTION_START_OFFSET;
- ecs->another_trap = 0;
- bpstat_clear (&stop_bpstat);
- stop_step = 0;
- stop_stack_dummy = 0;
- stop_print_frame = 1;
- ecs->random_signal = 0;
- stopped_by_random_signal = 0;
- breakpoints_failed = 0;
-
- /* Look at the cause of the stop, and decide what to do.
- The alternatives are:
- 1) break; to really stop and return to the debugger,
- 2) drop through to start up again
- (set ecs->another_trap to 1 to single step once)
- 3) set ecs->random_signal to 1, and the decision between 1 and 2
- will be made according to the signal handling tables. */
-
- /* First, distinguish signals caused by the debugger from signals
- that have to do with the program's own actions.
- Note that breakpoint insns may cause SIGTRAP or SIGILL
- or SIGEMT, depending on the operating system version.
- Here we detect when a SIGILL or SIGEMT is really a breakpoint
- and change it to SIGTRAP. */
-
- if (stop_signal == TARGET_SIGNAL_TRAP
- || (breakpoints_inserted &&
- (stop_signal == TARGET_SIGNAL_ILL
- || stop_signal == TARGET_SIGNAL_EMT
- ))
- || stop_soon_quietly)
+ switch (what.main_action)
{
- if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
+ case BPSTAT_WHAT_SET_LONGJMP_RESUME:
+ /* If we hit the breakpoint at longjmp, disable it for the
+ duration of this command. Then, install a temporary
+ breakpoint at the target of the jmp_buf. */
+ disable_longjmp_breakpoint ();
+ remove_breakpoints ();
+ breakpoints_inserted = 0;
+ if (!GET_LONGJMP_TARGET_P () || !GET_LONGJMP_TARGET (&jmp_buf_pc))
{
- stop_print_frame = 0;
- stop_stepping (ecs);
+ keep_going (ecs);
return;
}
- if (stop_soon_quietly)
+
+ /* Need to blow away step-resume breakpoint, as it
+ interferes with us */
+ if (step_resume_breakpoint != NULL)
{
- stop_stepping (ecs);
- return;
+ delete_step_resume_breakpoint (&step_resume_breakpoint);
}
-
- /* Don't even think about breakpoints
- if just proceeded over a breakpoint.
-
- However, if we are trying to proceed over a breakpoint
- and end up in sigtramp, then through_sigtramp_breakpoint
- will be set and we should check whether we've hit the
- step breakpoint. */
- if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected
- && through_sigtramp_breakpoint == NULL)
- bpstat_clear (&stop_bpstat);
- else
+ /* Not sure whether we need to blow this away too, but probably
+ it is like the step-resume breakpoint. */
+ if (through_sigtramp_breakpoint != NULL)
{
- /* See if there is a breakpoint at the current 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,
- /* Pass TRUE if our reason for stopping is something other
- than hitting a breakpoint. We do this by checking that
- 1) stepping is going on and 2) we didn't hit a breakpoint
- in a signal handler without an intervening stop in
- sigtramp, which is detected by a new stack pointer value
- below any usual function calling stack adjustments. */
- (currently_stepping (ecs)
- && prev_pc != stop_pc - DECR_PC_AFTER_BREAK
- && !(step_range_end
- && INNER_THAN (read_sp (), (step_sp - 16))))
- );
- /* Following in case break condition called a
- function. */
- stop_print_frame = 1;
+ delete_breakpoint (through_sigtramp_breakpoint);
+ through_sigtramp_breakpoint = NULL;
}
- if (stop_signal == TARGET_SIGNAL_TRAP)
- ecs->random_signal
- = !(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 ())))
- || (step_range_end && step_resume_breakpoint == NULL));
-
+#if 0
+ /* FIXME - Need to implement nested temporary breakpoints */
+ if (step_over_calls > 0)
+ set_longjmp_resume_breakpoint (jmp_buf_pc, get_current_frame ());
else
- {
- ecs->random_signal
- = !(bpstat_explains_signal (stop_bpstat)
- /* End of a stack dummy. Some systems (e.g. Sony
- 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 (get_current_frame ())))
- );
- if (!ecs->random_signal)
- stop_signal = TARGET_SIGNAL_TRAP;
- }
- }
+#endif /* 0 */
+ set_longjmp_resume_breakpoint (jmp_buf_pc, NULL);
+ ecs->handling_longjmp = 1; /* FIXME */
+ keep_going (ecs);
+ return;
- /* When we reach this point, we've pretty much decided
- that the reason for stopping must've been a random
- (unexpected) signal. */
-
- 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. */
+ case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME:
+ case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
+ remove_breakpoints ();
+ breakpoints_inserted = 0;
+#if 0
+ /* FIXME - Need to implement nested temporary breakpoints */
+ if (step_over_calls
+ && (INNER_THAN (FRAME_FP (get_current_frame ()),
+ step_frame_address)))
{
- stop_signal = TARGET_SIGNAL_0;
+ ecs->another_trap = 1;
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. */
+#endif /* 0 */
+ disable_longjmp_breakpoint ();
+ ecs->handling_longjmp = 0; /* FIXME */
+ if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
+ break;
+ /* else fallthrough */
+
+ case BPSTAT_WHAT_SINGLE:
+ if (breakpoints_inserted)
{
- trap_expected = 1;
- stop_signal = TARGET_SIGNAL_0;
- keep_going (ecs);
- return;
+ remove_breakpoints ();
}
- }
+ breakpoints_inserted = 0;
+ ecs->another_trap = 1;
+ /* Still need to check other stuff, at least the case
+ where we are stepping and step out of the right range. */
+ break;
- /* For the program's own signals, act according to
- the signal handling tables. */
+ case BPSTAT_WHAT_STOP_NOISY:
+ stop_print_frame = 1;
- if (ecs->random_signal)
- {
- /* Signal not for debugging purposes. */
- int printed = 0;
+ /* We are about to nuke the step_resume_breakpoint and
+ through_sigtramp_breakpoint via the cleanup chain, so
+ no need to worry about it here. */
- stopped_by_random_signal = 1;
+ stop_stepping (ecs);
+ return;
- if (signal_print[stop_signal])
- {
- printed = 1;
- target_terminal_ours_for_output ();
- print_stop_reason (SIGNAL_RECEIVED, stop_signal);
- }
- if (signal_stop[stop_signal])
- {
- stop_stepping (ecs);
- return;
- }
- /* If not going to stop, give terminal back
- if we took it away. */
- else if (printed)
- target_terminal_inferior ();
+ case BPSTAT_WHAT_STOP_SILENT:
+ stop_print_frame = 0;
- /* Clear the signal if it should not be passed. */
- if (signal_program[stop_signal] == 0)
- stop_signal = TARGET_SIGNAL_0;
+ /* We are about to nuke the step_resume_breakpoint and
+ through_sigtramp_breakpoint via the cleanup chain, so
+ no need to worry about it here. */
- /* I'm not sure whether this needs to be check_sigtramp2 or
- whether it could/should be keep_going.
-
- This used to jump to step_over_function if we are stepping,
- which is wrong.
-
- Suppose the user does a `next' over a function call, and while
- that call is in progress, the inferior receives a signal for
- which GDB does not stop (i.e., signal_stop[SIG] is false). In
- that case, when we reach this point, there is already a
- step-resume breakpoint established, right where it should be:
- immediately after the function call the user is "next"-ing
- over. If we call step_over_function now, two bad things
- happen:
-
- - we'll create a new breakpoint, at wherever the current
- frame's return address happens to be. That could be
- anywhere, depending on what function call happens to be on
- the top of the stack at that point. Point is, it's probably
- not where we need it.
-
- - the existing step-resume breakpoint (which is at the correct
- address) will get orphaned: step_resume_breakpoint will point
- to the new breakpoint, and the old step-resume breakpoint
- will never be cleaned up.
-
- The old behavior was meant to help HP-UX single-step out of
- sigtramps. It would place the new breakpoint at prev_pc, which
- was certainly wrong. I don't know the details there, so fixing
- this probably breaks that. As with anything else, it's up to
- the HP-UX maintainer to furnish a fix that doesn't break other
- platforms. --JimB, 20 May 1999 */
- check_sigtramp2 (ecs);
- keep_going (ecs);
+ stop_stepping (ecs);
return;
- }
- /* Handle cases caused by hitting a breakpoint. */
- {
- CORE_ADDR jmp_buf_pc;
- struct bpstat_what what;
+ case BPSTAT_WHAT_STEP_RESUME:
+ /* This proably demands a more elegant solution, but, yeah
+ right...
- what = bpstat_what (stop_bpstat);
+ This function's use of the simple variable
+ step_resume_breakpoint doesn't seem to accomodate
+ simultaneously active step-resume bp's, although the
+ breakpoint list certainly can.
- if (what.call_dummy)
- {
- stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
- trap_expected_after_continue = 1;
-#endif
- }
+ If we reach here and step_resume_breakpoint is already
+ NULL, then apparently we have multiple active
+ step-resume bp's. We'll just delete the breakpoint we
+ stopped at, and carry on.
+
+ Correction: what the code currently does is delete a
+ step-resume bp, but it makes no effort to ensure that
+ the one deleted is the one currently stopped at. MVS */
+
+ if (step_resume_breakpoint == NULL)
+ {
+ step_resume_breakpoint =
+ bpstat_find_step_resume_breakpoint (stop_bpstat);
+ }
+ delete_step_resume_breakpoint (&step_resume_breakpoint);
+ break;
- switch (what.main_action)
+ case BPSTAT_WHAT_THROUGH_SIGTRAMP:
+ if (through_sigtramp_breakpoint)
+ delete_breakpoint (through_sigtramp_breakpoint);
+ through_sigtramp_breakpoint = NULL;
+
+ /* If were waiting for a trap, hitting the step_resume_break
+ doesn't count as getting it. */
+ if (trap_expected)
+ ecs->another_trap = 1;
+ break;
+
+ case BPSTAT_WHAT_CHECK_SHLIBS:
+ case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
+#ifdef SOLIB_ADD
{
- case BPSTAT_WHAT_SET_LONGJMP_RESUME:
- /* If we hit the breakpoint at longjmp, disable it for the
- duration of this command. Then, install a temporary
- breakpoint at the target of the jmp_buf. */
- disable_longjmp_breakpoint ();
- remove_breakpoints ();
+ /* Remove breakpoints, we eventually want to step over the
+ shlib event breakpoint, and SOLIB_ADD might adjust
+ breakpoint addresses via breakpoint_re_set. */
+ if (breakpoints_inserted)
+ remove_breakpoints ();
breakpoints_inserted = 0;
- if (!GET_LONGJMP_TARGET_P ()
- || !GET_LONGJMP_TARGET (&jmp_buf_pc))
+
+ /* Check for any newly added shared libraries if we're
+ supposed to be adding them automatically. Switch
+ terminal for any messages produced by
+ breakpoint_re_set. */
+ target_terminal_ours_for_output ();
+ SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
+ target_terminal_inferior ();
+
+ /* Try to reenable shared library breakpoints, additional
+ code segments in shared libraries might be mapped in now. */
+ re_enable_breakpoints_in_shlibs ();
+
+ /* If requested, stop when the dynamic linker notifies
+ gdb of events. This allows the user to get control
+ and place breakpoints in initializer routines for
+ dynamically loaded objects (among other things). */
+ if (stop_on_solib_events)
{
- keep_going (ecs);
+ stop_stepping (ecs);
return;
}
- /* Need to blow away step-resume breakpoint, as it
- interferes with us */
- if (step_resume_breakpoint != NULL)
- {
- delete_step_resume_breakpoint (&step_resume_breakpoint);
- }
- /* Not sure whether we need to blow this away too, but probably
- it is like the step-resume breakpoint. */
- if (through_sigtramp_breakpoint != NULL)
+ /* If we stopped due to an explicit catchpoint, then the
+ (see above) call to SOLIB_ADD pulled in any symbols
+ from a newly-loaded library, if appropriate.
+
+ We do want the inferior to stop, but not where it is
+ now, which is in the dynamic linker callback. Rather,
+ we would like it stop in the user's program, just after
+ the call that caused this catchpoint to trigger. That
+ gives the user a more useful vantage from which to
+ examine their program's state. */
+ else if (what.main_action ==
+ BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
{
- delete_breakpoint (through_sigtramp_breakpoint);
- through_sigtramp_breakpoint = NULL;
+ /* ??rehrauer: If I could figure out how to get the
+ right return PC from here, we could just set a temp
+ breakpoint and resume. I'm not sure we can without
+ cracking open the dld's shared libraries and sniffing
+ their unwind tables and text/data ranges, and that's
+ not a terribly portable notion.
+
+ Until that time, we must step the inferior out of the
+ dld callback, and also out of the dld itself (and any
+ code or stubs in libdld.sl, such as "shl_load" and
+ friends) until we reach non-dld code. At that point,
+ we can stop stepping. */
+ bpstat_get_triggered_catchpoints (stop_bpstat,
+ &ecs->
+ stepping_through_solib_catchpoints);
+ ecs->stepping_through_solib_after_catch = 1;
+
+ /* Be sure to lift all breakpoints, so the inferior does
+ actually step past this point... */
+ ecs->another_trap = 1;
+ break;
}
-
-#if 0
- /* FIXME - Need to implement nested temporary breakpoints */
- if (step_over_calls > 0)
- set_longjmp_resume_breakpoint (jmp_buf_pc,
- get_current_frame ());
else
-#endif /* 0 */
- set_longjmp_resume_breakpoint (jmp_buf_pc, NULL);
- ecs->handling_longjmp = 1; /* FIXME */
- keep_going (ecs);
- return;
-
- case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME:
- case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
- remove_breakpoints ();
- breakpoints_inserted = 0;
-#if 0
- /* FIXME - Need to implement nested temporary breakpoints */
- if (step_over_calls
- && (INNER_THAN (FRAME_FP (get_current_frame ()),
- step_frame_address)))
{
+ /* We want to step over this breakpoint, then keep going. */
ecs->another_trap = 1;
- keep_going (ecs);
- return;
+ break;
}
-#endif /* 0 */
- disable_longjmp_breakpoint ();
- ecs->handling_longjmp = 0; /* FIXME */
- if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
- break;
- /* else fallthrough */
+ }
+#endif
+ break;
- case BPSTAT_WHAT_SINGLE:
- if (breakpoints_inserted)
- {
- remove_breakpoints ();
- }
- breakpoints_inserted = 0;
- ecs->another_trap = 1;
- /* Still need to check other stuff, at least the case
- where we are stepping and step out of the right range. */
- break;
+ case BPSTAT_WHAT_LAST:
+ /* Not a real code, but listed here to shut up gcc -Wall. */
- case BPSTAT_WHAT_STOP_NOISY:
- stop_print_frame = 1;
+ case BPSTAT_WHAT_KEEP_CHECKING:
+ break;
+ }
+ }
- /* We are about to nuke the step_resume_breakpoint and
- through_sigtramp_breakpoint via the cleanup chain, so
- no need to worry about it here. */
+ /* We come here if we hit a breakpoint but should not
+ stop for it. Possibly we also were stepping
+ and should stop for that. So fall through and
+ test for stepping. But, if not stepping,
+ do not stop. */
- stop_stepping (ecs);
+ /* Are we stepping to get the inferior out of the dynamic
+ linker's hook (and possibly the dld itself) after catching
+ a shlib event? */
+ if (ecs->stepping_through_solib_after_catch)
+ {
+#if defined(SOLIB_ADD)
+ /* Have we reached our destination? If not, keep going. */
+ if (SOLIB_IN_DYNAMIC_LINKER (PIDGET (ecs->ptid), stop_pc))
+ {
+ ecs->another_trap = 1;
+ keep_going (ecs);
return;
+ }
+#endif
+ /* Else, stop and report the catchpoint(s) whose triggering
+ caused us to begin stepping. */
+ ecs->stepping_through_solib_after_catch = 0;
+ bpstat_clear (&stop_bpstat);
+ stop_bpstat = bpstat_copy (ecs->stepping_through_solib_catchpoints);
+ bpstat_clear (&ecs->stepping_through_solib_catchpoints);
+ stop_print_frame = 1;
+ stop_stepping (ecs);
+ return;
+ }
- case BPSTAT_WHAT_STOP_SILENT:
+ if (!CALL_DUMMY_BREAKPOINT_OFFSET_P)
+ {
+ /* This is the old way of detecting the end of the stack dummy.
+ An architecture which defines CALL_DUMMY_BREAKPOINT_OFFSET gets
+ handled above. As soon as we can test it on all of them, all
+ architectures should define it. */
+
+ /* If this is the breakpoint at the end of a stack dummy,
+ just stop silently, unless the user was doing an si/ni, in which
+ case she'd better know what she's doing. */
+
+ if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (),
+ FRAME_FP (get_current_frame ()))
+ && !step_range_end)
+ {
stop_print_frame = 0;
-
- /* We are about to nuke the step_resume_breakpoint and
- through_sigtramp_breakpoint via the cleanup chain, so
- no need to worry about it here. */
-
+ stop_stack_dummy = 1;
+#ifdef HP_OS_BUG
+ trap_expected_after_continue = 1;
+#endif
stop_stepping (ecs);
return;
+ }
+ }
- case BPSTAT_WHAT_STEP_RESUME:
- /* This proably demands a more elegant solution, but, yeah
- right...
-
- This function's use of the simple variable
- step_resume_breakpoint doesn't seem to accomodate
- simultaneously active step-resume bp's, although the
- breakpoint list certainly can.
-
- If we reach here and step_resume_breakpoint is already
- NULL, then apparently we have multiple active
- step-resume bp's. We'll just delete the breakpoint we
- stopped at, and carry on.
-
- Correction: what the code currently does is delete a
- step-resume bp, but it makes no effort to ensure that
- the one deleted is the one currently stopped at. MVS */
-
- if (step_resume_breakpoint == NULL)
- {
- step_resume_breakpoint =
- bpstat_find_step_resume_breakpoint (stop_bpstat);
- }
- delete_step_resume_breakpoint (&step_resume_breakpoint);
- break;
+ if (step_resume_breakpoint)
+ {
+ /* Having a step-resume breakpoint overrides anything
+ else having to do with stepping commands until
+ that breakpoint is reached. */
+ /* I'm not sure whether this needs to be check_sigtramp2 or
+ whether it could/should be keep_going. */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- case BPSTAT_WHAT_THROUGH_SIGTRAMP:
- if (through_sigtramp_breakpoint)
- delete_breakpoint (through_sigtramp_breakpoint);
- through_sigtramp_breakpoint = NULL;
+ if (step_range_end == 0)
+ {
+ /* Likewise if we aren't even stepping. */
+ /* I'm not sure whether this needs to be check_sigtramp2 or
+ whether it could/should be keep_going. */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- /* If were waiting for a trap, hitting the step_resume_break
- doesn't count as getting it. */
- if (trap_expected)
- ecs->another_trap = 1;
- break;
+ /* If stepping through a line, keep going if still within it.
- case BPSTAT_WHAT_CHECK_SHLIBS:
- case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
-#ifdef SOLIB_ADD
- {
- /* Remove breakpoints, we eventually want to step over the
- shlib event breakpoint, and SOLIB_ADD might adjust
- breakpoint addresses via breakpoint_re_set. */
- if (breakpoints_inserted)
- remove_breakpoints ();
- breakpoints_inserted = 0;
-
- /* Check for any newly added shared libraries if we're
- supposed to be adding them automatically. Switch
- terminal for any messages produced by
- breakpoint_re_set. */
- target_terminal_ours_for_output ();
- SOLIB_ADD (NULL, 0, NULL, auto_solib_add);
- target_terminal_inferior ();
+ Note that step_range_end is the address of the first instruction
+ beyond the step range, and NOT the address of the last instruction
+ within it! */
+ if (stop_pc >= step_range_start && stop_pc < step_range_end)
+ {
+ /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
+ So definately need to check for sigtramp here. */
+ check_sigtramp2 (ecs);
+ keep_going (ecs);
+ return;
+ }
- /* Try to reenable shared library breakpoints, additional
- code segments in shared libraries might be mapped in now. */
- re_enable_breakpoints_in_shlibs ();
-
- /* If requested, stop when the dynamic linker notifies
- gdb of events. This allows the user to get control
- and place breakpoints in initializer routines for
- dynamically loaded objects (among other things). */
- if (stop_on_solib_events)
- {
- stop_stepping (ecs);
- return;
- }
-
- /* If we stopped due to an explicit catchpoint, then the
- (see above) call to SOLIB_ADD pulled in any symbols
- from a newly-loaded library, if appropriate.
-
- We do want the inferior to stop, but not where it is
- now, which is in the dynamic linker callback. Rather,
- we would like it stop in the user's program, just after
- the call that caused this catchpoint to trigger. That
- gives the user a more useful vantage from which to
- examine their program's state. */
- else if (what.main_action == BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
- {
- /* ??rehrauer: If I could figure out how to get the
- right return PC from here, we could just set a temp
- breakpoint and resume. I'm not sure we can without
- cracking open the dld's shared libraries and sniffing
- their unwind tables and text/data ranges, and that's
- not a terribly portable notion.
-
- Until that time, we must step the inferior out of the
- dld callback, and also out of the dld itself (and any
- code or stubs in libdld.sl, such as "shl_load" and
- friends) until we reach non-dld code. At that point,
- we can stop stepping. */
- bpstat_get_triggered_catchpoints (stop_bpstat,
- &ecs->stepping_through_solib_catchpoints);
- ecs->stepping_through_solib_after_catch = 1;
-
- /* Be sure to lift all breakpoints, so the inferior does
- actually step past this point... */
- ecs->another_trap = 1;
- break;
- }
- else
- {
- /* We want to step over this breakpoint, then keep going. */
- ecs->another_trap = 1;
- break;
- }
- }
-#endif
- break;
+ /* We stepped out of the stepping range. */
- case BPSTAT_WHAT_LAST:
- /* Not a real code, but listed here to shut up gcc -Wall. */
+ /* If we are stepping at the source level and entered the runtime
+ loader dynamic symbol resolution code, we keep on single stepping
+ until we exit the run time loader code and reach the callee's
+ address. */
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE
+ && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+ {
+ CORE_ADDR pc_after_resolver = SKIP_SOLIB_RESOLVER (stop_pc);
- case BPSTAT_WHAT_KEEP_CHECKING:
- break;
+ if (pc_after_resolver)
+ {
+ /* Set up a step-resume breakpoint at the address
+ indicated by SKIP_SOLIB_RESOLVER. */
+ struct symtab_and_line sr_sal;
+ INIT_SAL (&sr_sal);
+ sr_sal.pc = pc_after_resolver;
+
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ if (breakpoints_inserted)
+ insert_breakpoints ();
}
+
+ keep_going (ecs);
+ return;
}
- /* We come here if we hit a breakpoint but should not
- stop for it. Possibly we also were stepping
- and should stop for that. So fall through and
- test for stepping. But, if not stepping,
- do not stop. */
+ /* We can't update step_sp every time through the loop, because
+ reading the stack pointer would slow down stepping too much.
+ But we can update it every time we leave the step range. */
+ ecs->update_step_sp = 1;
- /* Are we stepping to get the inferior out of the dynamic
- linker's hook (and possibly the dld itself) after catching
- a shlib event? */
- if (ecs->stepping_through_solib_after_catch)
- {
-#if defined(SOLIB_ADD)
- /* Have we reached our destination? If not, keep going. */
- if (SOLIB_IN_DYNAMIC_LINKER (PIDGET (ecs->ptid), stop_pc))
- {
- ecs->another_trap = 1;
- keep_going (ecs);
- return;
- }
-#endif
- /* Else, stop and report the catchpoint(s) whose triggering
- caused us to begin stepping. */
- ecs->stepping_through_solib_after_catch = 0;
- bpstat_clear (&stop_bpstat);
- stop_bpstat = bpstat_copy (ecs->stepping_through_solib_catchpoints);
- bpstat_clear (&ecs->stepping_through_solib_catchpoints);
- stop_print_frame = 1;
- stop_stepping (ecs);
- return;
- }
-
- if (!CALL_DUMMY_BREAKPOINT_OFFSET_P)
- {
- /* This is the old way of detecting the end of the stack dummy.
- An architecture which defines CALL_DUMMY_BREAKPOINT_OFFSET gets
- handled above. As soon as we can test it on all of them, all
- architectures should define it. */
-
- /* If this is the breakpoint at the end of a stack dummy,
- just stop silently, unless the user was doing an si/ni, in which
- case she'd better know what she's doing. */
-
- if (CALL_DUMMY_HAS_COMPLETED (stop_pc, read_sp (),
- FRAME_FP (get_current_frame ()))
- && !step_range_end)
- {
- stop_print_frame = 0;
- stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
- trap_expected_after_continue = 1;
-#endif
- stop_stepping (ecs);
- return;
- }
- }
+ /* Did we just take a signal? */
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
+ && INNER_THAN (read_sp (), step_sp))
+ {
+ /* We've just taken a signal; go until we are back to
+ the point where we took it and one more. */
- if (step_resume_breakpoint)
- {
- /* Having a step-resume breakpoint overrides anything
- else having to do with stepping commands until
- that breakpoint is reached. */
- /* I'm not sure whether this needs to be check_sigtramp2 or
- whether it could/should be keep_going. */
- check_sigtramp2 (ecs);
- keep_going (ecs);
- return;
- }
-
- if (step_range_end == 0)
- {
- /* Likewise if we aren't even stepping. */
- /* I'm not sure whether this needs to be check_sigtramp2 or
- whether it could/should be keep_going. */
- check_sigtramp2 (ecs);
- keep_going (ecs);
- return;
- }
+ /* Note: The test above succeeds not only when we stepped
+ into a signal handler, but also when we step past the last
+ statement of a signal handler and end up in the return stub
+ of the signal handler trampoline. To distinguish between
+ these two cases, check that the frame is INNER_THAN the
+ previous one below. pai/1997-09-11 */
- /* If stepping through a line, keep going if still within it.
- Note that step_range_end is the address of the first instruction
- beyond the step range, and NOT the address of the last instruction
- within it! */
- if (stop_pc >= step_range_start
- && stop_pc < step_range_end)
{
- /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
- So definately need to check for sigtramp here. */
- check_sigtramp2 (ecs);
- keep_going (ecs);
- return;
- }
+ CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
- /* We stepped out of the stepping range. */
+ if (INNER_THAN (current_frame, step_frame_address))
+ {
+ /* We have just taken a signal; go until we are back to
+ the point where we took it and one more. */
- /* If we are stepping at the source level and entered the runtime
- loader dynamic symbol resolution code, we keep on single stepping
- until we exit the run time loader code and reach the callee's
- address. */
- if (step_over_calls == STEP_OVER_UNDEBUGGABLE && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
- {
- CORE_ADDR pc_after_resolver = SKIP_SOLIB_RESOLVER (stop_pc);
+ /* This code is needed at least in the following case:
+ The user types "next" and then a signal arrives (before
+ the "next" is done). */
- if (pc_after_resolver)
- {
- /* Set up a step-resume breakpoint at the address
- indicated by SKIP_SOLIB_RESOLVER. */
+ /* Note that if we are stopped at a breakpoint, then we need
+ the step_resume breakpoint to override any breakpoints at
+ the same location, so that we will still step over the
+ breakpoint even though the signal happened. */
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal);
- sr_sal.pc = pc_after_resolver;
+ INIT_SAL (&sr_sal);
+ sr_sal.symtab = NULL;
+ 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. */
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
}
-
- keep_going (ecs);
- return;
+ else
+ {
+ /* We just stepped out of a signal handler and into
+ its calling trampoline.
+
+ Normally, we'd call step_over_function from
+ here, but for some reason GDB can't unwind the
+ stack correctly to find the real PC for the point
+ user code where the signal trampoline will return
+ -- FRAME_SAVED_PC fails, at least on HP-UX 10.20.
+ But signal trampolines are pretty small stubs of
+ code, anyway, so it's OK instead to just
+ single-step out. Note: assuming such trampolines
+ don't exhibit recursion on any platform... */
+ find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+ &ecs->stop_func_start,
+ &ecs->stop_func_end);
+ /* Readjust stepping range */
+ step_range_start = ecs->stop_func_start;
+ step_range_end = ecs->stop_func_end;
+ ecs->stepping_through_sigtramp = 1;
+ }
}
- /* We can't update step_sp every time through the loop, because
- reading the stack pointer would slow down stepping too much.
- But we can update it every time we leave the step range. */
- ecs->update_step_sp = 1;
- /* Did we just take a signal? */
- if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
- && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
- && INNER_THAN (read_sp (), step_sp))
- {
- /* We've just taken a signal; go until we are back to
- the point where we took it and one more. */
+ /* If this is stepi or nexti, make sure that the stepping range
+ gets us past that instruction. */
+ if (step_range_end == 1)
+ /* FIXME: Does this run afoul of the code below which, if
+ we step into the middle of a line, resets the stepping
+ range? */
+ step_range_end = (step_range_start = prev_pc) + 1;
+
+ ecs->remove_breakpoints_on_following_step = 1;
+ keep_going (ecs);
+ return;
+ }
- /* Note: The test above succeeds not only when we stepped
- into a signal handler, but also when we step past the last
- statement of a signal handler and end up in the return stub
- of the signal handler trampoline. To distinguish between
- these two cases, check that the frame is INNER_THAN the
- previous one below. pai/1997-09-11 */
+ if (stop_pc == ecs->stop_func_start /* Quick test */
+ || (in_prologue (stop_pc, ecs->stop_func_start) &&
+ !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+ || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
+ || ecs->stop_func_name == 0)
+ {
+ /* It's a subroutine call. */
+ if ((step_over_calls == STEP_OVER_NONE)
+ || ((step_range_end == 1)
+ && in_prologue (prev_pc, ecs->stop_func_start)))
+ {
+ /* I presume that step_over_calls is only 0 when we're
+ supposed to be stepping at the assembly language level
+ ("stepi"). Just stop. */
+ /* Also, maybe we just did a "nexti" inside a prolog,
+ so we thought it was a subroutine call but it was not.
+ Stop as well. FENN */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
+ if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ /* We're doing a "next". */
+
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && INNER_THAN (step_frame_address, read_sp ()))
+ /* 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;
+
+ step_over_function (ecs);
+ keep_going (ecs);
+ return;
+ }
- if (INNER_THAN (current_frame, step_frame_address))
+ /* If we are in a function call trampoline (a stub between
+ the calling routine and the real function), locate the real
+ function. That's what tells us (a) whether we want to step
+ into it at all, and (b) what prologue we want to run to
+ the end of, if we do step into it. */
+ tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
+ if (tmp != 0)
+ ecs->stop_func_start = tmp;
+ else
+ {
+ tmp = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc);
+ if (tmp)
{
- /* We have just taken a signal; go until we are back to
- the point where we took it and one more. */
-
- /* This code is needed at least in the following case:
- The user types "next" and then a signal arrives (before
- the "next" is done). */
-
- /* Note that if we are stopped at a breakpoint, then we need
- the step_resume breakpoint to override any breakpoints at
- the same location, so that we will still step over the
- breakpoint even though the signal happened. */
- struct symtab_and_line sr_sal;
-
- INIT_SAL (&sr_sal);
- sr_sal.symtab = NULL;
- 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. */
+ struct symtab_and_line xxx;
+ /* Why isn't this s_a_l called "sr_sal", like all of the
+ other s_a_l's where this code is duplicated? */
+ INIT_SAL (&xxx); /* initialize to zeroes */
+ xxx.pc = tmp;
+ xxx.section = find_pc_overlay (xxx.pc);
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
- if (breakpoints_inserted)
- insert_breakpoints ();
- }
- else
- {
- /* We just stepped out of a signal handler and into
- its calling trampoline.
-
- Normally, we'd call step_over_function from
- here, but for some reason GDB can't unwind the
- stack correctly to find the real PC for the point
- user code where the signal trampoline will return
- -- FRAME_SAVED_PC fails, at least on HP-UX 10.20.
- But signal trampolines are pretty small stubs of
- code, anyway, so it's OK instead to just
- single-step out. Note: assuming such trampolines
- don't exhibit recursion on any platform... */
- find_pc_partial_function (stop_pc, &ecs->stop_func_name,
- &ecs->stop_func_start,
- &ecs->stop_func_end);
- /* Readjust stepping range */
- step_range_start = ecs->stop_func_start;
- step_range_end = ecs->stop_func_end;
- ecs->stepping_through_sigtramp = 1;
+ set_momentary_breakpoint (xxx, NULL, bp_step_resume);
+ insert_breakpoints ();
+ keep_going (ecs);
+ return;
}
}
+ /* If we have line number information for the function we
+ are thinking of stepping into, step into it.
- /* If this is stepi or nexti, make sure that the stepping range
- gets us past that instruction. */
- if (step_range_end == 1)
- /* FIXME: Does this run afoul of the code below which, if
- we step into the middle of a line, resets the stepping
- range? */
- step_range_end = (step_range_start = prev_pc) + 1;
-
- ecs->remove_breakpoints_on_following_step = 1;
- keep_going (ecs);
- return;
- }
-
- if (stop_pc == ecs->stop_func_start /* Quick test */
- || (in_prologue (stop_pc, ecs->stop_func_start) &&
- !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
- || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
- || ecs->stop_func_name == 0)
+ If there are several symtabs at that PC (e.g. with include
+ files), just want to know whether *any* of them have line
+ numbers. find_pc_line handles this. */
{
- /* It's a subroutine call. */
-
- if ((step_over_calls == STEP_OVER_NONE)
- || ((step_range_end == 1)
- && in_prologue (prev_pc, ecs->stop_func_start)))
- {
- /* I presume that step_over_calls is only 0 when we're
- supposed to be stepping at the assembly language level
- ("stepi"). Just stop. */
- /* Also, maybe we just did a "nexti" inside a prolog,
- so we thought it was a subroutine call but it was not.
- Stop as well. FENN */
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
+ struct symtab_and_line tmp_sal;
- if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
+ tmp_sal = find_pc_line (ecs->stop_func_start, 0);
+ if (tmp_sal.line != 0)
{
- /* We're doing a "next". */
-
- if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
- && INNER_THAN (step_frame_address, read_sp()))
- /* 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;
-
- step_over_function (ecs);
- keep_going (ecs);
+ step_into_function (ecs);
return;
}
+ }
- /* If we are in a function call trampoline (a stub between
- the calling routine and the real function), locate the real
- function. That's what tells us (a) whether we want to step
- into it at all, and (b) what prologue we want to run to
- the end of, if we do step into it. */
- tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
- if (tmp != 0)
- ecs->stop_func_start = tmp;
- else
- {
- tmp = DYNAMIC_TRAMPOLINE_NEXTPC (stop_pc);
- if (tmp)
- {
- struct symtab_and_line xxx;
- /* Why isn't this s_a_l called "sr_sal", like all of the
- other s_a_l's where this code is duplicated? */
- INIT_SAL (&xxx); /* initialize to zeroes */
- xxx.pc = tmp;
- xxx.section = find_pc_overlay (xxx.pc);
- check_for_old_step_resume_breakpoint ();
- step_resume_breakpoint =
- set_momentary_breakpoint (xxx, NULL, bp_step_resume);
- insert_breakpoints ();
- keep_going (ecs);
- return;
- }
- }
-
- /* If we have line number information for the function we
- are thinking of stepping into, step into it.
-
- If there are several symtabs at that PC (e.g. with include
- files), just want to know whether *any* of them have line
- numbers. find_pc_line handles this. */
+ /* If we have no line number and the step-stop-if-no-debug
+ is set, we stop the step so that the user has a chance to
+ switch in assembly mode. */
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
{
- struct symtab_and_line tmp_sal;
-
- tmp_sal = find_pc_line (ecs->stop_func_start, 0);
- if (tmp_sal.line != 0)
- {
- step_into_function (ecs);
- return;
- }
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
}
- /* If we have no line number and the step-stop-if-no-debug
- is set, we stop the step so that the user has a chance to
- switch in assembly mode. */
- if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
- {
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
-
- step_over_function (ecs);
- keep_going (ecs);
- return;
-
- }
+ step_over_function (ecs);
+ keep_going (ecs);
+ return;
- /* We've wandered out of the step range. */
+ }
- ecs->sal = find_pc_line (stop_pc, 0);
+ /* We've wandered out of the step range. */
- if (step_range_end == 1)
- {
- /* It is stepi or nexti. We always want to stop stepping after
- one instruction. */
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
+ ecs->sal = find_pc_line (stop_pc, 0);
- /* If we're in the return path from a shared library trampoline,
- we want to proceed through the trampoline when stepping. */
- if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
- {
- CORE_ADDR tmp;
+ if (step_range_end == 1)
+ {
+ /* It is stepi or nexti. We always want to stop stepping after
+ one instruction. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- /* Determine where this trampoline returns. */
- tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
+ /* If we're in the return path from a shared library trampoline,
+ we want to proceed through the trampoline when stepping. */
+ if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+ {
+ CORE_ADDR tmp;
- /* Only proceed through if we know where it's going. */
- if (tmp)
- {
- /* And put the step-breakpoint there and go until there. */
- struct symtab_and_line sr_sal;
+ /* Determine where this trampoline returns. */
+ tmp = SKIP_TRAMPOLINE_CODE (stop_pc);
- INIT_SAL (&sr_sal); /* initialize to zeroes */
- sr_sal.pc = tmp;
- sr_sal.section = find_pc_overlay (sr_sal.pc);
- /* Do not specify what the fp should be when we stop
- since on some machines the prologue
- is where the new fp value is established. */
- check_for_old_step_resume_breakpoint ();
- step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
- if (breakpoints_inserted)
- insert_breakpoints ();
+ /* Only proceed through if we know where it's going. */
+ if (tmp)
+ {
+ /* And put the step-breakpoint there and go until there. */
+ struct symtab_and_line sr_sal;
+
+ INIT_SAL (&sr_sal); /* initialize to zeroes */
+ sr_sal.pc = tmp;
+ sr_sal.section = find_pc_overlay (sr_sal.pc);
+ /* Do not specify what the fp should be when we stop
+ since on some machines the prologue
+ is where the new fp value is established. */
+ check_for_old_step_resume_breakpoint ();
+ step_resume_breakpoint =
+ set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ if (breakpoints_inserted)
+ insert_breakpoints ();
- /* Restart without fiddling with the step ranges or
- other state. */
- keep_going (ecs);
- return;
- }
- }
+ /* Restart without fiddling with the step ranges or
+ other state. */
+ keep_going (ecs);
+ return;
+ }
+ }
- if (ecs->sal.line == 0)
- {
- /* We have no line number information. That means to stop
- stepping (does this always happen right after one instruction,
- when we do "s" in a function with no line numbers,
- or can this happen as a result of a return or longjmp?). */
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
+ if (ecs->sal.line == 0)
+ {
+ /* We have no line number information. That means to stop
+ stepping (does this always happen right after one instruction,
+ when we do "s" in a function with no line numbers,
+ or can this happen as a result of a return or longjmp?). */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- if ((stop_pc == ecs->sal.pc)
- && (ecs->current_line != ecs->sal.line || ecs->current_symtab != ecs->sal.symtab))
- {
- /* We are at the start of a different line. So stop. Note that
- we don't stop if we step into the middle of a different line.
- That is said to make things like for (;;) statements work
- better. */
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
+ if ((stop_pc == ecs->sal.pc)
+ && (ecs->current_line != ecs->sal.line
+ || ecs->current_symtab != ecs->sal.symtab))
+ {
+ /* We are at the start of a different line. So stop. Note that
+ we don't stop if we step into the middle of a different line.
+ That is said to make things like for (;;) statements work
+ better. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
- /* We aren't done stepping.
+ /* We aren't done stepping.
- Optimize by setting the stepping range to the line.
- (We might not be in the original line, but if we entered a
- new line in mid-statement, we continue stepping. This makes
- things like for(;;) statements work better.) */
+ Optimize by setting the stepping range to the line.
+ (We might not be in the original line, but if we entered a
+ new line in mid-statement, we continue stepping. This makes
+ things like for(;;) statements work better.) */
- if (ecs->stop_func_end && ecs->sal.end >= ecs->stop_func_end)
- {
- /* If this is the last line of the function, don't keep stepping
- (it would probably step us out of the function).
- This is particularly necessary for a one-line function,
- in which after skipping the prologue we better stop even though
- we will be in mid-line. */
- stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
- stop_stepping (ecs);
- return;
- }
- step_range_start = ecs->sal.pc;
- step_range_end = ecs->sal.end;
- step_frame_address = FRAME_FP (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 */
+ if (ecs->stop_func_end && ecs->sal.end >= ecs->stop_func_end)
{
- CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
- if (!(INNER_THAN (current_frame, step_frame_address)))
- step_frame_address = current_frame;
+ /* If this is the last line of the function, don't keep stepping
+ (it would probably step us out of the function).
+ This is particularly necessary for a one-line function,
+ in which after skipping the prologue we better stop even though
+ we will be in mid-line. */
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
}
+ step_range_start = ecs->sal.pc;
+ step_range_end = ecs->sal.end;
+ step_frame_address = FRAME_FP (get_current_frame ());
+ ecs->current_line = ecs->sal.line;
+ ecs->current_symtab = ecs->sal.symtab;
- keep_going (ecs);
+ /* 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 */
+ {
+ CORE_ADDR current_frame = FRAME_FP (get_current_frame ());
+ if (!(INNER_THAN (current_frame, step_frame_address)))
+ step_frame_address = current_frame;
+ }
- } /* extra brace, to preserve old indentation */
+ keep_going (ecs);
}
/* Are we in the middle of stepping? */
@@ -2966,15 +2954,15 @@ check_sigtramp2 (struct execution_control_state *ecs)
&& INNER_THAN (read_sp (), step_sp))
{
/* What has happened here is that we have just stepped the
- inferior with a signal (because it is a signal which
- shouldn't make us stop), thus stepping into sigtramp.
+ inferior with a signal (because it is a signal which
+ shouldn't make us stop), thus stepping into sigtramp.
- So we need to set a step_resume_break_address breakpoint and
- continue until we hit it, and then step. FIXME: This should
- be more enduring than a step_resume breakpoint; we should
- know that we will later need to keep going rather than
- re-hitting the breakpoint here (see the testsuite,
- gdb.base/signals.exp where it says "exceedingly difficult"). */
+ So we need to set a step_resume_break_address breakpoint and
+ continue until we hit it, and then step. FIXME: This should
+ be more enduring than a step_resume breakpoint; we should
+ know that we will later need to keep going rather than
+ re-hitting the breakpoint here (see the testsuite,
+ gdb.base/signals.exp where it says "exceedingly difficult"). */
struct symtab_and_line sr_sal;
@@ -2982,7 +2970,7 @@ check_sigtramp2 (struct execution_control_state *ecs)
sr_sal.pc = prev_pc;
sr_sal.section = find_pc_overlay (sr_sal.pc);
/* 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. */
+ 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);
if (breakpoints_inserted)
@@ -3027,7 +3015,7 @@ step_into_function (struct execution_control_state *ecs)
{
/* We are already there: stop now. */
stop_step = 1;
- print_stop_reason (END_STEPPING_RANGE, 0);
+ print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
}
@@ -3038,8 +3026,8 @@ step_into_function (struct execution_control_state *ecs)
sr_sal.pc = ecs->stop_func_start;
sr_sal.section = find_pc_overlay (ecs->stop_func_start);
/* Do not specify what the fp should be when we stop since on
- some machines the prologue is where the new fp value is
- established. */
+ some machines the prologue 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);
@@ -3069,7 +3057,7 @@ step_over_function (struct execution_control_state *ecs)
{
struct symtab_and_line sr_sal;
- INIT_SAL (&sr_sal); /* initialize to zeros */
+ INIT_SAL (&sr_sal); /* initialize to zeros */
sr_sal.pc = ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
sr_sal.section = find_pc_overlay (sr_sal.pc);
@@ -3110,7 +3098,7 @@ stop_stepping (struct execution_control_state *ecs)
else
parent_ptid = target_wait (pid_to_ptid (-1), &(ecs->ws));
}
- while (! ptid_equal (parent_ptid, inferior_ptid));
+ while (!ptid_equal (parent_ptid, inferior_ptid));
}
/* Assuming the inferior still exists, set these up for next
@@ -3143,7 +3131,7 @@ keep_going (struct execution_control_state *ecs)
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_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */
prev_func_start = ecs->stop_func_start; /* Ok, since if DECR_PC_AFTER
BREAK is defined, the
original pc would not have
@@ -3161,25 +3149,25 @@ keep_going (struct execution_control_state *ecs)
if (trap_expected && stop_signal != TARGET_SIGNAL_TRAP)
{
/* We took a signal (which we are supposed to pass through to
- the inferior, else we'd have done a break above) and we
- haven't yet gotten our trap. Simply continue. */
+ the inferior, else we'd have done a break above) and we
+ haven't yet gotten our trap. Simply continue. */
resume (currently_stepping (ecs), stop_signal);
}
else
{
/* Either the trap was not expected, but we are continuing
- anyway (the user asked that this signal be passed to the
- child)
- -- or --
- The signal was SIGTRAP, e.g. it was our signal, but we
- decided we should resume from it.
+ anyway (the user asked that this signal be passed to the
+ child)
+ -- or --
+ The signal was SIGTRAP, e.g. it was our signal, but we
+ decided we should resume from it.
- We're going to run this baby now!
+ We're going to run this baby now!
- Insert breakpoints now, unless we are trying to one-proceed
- past a breakpoint. */
+ Insert breakpoints now, unless we are trying to one-proceed
+ past a breakpoint. */
/* If we've just finished a special step resume and we don't
- want to hit a breakpoint, pull em out. */
+ want to hit a breakpoint, pull em out. */
if (step_resume_breakpoint == NULL
&& through_sigtramp_breakpoint == NULL
&& ecs->remove_breakpoints_on_following_step)
@@ -3203,38 +3191,36 @@ keep_going (struct execution_control_state *ecs)
trap_expected = ecs->another_trap;
/* Do not deliver SIGNAL_TRAP (except when the user explicitly
- specifies that such a signal should be delivered to the
- target program).
-
- Typically, this would occure when a user is debugging a
- target monitor on a simulator: the target monitor sets a
- breakpoint; the simulator encounters this break-point and
- halts the simulation handing control to GDB; GDB, noteing
- that the break-point isn't valid, returns control back to the
- simulator; the simulator then delivers the hardware
- equivalent of a SIGNAL_TRAP to the program being debugged. */
-
- if (stop_signal == TARGET_SIGNAL_TRAP
- && !signal_program[stop_signal])
+ specifies that such a signal should be delivered to the
+ target program).
+
+ Typically, this would occure when a user is debugging a
+ target monitor on a simulator: the target monitor sets a
+ breakpoint; the simulator encounters this break-point and
+ halts the simulation handing control to GDB; GDB, noteing
+ that the break-point isn't valid, returns control back to the
+ simulator; the simulator then delivers the hardware
+ equivalent of a SIGNAL_TRAP to the program being debugged. */
+
+ if (stop_signal == TARGET_SIGNAL_TRAP && !signal_program[stop_signal])
stop_signal = TARGET_SIGNAL_0;
#ifdef SHIFT_INST_REGS
/* I'm not sure when this following segment applies. I do know,
- now, that we shouldn't rewrite the regs when we were stopped
- by a random signal from the inferior process. */
+ now, that we shouldn't rewrite the regs when we were stopped
+ by a random signal from the inferior process. */
/* FIXME: Shouldn't this be based on the valid bit of the SXIP?
- (this is only used on the 88k). */
+ (this is only used on the 88k). */
if (!bpstat_explains_signal (stop_bpstat)
- && (stop_signal != TARGET_SIGNAL_CHLD)
- && !stopped_by_random_signal)
+ && (stop_signal != TARGET_SIGNAL_CHLD) && !stopped_by_random_signal)
SHIFT_INST_REGS ();
#endif /* SHIFT_INST_REGS */
resume (currently_stepping (ecs), stop_signal);
}
- prepare_to_wait (ecs);
+ prepare_to_wait (ecs);
}
/* This function normally comes after a resume, before
@@ -3249,10 +3235,10 @@ prepare_to_wait (struct execution_control_state *ecs)
overlay_cache_invalid = 1;
/* We have to invalidate the registers BEFORE calling
- target_wait because they can be loaded from the target while
- in target_wait. This makes remote debugging a bit more
- efficient for those targets that provide critical registers
- as part of their normal status mechanism. */
+ target_wait because they can be loaded from the target while
+ in target_wait. This makes remote debugging a bit more
+ efficient for those targets that provide critical registers
+ as part of their normal status mechanism. */
registers_changed ();
ecs->waiton_ptid = pid_to_ptid (-1);
@@ -3282,7 +3268,7 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
/* We are done with a step/next/si/ni command. */
/* For now print nothing. */
/* Print a message only if not in the middle of doing a "step n"
- operation for n > 1 */
+ operation for n > 1 */
if (!step_multi || !stop_step)
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "end-stepping-range");
@@ -3298,11 +3284,13 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
ui_out_field_string (uiout, "reason", "exited-signalled");
ui_out_text (uiout, "\nProgram terminated with signal ");
annotate_signal_name ();
- ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ ui_out_field_string (uiout, "signal-name",
+ target_signal_to_name (stop_info));
annotate_signal_name_end ();
ui_out_text (uiout, ", ");
annotate_signal_string ();
- ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ ui_out_field_string (uiout, "signal-meaning",
+ target_signal_to_string (stop_info));
annotate_signal_string_end ();
ui_out_text (uiout, ".\n");
ui_out_text (uiout, "The program no longer exists.\n");
@@ -3315,7 +3303,8 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "exited");
ui_out_text (uiout, "\nProgram exited with code ");
- ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info);
+ ui_out_field_fmt (uiout, "exit-code", "0%o",
+ (unsigned int) stop_info);
ui_out_text (uiout, ".\n");
}
else
@@ -3333,11 +3322,13 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
annotate_signal_name ();
if (ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "reason", "signal-received");
- ui_out_field_string (uiout, "signal-name", target_signal_to_name (stop_info));
+ ui_out_field_string (uiout, "signal-name",
+ target_signal_to_name (stop_info));
annotate_signal_name_end ();
ui_out_text (uiout, ", ");
annotate_signal_string ();
- ui_out_field_string (uiout, "signal-meaning", target_signal_to_string (stop_info));
+ ui_out_field_string (uiout, "signal-meaning",
+ target_signal_to_string (stop_info));
annotate_signal_string_end ();
ui_out_text (uiout, ".\n");
break;
@@ -3366,7 +3357,7 @@ normal_stop (void)
(Note that there's no point in saying anything if the inferior
has exited!) */
- if (! ptid_equal (previous_inferior_ptid, inferior_ptid)
+ if (!ptid_equal (previous_inferior_ptid, inferior_ptid)
&& target_has_execution)
{
target_terminal_ours_for_output ();
@@ -3381,16 +3372,6 @@ normal_stop (void)
if (target_has_execution && get_current_frame ())
(get_current_frame ())->pc = read_pc ();
- if (breakpoints_failed)
- {
- target_terminal_ours_for_output ();
- print_sys_errmsg ("While inserting breakpoints", breakpoints_failed);
- printf_filtered ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process,\n\
-or you may have requested too many hardware breakpoints\n\
-and/or watchpoints.\n");
- }
-
if (target_has_execution && breakpoints_inserted)
{
if (remove_breakpoints ())
@@ -3449,8 +3430,7 @@ and/or watchpoints.\n");
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 && selected_frame)
{
int bpstat_ret;
int source_flag;
@@ -3463,32 +3443,31 @@ and/or watchpoints.\n");
if (stop_step
&& step_frame_address == FRAME_FP (get_current_frame ())
&& step_start_function == find_pc_function (stop_pc))
- source_flag = SRC_LINE; /* finished step, just print source line */
+ source_flag = SRC_LINE; /* finished step, just print source line */
else
- source_flag = SRC_AND_LOC; /* print location and source line */
+ source_flag = SRC_AND_LOC; /* print location and source line */
break;
case PRINT_SRC_AND_LOC:
- source_flag = SRC_AND_LOC; /* print location and source line */
+ source_flag = SRC_AND_LOC; /* print location and source line */
break;
case PRINT_SRC_ONLY:
source_flag = SRC_LINE;
break;
case PRINT_NOTHING:
- source_flag = SRC_LINE; /* something bogus */
+ source_flag = SRC_LINE; /* something bogus */
do_frame_printing = 0;
break;
default:
- internal_error (__FILE__, __LINE__,
- "Unknown value.");
+ internal_error (__FILE__, __LINE__, "Unknown value.");
}
/* For mi, have the same behavior every time we stop:
- print everything but the source line. */
+ print everything but the source line. */
if (ui_out_is_mi_like_p (uiout))
source_flag = LOC_AND_ADDRESS;
if (ui_out_is_mi_like_p (uiout))
ui_out_field_int (uiout, "thread-id",
- pid_to_thread_id (inferior_ptid));
+ pid_to_thread_id (inferior_ptid));
/* The behavior of this routine with respect to the source
flag is:
SRC_LINE: Print only source line
@@ -3505,7 +3484,9 @@ and/or watchpoints.\n");
/* Save the function value return registers, if we care.
We might be about to restore their previous contents. */
if (proceed_to_finish)
- read_register_bytes (0, stop_registers, REGISTER_BYTES);
+ /* NB: The copy goes through to the target picking up the value of
+ all the registers. */
+ regcache_cpy (stop_registers, current_regcache);
if (stop_stack_dummy)
{
@@ -3549,7 +3530,8 @@ signal_pass_state (int signo)
return signal_program[signo];
}
-int signal_stop_update (signo, state)
+int
+signal_stop_update (signo, state)
int signo;
int state;
{
@@ -3558,7 +3540,8 @@ int signal_stop_update (signo, state)
return ret;
}
-int signal_print_update (signo, state)
+int
+signal_print_update (signo, state)
int signo;
int state;
{
@@ -3567,7 +3550,8 @@ int signal_print_update (signo, state)
return ret;
}
-int signal_pass_update (signo, state)
+int
+signal_pass_update (signo, state)
int signo;
int state;
{
@@ -3593,8 +3577,7 @@ sig_print_info (enum target_signal oursig)
name_padding = 0;
printf_filtered ("%s", name);
- printf_filtered ("%*.*s ", name_padding, name_padding,
- " ");
+ printf_filtered ("%*.*s ", name_padding, name_padding, " ");
printf_filtered ("%s\t", signal_stop[oursig] ? "Yes" : "No");
printf_filtered ("%s\t", signal_print[oursig] ? "Yes" : "No");
printf_filtered ("%s\t\t", signal_program[oursig] ? "Yes" : "No");
@@ -3740,9 +3723,7 @@ handle_command (char *args, int from_tty)
if (!allsigs && !sigs[signum])
{
if (query ("%s is used by the debugger.\n\
-Are you sure you want to change it? ",
- target_signal_to_name
- ((enum target_signal) signum)))
+Are you sure you want to change it? ", target_signal_to_name ((enum target_signal) signum)))
{
sigs[signum] = 1;
}
@@ -3886,8 +3867,7 @@ signals_info (char *signum_exp, int from_tty)
QUIT;
if (oursig != TARGET_SIGNAL_UNKNOWN
- && oursig != TARGET_SIGNAL_DEFAULT
- && oursig != TARGET_SIGNAL_0)
+ && oursig != TARGET_SIGNAL_DEFAULT && oursig != TARGET_SIGNAL_0)
sig_print_info (oursig);
}
@@ -3910,38 +3890,21 @@ struct inferior_status
CORE_ADDR step_resume_break_address;
int stop_after_trap;
int stop_soon_quietly;
- CORE_ADDR selected_frame_address;
- char *stop_registers;
+ struct regcache *stop_registers;
/* These are here because if call_function_by_hand has written some
registers and then decides to call error(), we better not have changed
any registers. */
- char *registers;
+ struct regcache *registers;
+
+ /* A frame unique identifier. */
+ struct frame_id selected_frame_id;
- int selected_level;
int breakpoint_proceeded;
int restore_stack_info;
int proceed_to_finish;
};
-static struct inferior_status *
-xmalloc_inferior_status (void)
-{
- struct inferior_status *inf_status;
- inf_status = xmalloc (sizeof (struct inferior_status));
- inf_status->stop_registers = xmalloc (REGISTER_BYTES);
- inf_status->registers = xmalloc (REGISTER_BYTES);
- return inf_status;
-}
-
-static void
-free_inferior_status (struct inferior_status *inf_status)
-{
- xfree (inf_status->registers);
- xfree (inf_status->stop_registers);
- xfree (inf_status);
-}
-
void
write_inferior_status_register (struct inferior_status *inf_status, int regno,
LONGEST val)
@@ -3949,7 +3912,7 @@ write_inferior_status_register (struct inferior_status *inf_status, int regno,
int size = REGISTER_RAW_SIZE (regno);
void *buf = alloca (size);
store_signed_integer (buf, size, val);
- memcpy (&inf_status->registers[REGISTER_BYTE (regno)], buf, size);
+ regcache_raw_write (inf_status->registers, regno, buf);
}
/* Save all of the information associated with the inferior<==>gdb
@@ -3959,7 +3922,7 @@ write_inferior_status_register (struct inferior_status *inf_status, int regno,
struct inferior_status *
save_inferior_status (int restore_stack_info)
{
- struct inferior_status *inf_status = xmalloc_inferior_status ();
+ struct inferior_status *inf_status = XMALLOC (struct inferior_status);
inf_status->stop_signal = stop_signal;
inf_status->stop_pc = stop_pc;
@@ -3983,42 +3946,25 @@ save_inferior_status (int restore_stack_info)
inf_status->restore_stack_info = restore_stack_info;
inf_status->proceed_to_finish = proceed_to_finish;
- memcpy (inf_status->stop_registers, stop_registers, REGISTER_BYTES);
+ inf_status->stop_registers = regcache_dup_no_passthrough (stop_registers);
- read_register_bytes (0, inf_status->registers, REGISTER_BYTES);
+ inf_status->registers = regcache_dup (current_regcache);
- record_selected_frame (&(inf_status->selected_frame_address),
- &(inf_status->selected_level));
+ get_frame_id (selected_frame, &inf_status->selected_frame_id);
return inf_status;
}
-struct restore_selected_frame_args
-{
- CORE_ADDR frame_address;
- int level;
-};
-
static int
restore_selected_frame (void *args)
{
- struct restore_selected_frame_args *fr =
- (struct restore_selected_frame_args *) args;
+ struct frame_id *fid = (struct frame_id *) args;
struct frame_info *frame;
- int level = fr->level;
- frame = find_relative_frame (get_current_frame (), &level);
+ frame = frame_find_by_id (*fid);
/* If inf_status->selected_frame_address is NULL, there was no
previously selected frame. */
- if (frame == NULL ||
- /* FRAME_FP (frame) != fr->frame_address || */
- /* elz: deleted this check as a quick fix to the problem that
- for function called by hand gdb creates no internal frame
- structure and the real stack and gdb's idea of stack are
- different if nested calls by hands are made.
-
- mvs: this worries me. */
- level != 0)
+ if (frame == NULL)
{
warning ("Unable to restore previously selected frame.\n");
return 0;
@@ -4049,13 +3995,16 @@ restore_inferior_status (struct inferior_status *inf_status)
breakpoint_proceeded = inf_status->breakpoint_proceeded;
proceed_to_finish = inf_status->proceed_to_finish;
- /* FIXME: Is the restore of stop_registers always needed */
- memcpy (stop_registers, inf_status->stop_registers, REGISTER_BYTES);
+ /* FIXME: Is the restore of stop_registers always needed. */
+ regcache_xfree (stop_registers);
+ stop_registers = inf_status->stop_registers;
/* The inferior can be gone if the user types "print exit(0)"
(and perhaps other times). */
if (target_has_execution)
- write_register_bytes (0, inf_status->registers, REGISTER_BYTES);
+ /* NB: The register write goes through to the target. */
+ regcache_cpy (current_regcache, inf_status->registers);
+ regcache_xfree (inf_status->registers);
/* FIXME: If we are being called after stopping in a function which
is called from gdb, we should not be trying to restore the
@@ -4066,24 +4015,20 @@ restore_inferior_status (struct inferior_status *inf_status)
if (target_has_stack && inf_status->restore_stack_info)
{
- struct restore_selected_frame_args fr;
- fr.level = inf_status->selected_level;
- fr.frame_address = inf_status->selected_frame_address;
/* The point of catch_errors is that if the stack is clobbered,
- walking the stack might encounter a garbage pointer and error()
- trying to dereference it. */
- if (catch_errors (restore_selected_frame, &fr,
- "Unable to restore previously selected frame:\n",
- RETURN_MASK_ERROR) == 0)
+ walking the stack might encounter a garbage pointer and
+ error() trying to dereference it. */
+ if (catch_errors
+ (restore_selected_frame, &inf_status->selected_frame_id,
+ "Unable to restore previously selected frame:\n",
+ RETURN_MASK_ERROR) == 0)
/* Error in restoring the selected frame. Select the innermost
frame. */
-
-
select_frame (get_current_frame ());
}
- free_inferior_status (inf_status);
+ xfree (inf_status);
}
static void
@@ -4103,7 +4048,9 @@ discard_inferior_status (struct inferior_status *inf_status)
{
/* See save_inferior_status for info on stop_bpstat. */
bpstat_clear (&inf_status->stop_bpstat);
- free_inferior_status (inf_status);
+ regcache_xfree (inf_status->registers);
+ regcache_xfree (inf_status->stop_registers);
+ xfree (inf_status);
}
/* Oft used ptids */
@@ -4111,7 +4058,7 @@ ptid_t null_ptid;
ptid_t minus_one_ptid;
/* Create a ptid given the necessary PID, LWP, and TID components. */
-
+
ptid_t
ptid_build (int pid, long lwp, long tid)
{
@@ -4161,7 +4108,7 @@ int
ptid_equal (ptid_t ptid1, ptid_t ptid2)
{
return (ptid1.pid == ptid2.pid && ptid1.lwp == ptid2.lwp
- && ptid1.tid == ptid2.tid);
+ && ptid1.tid == ptid2.tid);
}
/* restore_inferior_ptid() will be used by the cleanup machinery
@@ -4189,12 +4136,12 @@ save_inferior_ptid (void)
*saved_ptid_ptr = inferior_ptid;
return make_cleanup (restore_inferior_ptid, saved_ptid_ptr);
}
-
+
static void
build_infrun (void)
{
- stop_registers = xmalloc (REGISTER_BYTES);
+ stop_registers = regcache_xmalloc (current_gdbarch);
}
void
@@ -4204,8 +4151,6 @@ _initialize_infrun (void)
register int numsigs;
struct cmd_list_element *c;
- build_infrun ();
-
register_gdbarch_swap (&stop_registers, sizeof (stop_registers), NULL);
register_gdbarch_swap (NULL, 0, build_infrun);
@@ -4221,8 +4166,7 @@ Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals\n\
from 1-15 are allowed for compatibility with old versions of GDB.\n\
Numeric ranges may be specified with the form LOW-HIGH (e.g. 1-5).\n\
The special arg \"all\" is recognized to mean all signals except those\n\
-used by the debugger, typically SIGTRAP and SIGINT.\n",
- "Recognized actions include \"stop\", \"nostop\", \"print\", \"noprint\",\n\
+used by the debugger, typically SIGTRAP and SIGINT.\n", "Recognized actions include \"stop\", \"nostop\", \"print\", \"noprint\",\n\
\"pass\", \"nopass\", \"ignore\", or \"noignore\".\n\
Stop means reenter debugger if this signal happens (implies print).\n\
Print means print a message if this signal happens.\n\
@@ -4241,8 +4185,7 @@ Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals\n\
from 1-15 are allowed for compatibility with old versions of GDB.\n\
Numeric ranges may be specified with the form LOW-HIGH (e.g. 1-5).\n\
The special arg \"all\" is recognized to mean all signals except those\n\
-used by the debugger, typically SIGTRAP and SIGINT.\n",
- "Recognized actions include \"s\" (toggles between stop and nostop), \n\
+used by the debugger, typically SIGTRAP and SIGINT.\n", "Recognized actions include \"s\" (toggles between stop and nostop), \n\
\"r\" (toggles between print and noprint), \"i\" (toggles between pass and \
nopass), \"Q\" (noprint)\n\
Stop means reenter debugger if this signal happens (implies print).\n\
@@ -4253,14 +4196,13 @@ Pass and Stop may be combined.", NULL));
}
if (!dbx_commands)
- stop_command = add_cmd ("stop", class_obscure, not_just_help_class_command,
- "There is no `stop' command, but you can set a hook on `stop'.\n\
+ stop_command =
+ add_cmd ("stop", class_obscure, not_just_help_class_command, "There is no `stop' command, but you can set a hook on `stop'.\n\
This allows you to set a list of commands to be run each time execution\n\
of the program stops.", &cmdlist);
numsigs = (int) TARGET_SIGNAL_LAST;
- signal_stop = (unsigned char *)
- xmalloc (sizeof (signal_stop[0]) * numsigs);
+ signal_stop = (unsigned char *) xmalloc (sizeof (signal_stop[0]) * numsigs);
signal_print = (unsigned char *)
xmalloc (sizeof (signal_print[0]) * numsigs);
signal_program = (unsigned char *)
@@ -4313,15 +4255,12 @@ of the program stops.", &cmdlist);
"Set stopping for shared library events.\n\
If nonzero, gdb will give control to the user when the dynamic linker\n\
notifies gdb of shared library events. The most common event of interest\n\
-to the user would be loading/unloading of a new library.\n",
- &setlist),
- &showlist);
+to the user would be loading/unloading of a new library.\n", &setlist), &showlist);
#endif
c = add_set_enum_cmd ("follow-fork-mode",
class_run,
- follow_fork_mode_kind_names,
- &follow_fork_mode_string,
+ follow_fork_mode_kind_names, &follow_fork_mode_string,
/* ??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
@@ -4347,31 +4286,27 @@ A fork or vfork creates a new process. follow-fork-mode can be:\n\
child - the new process is debugged after a fork\n\
ask - the debugger will ask for one of the above choices\n\
For \"parent\" or \"child\", the unfollowed process will run free.\n\
-By default, the debugger will follow the parent process.",
- &setlist);
+By default, the debugger will follow the parent process.", &setlist);
add_show_from_set (c, &showlist);
- c = add_set_enum_cmd ("scheduler-locking", class_run,
- scheduler_enums, /* array of string names */
+ c = add_set_enum_cmd ("scheduler-locking", class_run, scheduler_enums, /* array of string names */
&scheduler_mode, /* current mode */
"Set mode for locking scheduler during execution.\n\
off == no locking (threads may preempt at any time)\n\
on == full locking (no thread except the current thread may run)\n\
step == scheduler locked during every single-step operation.\n\
In this mode, no other thread may run during a step command.\n\
- Other threads may run while stepping over a function call ('next').",
- &setlist);
+ Other threads may run while stepping over a function call ('next').", &setlist);
set_cmd_sfunc (c, set_schedlock_func); /* traps on target vector */
add_show_from_set (c, &showlist);
c = add_set_cmd ("step-mode", class_run,
- var_boolean, (char*) &step_stop_if_no_debug,
-"Set mode of the step operation. When set, doing a step over a\n\
+ var_boolean, (char *) &step_stop_if_no_debug,
+ "Set mode of the step operation. When set, doing a step over a\n\
function without debug line information will stop at the first\n\
instruction of that function. Otherwise, the function is skipped and\n\
-the step command stops at a different source line.",
- &setlist);
+the step command stops at a different source line.", &setlist);
add_show_from_set (c, &showlist);
/* ptid initializations */
diff --git a/gdb/interps.c b/gdb/interps.c
deleted file mode 100644
index 4b9b901f1bc..00000000000
--- a/gdb/interps.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/* Manages interpreters for gdb.
- Copyright 2000, 2002 Free Software Foundation, Inc.
- Written by Jim Ingham <jingham@apple.com> of Apple Computer, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This is just a first cut at separating out the "interpreter" functions
- of gdb into self-contained modules. There are a couple of open areas that
- need to be sorted out:
-
- 1) The interpreter explicitly contains a UI_OUT, and can insert itself
- into the event loop, but it doesn't explicitly contain hooks for readline.
- I did this because it seems to me many interpreters won't want to use
- the readline command interface, and it is probably simpler to just let
- them take over the input in their resume proc.
-
- 2) The event loop insertion is probably wrong. I just inserted a
- do_one_event alongside gdb's do_one_event. This probably will lead
- to one or the other event loop getting starved. It would be better
- to provide conversion functions for the gdb file handlers, and when
- an interpreter starts up, it grabs all the gdb created file handlers
- and inserts them into its select. This is more complicated, however,
- and I have run out of time for now.
-*/
-
-#include "defs.h"
-#include "gdbcmd.h"
-#include "ui-out.h"
-#include "event-loop.h"
-#include "event-top.h"
-#include "interps.h"
-#include "completer.h"
-#include "gdb_string.h"
-
-struct gdb_interpreter
-{
- char *name; /* This is the name in "-i=" and set interpreter. */
- struct gdb_interpreter *next; /* Interpreters are stored in a linked list,
- this is the next one... */
- void *data; /* This is a cookie that the instance of the
- interpreter can use, for instance to call
- itself in hook functions */
- int inited; /* Has the init_proc been run? */
- struct ui_out *interpreter_out; /* This is the ui_out used to collect
- results for this interpreter. It can
- be a formatter for stdout, as is the
- case for the console & mi outputs, or it
- might be a result formatter. */
- struct gdb_interpreter_procs procs;
- int quiet_p;
-};
-
-/* Functions local to this file. */
-static void initialize_interps (void);
-
-static void set_interpreter_cmd (char *args, int from_tty,
- struct cmd_list_element *c);
-static void list_interpreter_cmd (char *args, int from_tty);
-static void do_set_interpreter (int not_an_fd);
-static char **interpreter_completer (char *text, char *word);
-
-/* The magic initialization routine for this module. */
-
-void _initialize_interpreter (void);
-
-/* Variables local to this file: */
-
-static struct gdb_interpreter *interp_list = NULL;
-static struct gdb_interpreter *current_interpreter = NULL;
-
-static int interpreter_initialized = 0;
-
-/* gdb_new_interpreter - This allocates space for a new interpreter,
- fills the fields from the inputs, and returns a pointer to the
- interpreter. */
-
-struct gdb_interpreter *
-gdb_new_interpreter (char *name,
- void *data,
- struct ui_out *uiout,
- struct gdb_interpreter_procs *procs)
-{
- struct gdb_interpreter *new_interp;
-
- new_interp =
- (struct gdb_interpreter *) xmalloc (sizeof (struct gdb_interpreter));
-
- new_interp->name = xstrdup (name);
- new_interp->data = data;
- new_interp->interpreter_out = uiout;
- new_interp->quiet_p = 0;
- new_interp->procs.init_proc = procs->init_proc;
- new_interp->procs.resume_proc = procs->resume_proc;
- new_interp->procs.do_one_event_proc = procs->do_one_event_proc;
- new_interp->procs.suspend_proc = procs->suspend_proc;
- new_interp->procs.delete_proc = procs->delete_proc;
- new_interp->procs.exec_proc = procs->exec_proc;
- new_interp->procs.prompt_proc = procs->prompt_proc;
- new_interp->inited = 0;
-
- return new_interp;
-}
-
-/* Add interpreter INTERP to the gdb interpreter list. If an
- interpreter of the same name is already on the list, then
- the new one is NOT added, and the function returns 0. Otherwise
- it returns 1. */
-
-int
-gdb_add_interpreter (struct gdb_interpreter *interp)
-{
- if (!interpreter_initialized)
- initialize_interps ();
-
- if (gdb_lookup_interpreter (interp->name) != NULL)
- return 0;
-
- interp->next = interp_list;
- interp_list = interp;
-
- return 1;
-}
-
-/* Looks for the interpreter INTERP in the interpreter list. If it exists,
- runs the delete_proc, and if this is successful, the INTERP is deleted from
- the interpreter list and the function returns 1. If the delete_proc fails, the
- function returns -1 and the interpreter is NOT removed from the list. If the
- interp is not found, 0 is returned. */
-
-int
-gdb_delete_interpreter (struct gdb_interpreter *interp)
-{
- struct gdb_interpreter *cur_ptr, *prev_ptr;
-
- if (!interpreter_initialized)
- {
- ui_out_message (uiout, 0,
- "You can't delete an interp before you have added one!");
- return -1;
- }
-
- if (interp_list == NULL)
- {
- ui_out_message (uiout, 0, "No interpreters to delete.");
- return -1;
- }
-
- if (interp_list->next == NULL)
- {
- ui_out_message (uiout, 0, "You can't delete gdb's only intepreter.");
- return -1;
- }
-
- for (cur_ptr = interp_list, prev_ptr = NULL;
- cur_ptr != NULL; prev_ptr = cur_ptr, cur_ptr = cur_ptr->next)
- {
- if (cur_ptr == interp)
- {
- /* Can't currently delete the console interpreter... */
- if (strcmp (interp->name, "console") == 0)
- {
- ui_out_message (uiout, 0,
- "You can't delete the console interpreter.");
- return -1;
- }
-
- /* If the interpreter is the current interpreter, switch
- back to the console interpreter */
-
- if (interp == current_interpreter)
- {
- gdb_set_interpreter (gdb_lookup_interpreter ("console"));
- }
-
- /* Don't delete the interpreter if its delete proc fails */
-
- if ((interp->procs.delete_proc != NULL)
- && (!interp->procs.delete_proc (interp->data)))
- return -1;
-
- if (cur_ptr == interp_list)
- interp_list = cur_ptr->next;
- else
- prev_ptr->next = cur_ptr->next;
-
- break;
- }
- }
-
- if (cur_ptr == NULL)
- return 0;
- else
- return 1;
-}
-
-/* This sets the current interpreter to be INTERP. If INTERP has not
- been initialized, then this will also run the init proc. If the
- init proc is successful, return 1, if it fails, set the old
- interpreter back in place and return 0. If we can't restore the
- old interpreter, then raise an internal error, since we are in
- pretty bad shape at this point. */
-
-int
-gdb_set_interpreter (struct gdb_interpreter *interp)
-{
- struct gdb_interpreter *old_interp = current_interpreter;
- int first_time = 0;
-
-
- char buffer[64];
-
- if (current_interpreter != NULL)
- {
- do_all_continuations ();
- ui_out_flush (uiout);
- if (current_interpreter->procs.suspend_proc &&
- !current_interpreter->procs.suspend_proc (current_interpreter->data))
- {
- error ("Could not suspend interpreter \"%s\"\n", current_interpreter->name);
- }
- }
- else
- {
- first_time = 1;
- }
-
- current_interpreter = interp;
-
- /* We use interpreter_p for the "set interpreter" variable, so we need
- to make sure we have a malloc'ed copy for the set command to free. */
- if (interpreter_p != NULL && strcmp (current_interpreter->name, interpreter_p) != 0)
- {
- xfree (interpreter_p);
-
- interpreter_p = xstrdup (current_interpreter->name);
- }
-
- uiout = interp->interpreter_out;
-
- /* Run the init proc. If it fails, try to restore the old interp. */
-
- if (!interp->inited)
- {
- if (interp->procs.init_proc != NULL)
- {
- if (!interp->procs.init_proc (interp->data))
- {
- if (!gdb_set_interpreter (old_interp))
- internal_error (__FILE__, __LINE__,
- "Failed to initialize new interp \"%s\" %s",
- interp->name,
- "and could not restore old interp!\n");
- return 0;
- }
- else
- {
- interp->inited = 1;
- }
- }
- else
- {
- interp->inited = 1;
- }
- }
-
- if (interp->procs.resume_proc != NULL
- && (!interp->procs.resume_proc (interp->data)))
- {
- if (!gdb_set_interpreter (old_interp))
- internal_error (__FILE__, __LINE__,
- "Failed to initialize new interp \"%s\" %s",
- interp->name, "and could not restore old interp!\n");
- return 0;
- }
-
- /* Finally, put up the new prompt to show that we are indeed here.
- Also, display_gdb_prompt for the console does some readline magic
- which is needed for the console interpreter, at least... */
-
- if (!first_time)
- {
- if (!gdb_interpreter_is_quiet (interp))
- {
- sprintf (buffer, "Switching to interpreter \"%.24s\".\n",
- interp->name);
- ui_out_text (uiout, buffer);
- }
- display_gdb_prompt (NULL);
- }
-
- return 1;
-}
-
-/*
- * gdb_lookup_interpreter - Looks up the interpreter for NAME. If
- * no such interpreter exists, return NULL, otherwise return a pointer
- * to the interpreter.
- */
-
-struct gdb_interpreter *
-gdb_lookup_interpreter (char *name)
-{
- struct gdb_interpreter *interp;
-
- if (name == NULL || strlen (name) == 0)
- return NULL;
-
- for (interp = interp_list; interp != NULL; interp = interp->next)
- {
- if (strcmp (interp->name, name) == 0)
- return interp;
- }
-
- return NULL;
-}
-
-/* Returns the current interpreter. */
-
-struct gdb_interpreter *
-gdb_current_interpreter ()
-{
- return current_interpreter;
-}
-
-struct ui_out *
-gdb_interpreter_ui_out (struct gdb_interpreter *interp)
-{
- if (interp != NULL)
- return interp->interpreter_out;
-
- return current_interpreter->interpreter_out;
-}
-
-/* Returns true if the current interp is the passed in name. */
-int
-gdb_current_interpreter_is_named (char *interp_name)
-{
- struct gdb_interpreter *current_interp = gdb_current_interpreter ();
-
- if (current_interp)
- return (strcmp (current_interp->name, interp_name) == 0);
-
- return 0;
-}
-
-/* This is called in display_gdb_prompt.
- If the current interpreter defines a prompt_proc, then that proc is
- run. If the proc returns a non-zero value, display_gdb_prompt will
- return without itself displaying the prompt. */
-
-int
-gdb_interpreter_display_prompt (char *new_prompt)
-{
- if (current_interpreter->procs.prompt_proc == NULL)
- return 0;
- else
- return current_interpreter->procs.prompt_proc (current_interpreter->data,
- new_prompt);
-}
-
-int
-gdb_interpreter_is_quiet (struct gdb_interpreter *interp)
-{
- if (interp != NULL)
- return interp->quiet_p;
- else
- return current_interpreter->quiet_p;
-}
-
-int
-gdb_interpreter_set_quiet (struct gdb_interpreter *interp, int quiet)
-{
- int old_val = interp->quiet_p;
- interp->quiet_p = quiet;
- return old_val;
-}
-
-/* gdb_interpreter_exec - This executes COMMAND_STR in the current
- interpreter. */
-
-int
-gdb_interpreter_exec (char *command_str)
-{
- if (current_interpreter->procs.exec_proc != NULL)
- {
- return current_interpreter->procs.exec_proc (current_interpreter->data,
- command_str);
- }
-
- return 0;
-}
-
-struct gdb_interpreter_procs *
-gdb_interpreter_get_procs (struct gdb_interpreter *interp)
-{
- if (interp != NULL)
- return &interp->procs;
-
- return &current_interpreter->procs;
-}
-
-void *
-gdb_interpreter_get_data (struct gdb_interpreter *interp)
-{
- if (interp != NULL)
- return interp->data;
-
- return current_interpreter->data;
-}
-
-int
-interpreter_do_one_event ()
-{
- if (current_interpreter->procs.do_one_event_proc == NULL)
- return 0;
-
- return current_interpreter->procs.do_one_event_proc (current_interpreter->data);
-}
-
-/* A convenience routine that nulls out all the
- common command hooks. Use it when removing your interpreter in its
- suspend proc. */
-
-void
-clear_interpreter_hooks ()
-{
- init_ui_hook = 0;
- print_frame_info_listing_hook = 0;
- /*print_frame_more_info_hook = 0; */
- query_hook = 0;
- warning_hook = 0;
- create_breakpoint_hook = 0;
- delete_breakpoint_hook = 0;
- modify_breakpoint_hook = 0;
- interactive_hook = 0;
- registers_changed_hook = 0;
- readline_begin_hook = 0;
- readline_hook = 0;
- readline_end_hook = 0;
- register_changed_hook = 0;
- memory_changed_hook = 0;
- context_hook = 0;
- target_wait_hook = 0;
- call_command_hook = 0;
- error_hook = 0;
- error_begin_hook = 0;
- command_loop_hook = 0;
-}
-
-/* This is a lazy init routine, called the first time
- the interpreter module is used. I put it here just in case, but I haven't
- thought of a use for it yet. I will probably bag it soon, since I don't
- think it will be necessary. */
-
-static void
-initialize_interps (void)
-{
- interpreter_initialized = 1;
- /* Don't know if anything needs to be done here... */
-}
-
-/* set_interpreter_cmd - This implements "set interpreter foo". */
-
-static void
-set_interpreter_cmd (char *args, int from_tty, struct cmd_list_element *c)
-{
- struct gdb_interpreter *interp_ptr;
-
- dont_repeat ();
-
- if (cmd_type (c) != set_cmd)
- return;
-
- interp_ptr = gdb_lookup_interpreter (interpreter_p);
- if (interp_ptr != NULL)
- {
- if (!gdb_set_interpreter (interp_ptr))
- error ("\nCould not switch to interpreter \"%s\", %s%s\".\n",
- interp_ptr->name, "reverting to interpreter \"",
- current_interpreter->name);
- }
- else
- {
- char *bad_name = interpreter_p;
- interpreter_p = xstrdup (current_interpreter->name);
- error ("Could not find interpreter \"%s\".", bad_name);
- }
-}
-
-/* list_interpreter_cmd - This implements "info interpreters". */
-
-void
-list_interpreter_cmd (char *args, int from_tty)
-{
- struct gdb_interpreter *interp_ptr;
-
- ui_out_list_begin (uiout, "interpreters");
- for (interp_ptr = interp_list; interp_ptr != NULL;
- interp_ptr = interp_ptr->next)
- {
- ui_out_text (uiout, " * ");
- ui_out_field_string (uiout, "interpreter", interp_ptr->name);
- ui_out_text (uiout, "\n");
- }
- ui_out_list_end (uiout);
-}
-
-void
-interpreter_exec_cmd (char *args, int from_tty)
-{
- struct gdb_interpreter *old_interp, *interp_to_use;
- char **prules = NULL;
- char **trule = NULL;
- unsigned int nrules;
- unsigned int i;
- int old_quiet;
-
- prules = buildargv (args);
- if (prules == NULL)
- {
- error ("unable to parse arguments");
- }
-
- nrules = 0;
- if (prules != NULL)
- {
- for (trule = prules; *trule != NULL; trule++)
- {
- nrules++;
- }
- }
-
- if (nrules < 2)
- error ("usage: interpreter-exec <interpreter> [ <command> ... ]");
-
- old_interp = gdb_current_interpreter ();
-
- interp_to_use = gdb_lookup_interpreter (prules[0]);
- if (interp_to_use == NULL)
- error ("Could not find interpreter \"%s\".", prules[0]);
-
- old_quiet = gdb_interpreter_set_quiet (interp_to_use, 1);
-
- if (!gdb_set_interpreter (interp_to_use))
- error ("Could not switch to interpreter \"%s\".", prules[0]);
-
- for (i = 1; i < nrules; i++)
- {
- if (!gdb_interpreter_exec (prules[i]))
- {
- gdb_set_interpreter (old_interp);
- gdb_interpreter_set_quiet (interp_to_use, old_quiet);
- error
- ("interpreter-exec: mi_interpreter_execute: error in command: \"%s\".",
- prules[i]);
- break;
- }
- }
-
- gdb_set_interpreter (old_interp);
- gdb_interpreter_set_quiet (interp_to_use, old_quiet);
-}
-
-/* List the possible interpreters which could complete the given text. */
-
-static char **
-interpreter_completer (char *text, char *word)
-{
- int alloced, textlen;
- int num_matches;
- char **matches;
- struct gdb_interpreter *interp;
-
- /* We expect only a very limited number of interpreters, so just
- allocate room for all of them. */
- for (interp = interp_list; interp != NULL; interp = interp->next)
- ++alloced;
- matches = (char **) xmalloc (alloced * sizeof (char *));
-
- num_matches = 0;
- textlen = strlen (text);
- for (interp = interp_list; interp != NULL; interp = interp->next)
- {
- if (strncmp (interp->name, text, textlen) == 0)
- {
- matches[num_matches] =
- (char *) xmalloc (strlen (word) + strlen (interp->name) + 1);
- if (word == text)
- strcpy (matches[num_matches], interp->name);
- else if (word > text)
- {
- /* Return some portion of interp->name */
- strcpy (matches[num_matches], interp->name + (word - text));
- }
- else
- {
- /* Return some of text plus interp->name */
- strncpy (matches[num_matches], word, text - word);
- matches[num_matches][text - word] = '\0';
- strcat (matches[num_matches], interp->name);
- }
- ++num_matches;
- }
- }
-
- if (num_matches == 0)
- {
- xfree (matches);
- matches = NULL;
- }
- else if (num_matches < alloced)
- {
- matches = (char **) xrealloc ((char *) matches, ((num_matches + 1)
- * sizeof (char *)));
- matches[num_matches] = NULL;
- }
-
- return matches;
-}
-
-/* This just adds the "set interpreter" and "info interpreters" commands. */
-
-void
-_initialize_interpreter (void)
-{
- struct cmd_list_element *c;
-
- c = add_set_cmd ("interpreter", class_support,
- var_string,
- &interpreter_p, "Set the interpreter for gdb.", &setlist);
- set_cmd_sfunc (c, set_interpreter_cmd);
- add_show_from_set (c, &showlist);
-
- add_cmd ("interpreters", class_support,
- list_interpreter_cmd,
- "List the interpreters currently available in gdb.", &infolist);
-
- c = add_cmd ("interpreter-exec", class_support,
- interpreter_exec_cmd,
- "Execute a command in an interpreter. It takes two arguments:\n\
-The first argument is the name of the interpreter to use.\n\
-The second argument is the command to execute.\n", &cmdlist);
- set_cmd_completer (c, interpreter_completer);
-}
diff --git a/gdb/interps.h b/gdb/interps.h
deleted file mode 100644
index 05420b1a66a..00000000000
--- a/gdb/interps.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Manages interpreters for gdb.
- Copyright 2000,2002 Free Software Foundation, Inc.
- Written by Jim Ingham <jingham@apple.com> of Apple Computer, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef GDB_INTERPRETER_H
-#define GDB_INTERPRETER_H
-
-typedef int (*interp_init_ftype) (void *data);
-typedef int (*interp_resume_ftype) (void *data);
-typedef int (*interp_do_one_event_ftype) (void *data);
-typedef int (*interp_suspend_ftype) (void *data);
-typedef int (*interp_delete_ftype) (void *data);
-typedef int (*interp_prompt_ftype) (void *data, char *new_prompt);
-typedef int (*interp_exec_ftype) (void *data, char *command);
-
-struct ui_out;
-struct gdb_interpreter;
-
-struct gdb_interpreter_procs
-{
- interp_init_ftype init_proc;
- interp_resume_ftype resume_proc;
- interp_do_one_event_ftype do_one_event_proc;
- interp_suspend_ftype suspend_proc;
- interp_delete_ftype delete_proc;
- interp_exec_ftype exec_proc;
- interp_prompt_ftype prompt_proc;
-};
-
-extern struct gdb_interpreter
- *gdb_new_interpreter (char *name, void *data, struct ui_out *uiout,
- struct gdb_interpreter_procs *procs);
-
-extern int gdb_add_interpreter (struct gdb_interpreter *interp);
-extern int gdb_delete_interpreter (struct gdb_interpreter *interp);
-extern int gdb_set_interpreter (struct gdb_interpreter *interp);
-extern struct gdb_interpreter *gdb_lookup_interpreter (char *name);
-extern struct gdb_interpreter *gdb_current_interpreter ();
-extern struct ui_out *gdb_interpreter_ui_out (struct gdb_interpreter *interp);
-extern int gdb_current_interpreter_is_named (char *interp_name);
-extern int gdb_interpreter_exec (char *command_str);
-extern int gdb_interpreter_display_prompt (char *new_prompt);
-extern int gdb_interpreter_set_quiet (struct gdb_interpreter *interp,
- int quiet);
-extern int gdb_interpreter_is_quiet (struct gdb_interpreter *interp);
-extern struct gdb_interpreter_procs *gdb_interpreter_get_procs (struct gdb_interpreter *interp);
-extern void *gdb_interpreter_get_data (struct gdb_interpreter *interp);
-extern int interpreter_do_one_event ();
-
-void clear_interpreter_hooks ();
-
-/* well-known interpreters */
-#define GDB_INTERPRETER_CONSOLE "console"
-#define GDB_INTERPRETER_MI "mi"
-#define GDB_INTERPRETER_MI0 "mi0"
-
-#endif /* GDB_INTERPRETER_H */
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 459abe3879c..d5b5c0c1c4d 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -1,6 +1,6 @@
/* Native support for the SGI Iris running IRIX version 5, for GDB.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
Implemented for Irix 4.x by Garrett A. Wollman.
@@ -56,8 +56,7 @@ supply_gregset (gregset_t *gregsetp)
register int regi;
register greg_t *regp = &(*gregsetp)[0];
int gregoff = sizeof (greg_t) - MIPS_REGSIZE;
- static char zerobuf[MAX_REGISTER_RAW_SIZE] =
- {0};
+ static char zerobuf[32] = {0};
for (regi = 0; regi <= CTX_RA; regi++)
supply_register (regi, (char *) (regp + regi) + gregoff);
@@ -120,8 +119,7 @@ void
supply_fpregset (fpregset_t *fpregsetp)
{
register int regi;
- static char zerobuf[MAX_REGISTER_RAW_SIZE] =
- {0};
+ static char zerobuf[32] = {0};
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
@@ -254,1052 +252,6 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
registers_fetched ();
}
-
-/* Irix 5 uses what appears to be a unique form of shared library
- support. This is a copy of solib.c modified for Irix 5. */
-/* FIXME: Most of this code could be merged with osfsolib.c and solib.c
- by using next_link_map_member and xfer_link_map_member in solib.c. */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/param.h>
-#include <fcntl.h>
-
-/* <obj.h> includes <sym.h> and <symconst.h>, which causes conflicts
- with our versions of those files included by tm-mips.h. Prevent
- <obj.h> from including them with some appropriate defines. */
-#define __SYM_H__
-#define __SYMCONST_H__
-#include <obj.h>
-#ifdef HAVE_OBJLIST_H
-#include <objlist.h>
-#endif
-
-#ifdef NEW_OBJ_INFO_MAGIC
-#define HANDLE_NEW_OBJ_LIST
-#endif
-
-#include "symtab.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "command.h"
-#include "frame.h"
-#include "gdb_regex.h"
-#include "inferior.h"
-#include "language.h"
-#include "gdbcmd.h"
-
-/* The symbol which starts off the list of shared libraries. */
-#define DEBUG_BASE "__rld_obj_head"
-
-/* Irix 6.x introduces a new variant of object lists.
- To be able to debug O32 executables under Irix 6, we have to handle both
- variants. */
-
-typedef enum
-{
- OBJ_LIST_OLD, /* Pre Irix 6.x object list. */
- OBJ_LIST_32, /* 32 Bit Elf32_Obj_Info. */
- OBJ_LIST_64 /* 64 Bit Elf64_Obj_Info, FIXME not yet implemented. */
-}
-obj_list_variant;
-
-/* Define our own link_map structure.
- This will help to share code with osfsolib.c and solib.c. */
-
-struct link_map
- {
- obj_list_variant l_variant; /* which variant of object list */
- CORE_ADDR l_lladdr; /* addr in inferior list was read from */
- CORE_ADDR l_next; /* address of next object list entry */
- };
-
-/* Irix 5 shared objects are pre-linked to particular addresses
- although the dynamic linker may have to relocate them if the
- address ranges of the libraries used by the main program clash.
- The offset is the difference between the address where the object
- is mapped and the binding address of the shared library. */
-#define LM_OFFSET(so) ((so) -> offset)
-/* Loaded address of shared library. */
-#define LM_ADDR(so) ((so) -> lmstart)
-
-char shadow_contents[BREAKPOINT_MAX]; /* Stash old bkpt addr contents */
-
-struct so_list
- {
- struct so_list *next; /* next structure in linked list */
- struct link_map lm;
- CORE_ADDR offset; /* prelink to load address offset */
- char *so_name; /* shared object lib name */
- CORE_ADDR lmstart; /* lower addr bound of mapped object */
- CORE_ADDR lmend; /* upper addr bound of mapped object */
- char symbols_loaded; /* flag: symbols read in yet? */
- char from_tty; /* flag: print msgs? */
- struct objfile *objfile; /* objfile for loaded lib */
- struct section_table *sections;
- struct section_table *sections_end;
- struct section_table *textsection;
- bfd *abfd;
- };
-
-static struct so_list *so_list_head; /* List of known shared objects */
-static CORE_ADDR debug_base; /* Base of dynamic linker structures */
-static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
-
-/* Local function prototypes */
-
-static void sharedlibrary_command (char *, int);
-
-static int enable_break (void);
-
-static int disable_break (void);
-
-static void info_sharedlibrary_command (char *, int);
-
-static int symbol_add_stub (void *);
-
-static struct so_list *find_solib (struct so_list *);
-
-static struct link_map *first_link_map_member (void);
-
-static struct link_map *next_link_map_member (struct so_list *);
-
-static void xfer_link_map_member (struct so_list *, struct link_map *);
-
-static CORE_ADDR locate_base (void);
-
-static int solib_map_sections (void *);
-
-/*
-
- LOCAL FUNCTION
-
- solib_map_sections -- open bfd and build sections for shared lib
-
- SYNOPSIS
-
- static int solib_map_sections (struct so_list *so)
-
- DESCRIPTION
-
- Given a pointer to one of the shared objects in our list
- of mapped objects, use the recorded name to open a bfd
- descriptor for the object, build a section table, and then
- relocate all the section addresses by the base address at
- which the shared object was mapped.
-
- FIXMES
-
- In most (all?) cases the shared object file name recorded in the
- dynamic linkage tables will be a fully qualified pathname. For
- cases where it isn't, do we really mimic the systems search
- mechanism correctly in the below code (particularly the tilde
- expansion stuff?).
- */
-
-static int
-solib_map_sections (void *arg)
-{
- struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
- char *filename;
- char *scratch_pathname;
- int scratch_chan;
- struct section_table *p;
- struct cleanup *old_chain;
- bfd *abfd;
-
- filename = tilde_expand (so->so_name);
- old_chain = make_cleanup (xfree, filename);
-
- scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
- &scratch_pathname);
- if (scratch_chan < 0)
- {
- scratch_chan = openp (getenv ("LD_LIBRARY_PATH"), 1, filename,
- O_RDONLY, 0, &scratch_pathname);
- }
- if (scratch_chan < 0)
- {
- perror_with_name (filename);
- }
- /* Leave scratch_pathname allocated. abfd->name will point to it. */
-
- abfd = bfd_fdopenr (scratch_pathname, gnutarget, scratch_chan);
- if (!abfd)
- {
- close (scratch_chan);
- error ("Could not open `%s' as an executable file: %s",
- scratch_pathname, bfd_errmsg (bfd_get_error ()));
- }
- /* Leave bfd open, core_xfer_memory and "info files" need it. */
- so->abfd = abfd;
- abfd->cacheable = 1;
-
- if (!bfd_check_format (abfd, bfd_object))
- {
- error ("\"%s\": not in executable format: %s.",
- scratch_pathname, bfd_errmsg (bfd_get_error ()));
- }
- if (build_section_table (abfd, &so->sections, &so->sections_end))
- {
- error ("Can't find the file sections in `%s': %s",
- bfd_get_filename (exec_bfd), bfd_errmsg (bfd_get_error ()));
- }
-
- for (p = so->sections; p < so->sections_end; p++)
- {
- /* Relocate the section binding addresses as recorded in the shared
- object's file by the offset to get the address to which the
- object was actually mapped. */
- p->addr += LM_OFFSET (so);
- p->endaddr += LM_OFFSET (so);
- so->lmend = (CORE_ADDR) max (p->endaddr, so->lmend);
- if (STREQ (p->the_bfd_section->name, ".text"))
- {
- so->textsection = p;
- }
- }
-
- /* Free the file names, close the file now. */
- do_cleanups (old_chain);
-
- /* must be non-zero */
- return (1);
-}
-
-/*
-
- LOCAL FUNCTION
-
- locate_base -- locate the base address of dynamic linker structs
-
- SYNOPSIS
-
- CORE_ADDR locate_base (void)
-
- DESCRIPTION
-
- For both the SunOS and SVR4 shared library implementations, if the
- inferior executable has been linked dynamically, there is a single
- address somewhere in the inferior's data space which is the key to
- locating all of the dynamic linker's runtime structures. This
- address is the value of the symbol defined by the macro DEBUG_BASE.
- The job of this function is to find and return that address, or to
- return 0 if there is no such address (the executable is statically
- linked for example).
-
- For SunOS, the job is almost trivial, since the dynamic linker and
- all of it's structures are statically linked to the executable at
- link time. Thus the symbol for the address we are looking for has
- already been added to the minimal symbol table for the executable's
- objfile at the time the symbol file's symbols were read, and all we
- have to do is look it up there. Note that we explicitly do NOT want
- to find the copies in the shared library.
-
- The SVR4 version is much more complicated because the dynamic linker
- and it's structures are located in the shared C library, which gets
- run as the executable's "interpreter" by the kernel. We have to go
- to a lot more work to discover the address of DEBUG_BASE. Because
- of this complexity, we cache the value we find and return that value
- on subsequent invocations. Note there is no copy in the executable
- symbol tables.
-
- Irix 5 is basically like SunOS.
-
- Note that we can assume nothing about the process state at the time
- we need to find this address. We may be stopped on the first instruc-
- tion of the interpreter (C shared library), the first instruction of
- the executable itself, or somewhere else entirely (if we attached
- to the process for example).
-
- */
-
-static CORE_ADDR
-locate_base (void)
-{
- struct minimal_symbol *msymbol;
- CORE_ADDR address = 0;
-
- msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
- if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
- {
- address = SYMBOL_VALUE_ADDRESS (msymbol);
- }
- return (address);
-}
-
-/*
-
- LOCAL FUNCTION
-
- first_link_map_member -- locate first member in dynamic linker's map
-
- SYNOPSIS
-
- static struct link_map *first_link_map_member (void)
-
- DESCRIPTION
-
- Read in a copy of the first member in the inferior's dynamic
- link map from the inferior's dynamic linker structures, and return
- a pointer to the link map descriptor.
- */
-
-static struct link_map *
-first_link_map_member (void)
-{
- struct obj_list *listp;
- struct obj_list list_old;
- struct link_map *lm;
- static struct link_map first_lm;
- CORE_ADDR lladdr;
- CORE_ADDR next_lladdr;
-
- /* We have not already read in the dynamic linking structures
- from the inferior, lookup the address of the base structure. */
- debug_base = locate_base ();
- if (debug_base == 0)
- return NULL;
-
- /* Get address of first list entry. */
- read_memory (debug_base, (char *) &listp, sizeof (struct obj_list *));
-
- if (listp == NULL)
- return NULL;
-
- /* Get first list entry. */
- /* The MIPS Sign extends addresses. */
- lladdr = host_pointer_to_address (listp);
- read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list));
-
- /* The first entry in the list is the object file we are debugging,
- so skip it. */
- next_lladdr = host_pointer_to_address (list_old.next);
-
-#ifdef HANDLE_NEW_OBJ_LIST
- if (list_old.data == NEW_OBJ_INFO_MAGIC)
- {
- Elf32_Obj_Info list_32;
-
- read_memory (lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info));
- if (list_32.oi_size != sizeof (Elf32_Obj_Info))
- return NULL;
- next_lladdr = (CORE_ADDR) list_32.oi_next;
- }
-#endif
-
- if (next_lladdr == 0)
- return NULL;
-
- first_lm.l_lladdr = next_lladdr;
- lm = &first_lm;
- return lm;
-}
-
-/*
-
- LOCAL FUNCTION
-
- next_link_map_member -- locate next member in dynamic linker's map
-
- SYNOPSIS
-
- static struct link_map *next_link_map_member (so_list_ptr)
-
- DESCRIPTION
-
- Read in a copy of the next member in the inferior's dynamic
- link map from the inferior's dynamic linker structures, and return
- a pointer to the link map descriptor.
- */
-
-static struct link_map *
-next_link_map_member (struct so_list *so_list_ptr)
-{
- struct link_map *lm = &so_list_ptr->lm;
- CORE_ADDR next_lladdr = lm->l_next;
- static struct link_map next_lm;
-
- if (next_lladdr == 0)
- {
- /* We have hit the end of the list, so check to see if any were
- added, but be quiet if we can't read from the target any more. */
- int status = 0;
-
- if (lm->l_variant == OBJ_LIST_OLD)
- {
- struct obj_list list_old;
-
- status = target_read_memory (lm->l_lladdr,
- (char *) &list_old,
- sizeof (struct obj_list));
- next_lladdr = host_pointer_to_address (list_old.next);
- }
-#ifdef HANDLE_NEW_OBJ_LIST
- else if (lm->l_variant == OBJ_LIST_32)
- {
- Elf32_Obj_Info list_32;
- status = target_read_memory (lm->l_lladdr,
- (char *) &list_32,
- sizeof (Elf32_Obj_Info));
- next_lladdr = (CORE_ADDR) list_32.oi_next;
- }
-#endif
-
- if (status != 0 || next_lladdr == 0)
- return NULL;
- }
-
- next_lm.l_lladdr = next_lladdr;
- lm = &next_lm;
- return lm;
-}
-
-/*
-
- LOCAL FUNCTION
-
- xfer_link_map_member -- set local variables from dynamic linker's map
-
- SYNOPSIS
-
- static void xfer_link_map_member (so_list_ptr, lm)
-
- DESCRIPTION
-
- Read in a copy of the requested member in the inferior's dynamic
- link map from the inferior's dynamic linker structures, and fill
- in the necessary so_list_ptr elements.
- */
-
-static void
-xfer_link_map_member (struct so_list *so_list_ptr, struct link_map *lm)
-{
- struct obj_list list_old;
- CORE_ADDR lladdr = lm->l_lladdr;
- struct link_map *new_lm = &so_list_ptr->lm;
- int errcode;
-
- read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list));
-
- new_lm->l_variant = OBJ_LIST_OLD;
- new_lm->l_lladdr = lladdr;
- new_lm->l_next = host_pointer_to_address (list_old.next);
-
-#ifdef HANDLE_NEW_OBJ_LIST
- if (list_old.data == NEW_OBJ_INFO_MAGIC)
- {
- Elf32_Obj_Info list_32;
-
- read_memory (lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info));
- if (list_32.oi_size != sizeof (Elf32_Obj_Info))
- return;
- new_lm->l_variant = OBJ_LIST_32;
- new_lm->l_next = (CORE_ADDR) list_32.oi_next;
-
- target_read_string ((CORE_ADDR) list_32.oi_pathname,
- &so_list_ptr->so_name,
- list_32.oi_pathname_len + 1, &errcode);
- if (errcode != 0)
- memory_error (errcode, (CORE_ADDR) list_32.oi_pathname);
-
- LM_ADDR (so_list_ptr) = (CORE_ADDR) list_32.oi_ehdr;
- LM_OFFSET (so_list_ptr) =
- (CORE_ADDR) list_32.oi_ehdr - (CORE_ADDR) list_32.oi_orig_ehdr;
- }
- else
-#endif
- {
-#if defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32
- /* If we are compiling GDB under N32 ABI, the alignments in
- the obj struct are different from the O32 ABI and we will get
- wrong values when accessing the struct.
- As a workaround we use fixed values which are good for
- Irix 6.2. */
- char buf[432];
-
- read_memory ((CORE_ADDR) list_old.data, buf, sizeof (buf));
-
- target_read_string (extract_address (&buf[236], 4),
- &so_list_ptr->so_name,
- INT_MAX, &errcode);
- if (errcode != 0)
- memory_error (errcode, extract_address (&buf[236], 4));
-
- LM_ADDR (so_list_ptr) = extract_address (&buf[196], 4);
- LM_OFFSET (so_list_ptr) =
- extract_address (&buf[196], 4) - extract_address (&buf[248], 4);
-#else
- struct obj obj_old;
-
- read_memory ((CORE_ADDR) list_old.data, (char *) &obj_old,
- sizeof (struct obj));
-
- target_read_string ((CORE_ADDR) obj_old.o_path,
- &so_list_ptr->so_name,
- INT_MAX, &errcode);
- if (errcode != 0)
- memory_error (errcode, (CORE_ADDR) obj_old.o_path);
-
- LM_ADDR (so_list_ptr) = (CORE_ADDR) obj_old.o_praw;
- LM_OFFSET (so_list_ptr) =
- (CORE_ADDR) obj_old.o_praw - obj_old.o_base_address;
-#endif
- }
-
- catch_errors (solib_map_sections, (char *) so_list_ptr,
- "Error while mapping shared library sections:\n",
- RETURN_MASK_ALL);
-}
-
-
-/*
-
- LOCAL FUNCTION
-
- find_solib -- step through list of shared objects
-
- SYNOPSIS
-
- struct so_list *find_solib (struct so_list *so_list_ptr)
-
- DESCRIPTION
-
- This module contains the routine which finds the names of any
- loaded "images" in the current process. The argument in must be
- NULL on the first call, and then the returned value must be passed
- in on subsequent calls. This provides the capability to "step" down
- the list of loaded objects. On the last object, a NULL value is
- returned.
- */
-
-static struct so_list *
-find_solib (struct so_list *so_list_ptr)
-{
- struct so_list *so_list_next = NULL;
- struct link_map *lm = NULL;
- struct so_list *new;
-
- if (so_list_ptr == NULL)
- {
- /* We are setting up for a new scan through the loaded images. */
- if ((so_list_next = so_list_head) == NULL)
- {
- /* Find the first link map list member. */
- lm = first_link_map_member ();
- }
- }
- else
- {
- /* We have been called before, and are in the process of walking
- the shared library list. Advance to the next shared object. */
- lm = next_link_map_member (so_list_ptr);
- so_list_next = so_list_ptr->next;
- }
- if ((so_list_next == NULL) && (lm != NULL))
- {
- new = (struct so_list *) xmalloc (sizeof (struct so_list));
- memset ((char *) new, 0, sizeof (struct so_list));
- /* Add the new node as the next node in the list, or as the root
- node if this is the first one. */
- if (so_list_ptr != NULL)
- {
- so_list_ptr->next = new;
- }
- else
- {
- so_list_head = new;
- }
- so_list_next = new;
- xfer_link_map_member (new, lm);
- }
- return (so_list_next);
-}
-
-/* A small stub to get us past the arg-passing pinhole of catch_errors. */
-
-static int
-symbol_add_stub (void *arg)
-{
- register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */
- CORE_ADDR text_addr = 0;
- struct section_addr_info section_addrs;
-
- memset (&section_addrs, 0, sizeof (section_addrs));
- if (so->textsection)
- text_addr = so->textsection->addr;
- else if (so->abfd != NULL)
- {
- asection *lowest_sect;
-
- /* If we didn't find a mapped non zero sized .text section, set up
- text_addr so that the relocation in symbol_file_add does no harm. */
-
- lowest_sect = bfd_get_section_by_name (so->abfd, ".text");
- if (lowest_sect == NULL)
- bfd_map_over_sections (so->abfd, find_lowest_section,
- (PTR) &lowest_sect);
- if (lowest_sect)
- text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so);
- }
-
-
- section_addrs.other[0].name = ".text";
- section_addrs.other[0].addr = text_addr;
- so->objfile = symbol_file_add (so->so_name, so->from_tty,
- &section_addrs, 0, 0);
- /* must be non-zero */
- return (1);
-}
-
-/*
-
- GLOBAL FUNCTION
-
- solib_add -- add a shared library file to the symtab and section list
-
- SYNOPSIS
-
- void solib_add (char *arg_string, int from_tty,
- struct target_ops *target, int readsyms)
-
- DESCRIPTION
-
- */
-
-void
-solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
-{
- register struct so_list *so = NULL; /* link map state variable */
-
- /* Last shared library that we read. */
- struct so_list *so_last = NULL;
-
- char *re_err;
- int count;
- int old;
-
- if (!readsyms)
- return;
-
- if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
- {
- error ("Invalid regexp: %s", re_err);
- }
-
- /* Add the shared library sections to the section table of the
- specified target, if any. */
- if (target)
- {
- /* Count how many new section_table entries there are. */
- so = NULL;
- count = 0;
- while ((so = find_solib (so)) != NULL)
- {
- if (so->so_name[0])
- {
- count += so->sections_end - so->sections;
- }
- }
-
- if (count)
- {
- old = target_resize_to_sections (target, count);
-
- /* Add these section table entries to the target's table. */
- while ((so = find_solib (so)) != NULL)
- {
- if (so->so_name[0])
- {
- count = so->sections_end - so->sections;
- memcpy ((char *) (target->to_sections + old),
- so->sections,
- (sizeof (struct section_table)) * count);
- old += count;
- }
- }
- }
- }
-
- /* Now add the symbol files. */
- while ((so = find_solib (so)) != NULL)
- {
- if (so->so_name[0] && re_exec (so->so_name))
- {
- so->from_tty = from_tty;
- if (so->symbols_loaded)
- {
- if (from_tty)
- {
- printf_unfiltered ("Symbols already loaded for %s\n", so->so_name);
- }
- }
- else if (catch_errors
- (symbol_add_stub, (char *) so,
- "Error while reading shared library symbols:\n",
- RETURN_MASK_ALL))
- {
- so_last = so;
- so->symbols_loaded = 1;
- }
- }
- }
-
- /* Getting new symbols may change our opinion about what is
- frameless. */
- if (so_last)
- reinit_frame_cache ();
-}
-
-/*
-
- LOCAL FUNCTION
-
- info_sharedlibrary_command -- code for "info sharedlibrary"
-
- SYNOPSIS
-
- static void info_sharedlibrary_command ()
-
- DESCRIPTION
-
- Walk through the shared library list and print information
- about each attached library.
- */
-
-static void
-info_sharedlibrary_command (char *ignore, int from_tty)
-{
- register struct so_list *so = NULL; /* link map state variable */
- int header_done = 0;
-
- if (exec_bfd == NULL)
- {
- printf_unfiltered ("No executable file.\n");
- return;
- }
- while ((so = find_solib (so)) != NULL)
- {
- if (so->so_name[0])
- {
- if (!header_done)
- {
- printf_unfiltered ("%-12s%-12s%-12s%s\n", "From", "To", "Syms Read",
- "Shared Object Library");
- header_done++;
- }
- printf_unfiltered ("%-12s",
- local_hex_string_custom ((unsigned long) LM_ADDR (so),
- "08l"));
- printf_unfiltered ("%-12s",
- local_hex_string_custom ((unsigned long) so->lmend,
- "08l"));
- printf_unfiltered ("%-12s", so->symbols_loaded ? "Yes" : "No");
- printf_unfiltered ("%s\n", so->so_name);
- }
- }
- if (so_list_head == NULL)
- {
- printf_unfiltered ("No shared libraries loaded at this time.\n");
- }
-}
-
-/*
-
- GLOBAL FUNCTION
-
- solib_address -- check to see if an address is in a shared lib
-
- SYNOPSIS
-
- char *solib_address (CORE_ADDR address)
-
- DESCRIPTION
-
- Provides a hook for other gdb routines to discover whether or
- not a particular address is within the mapped address space of
- a shared library. Any address between the base mapping address
- and the first address beyond the end of the last mapping, is
- considered to be within the shared library address space, for
- our purposes.
-
- For example, this routine is called at one point to disable
- breakpoints which are in shared libraries that are not currently
- mapped in.
- */
-
-char *
-solib_address (CORE_ADDR address)
-{
- register struct so_list *so = 0; /* link map state variable */
-
- while ((so = find_solib (so)) != NULL)
- {
- if (so->so_name[0])
- {
- if ((address >= (CORE_ADDR) LM_ADDR (so)) &&
- (address < (CORE_ADDR) so->lmend))
- return (so->so_name);
- }
- }
- return (0);
-}
-
-/* Called by free_all_symtabs */
-
-void
-clear_solib (void)
-{
- struct so_list *next;
- char *bfd_filename;
-
- disable_breakpoints_in_shlibs (1);
-
- while (so_list_head)
- {
- if (so_list_head->sections)
- {
- xfree (so_list_head->sections);
- }
- if (so_list_head->abfd)
- {
- remove_target_sections (so_list_head->abfd);
- bfd_filename = bfd_get_filename (so_list_head->abfd);
- if (!bfd_close (so_list_head->abfd))
- warning ("cannot close \"%s\": %s",
- bfd_filename, bfd_errmsg (bfd_get_error ()));
- }
- else
- /* This happens for the executable on SVR4. */
- bfd_filename = NULL;
-
- next = so_list_head->next;
- if (bfd_filename)
- xfree (bfd_filename);
- xfree (so_list_head->so_name);
- xfree (so_list_head);
- so_list_head = next;
- }
- debug_base = 0;
-}
-
-/*
-
- LOCAL FUNCTION
-
- disable_break -- remove the "mapping changed" breakpoint
-
- SYNOPSIS
-
- static int disable_break ()
-
- DESCRIPTION
-
- Removes the breakpoint that gets hit when the dynamic linker
- completes a mapping change.
-
- */
-
-static int
-disable_break (void)
-{
- int status = 1;
-
-
- /* Note that breakpoint address and original contents are in our address
- space, so we just need to write the original contents back. */
-
- if (memory_remove_breakpoint (breakpoint_addr, shadow_contents) != 0)
- {
- status = 0;
- }
-
- /* For the SVR4 version, we always know the breakpoint address. For the
- SunOS version we don't know it until the above code is executed.
- Grumble if we are stopped anywhere besides the breakpoint address. */
-
- if (stop_pc != breakpoint_addr)
- {
- warning ("stopped at unknown breakpoint while handling shared libraries");
- }
-
- return (status);
-}
-
-/*
-
- LOCAL FUNCTION
-
- enable_break -- arrange for dynamic linker to hit breakpoint
-
- SYNOPSIS
-
- int enable_break (void)
-
- DESCRIPTION
-
- This functions inserts a breakpoint at the entry point of the
- main executable, where all shared libraries are mapped in.
- */
-
-static int
-enable_break (void)
-{
- if (symfile_objfile != NULL
- && target_insert_breakpoint (symfile_objfile->ei.entry_point,
- shadow_contents) == 0)
- {
- breakpoint_addr = symfile_objfile->ei.entry_point;
- return 1;
- }
-
- return 0;
-}
-
-/*
-
- GLOBAL FUNCTION
-
- solib_create_inferior_hook -- shared library startup support
-
- SYNOPSIS
-
- void solib_create_inferior_hook()
-
- DESCRIPTION
-
- When gdb starts up the inferior, it nurses it along (through the
- shell) until it is ready to execute it's first instruction. At this
- point, this function gets called via expansion of the macro
- SOLIB_CREATE_INFERIOR_HOOK.
-
- For SunOS executables, this first instruction is typically the
- one at "_start", or a similar text label, regardless of whether
- the executable is statically or dynamically linked. The runtime
- startup code takes care of dynamically linking in any shared
- libraries, once gdb allows the inferior to continue.
-
- For SVR4 executables, this first instruction is either the first
- instruction in the dynamic linker (for dynamically linked
- executables) or the instruction at "start" for statically linked
- executables. For dynamically linked executables, the system
- first exec's /lib/libc.so.N, which contains the dynamic linker,
- and starts it running. The dynamic linker maps in any needed
- shared libraries, maps in the actual user executable, and then
- jumps to "start" in the user executable.
-
- For both SunOS shared libraries, and SVR4 shared libraries, we
- can arrange to cooperate with the dynamic linker to discover the
- names of shared libraries that are dynamically linked, and the
- base addresses to which they are linked.
-
- This function is responsible for discovering those names and
- addresses, and saving sufficient information about them to allow
- their symbols to be read at a later time.
-
- FIXME
-
- Between enable_break() and disable_break(), this code does not
- properly handle hitting breakpoints which the user might have
- set in the startup code or in the dynamic linker itself. Proper
- handling will probably have to wait until the implementation is
- changed to use the "breakpoint handler function" method.
-
- Also, what if child has exit()ed? Must exit loop somehow.
- */
-
-void
-solib_create_inferior_hook (void)
-{
- if (!enable_break ())
- {
- warning ("shared library handler failed to enable breakpoint");
- return;
- }
-
- /* Now run the target. It will eventually hit the breakpoint, at
- which point all of the libraries will have been mapped in and we
- can go groveling around in the dynamic linker structures to find
- out what we need to know about them. */
-
- clear_proceed_status ();
- stop_soon_quietly = 1;
- stop_signal = TARGET_SIGNAL_0;
- do
- {
- target_resume (pid_to_ptid (-1), 0, stop_signal);
- wait_for_inferior ();
- }
- while (stop_signal != TARGET_SIGNAL_TRAP);
-
- /* We are now either at the "mapping complete" breakpoint (or somewhere
- else, a condition we aren't prepared to deal with anyway), so adjust
- the PC as necessary after a breakpoint, disable the breakpoint, and
- add any shared libraries that were mapped in. */
-
- if (DECR_PC_AFTER_BREAK)
- {
- stop_pc -= DECR_PC_AFTER_BREAK;
- write_register (PC_REGNUM, stop_pc);
- }
-
- if (!disable_break ())
- {
- warning ("shared library handler failed to disable breakpoint");
- }
-
- /* solib_add will call reinit_frame_cache.
- But we are stopped in the startup code and we might not have symbols
- for the startup code, so heuristic_proc_start could be called
- and will put out an annoying warning.
- Delaying the resetting of stop_soon_quietly until after symbol loading
- suppresses the warning. */
- solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
- stop_soon_quietly = 0;
-}
-
-/*
-
- LOCAL FUNCTION
-
- sharedlibrary_command -- handle command to explicitly add library
-
- SYNOPSIS
-
- static void sharedlibrary_command (char *args, int from_tty)
-
- DESCRIPTION
-
- */
-
-static void
-sharedlibrary_command (char *args, int from_tty)
-{
- dont_repeat ();
- solib_add (args, from_tty, (struct target_ops *) 0, 1);
-}
-
-void
-_initialize_solib (void)
-{
- add_com ("sharedlibrary", class_files, sharedlibrary_command,
- "Load shared object library symbols for files matching REGEXP.");
- add_info ("sharedlibrary", info_sharedlibrary_command,
- "Status of loaded shared object libraries.");
-
- add_show_from_set
- (add_set_cmd ("auto-solib-add", class_support, var_boolean,
- (char *) &auto_solib_add,
- "Set autoloading of shared library symbols.\n\
-If \"on\", symbols from all shared object libraries will be loaded\n\
-automatically when the inferior begins execution, when the dynamic linker\n\
-informs gdb that a new library has been loaded, or when attaching to the\n\
-inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'.",
- &setlist),
- &showlist);
-}
-
/* Register that we are able to handle irix5 core file formats.
This really is bfd_target_unknown_flavour */
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 495bf3e0537..c2e5d16c68e 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -96,9 +96,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yycheck java_yycheck
#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
int yyparse (void);
static int yylex (void);
@@ -388,7 +390,8 @@ rcurly:
ClassInstanceCreationExpression:
NEW ClassType '(' ArgumentList_opt ')'
- { error ("FIXME - ClassInstanceCreationExpression"); }
+ { internal_error (__FILE__, __LINE__,
+ _("FIXME - ClassInstanceCreationExpression")); }
;
ArgumentList:
@@ -406,9 +409,11 @@ ArgumentList_opt:
ArrayCreationExpression:
NEW PrimitiveType DimExprs Dims_opt
- { error ("FIXME - ArrayCreatiionExpression"); }
+ { internal_error (__FILE__, __LINE__,
+ _("FIXME - ArrayCreationExpression")); }
| NEW ClassOrInterfaceType DimExprs Dims_opt
- { error ("FIXME - ArrayCreatiionExpression"); }
+ { internal_error (__FILE__, __LINE__,
+ _("FIXME - ArrayCreationExpression")); }
;
DimExprs:
@@ -443,11 +448,11 @@ FieldAccess:
MethodInvocation:
Name '(' ArgumentList_opt ')'
- { error ("method invocation not implemented"); }
+ { error (_("Method invocation not implemented")); }
| Primary '.' SimpleName '(' ArgumentList_opt ')'
- { error ("method invocation not implemented"); }
+ { error (_("Method invocation not implemented")); }
| SUPER '.' SimpleName '(' ArgumentList_opt ')'
- { error ("method invocation not implemented"); }
+ { error (_("Method invocation not implemented")); }
;
ArrayAccess:
@@ -537,7 +542,7 @@ CastExpression:
int i;
int base = expout_ptr - last_exp_size - 3;
if (base < 0 || expout->elts[base+2].opcode != OP_TYPE)
- error ("invalid cast expression");
+ error (_("Invalid cast expression"));
type = expout->elts[base+1].type;
/* Remove the 'Expression' and slide the
UnaryExpressionNotPlusMinus down to replace it. */
@@ -793,7 +798,7 @@ parse_number (p, len, parsed_float, putithere)
return ERROR;
if (n > limit_div_base
|| (n *= base) > limit - c)
- error ("Numeric constant too large.");
+ error (_("Numeric constant too large"));
n += c;
}
@@ -903,7 +908,7 @@ yylex ()
if (c == '\\')
c = parse_escape (&lexptr);
else if (c == '\'')
- error ("Empty character constant.");
+ error (_("Empty character constant"));
yylval.typed_val_int.val = c;
yylval.typed_val_int.type = java_char_type;
@@ -916,12 +921,12 @@ yylex ()
{
lexptr = tokstart + namelen;
if (lexptr[-1] != '\'')
- error ("Unmatched single quote.");
+ error (_("Unmatched single quote"));
namelen -= 2;
tokstart++;
goto tryname;
}
- error ("Invalid character constant.");
+ error (_("Invalid character constant"));
}
return INTEGER_LITERAL;
@@ -1006,7 +1011,7 @@ yylex ()
memcpy (err_copy, tokstart, p - tokstart);
err_copy[p - tokstart] = 0;
- error ("Invalid number \"%s\".", err_copy);
+ error (_("Invalid number \"%s\""), err_copy);
}
lexptr = p;
return toktype;
@@ -1078,7 +1083,7 @@ yylex ()
} while ((*tokptr != '"') && (*tokptr != '\0'));
if (*tokptr++ != '"')
{
- error ("Unterminated string in expression.");
+ error (_("Unterminated string in expression"));
}
tempbuf[tempbufindex] = '\0'; /* See note above */
yylval.sval.ptr = tempbuf;
@@ -1090,7 +1095,7 @@ yylex ()
if (!(c == '_' || c == '$'
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
/* We must have come across a bad character (e.g. ';'). */
- error ("Invalid character '%c' in expression.", c);
+ error (_("Invalid character '%c' in expression"), c);
/* It's a name. See how long it is. */
namelen = 0;
@@ -1212,7 +1217,10 @@ yyerror (msg)
if (prev_lexptr)
lexptr = prev_lexptr;
- error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
+ if (msg)
+ error (_("%s: near `%s'"), msg, lexptr);
+ else
+ error (_("error in expression, near `%s'"), lexptr);
}
static struct type *
@@ -1223,7 +1231,7 @@ java_type_from_name (name)
char *tmp = copy_name (name);
struct type *typ = java_lookup_class (tmp);
if (typ == NULL || TYPE_CODE (typ) != TYPE_CODE_STRUCT)
- error ("No class named %s.", tmp);
+ error (_("No class named `%s'"), tmp);
return typ;
}
@@ -1366,7 +1374,7 @@ push_qualified_expression_name (name, dot_index)
while (dot_index < name.length && name.ptr[dot_index] != '.')
dot_index++;
}
- error ("unknown type `%.*s'", name.length, name.ptr);
+ error (_("unknown type `%.*s'"), name.length, name.ptr);
}
/* Handle Name in an expression (or LHS).
@@ -1415,9 +1423,9 @@ push_expression_name (name)
builtin_type_int);
}
else if (!have_full_symbols () && !have_partial_symbols ())
- error ("No symbol table is loaded. Use the \"file\" command.");
+ error (_("No symbol table is loaded. Use the \"file\" command"));
else
- error ("No symbol \"%s\" in current context.", tmp);
+ error (_("No symbol \"%s\" in current context"), tmp);
}
}
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index e221105ed6f..3afdebdb467 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -106,6 +106,7 @@ get_java_class_symtab (void)
bl = (struct block *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
BLOCK_NSYMS (bl) = 0;
+ BLOCK_HASHTABLE (bl) = 0;
BLOCK_START (bl) = 0;
BLOCK_END (bl) = 0;
BLOCK_FUNCTION (bl) = NULL;
diff --git a/gdb/language.c b/gdb/language.c
index 1bfba98c86d..dc94ebdd8c3 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -484,7 +484,7 @@ set_range_str (void)
}
static void
-set_case_str()
+set_case_str (void)
{
char *tmp = NULL, *prefix = "";
@@ -567,8 +567,8 @@ binop_result_type (struct value *v1, struct value *v2)
not needed. */
return l1 > l2 ? VALUE_TYPE (v1) : VALUE_TYPE (v2);
break;
- case language_chill:
- error ("Missing Chill support in function binop_result_check."); /*FIXME */
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE error ("Missing Chill support in function binop_result_check."); */ /*FIXME */
}
internal_error (__FILE__, __LINE__, "failed internal consistency check");
return (struct type *) 0; /* For lint */
@@ -791,8 +791,8 @@ integral_type (struct type *type)
case language_m2:
case language_pascal:
return TYPE_CODE (type) != TYPE_CODE_INT ? 0 : 1;
- case language_chill:
- error ("Missing Chill support in function integral_type."); /*FIXME */
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE error ("Missing Chill support in function integral_type."); *//*FIXME */
default:
error ("Language not supported.");
}
@@ -821,7 +821,7 @@ character_type (struct type *type)
CHECK_TYPEDEF (type);
switch (current_language->la_language)
{
- case language_chill:
+ /* OBSOLETE case language_chill: */
case language_m2:
case language_pascal:
return TYPE_CODE (type) != TYPE_CODE_CHAR ? 0 : 1;
@@ -843,7 +843,7 @@ string_type (struct type *type)
CHECK_TYPEDEF (type);
switch (current_language->la_language)
{
- case language_chill:
+ /* OBSOLETE case language_chill: */
case language_m2:
case language_pascal:
return TYPE_CODE (type) != TYPE_CODE_STRING ? 0 : 1;
@@ -868,8 +868,9 @@ boolean_type (struct type *type)
{
case language_c:
case language_cplus:
- /* Might be more cleanly handled by having a TYPE_CODE_INT_NOT_BOOL
- for CHILL and such languages, or a TYPE_CODE_INT_OR_BOOL for C. */
+ /* Might be more cleanly handled by having a
+ TYPE_CODE_INT_NOT_BOOL for (OBSOLETE) CHILL and such
+ languages, or a TYPE_CODE_INT_OR_BOOL for C. */
if (TYPE_CODE (type) == TYPE_CODE_INT)
return 1;
default:
@@ -915,8 +916,8 @@ structured_type (struct type *type)
return (TYPE_CODE (type) == TYPE_CODE_STRUCT) ||
(TYPE_CODE (type) == TYPE_CODE_SET) ||
(TYPE_CODE (type) == TYPE_CODE_ARRAY);
- case language_chill:
- error ("Missing Chill support in function structured_type."); /*FIXME */
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE error ("Missing Chill support in function structured_type."); *//*FIXME */
default:
return (0);
}
@@ -930,8 +931,10 @@ lang_bool_type (void)
struct type *type;
switch (current_language->la_language)
{
- case language_chill:
- return builtin_type_chill_bool;
+#if 0
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE return builtin_type_chill_bool; */
+#endif
case language_fortran:
sym = lookup_symbol ("logical", NULL, VAR_NAMESPACE, NULL, NULL);
if (sym)
@@ -1161,9 +1164,9 @@ binop_type_check (struct value *arg1, struct value *arg2, int op)
}
#endif
-#ifdef _LANG_chill
- case language_chill:
- error ("Missing Chill support in function binop_type_check."); /*FIXME */
+#ifdef _LANG_chill /* OBSOLETE */
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE error ("Missing Chill support in function binop_type_check."); *//*FIXME */
#endif
}
diff --git a/gdb/language.h b/gdb/language.h
index 301fefd18dd..67a8ff26afe 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -35,7 +35,7 @@ struct expression;
/* #include "lang_def.h" */
#define _LANG_c
#define _LANG_m2
-#define _LANG_chill
+/* OBSOLETE #define _LANG_chill */
#define _LANG_fortran
#define _LANG_pascal
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index aa3b5711da0..f76def3a3a2 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -31,6 +31,7 @@
#include "gdbthread.h" /* for struct thread_info etc. */
#include "elf-bfd.h" /* for elfcore_write_* */
#include "cli/cli-decode.h" /* for add_info */
+#include "gdb_string.h"
/* Function: child_pid_to_exec_file
*
@@ -197,10 +198,12 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
return note_data;
}
-struct linux_corefile_thread_data {
- bfd *obfd;
+struct linux_corefile_thread_data
+{
+ bfd *obfd;
char *note_data;
- int *note_size;
+ int *note_size;
+ int num_notes;
};
/* Function: linux_corefile_thread_callback
@@ -223,6 +226,7 @@ linux_corefile_thread_callback (struct thread_info *ti, void *data)
ti->ptid,
args->note_data,
args->note_size);
+ args->num_notes++;
inferior_ptid = saved_ptid;
registers_changed ();
target_fetch_registers (-1); /* FIXME should not be necessary;
@@ -270,11 +274,12 @@ linux_make_note_section (bfd *obfd, int *note_size)
thread_args.obfd = obfd;
thread_args.note_data = note_data;
thread_args.note_size = note_size;
+ thread_args.num_notes = 0;
iterate_over_threads (linux_corefile_thread_callback, &thread_args);
- if (thread_args.note_data == note_data)
+ if (thread_args.num_notes == 0)
{
/* iterate_over_threads didn't come up with any threads;
- just use inferior_ptid. */
+ just use inferior_ptid. */
note_data = linux_do_thread_registers (obfd, inferior_ptid,
note_data, note_size);
}
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 772c6b7b286..707c9e21091 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -98,9 +98,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yycheck m2_yycheck
#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
int yyparse (void);
static int yylex (void);
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 4b883fb213e..b4ee7775b76 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -21,7 +21,6 @@
#include "defs.h"
#include "frame.h"
#include "inferior.h"
-#include "obstack.h"
#include "target.h"
#include "value.h"
#include "bfd.h"
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 6d00ab1faf5..aa1a226754f 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for Motorola 68HC11 & 68HC12
Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Stephane Carrez, stcarrez@worldnet.fr
+ Contributed by Stephane Carrez, stcarrez@nerim.fr
This file is part of GDB.
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "gdbcmd.h"
@@ -37,7 +36,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "target.h"
#include "opcode/m68hc11.h"
+#include "elf/m68hc11.h"
+#include "elf-bfd.h"
+
+/* Macros for setting and testing a bit in a minimal symbol.
+ For 68HC11/68HC12 we have two flags that tell which return
+ type the function is using. This is used for prologue and frame
+ analysis to compute correct stack frame layout.
+
+ The MSB of the minimal symbol's "info" field is used for this purpose.
+ This field is already being used to store the symbol size, so the
+ assumption is that the symbol size cannot exceed 2^30.
+
+ MSYMBOL_SET_RTC Actually sets the "RTC" bit.
+ MSYMBOL_SET_RTI Actually sets the "RTI" bit.
+ MSYMBOL_IS_RTC Tests the "RTC" bit in a minimal symbol.
+ MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol.
+ MSYMBOL_SIZE Returns the size of the minimal symbol,
+ i.e. the "info" field with the "special" bit
+ masked out. */
+
+#define MSYMBOL_SET_RTC(msym) \
+ MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
+ | 0x80000000)
+
+#define MSYMBOL_SET_RTI(msym) \
+ MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
+ | 0x40000000)
+
+#define MSYMBOL_IS_RTC(msym) \
+ (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+
+#define MSYMBOL_IS_RTI(msym) \
+ (((long) MSYMBOL_INFO (msym) & 0x40000000) != 0)
+
+#define MSYMBOL_SIZE(msym) \
+ ((long) MSYMBOL_INFO (msym) & 0x3fffffff)
+
+enum insn_return_kind {
+ RETURN_RTS,
+ RETURN_RTC,
+ RETURN_RTI
+};
+
/* 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,
@@ -54,7 +96,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define HARD_A_REGNUM 5
#define HARD_B_REGNUM 6
#define HARD_CCR_REGNUM 7
-#define M68HC11_LAST_HARD_REG (HARD_CCR_REGNUM)
+
+/* 68HC12 page number register.
+ Note: to keep a compatibility with gcc register naming, we must
+ not have to rename FP and other soft registers. The page register
+ is a real hard register and must therefore be counted by NUM_REGS.
+ For this it has the same number as Z register (which is not used). */
+#define HARD_PAGE_REGNUM 8
+#define M68HC11_LAST_HARD_REG (HARD_PAGE_REGNUM)
/* Z is replaced by X or Y by gcc during machine reorg.
??? There is no way to get it and even know whether
@@ -79,6 +128,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define M68HC11_REG_SIZE (2)
+#define M68HC12_NUM_REGS (9)
+#define M68HC12_NUM_PSEUDO_REGS ((M68HC11_MAX_SOFT_REGS+5)+1-1)
+#define M68HC12_HARD_PC_REGNUM (SOFT_D32_REGNUM+1)
+
struct insn_sequence;
struct gdbarch_tdep
{
@@ -90,18 +143,25 @@ struct gdbarch_tdep
/* Description of instructions in the prologue. */
struct insn_sequence *prologue;
+
+ /* True if the page memory bank register is available
+ and must be used. */
+ int use_page_register;
+
+ /* ELF flags for ABI. */
+ int elf_flags;
};
#define M6811_TDEP gdbarch_tdep (current_gdbarch)
#define STACK_CORRECTION (M6811_TDEP->stack_correction)
+#define USE_PAGE_REGISTER (M6811_TDEP->use_page_register)
struct frame_extra_info
{
- int frame_reg;
CORE_ADDR return_pc;
- CORE_ADDR dummy;
int frameless;
int size;
+ enum insn_return_kind return_kind;
};
/* Table of registers for 68HC11. This includes the hard registers
@@ -110,7 +170,7 @@ static char *
m68hc11_register_names[] =
{
"x", "d", "y", "sp", "pc", "a", "b",
- "ccr", "z", "frame","tmp", "zs", "xy", 0,
+ "ccr", "page", "frame","tmp", "zs", "xy", 0,
"d1", "d2", "d3", "d4", "d5", "d6", "d7",
"d8", "d9", "d10", "d11", "d12", "d13", "d14",
"d15", "d16", "d17", "d18", "d19", "d20", "d21",
@@ -219,10 +279,28 @@ m68hc11_which_soft_register (CORE_ADDR addr)
/* Fetch a pseudo register. The 68hc11 soft registers are treated like
pseudo registers. They are located in memory. Translate the register
fetch into a memory read. */
-void
-m68hc11_fetch_pseudo_register (int regno)
+static void
+m68hc11_pseudo_register_read (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regno, void *buf)
{
- char buf[MAX_REGISTER_RAW_SIZE];
+ /* The PC is a pseudo reg only for 68HC12 with the memory bank
+ addressing mode. */
+ if (regno == M68HC12_HARD_PC_REGNUM)
+ {
+ const int regsize = TYPE_LENGTH (builtin_type_uint32);
+ CORE_ADDR pc = read_register (HARD_PC_REGNUM);
+ int page = read_register (HARD_PAGE_REGNUM);
+
+ if (pc >= 0x8000 && pc < 0xc000)
+ {
+ pc -= 0x8000;
+ pc += (page << 14);
+ pc += 0x1000000;
+ }
+ store_unsigned_integer (buf, regsize, pc);
+ return;
+ }
m68hc11_initialize_register_info ();
@@ -235,29 +313,57 @@ m68hc11_fetch_pseudo_register (int regno)
{
memset (buf, 0, 2);
}
- supply_register (regno, buf);
}
/* Store a pseudo register. Translate the register store
into a memory write. */
static void
-m68hc11_store_pseudo_register (int regno)
+m68hc11_pseudo_register_write (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regno, const void *buf)
{
+ /* The PC is a pseudo reg only for 68HC12 with the memory bank
+ addressing mode. */
+ if (regno == M68HC12_HARD_PC_REGNUM)
+ {
+ const int regsize = TYPE_LENGTH (builtin_type_uint32);
+ char *tmp = alloca (regsize);
+ CORE_ADDR pc;
+
+ memcpy (tmp, buf, regsize);
+ pc = extract_unsigned_integer (tmp, regsize);
+ if (pc >= 0x1000000)
+ {
+ pc -= 0x1000000;
+ write_register (HARD_PAGE_REGNUM, (pc >> 14) & 0x0ff);
+ pc &= 0x03fff;
+ write_register (HARD_PC_REGNUM, pc + 0x8000);
+ }
+ else
+ write_register (HARD_PC_REGNUM, pc);
+ return;
+ }
+
m68hc11_initialize_register_info ();
/* Store a soft register: translate into a memory write. */
if (soft_regs[regno].name)
{
- char buf[MAX_REGISTER_RAW_SIZE];
-
- read_register_gen (regno, buf);
- target_write_memory (soft_regs[regno].addr, buf, 2);
+ const int regsize = 2;
+ char *tmp = alloca (regsize);
+ memcpy (tmp, buf, regsize);
+ target_write_memory (soft_regs[regno].addr, tmp, regsize);
}
}
-static char *
+static const char *
m68hc11_register_name (int reg_nr)
{
+ if (reg_nr == M68HC12_HARD_PC_REGNUM && USE_PAGE_REGISTER)
+ return "pc";
+ if (reg_nr == HARD_PC_REGNUM && USE_PAGE_REGISTER)
+ return "ppc";
+
if (reg_nr < 0)
return NULL;
if (reg_nr >= M68HC11_ALL_REGS)
@@ -301,7 +407,15 @@ m68hc11_frame_saved_pc (struct frame_info *frame)
static CORE_ADDR
m68hc11_frame_args_address (struct frame_info *frame)
{
- return frame->frame + frame->extra_info->size + STACK_CORRECTION + 2;
+ CORE_ADDR addr;
+
+ addr = frame->frame + frame->extra_info->size + STACK_CORRECTION + 2;
+ if (frame->extra_info->return_kind == RETURN_RTC)
+ addr += 1;
+ else if (frame->extra_info->return_kind == RETURN_RTI)
+ addr += 7;
+
+ return addr;
}
static CORE_ADDR
@@ -364,6 +478,8 @@ m68hc11_pop_frame (void)
#define M6812_PB_PSHW (0xae)
#define M6812_OP_STS (0x7f)
#define M6812_OP_LEAS (0x1b)
+#define M6812_OP_PSHX (0x34)
+#define M6812_OP_PSHY (0x35)
/* Operand extraction. */
#define OP_DIRECT (0x100) /* 8-byte direct addressing. */
@@ -423,6 +539,8 @@ static struct insn_sequence m6812_prologue[] = {
OP_IMM_HIGH, OP_IMM_LOW } },
{ P_SET_FRAME, 3, { M6812_OP_STS, OP_IMM_HIGH, OP_IMM_LOW } },
{ P_LOCAL_N, 2, { M6812_OP_LEAS, OP_PBYTE } },
+ { P_LOCAL_2, 1, { M6812_OP_PSHX } },
+ { P_LOCAL_2, 1, { M6812_OP_PSHY } },
{ P_LAST, 0 }
};
@@ -512,6 +630,28 @@ m68hc11_analyze_instruction (struct insn_sequence *seq, CORE_ADDR *pc,
return 0;
}
+/* Return the instruction that the function at the PC is using. */
+static enum insn_return_kind
+m68hc11_get_return_insn (CORE_ADDR pc)
+{
+ struct minimal_symbol *sym;
+
+ /* A flag indicating that this is a STO_M68HC12_FAR or STO_M68HC12_INTERRUPT
+ function is stored by elfread.c in the high bit of the info field.
+ Use this to decide which instruction the function uses to return. */
+ sym = lookup_minimal_symbol_by_pc (pc);
+ if (sym == 0)
+ return RETURN_RTS;
+
+ if (MSYMBOL_IS_RTC (sym))
+ return RETURN_RTC;
+ else if (MSYMBOL_IS_RTI (sym))
+ return RETURN_RTI;
+ else
+ return RETURN_RTS;
+}
+
+
/* Analyze the function prologue to find some information
about the function:
- the PC of the first line (for m68hc11_skip_prologue)
@@ -686,11 +826,6 @@ m68hc11_frame_chain (struct frame_info *frame)
addr = frame->frame + frame->extra_info->size + STACK_CORRECTION - 2;
addr = read_memory_unsigned_integer (addr, 2) & 0x0FFFF;
- if (addr == 0)
- {
- return (CORE_ADDR) 0;
- }
-
return addr;
}
@@ -704,19 +839,35 @@ m68hc11_frame_init_saved_regs (struct frame_info *fi)
{
CORE_ADDR pc;
CORE_ADDR addr;
-
+
if (fi->saved_regs == NULL)
frame_saved_regs_zalloc (fi);
else
memset (fi->saved_regs, 0, sizeof (fi->saved_regs));
pc = fi->pc;
+ fi->extra_info->return_kind = m68hc11_get_return_insn (pc);
m68hc11_guess_from_prologue (pc, fi->frame, &pc, &fi->extra_info->size,
fi->saved_regs);
addr = fi->frame + fi->extra_info->size + STACK_CORRECTION;
if (soft_regs[SOFT_FP_REGNUM].name)
fi->saved_regs[SOFT_FP_REGNUM] = addr - 2;
+
+ /* Take into account how the function was called/returns. */
+ if (fi->extra_info->return_kind == RETURN_RTC)
+ {
+ fi->saved_regs[HARD_PAGE_REGNUM] = addr;
+ addr++;
+ }
+ else if (fi->extra_info->return_kind == RETURN_RTI)
+ {
+ fi->saved_regs[HARD_CCR_REGNUM] = addr;
+ fi->saved_regs[HARD_D_REGNUM] = addr + 1;
+ fi->saved_regs[HARD_X_REGNUM] = addr + 3;
+ fi->saved_regs[HARD_Y_REGNUM] = addr + 5;
+ addr += 7;
+ }
fi->saved_regs[HARD_SP_REGNUM] = addr;
fi->saved_regs[HARD_PC_REGNUM] = fi->saved_regs[HARD_SP_REGNUM];
}
@@ -736,20 +887,27 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi)
if (fromleaf)
{
+ fi->extra_info->return_kind = m68hc11_get_return_insn (fi->pc);
fi->extra_info->return_pc = m68hc11_saved_pc_after_call (fi);
}
else
{
- addr = fi->frame + fi->extra_info->size + STACK_CORRECTION;
+ addr = fi->saved_regs[HARD_PC_REGNUM];
addr = read_memory_unsigned_integer (addr, 2) & 0x0ffff;
+
+ /* Take into account the 68HC12 specific call (PC + page). */
+ if (fi->extra_info->return_kind == RETURN_RTC
+ && addr >= 0x08000 && addr < 0x0c000
+ && USE_PAGE_REGISTER)
+ {
+ CORE_ADDR page_addr = fi->saved_regs[HARD_PAGE_REGNUM];
+
+ unsigned page = read_memory_unsigned_integer (page_addr, 1);
+ addr -= 0x08000;
+ addr += ((page & 0x0ff) << 14);
+ addr += 0x1000000;
+ }
fi->extra_info->return_pc = addr;
-#if 0
- printf ("Pc@0x%04x, FR 0x%04x, size %d, read ret @0x%04x -> 0x%04x\n",
- fi->pc,
- fi->frame, fi->size,
- addr & 0x0ffff,
- fi->return_pc);
-#endif
}
}
@@ -775,11 +933,18 @@ show_regs (char *args, int from_tty)
ccr & M6811_V_BIT ? 'V' : '-',
ccr & M6811_C_BIT ? 'C' : '-');
- printf_filtered ("D=%04x IX=%04x IY=%04x\n",
+ printf_filtered ("D=%04x IX=%04x IY=%04x",
(int) read_register (HARD_D_REGNUM),
(int) read_register (HARD_X_REGNUM),
(int) read_register (HARD_Y_REGNUM));
+ if (USE_PAGE_REGISTER)
+ {
+ printf_filtered (" Page=%02x",
+ (int) read_register (HARD_PAGE_REGNUM));
+ }
+ printf_filtered ("\n");
+
nr = 0;
for (i = SOFT_D1_REGNUM; i < M68HC11_ALL_REGS; i++)
{
@@ -887,7 +1052,20 @@ m68hc11_call_dummy_address (void)
static struct type *
m68hc11_register_virtual_type (int reg_nr)
{
- return builtin_type_uint16;
+ switch (reg_nr)
+ {
+ case HARD_PAGE_REGNUM:
+ case HARD_A_REGNUM:
+ case HARD_B_REGNUM:
+ case HARD_CCR_REGNUM:
+ return builtin_type_uint8;
+
+ case M68HC12_HARD_PC_REGNUM:
+ return builtin_type_uint32;
+
+ default:
+ return builtin_type_uint16;
+ }
}
static void
@@ -1010,7 +1188,35 @@ m68hc11_register_byte (int reg_nr)
static int
m68hc11_register_raw_size (int reg_nr)
{
- return M68HC11_REG_SIZE;
+ 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. */
+
+static void
+m68hc11_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
+{
+ unsigned char flags;
+
+ flags = ((elf_symbol_type *)sym)->internal_elf_sym.st_other;
+ if (flags & STO_M68HC12_FAR)
+ MSYMBOL_SET_RTC (msym);
+ if (flags & STO_M68HC12_INTERRUPT)
+ MSYMBOL_SET_RTI (msym);
}
static int
@@ -1030,31 +1236,58 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
{0};
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
+ int elf_flags;
soft_reg_initialized = 0;
-
+
+ /* Extract the elf_flags if available. */
+ if (info.abfd != NULL
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
+ elf_flags = elf_elfheader (info.abfd)->e_flags;
+ else
+ elf_flags = 0;
+
/* try to find a pre-existing architecture */
for (arches = gdbarch_list_lookup_by_info (arches, &info);
arches != NULL;
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
+ if (gdbarch_tdep (arches->gdbarch)->elf_flags != elf_flags)
+ continue;
+
return arches->gdbarch;
}
/* Need a new architecture. Fill in a target specific vector. */
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
+ tdep->elf_flags = elf_flags;
switch (info.bfd_arch_info->arch)
{
case bfd_arch_m68hc11:
tdep->stack_correction = 1;
+ tdep->use_page_register = 0;
tdep->prologue = m6811_prologue;
+ set_gdbarch_addr_bit (gdbarch, 16);
+ set_gdbarch_num_pseudo_regs (gdbarch, M68HC11_NUM_PSEUDO_REGS);
+ set_gdbarch_pc_regnum (gdbarch, HARD_PC_REGNUM);
+ set_gdbarch_num_regs (gdbarch, M68HC11_NUM_REGS);
break;
case bfd_arch_m68hc12:
tdep->stack_correction = 0;
+ tdep->use_page_register = elf_flags & E_M68HC12_BANKS;
tdep->prologue = m6812_prologue;
+ set_gdbarch_addr_bit (gdbarch, elf_flags & E_M68HC12_BANKS ? 32 : 16);
+ set_gdbarch_num_pseudo_regs (gdbarch,
+ elf_flags & E_M68HC12_BANKS
+ ? M68HC12_NUM_PSEUDO_REGS
+ : M68HC11_NUM_PSEUDO_REGS);
+ set_gdbarch_pc_regnum (gdbarch, elf_flags & E_M68HC12_BANKS
+ ? M68HC12_HARD_PC_REGNUM : HARD_PC_REGNUM);
+ set_gdbarch_num_regs (gdbarch, elf_flags & E_M68HC12_BANKS
+ ? M68HC12_NUM_REGS : M68HC11_NUM_REGS);
break;
default:
@@ -1066,10 +1299,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
programs. The size of these types should normally be set
according to the dwarf2 debug information. */
set_gdbarch_short_bit (gdbarch, 16);
- set_gdbarch_int_bit (gdbarch, 16);
+ set_gdbarch_int_bit (gdbarch, elf_flags & E_M68HC11_I32 ? 32 : 16);
set_gdbarch_float_bit (gdbarch, 32);
- set_gdbarch_double_bit (gdbarch, 64);
- set_gdbarch_long_double_bit (gdbarch, 64);
+ set_gdbarch_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32);
+ set_gdbarch_long_double_bit (gdbarch, elf_flags & E_M68HC11_F64 ? 64 : 32);
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 16);
set_gdbarch_long_long_bit (gdbarch, 64);
@@ -1090,17 +1323,14 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
- set_gdbarch_num_regs (gdbarch, M68HC11_NUM_REGS);
- set_gdbarch_num_pseudo_regs (gdbarch, M68HC11_NUM_PSEUDO_REGS);
set_gdbarch_sp_regnum (gdbarch, HARD_SP_REGNUM);
set_gdbarch_fp_regnum (gdbarch, SOFT_FP_REGNUM);
- set_gdbarch_pc_regnum (gdbarch, HARD_PC_REGNUM);
set_gdbarch_register_name (gdbarch, m68hc11_register_name);
set_gdbarch_register_size (gdbarch, 2);
set_gdbarch_register_bytes (gdbarch, M68HC11_ALL_REGS * 2);
set_gdbarch_register_virtual_type (gdbarch, m68hc11_register_virtual_type);
- set_gdbarch_fetch_pseudo_register (gdbarch, m68hc11_fetch_pseudo_register);
- set_gdbarch_store_pseudo_register (gdbarch, m68hc11_store_pseudo_register);
+ 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);
@@ -1117,16 +1347,15 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_extract_return_value (gdbarch, m68hc11_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, m68hc11_push_return_address);
set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack);
set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- m68hc11_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address);
set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
@@ -1142,8 +1371,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value);
- set_gdbarch_extract_struct_value_address
+ set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address
(gdbarch, m68hc11_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention);
set_gdbarch_init_extra_frame_info (gdbarch, m68hc11_init_extra_frame_info);
@@ -1156,6 +1385,10 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_stack_align (gdbarch, m68hc11_stack_align);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
+ /* Minsymbol frobbing. */
+ set_gdbarch_elf_make_msymbol_special (gdbarch,
+ m68hc11_elf_make_msymbol_special);
+
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
return gdbarch;
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 1c4bc4d4d1f..31e8e660dc8 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -27,6 +27,7 @@
#include "gdb_string.h"
#include "inferior.h"
#include "regcache.h"
+#include "arch-utils.h"
#define P_LINKL_FP 0x480e
@@ -41,6 +42,271 @@
#define P_FMOVM 0xf237
#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)
+
+#define NUM_FREGS (NUM_REGS-24)
+
+/* Offset from SP to first arg on stack at first instruction of a function */
+
+#define SP_ARG0 (1 * 4)
+
+/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
+ it corresponds to some offset in /usr/include/sys/user.h or
+ something like that. Using some system include file would
+ have the advantage of probably being more robust in the face
+ of OS upgrades, but the disadvantage of being wrong for
+ cross-debugging. */
+
+#define SIG_PC_FP_OFFSET 530
+
+#define TARGET_M68K
+
+
+#if !defined (BPT_VECTOR)
+#define BPT_VECTOR 0xf
+#endif
+
+#if !defined (REMOTE_BPT_VECTOR)
+#define REMOTE_BPT_VECTOR 1
+#endif
+
+
+void m68k_frame_init_saved_regs (struct frame_info *frame_info);
+
+
+/* gdbarch_breakpoint_from_pc is set to m68k_local_breakpoint_from_pc
+ so m68k_remote_breakpoint_from_pc is currently not used. */
+
+const static unsigned char *
+m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+const static unsigned char *
+m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+
+static int
+m68k_register_bytes_ok (long numbytes)
+{
+ return ((numbytes == REGISTER_BYTES_FP)
+ || (numbytes == REGISTER_BYTES_NOFP));
+}
+
+/* Number of bytes of storage in the actual machine representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12 bytes. */
+/* Note that the unsigned cast here forces the result of the
+ subtraction to very high positive values if regnum < FP0_REGNUM */
+
+static int
+m68k_register_raw_size (int regnum)
+{
+ return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+}
+
+/* Number of bytes of storage in the program's representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12-byte long doubles. */
+
+static int
+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. */
+
+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;
+}
+
+/* Function: m68k_register_name
+ Returns the name of the standard m68k register regnum. */
+
+static const char *
+m68k_register_name (int regnum)
+{
+ static char *register_names[] = {
+ "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+ "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
+ "ps", "pc",
+ "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
+ "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags"
+ };
+
+ if (regnum < 0 ||
+ regnum >= sizeof (register_names) / sizeof (register_names[0]))
+ internal_error (__FILE__, __LINE__,
+ "m68k_register_name: illegal register number %d", regnum);
+ else
+ return register_names[regnum];
+}
+
+/* Stack must be kept short aligned when doing function calls. */
+
+static CORE_ADDR
+m68k_stack_align (CORE_ADDR addr)
+{
+ return ((addr + 1) & ~1);
+}
+
+/* Index within `registers' of the first byte of the space for
+ register regnum. */
+
+static int
+m68k_register_byte (int regnum)
+{
+ if (regnum >= E_FPC_REGNUM)
+ return (((regnum - E_FPC_REGNUM) * 4) + 168);
+ else if (regnum >= FP0_REGNUM)
+ return (((regnum - FP0_REGNUM) * 12) + 72);
+ else
+ return (regnum * 4);
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+
+static void
+m68k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (E_A1_REGNUM, addr);
+}
+
+/* Extract from an array regbuf containing the (raw) register state
+ a function return value of type type, and copy that, in virtual format,
+ into valbuf. This is assuming that floating point values are returned
+ as doubles in d0/d1. */
+
+static void
+m68k_deprecated_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf)
+{
+ int offset = 0;
+ int typeLength = TYPE_LENGTH (type);
+
+ if (typeLength < 4)
+ offset = 4 - typeLength;
+
+ memcpy (valbuf, regbuf + offset, typeLength);
+}
+
+static CORE_ADDR
+m68k_deprecated_extract_struct_value_address (char *regbuf)
+{
+ return (*(CORE_ADDR *) (regbuf));
+}
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. Assumes floats are passed
+ in d0/d1. */
+
+static void
+m68k_store_return_value (struct type *type, char *valbuf)
+{
+ write_register_bytes (0, valbuf, TYPE_LENGTH (type));
+}
+
+/* Describe the pointer in each stack frame to the previous stack frame
+ (its caller). */
+
+/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
+ chain-pointer.
+ In the case of the 68000, the frame's nominal address
+ is the address of a 4-byte word containing the calling frame's address. */
+
+/* If we are chaining from sigtramp, then manufacture a sigtramp frame
+ (which isn't really on the stack. I'm not sure this is right for anything
+ but BSD4.3 on an hp300. */
+
+static CORE_ADDR
+m68k_frame_chain (struct frame_info *thisframe)
+{
+ if (thisframe->signal_handler_caller)
+ return thisframe->frame;
+ else if (!inside_entry_file ((thisframe)->pc))
+ return read_memory_integer ((thisframe)->frame, 4);
+ else
+ return 0;
+}
+
+/* A function that tells us whether the function invocation represented
+ by fi does not have a frame on the stack associated with it. If it
+ does not, FRAMELESS is set to 1, else 0. */
+
+static int
+m68k_frameless_function_invocation (struct frame_info *fi)
+{
+ if (fi->signal_handler_caller)
+ return 0;
+ else
+ return frameless_look_for_prologue (fi);
+}
+
+static CORE_ADDR
+m68k_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ {
+ if (frame->next)
+ return read_memory_integer (frame->next->frame + SIG_PC_FP_OFFSET, 4);
+ else
+ return read_memory_integer (read_register (SP_REGNUM)
+ + SIG_PC_FP_OFFSET - 8, 4);
+ }
+ else
+ return read_memory_integer (frame->frame + 4, 4);
+}
+
+
/* The only reason this is here is the tm-altos.h reference below. It
was moved back here from tm-m68k.h. FIXME? */
@@ -81,11 +347,11 @@ delta68_frame_args_address (struct frame_info *frame_info)
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)
- return frame_info->next->frame + 16;
- else
- return frame_info->frame + 4;
+ /* Check for an interrupted system call */
+ if (frame_info->next && frame_info->next->signal_handler_caller)
+ return frame_info->next->frame + 16;
+ else
+ return frame_info->frame + 4;
}
else
return frame_info->frame;
@@ -166,6 +432,20 @@ news_frame_num_args (struct frame_info *fi)
return val;
}
+/* Insert the specified number of args and function address
+ into a call sequence of the above form stored at DUMMYNAME.
+ We use the BFD routines to store a big-endian value of known size. */
+
+void
+m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ struct value **args, struct type *type, int gcc_p)
+{
+ bfd_putb32 (fun, (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 2);
+ bfd_putb32 (nargs * 4,
+ (unsigned char *) dummy + CALL_DUMMY_START_OFFSET + 8);
+}
+
+
/* Push an empty stack frame, to record the current PC, etc. */
void
@@ -204,29 +484,30 @@ m68k_pop_frame (void)
register struct frame_info *frame = get_current_frame ();
register CORE_ADDR fp;
register int regnum;
- struct frame_saved_regs fsr;
char raw_buffer[12];
fp = FRAME_FP (frame);
- get_frame_saved_regs (frame, &fsr);
+ m68k_frame_init_saved_regs (frame);
for (regnum = FP0_REGNUM + 7; regnum >= FP0_REGNUM; regnum--)
{
- if (fsr.regs[regnum])
+ if (frame->saved_regs[regnum])
{
- read_memory (fsr.regs[regnum], raw_buffer, 12);
+ read_memory (frame->saved_regs[regnum], raw_buffer, 12);
write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, 12);
}
}
for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--)
{
- if (fsr.regs[regnum])
+ if (frame->saved_regs[regnum])
{
- write_register (regnum, read_memory_integer (fsr.regs[regnum], 4));
+ write_register (regnum,
+ read_memory_integer (frame->saved_regs[regnum], 4));
}
}
- if (fsr.regs[PS_REGNUM])
+ if (frame->saved_regs[PS_REGNUM])
{
- write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4));
+ write_register (PS_REGNUM,
+ read_memory_integer (frame->saved_regs[PS_REGNUM], 4));
}
write_register (FP_REGNUM, read_memory_integer (fp, 4));
write_register (PC_REGNUM, read_memory_integer (fp + 4, 4));
@@ -278,7 +559,7 @@ m68k_skip_prologue (CORE_ADDR ip)
If so, ensure we don't go past it. If not, assume "infinity". */
sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : (CORE_ADDR) ~ 0;
+ limit = (sal.end) ? sal.end : (CORE_ADDR) ~0;
while (ip < limit)
{
@@ -298,14 +579,19 @@ m68k_skip_prologue (CORE_ADDR ip)
else if (op == P_FMOVM)
ip += 10; /* Skip fmovm */
else
- break; /* Found unknown code, bail out. */
+ break; /* Found unknown code, bail out. */
}
return (ip);
}
+/* Store the addresses of the saved registers of the frame described by
+ FRAME_INFO in its saved_regs field.
+ This includes special registers such as pc and fp saved in special
+ ways in the stack frame. sp is even more special:
+ the address we return for it IS the sp for the next frame. */
+
void
-m68k_find_saved_regs (struct frame_info *frame_info,
- struct frame_saved_regs *saved_regs)
+m68k_frame_init_saved_regs (struct frame_info *frame_info)
{
register int regnum;
register int regmask;
@@ -314,10 +600,17 @@ m68k_find_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 - CALL_DUMMY_LENGTH - FP_REGNUM * 4 - 4 - 8 * 12;
+ (frame_info)->frame - 28 - FP_REGNUM * 4 - 4 - 8 * 12;
int nextinsn;
- memset (saved_regs, 0, sizeof (*saved_regs));
+
+ if (frame_info->saved_regs)
+ return;
+
+ frame_saved_regs_zalloc (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)
{
@@ -367,7 +660,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
next_addr += read_memory_integer (pc += 2, 4), pc += 4;
}
- for ( ; ; )
+ for (;;)
{
nextinsn = 0xffff & read_memory_integer (pc, 2);
regmask = read_memory_integer (pc + 2, 2);
@@ -377,7 +670,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
/* Regmask's low bit is for register fp7, the first pushed */
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
- saved_regs->regs[regnum] = (next_addr -= 12);
+ frame_info->saved_regs[regnum] = (next_addr -= 12);
pc += 4;
}
/* fmovemx to (fp + displacement) */
@@ -390,7 +683,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
{
- saved_regs->regs[regnum] = addr;
+ frame_info->saved_regs[regnum] = addr;
addr += 12;
}
pc += 6;
@@ -402,7 +695,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
{
- saved_regs->regs[regnum] = next_addr;
+ frame_info->saved_regs[regnum] = next_addr;
next_addr += 4;
}
pc += 4;
@@ -417,7 +710,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
for (regnum = 0; regnum < 16; regnum++, regmask >>= 1)
if (regmask & 1)
{
- saved_regs->regs[regnum] = addr;
+ frame_info->saved_regs[regnum] = addr;
addr += 4;
}
pc += 6;
@@ -428,14 +721,14 @@ m68k_find_saved_regs (struct frame_info *frame_info,
/* Regmask's low bit is for register 15, the first pushed */
for (regnum = 16; --regnum >= 0; regmask >>= 1)
if (regmask & 1)
- saved_regs->regs[regnum] = (next_addr -= 4);
+ frame_info->saved_regs[regnum] = (next_addr -= 4);
pc += 4;
}
/* movl r,-(sp) */
else if (0x2f00 == (0xfff0 & nextinsn))
{
regnum = 0xf & nextinsn;
- saved_regs->regs[regnum] = (next_addr -= 4);
+ frame_info->saved_regs[regnum] = (next_addr -= 4);
pc += 2;
}
/* fmovemx to index of sp */
@@ -445,7 +738,7 @@ m68k_find_saved_regs (struct frame_info *frame_info,
for (regnum = FP0_REGNUM + 8; --regnum >= FP0_REGNUM; regmask >>= 1)
if (regmask & 1)
{
- saved_regs->regs[regnum] = next_addr;
+ frame_info->saved_regs[regnum] = next_addr;
next_addr += 12;
}
pc += 10;
@@ -453,20 +746,21 @@ m68k_find_saved_regs (struct frame_info *frame_info,
/* clrw -(sp); movw ccr,-(sp) */
else if (0x4267 == nextinsn && 0x42e7 == regmask)
{
- saved_regs->regs[PS_REGNUM] = (next_addr -= 4);
+ frame_info->saved_regs[PS_REGNUM] = (next_addr -= 4);
pc += 4;
}
else
break;
}
lose:;
- saved_regs->regs[SP_REGNUM] = (frame_info)->frame + 8;
- saved_regs->regs[FP_REGNUM] = (frame_info)->frame;
- saved_regs->regs[PC_REGNUM] = (frame_info)->frame + 4;
+ frame_info->saved_regs[SP_REGNUM] = (frame_info)->frame + 8;
+ frame_info->saved_regs[FP_REGNUM] = (frame_info)->frame;
+ 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)
- saved_regs->regs[SP_REGNUM] = frame_info->next->frame + SIG_SP_FP_OFFSET;
+ frame_info->saved_regs[SP_REGNUM] =
+ frame_info->next->frame + SIG_SP_FP_OFFSET;
#endif
}
@@ -567,14 +861,14 @@ supply_fpregset (fpregset_t *fpregsetp)
register int regi;
char *from;
- for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++)
+ for (regi = FP0_REGNUM; regi < E_FPC_REGNUM; regi++)
{
from = (char *) &(fpregsetp->f_fpregs[regi - FP0_REGNUM][0]);
supply_register (regi, from);
}
- supply_register (FPC_REGNUM, (char *) &(fpregsetp->f_pcr));
- supply_register (FPS_REGNUM, (char *) &(fpregsetp->f_psr));
- supply_register (FPI_REGNUM, (char *) &(fpregsetp->f_fpiaddr));
+ 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));
}
/* Given a pointer to a floating point register set in /proc format
@@ -589,7 +883,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
char *to;
char *from;
- for (regi = FP0_REGNUM; regi < FPC_REGNUM; regi++)
+ for (regi = FP0_REGNUM; regi < E_FPC_REGNUM; regi++)
{
if ((regno == -1) || (regno == regi))
{
@@ -598,17 +892,17 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
- if ((regno == -1) || (regno == FPC_REGNUM))
+ if ((regno == -1) || (regno == E_FPC_REGNUM))
{
- fpregsetp->f_pcr = *(int *) &registers[REGISTER_BYTE (FPC_REGNUM)];
+ fpregsetp->f_pcr = *(int *) &registers[REGISTER_BYTE (E_FPC_REGNUM)];
}
- if ((regno == -1) || (regno == FPS_REGNUM))
+ if ((regno == -1) || (regno == E_FPS_REGNUM))
{
- fpregsetp->f_psr = *(int *) &registers[REGISTER_BYTE (FPS_REGNUM)];
+ fpregsetp->f_psr = *(int *) &registers[REGISTER_BYTE (E_FPS_REGNUM)];
}
- if ((regno == -1) || (regno == FPI_REGNUM))
+ if ((regno == -1) || (regno == E_FPI_REGNUM))
{
- fpregsetp->f_fpiaddr = *(int *) &registers[REGISTER_BYTE (FPI_REGNUM)];
+ fpregsetp->f_fpiaddr = *(int *) &registers[REGISTER_BYTE (E_FPI_REGNUM)];
}
}
@@ -636,9 +930,8 @@ m68k_get_longjmp_target (CORE_ADDR *pc)
buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
sp = read_register (SP_REGNUM);
- if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
- buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
+ if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
+ buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
@@ -677,9 +970,112 @@ m68k_saved_pc_after_call (struct frame_info *frame)
return read_memory_integer (read_register (SP_REGNUM), 4);
}
+/* Function: m68k_gdbarch_init
+ Initializer function for the m68k gdbarch vector.
+ Called by gdbarch. Sets up the gdbarch vector(s) for this target. */
+
+static struct gdbarch *
+m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ static LONGEST call_dummy_words[7] = { 0xf227e0ff, 0x48e7fffc, 0x426742e7,
+ 0x4eb93232, 0x3232dffc, 0x69696969,
+ (0x4e404e71 | (BPT_VECTOR << 16))
+ };
+ struct gdbarch_tdep *tdep = NULL;
+ struct gdbarch *gdbarch;
+
+ /* find a candidate among the list of pre-declared architectures. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return (arches->gdbarch);
+
+#if 0
+ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
+#endif
+
+ gdbarch = gdbarch_alloc (&info, 0);
+
+ set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
+ set_gdbarch_long_double_bit (gdbarch, 96);
+
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue);
+ set_gdbarch_saved_pc_after_call (gdbarch, m68k_saved_pc_after_call);
+ set_gdbarch_breakpoint_from_pc (gdbarch, m68k_local_breakpoint_from_pc);
+
+ /* Stack grows down. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_stack_align (gdbarch, m68k_stack_align);
+
+
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+ set_gdbarch_decr_pc_after_break (gdbarch, 2);
+
+ set_gdbarch_store_struct_return (gdbarch, m68k_store_struct_return);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ m68k_deprecated_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, m68k_store_return_value);
+
+ set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
+ set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ m68k_frameless_function_invocation);
+ /* 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);
+ set_gdbarch_max_register_raw_size (gdbarch, 12);
+ set_gdbarch_max_register_virtual_size (gdbarch, 12);
+ set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type);
+ set_gdbarch_register_name (gdbarch, m68k_register_name);
+ set_gdbarch_register_size (gdbarch, 4);
+ set_gdbarch_register_byte (gdbarch, m68k_register_byte);
+ 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_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_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_call_dummy_length (gdbarch, 28);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 12);
+
+ set_gdbarch_call_dummy_words (gdbarch, call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (call_dummy_words));
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
+ set_gdbarch_push_dummy_frame (gdbarch, m68k_push_dummy_frame);
+ set_gdbarch_pop_frame (gdbarch, m68k_pop_frame);
+
+ return gdbarch;
+}
+
+
+static void
+m68k_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+
+}
void
_initialize_m68k_tdep (void)
{
+ gdbarch_register (bfd_arch_m68k, m68k_gdbarch_init, m68k_dump_tdep);
tm_print_insn = print_insn_m68k;
}
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 82a6124a7aa..add14902698 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -704,7 +704,7 @@ static struct core_fns linux_elf_core_fns =
};
void
-_initialize_m68k_linux_nat ()
+_initialize_m68k_linux_nat (void)
{
add_core_fns (&linux_elf_core_fns);
}
diff --git a/gdb/m88k-nat.c b/gdb/m88k-nat.c
index b631cda2735..11bde5782bc 100644
--- a/gdb/m88k-nat.c
+++ b/gdb/m88k-nat.c
@@ -1,290 +1,290 @@
-/* Native-dependent Motorola 88xxx support for GDB, the GNU Debugger.
- Copyright 1988, 1990, 1991, 1992, 1993, 1995, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "regcache.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include "gdbcore.h"
-#include <sys/user.h>
-
-#ifndef USER /* added to support BCS ptrace_user */
-#define USER ptrace_user
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include "gdb_stat.h"
-
-#include "symtab.h"
-#include "setjmp.h"
-#include "value.h"
-
-#ifdef DELTA88
-#include <sys/ptrace.h>
-
-/* define offsets to the pc instruction offsets in ptrace_user struct */
-#define SXIP_OFFSET ((char *)&u.pt_sigframe.sig_sxip - (char *)&u)
-#define SNIP_OFFSET ((char *)&u.pt_sigframe.sig_snip - (char *)&u)
-#define SFIP_OFFSET ((char *)&u.pt_sigframe.sig_sfip - (char *)&u)
-#else
-/* define offsets to the pc instruction offsets in ptrace_user struct */
-#define SXIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_sxip - (char *)&u)
-#define SNIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_snip - (char *)&u)
-#define SFIP_OFFSET ((char *)&u.pt_sigframe.dg_sigframe.sc_sfip - (char *)&u)
-#endif
-
-extern int have_symbol_file_p ();
-
-extern jmp_buf stack_jmp;
-
-extern int errno;
-
-void
-fetch_inferior_registers (int regno)
-{
- register unsigned int regaddr;
- char buf[MAX_REGISTER_RAW_SIZE];
- register int i;
-
- struct USER u;
- unsigned int offset;
-
- offset = (char *) &u.pt_r0 - (char *) &u;
- regaddr = offset; /* byte offset to r0; */
-
-/* offset = ptrace (3, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) offset, 0) - KERNEL_U_ADDR; */
- for (regno = 0; regno < NUM_REGS; regno++)
- {
- /*regaddr = register_addr (regno, offset); */
- /* 88k enhancement */
-
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
- {
- *(int *) &buf[i] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, 0);
- regaddr += sizeof (int);
- }
- supply_register (regno, buf);
- }
- /* now load up registers 36 - 38; special pc registers */
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, 0);
- supply_register (SXIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, 0);
- supply_register (SNIP_REGNUM, buf);
- *(int *) &buf[0] = ptrace (3, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, 0);
- supply_register (SFIP_REGNUM, buf);
-}
-
-/* Store our register values back into the inferior.
- If REGNO is -1, do this for all registers.
- Otherwise, REGNO specifies which register (so we can save time). */
-
-void
-store_inferior_registers (int regno)
-{
- register unsigned int regaddr;
- char buf[80];
-
- struct USER u;
-
- unsigned int offset = (char *) &u.pt_r0 - (char *) &u;
-
- regaddr = offset;
-
- /* Don't try to deal with EXIP_REGNUM or ENIP_REGNUM, because I think either
- svr3 doesn't run on an 88110, or the kernel isolates the different (not
- completely sure this is true, but seems to be. */
- if (regno >= 0)
- {
- /* regaddr = register_addr (regno, offset); */
- if (regno < PC_REGNUM)
- {
- regaddr = offset + regno * sizeof (int);
- errno = 0;
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- else if (regno == SXIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (regno));
- else if (regno == SNIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (regno));
- else if (regno == SFIP_REGNUM)
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (regno));
- else
- printf_unfiltered ("Bad register number for store_inferior routine\n");
- }
- else
- {
- for (regno = 0; regno < PC_REGNUM; regno++)
- {
- /* regaddr = register_addr (regno, offset); */
- errno = 0;
- regaddr = offset + regno * sizeof (int);
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) regaddr, read_register (regno));
- if (errno != 0)
- {
- sprintf (buf, "writing register number %d", regno);
- perror_with_name (buf);
- }
- }
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SXIP_OFFSET, read_register (SXIP_REGNUM));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SNIP_OFFSET, read_register (SNIP_REGNUM));
- ptrace (6, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) SFIP_OFFSET, read_register (SFIP_REGNUM));
- }
-}
-
-
-/* blockend is the address of the end of the user structure */
-m88k_register_u_addr (int blockend, int regnum)
-{
- struct USER u;
- int ustart = blockend - sizeof (struct USER);
- switch (regnum)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- case 30:
- case 31:
- return (ustart + ((int) &u.pt_r0 - (int) &u) + REGISTER_SIZE * regnum);
- case PSR_REGNUM:
- return (ustart + ((int) &u.pt_psr - (int) &u));
- case FPSR_REGNUM:
- return (ustart + ((int) &u.pt_fpsr - (int) &u));
- case FPCR_REGNUM:
- return (ustart + ((int) &u.pt_fpcr - (int) &u));
- case SXIP_REGNUM:
- return (ustart + SXIP_OFFSET);
- case SNIP_REGNUM:
- return (ustart + SNIP_OFFSET);
- case SFIP_REGNUM:
- return (ustart + SFIP_OFFSET);
- default:
- if (regnum < NUM_REGS)
- /* The register is one of those which is not defined...
- give it zero */
- return (ustart + ((int) &u.pt_r0 - (int) &u));
- else
- return (blockend + REGISTER_SIZE * regnum);
- }
-}
-
-#ifdef USE_PROC_FS
-
-#include <sys/procfs.h>
-
-/* Prototypes for supply_gregset etc. */
-#include "gregset.h"
-
-/* Given a pointer to a general register set in /proc format (gregset_t *),
- unpack the register contents and supply them as gdb's idea of the current
- register values. */
-
-void
-supply_gregset (gregset_t *gregsetp)
-{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regi = 0; regi <= SP_REGNUM; regi++)
- supply_register (regi, (char *) (regp + regi));
-
- supply_register (SXIP_REGNUM, (char *) (regp + R_XIP));
- supply_register (SNIP_REGNUM, (char *) (regp + R_NIP));
- supply_register (SFIP_REGNUM, (char *) (regp + R_FIP));
- supply_register (PSR_REGNUM, (char *) (regp + R_PSR));
- supply_register (FPSR_REGNUM, (char *) (regp + R_FPSR));
- supply_register (FPCR_REGNUM, (char *) (regp + R_FPCR));
-}
-
-void
-fill_gregset (gregset_t *gregsetp, int regno)
-{
- int regi;
- register greg_t *regp = (greg_t *) gregsetp;
-
- for (regi = 0; regi <= R_R31; regi++)
- if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(int *) &registers[REGISTER_BYTE (regi)];
-
- if ((regno == -1) || (regno == SXIP_REGNUM))
- *(regp + R_XIP) = *(int *) &registers[REGISTER_BYTE (SXIP_REGNUM)];
- if ((regno == -1) || (regno == SNIP_REGNUM))
- *(regp + R_NIP) = *(int *) &registers[REGISTER_BYTE (SNIP_REGNUM)];
- if ((regno == -1) || (regno == SFIP_REGNUM))
- *(regp + R_FIP) = *(int *) &registers[REGISTER_BYTE (SFIP_REGNUM)];
- if ((regno == -1) || (regno == PSR_REGNUM))
- *(regp + R_PSR) = *(int *) &registers[REGISTER_BYTE (PSR_REGNUM)];
- if ((regno == -1) || (regno == FPSR_REGNUM))
- *(regp + R_FPSR) = *(int *) &registers[REGISTER_BYTE (FPSR_REGNUM)];
- if ((regno == -1) || (regno == FPCR_REGNUM))
- *(regp + R_FPCR) = *(int *) &registers[REGISTER_BYTE (FPCR_REGNUM)];
-}
-
-#endif /* USE_PROC_FS */
+// 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 <sys/types.h>
+// OBSOLETE #include <sys/param.h>
+// OBSOLETE #include <sys/dir.h>
+// OBSOLETE #include <signal.h>
+// OBSOLETE #include "gdbcore.h"
+// OBSOLETE #include <sys/user.h>
+// OBSOLETE
+// OBSOLETE #ifndef USER /* added to support BCS ptrace_user */
+// OBSOLETE #define USER ptrace_user
+// OBSOLETE #endif
+// OBSOLETE #include <sys/ioctl.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE #include <sys/file.h>
+// OBSOLETE #include "gdb_stat.h"
+// OBSOLETE
+// OBSOLETE #include "symtab.h"
+// OBSOLETE #include "setjmp.h"
+// OBSOLETE #include "value.h"
+// OBSOLETE
+// OBSOLETE #ifdef DELTA88
+// OBSOLETE #include <sys/ptrace.h>
+// 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 <sys/procfs.h>
+// 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 *) &registers[REGISTER_BYTE (regi)];
+// OBSOLETE
+// OBSOLETE if ((regno == -1) || (regno == SXIP_REGNUM))
+// OBSOLETE *(regp + R_XIP) = *(int *) &registers[REGISTER_BYTE (SXIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == SNIP_REGNUM))
+// OBSOLETE *(regp + R_NIP) = *(int *) &registers[REGISTER_BYTE (SNIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == SFIP_REGNUM))
+// OBSOLETE *(regp + R_FIP) = *(int *) &registers[REGISTER_BYTE (SFIP_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == PSR_REGNUM))
+// OBSOLETE *(regp + R_PSR) = *(int *) &registers[REGISTER_BYTE (PSR_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == FPSR_REGNUM))
+// OBSOLETE *(regp + R_FPSR) = *(int *) &registers[REGISTER_BYTE (FPSR_REGNUM)];
+// OBSOLETE if ((regno == -1) || (regno == FPCR_REGNUM))
+// OBSOLETE *(regp + R_FPCR) = *(int *) &registers[REGISTER_BYTE (FPCR_REGNUM)];
+// OBSOLETE }
+// OBSOLETE
+// OBSOLETE #endif /* USE_PROC_FS */
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index 3c96d37a8de..da0b67ca3d5 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -1,661 +1,661 @@
-/* Target-machine dependent code for Motorola 88000 series, for GDB.
-
- Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
- 2000, 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "frame.h"
-#include "inferior.h"
-#include "value.h"
-#include "gdbcore.h"
-#include "symtab.h"
-#include "setjmp.h"
-#include "value.h"
-#include "regcache.h"
-
-/* Size of an instruction */
-#define BYTES_PER_88K_INSN 4
-
-void frame_find_saved_regs ();
-
-/* Is this target an m88110? Otherwise assume m88100. This has
- relevance for the ways in which we screw with instruction pointers. */
-
-int target_is_m88110 = 0;
-
-void
-m88k_target_write_pc (CORE_ADDR pc, ptid_t ptid)
-{
- /* According to the MC88100 RISC Microprocessor User's Manual,
- section 6.4.3.1.2:
-
- ... can be made to return to a particular instruction by placing
- a valid instruction address in the SNIP and the next sequential
- instruction address in the SFIP (with V bits set and E bits
- clear). The rte resumes execution at the instruction pointed to
- by the SNIP, then the SFIP.
-
- The E bit is the least significant bit (bit 0). The V (valid)
- bit is bit 1. This is why we logical or 2 into the values we are
- writing below. It turns out that SXIP plays no role when
- returning from an exception so nothing special has to be done
- with it. We could even (presumably) give it a totally bogus
- value.
-
- -- Kevin Buettner */
-
- write_register_pid (SXIP_REGNUM, pc, ptid);
- write_register_pid (SNIP_REGNUM, (pc | 2), ptid);
- write_register_pid (SFIP_REGNUM, (pc | 2) + 4, ptid);
-}
-
-/* The type of a register. */
-struct type *
-m88k_register_type (int regnum)
-{
- if (regnum >= XFP_REGNUM)
- return builtin_type_m88110_ext;
- else if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
- return builtin_type_void_func_ptr;
- else
- return builtin_type_int32;
-}
-
-
-/* The m88k kernel aligns all instructions on 4-byte boundaries. The
- kernel also uses the least significant two bits for its own hocus
- pocus. When gdb receives an address from the kernel, it needs to
- preserve those right-most two bits, but gdb also needs to be careful
- to realize that those two bits are not really a part of the address
- of an instruction. Shrug. */
-
-CORE_ADDR
-m88k_addr_bits_remove (CORE_ADDR addr)
-{
- return ((addr) & ~3);
-}
-
-
-/* Given a GDB frame, determine the address of the calling function's frame.
- This will be used to create a new GDB frame struct, and then
- INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
-
- For us, the frame address is its stack pointer value, so we look up
- the function prologue to determine the caller's sp value, and return it. */
-
-CORE_ADDR
-frame_chain (struct frame_info *thisframe)
-{
-
- frame_find_saved_regs (thisframe, (struct frame_saved_regs *) 0);
- /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
- the ADDRESS, of SP_REGNUM. It also depends on the cache of
- frame_find_saved_regs results. */
- if (thisframe->fsr->regs[SP_REGNUM])
- return thisframe->fsr->regs[SP_REGNUM];
- else
- return thisframe->frame; /* Leaf fn -- next frame up has same SP. */
-}
-
-int
-frameless_function_invocation (struct frame_info *frame)
-{
-
- frame_find_saved_regs (frame, (struct frame_saved_regs *) 0);
- /* NOTE: this depends on frame_find_saved_regs returning the VALUE, not
- the ADDRESS, of SP_REGNUM. It also depends on the cache of
- frame_find_saved_regs results. */
- if (frame->fsr->regs[SP_REGNUM])
- return 0; /* Frameful -- return addr saved somewhere */
- else
- return 1; /* Frameless -- no saved return address */
-}
-
-void
-init_extra_frame_info (int fromleaf, struct frame_info *frame)
-{
- frame->fsr = 0; /* Not yet allocated */
- frame->args_pointer = 0; /* Unknown */
- frame->locals_pointer = 0; /* Unknown */
-}
-
-/* Examine an m88k function prologue, recording the addresses at which
- registers are saved explicitly by the prologue code, and returning
- the address of the first instruction after the prologue (but not
- after the instruction at address LIMIT, as explained below).
-
- LIMIT places an upper bound on addresses of the instructions to be
- examined. If the prologue code scan reaches LIMIT, the scan is
- aborted and LIMIT is returned. This is used, when examining the
- prologue for the current frame, to keep examine_prologue () from
- claiming that a given register has been saved when in fact the
- instruction that saves it has not yet been executed. LIMIT is used
- at other times to stop the scan when we hit code after the true
- function prologue (e.g. for the first source line) which might
- otherwise be mistaken for function prologue.
-
- The format of the function prologue matched by this routine is
- derived from examination of the source to gcc 1.95, particularly
- the routine output_prologue () in config/out-m88k.c.
-
- subu r31,r31,n # stack pointer update
-
- (st rn,r31,offset)? # save incoming regs
- (st.d rn,r31,offset)?
-
- (addu r30,r31,n)? # frame pointer update
-
- (pic sequence)? # PIC code prologue
-
- (or rn,rm,0)? # Move parameters to other regs
- */
-
-/* Macros for extracting fields from instructions. */
-
-#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
-#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
-#define SUBU_OFFSET(x) ((unsigned)(x & 0xFFFF))
-#define ST_OFFSET(x) ((unsigned)((x) & 0xFFFF))
-#define ST_SRC(x) EXTRACT_FIELD ((x), 21, 5)
-#define ADDU_OFFSET(x) ((unsigned)(x & 0xFFFF))
-
-/*
- * prologue_insn_tbl is a table of instructions which may comprise a
- * function prologue. Associated with each table entry (corresponding
- * to a single instruction or group of instructions), is an action.
- * This action is used by examine_prologue (below) to determine
- * the state of certain machine registers and where the stack frame lives.
- */
-
-enum prologue_insn_action
-{
- PIA_SKIP, /* don't care what the instruction does */
- PIA_NOTE_ST, /* note register stored and where */
- PIA_NOTE_STD, /* note pair of registers stored and where */
- PIA_NOTE_SP_ADJUSTMENT, /* note stack pointer adjustment */
- PIA_NOTE_FP_ASSIGNMENT, /* note frame pointer assignment */
- PIA_NOTE_PROLOGUE_END, /* no more prologue */
-};
-
-struct prologue_insns
- {
- unsigned long insn;
- unsigned long mask;
- enum prologue_insn_action action;
- };
-
-struct prologue_insns prologue_insn_tbl[] =
-{
- /* Various register move instructions */
- {0x58000000, 0xf800ffff, PIA_SKIP}, /* or/or.u with immed of 0 */
- {0xf4005800, 0xfc1fffe0, PIA_SKIP}, /* or rd, r0, rs */
- {0xf4005800, 0xfc00ffff, PIA_SKIP}, /* or rd, rs, r0 */
-
- /* Stack pointer setup: "subu sp, sp, n" where n is a multiple of 8 */
- {0x67ff0000, 0xffff0007, PIA_NOTE_SP_ADJUSTMENT},
-
- /* Frame pointer assignment: "addu r30, r31, n" */
- {0x63df0000, 0xffff0000, PIA_NOTE_FP_ASSIGNMENT},
-
- /* Store to stack instructions; either "st rx, sp, n" or "st.d rx, sp, n" */
- {0x241f0000, 0xfc1f0000, PIA_NOTE_ST}, /* st rx, sp, n */
- {0x201f0000, 0xfc1f0000, PIA_NOTE_STD}, /* st.d rs, sp, n */
-
- /* Instructions needed for setting up r25 for pic code. */
- {0x5f200000, 0xffff0000, PIA_SKIP}, /* or.u r25, r0, offset_high */
- {0xcc000002, 0xffffffff, PIA_SKIP}, /* bsr.n Lab */
- {0x5b390000, 0xffff0000, PIA_SKIP}, /* or r25, r25, offset_low */
- {0xf7396001, 0xffffffff, PIA_SKIP}, /* Lab: addu r25, r25, r1 */
-
- /* Various branch or jump instructions which have a delay slot -- these
- do not form part of the prologue, but the instruction in the delay
- slot might be a store instruction which should be noted. */
- {0xc4000000, 0xe4000000, PIA_NOTE_PROLOGUE_END},
- /* br.n, bsr.n, bb0.n, or bb1.n */
- {0xec000000, 0xfc000000, PIA_NOTE_PROLOGUE_END}, /* bcnd.n */
- {0xf400c400, 0xfffff7e0, PIA_NOTE_PROLOGUE_END} /* jmp.n or jsr.n */
-
-};
-
-
-/* Fetch the instruction at ADDR, returning 0 if ADDR is beyond LIM or
- is not the address of a valid instruction, the address of the next
- instruction beyond ADDR otherwise. *PWORD1 receives the first word
- of the instruction. */
-
-#define NEXT_PROLOGUE_INSN(addr, lim, pword1) \
- (((addr) < (lim)) ? next_insn (addr, pword1) : 0)
-
-/* Read the m88k instruction at 'memaddr' and return the address of
- the next instruction after that, or 0 if 'memaddr' is not the
- address of a valid instruction. The instruction
- is stored at 'pword1'. */
-
-CORE_ADDR
-next_insn (CORE_ADDR memaddr, unsigned long *pword1)
-{
- *pword1 = read_memory_integer (memaddr, BYTES_PER_88K_INSN);
- return memaddr + BYTES_PER_88K_INSN;
-}
-
-/* Read a register from frames called by us (or from the hardware regs). */
-
-static int
-read_next_frame_reg (struct frame_info *frame, int regno)
-{
- for (; frame; frame = frame->next)
- {
- if (regno == SP_REGNUM)
- return FRAME_FP (frame);
- else if (frame->fsr->regs[regno])
- return read_memory_integer (frame->fsr->regs[regno], 4);
- }
- return read_register (regno);
-}
-
-/* Examine the prologue of a function. `ip' points to the first instruction.
- `limit' is the limit of the prologue (e.g. the addr of the first
- linenumber, or perhaps the program counter if we're stepping through).
- `frame_sp' is the stack pointer value in use in this frame.
- `fsr' is a pointer to a frame_saved_regs structure into which we put
- info about the registers saved by this frame.
- `fi' is a struct frame_info pointer; we fill in various fields in it
- to reflect the offsets of the arg pointer and the locals pointer. */
-
-static CORE_ADDR
-examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
- CORE_ADDR frame_sp, struct frame_saved_regs *fsr,
- struct frame_info *fi)
-{
- register CORE_ADDR next_ip;
- register int src;
- unsigned long insn;
- int size, offset;
- char must_adjust[32]; /* If set, must adjust offsets in fsr */
- int sp_offset = -1; /* -1 means not set (valid must be mult of 8) */
- int fp_offset = -1; /* -1 means not set */
- CORE_ADDR frame_fp;
- CORE_ADDR prologue_end = 0;
-
- memset (must_adjust, '\0', sizeof (must_adjust));
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn);
-
- while (next_ip)
- {
- struct prologue_insns *pip;
-
- for (pip = prologue_insn_tbl; (insn & pip->mask) != pip->insn;)
- if (++pip >= prologue_insn_tbl + sizeof prologue_insn_tbl)
- goto end_of_prologue_found; /* not a prologue insn */
-
- switch (pip->action)
- {
- case PIA_NOTE_ST:
- case PIA_NOTE_STD:
- if (sp_offset != -1)
- {
- src = ST_SRC (insn);
- offset = ST_OFFSET (insn);
- must_adjust[src] = 1;
- fsr->regs[src++] = offset; /* Will be adjusted later */
- if (pip->action == PIA_NOTE_STD && src < 32)
- {
- offset += 4;
- must_adjust[src] = 1;
- fsr->regs[src++] = offset;
- }
- }
- else
- goto end_of_prologue_found;
- break;
- case PIA_NOTE_SP_ADJUSTMENT:
- if (sp_offset == -1)
- sp_offset = -SUBU_OFFSET (insn);
- else
- goto end_of_prologue_found;
- break;
- case PIA_NOTE_FP_ASSIGNMENT:
- if (fp_offset == -1)
- fp_offset = ADDU_OFFSET (insn);
- else
- goto end_of_prologue_found;
- break;
- case PIA_NOTE_PROLOGUE_END:
- if (!prologue_end)
- prologue_end = ip;
- break;
- case PIA_SKIP:
- default:
- /* Do nothing */
- break;
- }
-
- ip = next_ip;
- next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn);
- }
-
-end_of_prologue_found:
-
- if (prologue_end)
- ip = prologue_end;
-
- /* We're done with the prologue. If we don't care about the stack
- frame itself, just return. (Note that fsr->regs has been trashed,
- but the one caller who calls with fi==0 passes a dummy there.) */
-
- if (fi == 0)
- return ip;
-
- /*
- OK, now we have:
-
- sp_offset original (before any alloca calls) displacement of SP
- (will be negative).
-
- fp_offset displacement from original SP to the FP for this frame
- or -1.
-
- fsr->regs[0..31] displacement from original SP to the stack
- location where reg[0..31] is stored.
-
- must_adjust[0..31] set if corresponding offset was set.
-
- If alloca has been called between the function prologue and the current
- IP, then the current SP (frame_sp) will not be the original SP as set by
- the function prologue. If the current SP is not the original SP, then the
- compiler will have allocated an FP for this frame, fp_offset will be set,
- and we can use it to calculate the original SP.
-
- Then, we figure out where the arguments and locals are, and relocate the
- offsets in fsr->regs to absolute addresses. */
-
- if (fp_offset != -1)
- {
- /* We have a frame pointer, so get it, and base our calc's on it. */
- frame_fp = (CORE_ADDR) read_next_frame_reg (fi->next, ACTUAL_FP_REGNUM);
- frame_sp = frame_fp - fp_offset;
- }
- else
- {
- /* We have no frame pointer, therefore frame_sp is still the same value
- as set by prologue. But where is the frame itself? */
- if (must_adjust[SRP_REGNUM])
- {
- /* Function header saved SRP (r1), the return address. Frame starts
- 4 bytes down from where it was saved. */
- frame_fp = frame_sp + fsr->regs[SRP_REGNUM] - 4;
- fi->locals_pointer = frame_fp;
- }
- else
- {
- /* Function header didn't save SRP (r1), so we are in a leaf fn or
- are otherwise confused. */
- frame_fp = -1;
- }
- }
-
- /* The locals are relative to the FP (whether it exists as an allocated
- register, or just as an assumed offset from the SP) */
- fi->locals_pointer = frame_fp;
-
- /* The arguments are just above the SP as it was before we adjusted it
- on entry. */
- fi->args_pointer = frame_sp - sp_offset;
-
- /* Now that we know the SP value used by the prologue, we know where
- it saved all the registers. */
- for (src = 0; src < 32; src++)
- if (must_adjust[src])
- fsr->regs[src] += frame_sp;
-
- /* The saved value of the SP is always known. */
- /* (we hope...) */
- if (fsr->regs[SP_REGNUM] != 0
- && fsr->regs[SP_REGNUM] != frame_sp - sp_offset)
- fprintf_unfiltered (gdb_stderr, "Bad saved SP value %lx != %lx, offset %x!\n",
- fsr->regs[SP_REGNUM],
- frame_sp - sp_offset, sp_offset);
-
- fsr->regs[SP_REGNUM] = frame_sp - sp_offset;
-
- return (ip);
-}
-
-/* Given an ip value corresponding to the start of a function,
- return the ip of the first instruction after the function
- prologue. */
-
-CORE_ADDR
-m88k_skip_prologue (CORE_ADDR ip)
-{
- struct frame_saved_regs saved_regs_dummy;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- sal = find_pc_line (ip, 0);
- limit = (sal.end) ? sal.end : 0xffffffff;
-
- return (examine_prologue (ip, limit, (CORE_ADDR) 0, &saved_regs_dummy,
- (struct frame_info *) 0));
-}
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame.
-
- We cache the result of doing this in the frame_obstack, since it is
- fairly expensive. */
-
-void
-frame_find_saved_regs (struct frame_info *fi, struct frame_saved_regs *fsr)
-{
- register struct frame_saved_regs *cache_fsr;
- CORE_ADDR ip;
- struct symtab_and_line sal;
- CORE_ADDR limit;
-
- if (!fi->fsr)
- {
- cache_fsr = (struct frame_saved_regs *)
- frame_obstack_alloc (sizeof (struct frame_saved_regs));
- memset (cache_fsr, '\0', sizeof (struct frame_saved_regs));
- fi->fsr = cache_fsr;
-
- /* Find the start and end of the function prologue. If the PC
- is in the function prologue, we only consider the part that
- has executed already. In the case where the PC is not in
- the function prologue, we set limit to two instructions beyond
- where the prologue ends in case if any of the prologue instructions
- were moved into a delay slot of a branch instruction. */
-
- ip = get_pc_function_start (fi->pc);
- sal = find_pc_line (ip, 0);
- limit = (sal.end && sal.end < fi->pc) ? sal.end + 2 * BYTES_PER_88K_INSN
- : fi->pc;
-
- /* This will fill in fields in *fi as well as in cache_fsr. */
-#ifdef SIGTRAMP_FRAME_FIXUP
- if (fi->signal_handler_caller)
- SIGTRAMP_FRAME_FIXUP (fi->frame);
-#endif
- examine_prologue (ip, limit, fi->frame, cache_fsr, fi);
-#ifdef SIGTRAMP_SP_FIXUP
- if (fi->signal_handler_caller && fi->fsr->regs[SP_REGNUM])
- SIGTRAMP_SP_FIXUP (fi->fsr->regs[SP_REGNUM]);
-#endif
- }
-
- if (fsr)
- *fsr = *fi->fsr;
-}
-
-/* Return the address of the locals block for the frame
- described by FI. Returns 0 if the address is unknown.
- NOTE! Frame locals are referred to by negative offsets from the
- argument pointer, so this is the same as frame_args_address(). */
-
-CORE_ADDR
-frame_locals_address (struct frame_info *fi)
-{
- struct frame_saved_regs fsr;
-
- if (fi->args_pointer) /* Cached value is likely there. */
- return fi->args_pointer;
-
- /* Nope, generate it. */
-
- get_frame_saved_regs (fi, &fsr);
-
- return fi->args_pointer;
-}
-
-/* Return the address of the argument block for the frame
- described by FI. Returns 0 if the address is unknown. */
-
-CORE_ADDR
-frame_args_address (struct frame_info *fi)
-{
- struct frame_saved_regs fsr;
-
- if (fi->args_pointer) /* Cached value is likely there. */
- return fi->args_pointer;
-
- /* Nope, generate it. */
-
- get_frame_saved_regs (fi, &fsr);
-
- return fi->args_pointer;
-}
-
-/* Return the saved PC from this frame.
-
- If the frame has a memory copy of SRP_REGNUM, use that. If not,
- just use the register SRP_REGNUM itself. */
-
-CORE_ADDR
-frame_saved_pc (struct frame_info *frame)
-{
- return read_next_frame_reg (frame, SRP_REGNUM);
-}
-
-
-#define DUMMY_FRAME_SIZE 192
-
-static void
-write_word (CORE_ADDR sp, ULONGEST word)
-{
- register int len = REGISTER_SIZE;
- char buffer[MAX_REGISTER_RAW_SIZE];
-
- store_unsigned_integer (buffer, len, word);
- write_memory (sp, buffer, len);
-}
-
-void
-m88k_push_dummy_frame (void)
-{
- register CORE_ADDR sp = read_register (SP_REGNUM);
- register int rn;
- int offset;
-
- sp -= DUMMY_FRAME_SIZE; /* allocate a bunch of space */
-
- for (rn = 0, offset = 0; rn <= SP_REGNUM; rn++, offset += 4)
- write_word (sp + offset, read_register (rn));
-
- write_word (sp + offset, read_register (SXIP_REGNUM));
- offset += 4;
-
- write_word (sp + offset, read_register (SNIP_REGNUM));
- offset += 4;
-
- write_word (sp + offset, read_register (SFIP_REGNUM));
- offset += 4;
-
- write_word (sp + offset, read_register (PSR_REGNUM));
- offset += 4;
-
- write_word (sp + offset, read_register (FPSR_REGNUM));
- offset += 4;
-
- write_word (sp + offset, read_register (FPCR_REGNUM));
- offset += 4;
-
- write_register (SP_REGNUM, sp);
- write_register (ACTUAL_FP_REGNUM, sp);
-}
-
-void
-pop_frame (void)
-{
- register struct frame_info *frame = get_current_frame ();
- register int regnum;
- struct frame_saved_regs fsr;
-
- get_frame_saved_regs (frame, &fsr);
-
- if (PC_IN_CALL_DUMMY (read_pc (), read_register (SP_REGNUM), frame->frame))
- {
- /* FIXME: I think get_frame_saved_regs should be handling this so
- that we can deal with the saved registers properly (e.g. frame
- 1 is a call dummy, the user types "frame 2" and then "print $ps"). */
- register CORE_ADDR sp = read_register (ACTUAL_FP_REGNUM);
- int offset;
-
- for (regnum = 0, offset = 0; regnum <= SP_REGNUM; regnum++, offset += 4)
- (void) write_register (regnum, read_memory_integer (sp + offset, 4));
-
- write_register (SXIP_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- write_register (SNIP_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- write_register (SFIP_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- write_register (PSR_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- write_register (FPSR_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- write_register (FPCR_REGNUM, read_memory_integer (sp + offset, 4));
- offset += 4;
-
- }
- else
- {
- for (regnum = FP_REGNUM; regnum > 0; regnum--)
- if (fsr.regs[regnum])
- write_register (regnum,
- read_memory_integer (fsr.regs[regnum], 4));
- write_pc (frame_saved_pc (frame));
- }
- reinit_frame_cache ();
-}
-
-void
-_initialize_m88k_tdep (void)
-{
- tm_print_insn = print_insn_m88k;
-}
+// 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/macrocmd.c b/gdb/macrocmd.c
index 1d14735bbe6..02f44fce4cd 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -135,20 +135,20 @@ show_pp_source_pos (struct ui_file *stream,
static void
-show_macro_command (char *name, int from_tty)
+info_macro_command (char *name, int from_tty)
{
struct macro_scope *ms = NULL;
struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms);
struct macro_definition *d;
if (! name || ! *name)
- error ("You must follow the `show macro' command with the name"
+ error ("You must follow the `info macro' command with the name"
" of the macro\n"
"whose definition you want to see.");
ms = default_macro_scope ();
if (! ms)
- error ("GDB has no preprocessor macro information for that code.\n");
+ error ("GDB has no preprocessor macro information for that code.");
d = macro_lookup_definition (ms->file, ms->line, name);
if (d)
@@ -257,9 +257,9 @@ _initialize_macrocmd (void)
add_alias_cmd ("exp1", "expand-once", no_class, 1, &macrolist);
add_cmd
- ("macro", no_class, show_macro_command,
+ ("macro", no_class, info_macro_command,
"Show the definition of MACRO, and its source location.",
- &showlist);
+ &infolist);
add_cmd
("define", no_class, macro_define_command,
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index 061c63a00cf..992c4669002 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bcache.h"
#include "macrotab.h"
#include "macroexp.h"
diff --git a/gdb/macroscope.c b/gdb/macroscope.c
index 4441be3103f..08ff6ebff58 100644
--- a/gdb/macroscope.c
+++ b/gdb/macroscope.c
@@ -58,7 +58,7 @@ sal_macro_scope (struct symtab_and_line sal)
struct macro_scope *
-default_macro_scope ()
+default_macro_scope (void)
{
struct symtab_and_line sal;
struct macro_source_file *main;
diff --git a/gdb/macrotab.c b/gdb/macrotab.c
index bb615a55723..accaa7dad83 100644
--- a/gdb/macrotab.c
+++ b/gdb/macrotab.c
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "splay-tree.h"
#include "symtab.h"
#include "symfile.h"
diff --git a/gdb/macrotab.h b/gdb/macrotab.h
index cbc6d1b53d7..df32977967e 100644
--- a/gdb/macrotab.h
+++ b/gdb/macrotab.h
@@ -22,8 +22,8 @@
#ifndef MACROTAB_H
#define MACROTAB_H
-#include "obstack.h"
-#include "bcache.h"
+struct obstack;
+struct bcache;
/* How do we represent a source location? I mean, how should we
represent them within GDB; the user wants to use all sorts of
diff --git a/gdb/main.c b/gdb/main.c
index 78852115d65..61479e8f1e6 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -51,9 +51,7 @@ int display_space;
processes UI events asynchronously. */
int event_loop_p = 1;
-/* Has an interpreter been specified and if so, which.
- This will be used as a set command variable, so it should
- always be malloc'ed - since do_setshow_command will free it. */
+/* Has an interpreter been specified and if so, which. */
char *interpreter_p;
/* Whether this is the command line version or not */
@@ -159,6 +157,15 @@ captured_main (void *data)
long time_at_startup = get_run_time ();
+#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
+ setlocale (LC_MESSAGES, "");
+#endif
+#if defined (HAVE_SETLOCALE)
+ setlocale (LC_CTYPE, "");
+#endif
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
START_PROGRESS (argv[0], 0);
#ifdef MPW
@@ -340,7 +347,7 @@ captured_main (void *data)
extern int gdbtk_test (char *);
if (!gdbtk_test (optarg))
{
- fprintf_unfiltered (gdb_stderr, "%s: unable to load tclcommand file \"%s\"",
+ fprintf_unfiltered (gdb_stderr, _("%s: unable to load tclcommand file \"%s\""),
argv[0], optarg);
exit (1);
}
@@ -356,7 +363,7 @@ extern int gdbtk_test (char *);
}
#endif /* GDBTK */
case 'i':
- interpreter_p = xstrdup (optarg);
+ interpreter_p = optarg;
break;
case 'd':
dirarg[ndir++] = optarg;
@@ -386,7 +393,7 @@ extern int gdbtk_test (char *);
fprintf_unfiltered
(gdb_stderr,
- "warning: could not set baud rate to `%s'.\n", optarg);
+ _("warning: could not set baud rate to `%s'.\n"), optarg);
else
baud_rate = i;
}
@@ -403,7 +410,7 @@ extern int gdbtk_test (char *);
fprintf_unfiltered
(gdb_stderr,
- "warning: could not set timeout limit to `%s'.\n", optarg);
+ _("warning: could not set timeout limit to `%s'.\n"), optarg);
else
remote_timeout = i;
}
@@ -414,7 +421,7 @@ extern int gdbtk_test (char *);
#endif
case '?':
fprintf_unfiltered (gdb_stderr,
- "Use `%s --help' for a complete list of options.\n",
+ _("Use `%s --help' for a complete list of options.\n"),
argv[0]);
exit (1);
}
@@ -445,7 +452,7 @@ extern int gdbtk_test (char *);
if (optind >= argc)
{
fprintf_unfiltered (gdb_stderr,
- "%s: `--args' specified but no program specified\n",
+ _("%s: `--args' specified but no program specified\n"),
argv[0]);
exit (1);
}
@@ -472,7 +479,7 @@ extern int gdbtk_test (char *);
break;
case 3:
fprintf_unfiltered (gdb_stderr,
- "Excess command line arguments ignored. (%s%s)\n",
+ _("Excess command line arguments ignored. (%s%s)\n"),
argv[optind], (optind == argc - 1) ? "" : " ...");
break;
}
@@ -517,7 +524,7 @@ extern int gdbtk_test (char *);
quit_pre_print = error_pre_print;
/* We may get more than one warning, don't double space all of them... */
- warning_pre_print = "\nwarning: ";
+ warning_pre_print = _("\nwarning: ");
/* Read and execute $HOME/.gdbinit file, if it exists. This is done
*before* all the command line arguments are processed; it sets
@@ -585,7 +592,7 @@ extern int gdbtk_test (char *);
printf_filtered ("\n");
error_pre_print = "\n";
quit_pre_print = error_pre_print;
- warning_pre_print = "\nwarning: ";
+ warning_pre_print = _("\nwarning: ");
if (corearg != NULL)
{
@@ -615,7 +622,7 @@ extern int gdbtk_test (char *);
/* Error messages should no longer be distinguished with extra output. */
error_pre_print = NULL;
quit_pre_print = NULL;
- warning_pre_print = "warning: ";
+ warning_pre_print = _("warning: ");
/* Read the .gdbinit file in the current directory, *if* it isn't
the same as the $HOME/.gdbinit file (it should exist, also). */
@@ -674,7 +681,7 @@ extern int gdbtk_test (char *);
{
long init_time = get_run_time () - time_at_startup;
- printf_unfiltered ("Startup time: %ld.%06ld\n",
+ printf_unfiltered (_("Startup time: %ld.%06ld\n"),
init_time / 1000000, init_time % 1000000);
}
@@ -684,7 +691,7 @@ extern int gdbtk_test (char *);
extern char **environ;
char *lim = (char *) sbrk (0);
- printf_unfiltered ("Startup size: data size %ld\n",
+ printf_unfiltered (_("Startup size: data size %ld\n"),
(long) (lim - (char *) &environ));
#endif
}
@@ -745,69 +752,69 @@ main (int argc, char **argv)
static void
print_gdb_help (struct ui_file *stream)
{
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
Options:\n\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--args Arguments after executable-file are passed to inferior\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--[no]async Enable (disable) asynchronous version of CLI\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
-b BAUDRATE Set serial port baud rate used for remote debugging.\n\
--batch Exit after processing options.\n\
--cd=DIR Change current directory to DIR.\n\
--command=FILE Execute GDB commands from FILE.\n\
--core=COREFILE Analyze the core dump COREFILE.\n\
--pid=PID Attach to running process PID.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
--directory=DIR Search for source files in DIR.\n\
--epoch Output information used by epoch emacs-GDB interface.\n\
--exec=EXECFILE Use EXECFILE as the executable.\n\
--fullname Output information used by emacs-GDB interface.\n\
--help Print this message.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--interpreter=INTERP\n\
Select a specific interpreter / user interface\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--mapped Use mapped symbol files if supported on this system.\n\
--nw Do not use a window interface.\n\
- --nx Do not read ", stream);
+ --nx Do not read "), stream);
fputs_unfiltered (gdbinit, stream);
- fputs_unfiltered (" file.\n\
+ fputs_unfiltered (_(" file.\n\
--quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--se=FILE Use FILE as symbol file and executable file.\n\
--symbols=SYMFILE Read symbols from SYMFILE.\n\
--tty=TTY Use TTY for input/output by the program being debugged.\n\
-", stream);
+"), stream);
#if defined(TUI)
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
--tui Use a terminal user interface.\n\
-", stream);
+"), stream);
#endif
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
--version Print version information and then exit.\n\
-w Use a window interface.\n\
--write Set writing into executable and core files.\n\
--xdb XDB compatibility mode.\n\
-", stream);
+"), stream);
#ifdef ADDITIONAL_OPTION_HELP
fputs_unfiltered (ADDITIONAL_OPTION_HELP, stream);
#endif
- fputs_unfiltered ("\n\
+ fputs_unfiltered (_("\n\
For more information, type \"help\" from within GDB, or consult the\n\
GDB manual (available as on-line info or a printed manual).\n\
Report bugs to \"bug-gdb@gnu.org\".\
-", stream);
+"), stream);
}
diff --git a/gdb/maint.c b/gdb/maint.c
index ddaa390b683..f09703f7729 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -783,16 +783,15 @@ passes without a response from the target, an error occurs.", &setlist),
#ifdef NOTYET
- /* FIXME: cagney/2001-09-24: A patch introducing a
- add_set_boolean_cmd() is pending, the below should probably use
- it. A patch implementing profiling is pending, this just sets up
- the framework. */
- tmpcmd = add_set_cmd ("profile", class_maintenance,
- var_boolean, &maintenance_profile_p,
- "Set internal profiling.\n\
-When enabled GDB is profiled.",
- &maintenance_set_cmdlist);
- set_cmd_sfunc (tmpcmd, maintenance_set_profile_cmd);
- add_show_from_set (tmpcmd, &maintenance_show_cmdlist);
+ /* FIXME: cagney/2002-06-15: A patch implementing profiling is
+ pending, this just sets up the framework. */
+ tmpcmd = add_setshow_boolean_cmd ("profile", class_maintenance,
+ var_boolean, &maintenance_profile_p, "\
+Set internal profiling.\n\
+When enabled GDB is profiled.", "\
+Show internal profiling.\n",
+ maintenance_set_profile_cmd, NULL,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
#endif
}
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 0e6ffc80a68..a53aaa00c92 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -26,6 +26,7 @@
#include "symfile.h"
#include "gdbcore.h"
#include "inferior.h"
+#include "arch-utils.h"
/* Functions declared and used only in this file */
@@ -41,7 +42,7 @@ int mcore_use_struct_convention (int gcc_p, struct type *type);
void _initialize_mcore (void);
-void mcore_init_extra_frame_info (struct frame_info *fi);
+void mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi);
CORE_ADDR mcore_frame_saved_pc (struct frame_info *fi);
@@ -54,9 +55,9 @@ CORE_ADDR mcore_frame_locals_address (struct frame_info *fi);
CORE_ADDR mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp);
CORE_ADDR mcore_push_arguments (int nargs, struct value ** args, CORE_ADDR sp,
- unsigned char struct_return, CORE_ADDR struct_addr);
+ int struct_return, CORE_ADDR struct_addr);
-void mcore_pop_frame (struct frame_info *fi);
+void mcore_pop_frame ();
CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
@@ -76,22 +77,18 @@ void mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf);
int mcore_debug = 0;
#endif
-/* The registers of the Motorola MCore processors */
-/* *INDENT-OFF* */
-char *mcore_register_names[] =
-{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",
- "ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15",
- "psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1",
- "ss2", "ss3", "ss4", "gcr", "gsr", "cr13", "cr14", "cr15",
- "cr16", "cr17", "cr18", "cr19", "cr20", "cr21", "cr22", "cr23",
- "cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31",
- "pc" };
-/* *INDENT-ON* */
+/* All registers are 4 bytes long. */
+#define MCORE_REG_SIZE 4
+#define MCORE_NUM_REGS 65
+/* Some useful register numbers. */
+#define PR_REGNUM 15
+#define FIRST_ARGREG 2
+#define LAST_ARGREG 7
+#define RETVAL_REGNUM 2
+
/* Additional info that we use for managing frames */
struct frame_extra_info
{
@@ -175,6 +172,68 @@ mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn)
#define mcore_insn_debug(args) {}
#endif
+
+static struct type *
+mcore_register_virtual_type (int regnum)
+{
+ if (regnum < 0 || regnum >= MCORE_NUM_REGS)
+ internal_error (__FILE__, __LINE__,
+ "mcore_register_virtual_type: illegal register number %d",
+ regnum);
+ else
+ return builtin_type_int;
+}
+
+static int
+mcore_register_byte (int regnum)
+{
+ if (regnum < 0 || regnum >= MCORE_NUM_REGS)
+ internal_error (__FILE__, __LINE__,
+ "mcore_register_byte: illegal register number %d",
+ regnum);
+ else
+ return (regnum * MCORE_REG_SIZE);
+}
+
+static int
+mcore_register_size (int regnum)
+{
+
+ if (regnum < 0 || regnum >= MCORE_NUM_REGS)
+ internal_error (__FILE__, __LINE__,
+ "mcore_register_size: illegal register number %d",
+ regnum);
+ else
+ return MCORE_REG_SIZE;
+}
+
+/* The registers of the Motorola MCore processors */
+
+static const char *
+mcore_register_name (int regnum)
+{
+
+ static char *register_names[] = {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",
+ "ar8", "ar9", "ar10", "ar11", "ar12", "ar13", "ar14", "ar15",
+ "psr", "vbr", "epsr", "fpsr", "epc", "fpc", "ss0", "ss1",
+ "ss2", "ss3", "ss4", "gcr", "gsr", "cr13", "cr14", "cr15",
+ "cr16", "cr17", "cr18", "cr19", "cr20", "cr21", "cr22", "cr23",
+ "cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31",
+ "pc"
+ };
+
+ if (regnum < 0 ||
+ regnum >= sizeof (register_names) / sizeof (register_names[0]))
+ internal_error (__FILE__, __LINE__,
+ "mcore_register_name: illegal register number %d",
+ regnum);
+ else
+ return register_names[regnum];
+}
+
/* Given the address at which to insert a breakpoint (BP_ADDR),
what will that breakpoint be?
@@ -191,6 +250,33 @@ mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
return breakpoint;
}
+static CORE_ADDR
+mcore_saved_pc_after_call (struct frame_info *frame)
+{
+ return read_register (PR_REGNUM);
+}
+
+/* This is currently handled by init_extra_frame_info. */
+static void
+mcore_frame_init_saved_regs (struct frame_info *frame)
+{
+
+}
+
+/* This is currently handled by mcore_push_arguments */
+static void
+mcore_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+
+}
+
+static int
+mcore_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ return 0;
+}
+
+
/* Helper function for several routines below. This funtion simply
sets up a fake, aka dummy, frame (not a _call_ dummy frame) that
we can analyze with mcore_analyze_prologue. */
@@ -697,9 +783,10 @@ mcore_frame_saved_pc (struct frame_info * fi)
command, or the call dummy breakpoint gets hit. */
void
-mcore_pop_frame (struct frame_info *fi)
+mcore_pop_frame (void)
{
int rn;
+ struct frame_info *fi = get_current_frame ();
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
generic_pop_dummy_frame ();
@@ -746,7 +833,7 @@ mcore_pop_frame (struct frame_info *fi)
CORE_ADDR
mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- unsigned char struct_return, CORE_ADDR struct_addr)
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int argnum;
@@ -946,9 +1033,9 @@ mcore_store_return_value (struct type *type, char *valbuf)
the prologue of this frame. */
void
-mcore_init_extra_frame_info (struct frame_info *fi)
+mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
- if (fi->next)
+ if (fi && fi->next)
fi->pc = FRAME_SAVED_PC (fi->next);
frame_saved_regs_zalloc (fi);
@@ -981,10 +1068,107 @@ get_insn (CORE_ADDR pc)
return extract_unsigned_integer (buf, 2);
}
+static struct gdbarch *
+mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ static LONGEST call_dummy_words[7] = { };
+ struct gdbarch_tdep *tdep = NULL;
+ struct gdbarch *gdbarch;
+
+ /* find a candidate among the list of pre-declared architectures. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return (arches->gdbarch);
+
+ gdbarch = gdbarch_alloc (&info, 0);
+
+ /* Registers: */
+
+ /* All registers are 32 bits */
+ set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_register_name (gdbarch, mcore_register_name);
+ set_gdbarch_register_virtual_type (gdbarch, mcore_register_virtual_type);
+ set_gdbarch_register_virtual_size (gdbarch, mcore_register_size);
+ set_gdbarch_register_raw_size (gdbarch, mcore_register_size);
+ set_gdbarch_register_byte (gdbarch, mcore_register_byte);
+ set_gdbarch_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS);
+ set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS);
+ 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);
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc);
+ set_gdbarch_push_return_address (gdbarch, mcore_push_return_address);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+ set_gdbarch_push_arguments (gdbarch, mcore_push_arguments);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+
+ /* Frames: */
+
+ set_gdbarch_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info);
+ set_gdbarch_frame_chain (gdbarch, mcore_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
+ set_gdbarch_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs);
+ set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mcore_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ mcore_extract_return_value);
+ set_gdbarch_store_struct_return (gdbarch, mcore_store_struct_return);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
+ mcore_extract_struct_value_address);
+ set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue);
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+ set_gdbarch_frame_args_address (gdbarch, mcore_frame_args_address);
+ set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address);
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_pop_frame (gdbarch, mcore_pop_frame);
+ set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer);
+
+ /* Misc.: */
+
+ /* Stack grows down. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_use_struct_convention (gdbarch, mcore_use_struct_convention);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+ /* MCore will never pass a sturcture by reference. It will always be split
+ between registers and stack. */
+ set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr);
+
+ return gdbarch;
+}
+
+static void
+mcore_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+
+}
+
void
_initialize_mcore_tdep (void)
{
extern int print_insn_mcore (bfd_vma, disassemble_info *);
+ gdbarch_register (bfd_arch_mcore, mcore_gdbarch_init, mcore_dump_tdep);
tm_print_insn = print_insn_mcore;
#ifdef MCORE_DEBUG
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 14d2c0f753e..d920f8dae86 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -47,11 +47,12 @@
#include "gdbcore.h"
#include "symfile.h"
#include "objfiles.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "buildsym.h"
#include "stabsread.h"
#include "complaints.h"
#include "demangle.h"
+#include "gdb_assert.h"
/* These are needed if the tm.h file does not contain the necessary
mips specific definitions. */
@@ -4727,6 +4728,11 @@ shrink_block (struct block *b, struct symtab *s)
+ ((BLOCK_NSYMS (b) - 1)
* sizeof (struct symbol *))));
+ /* FIXME: Not worth hashing this block as it's built. */
+ /* All callers should have created the block with new_block (), which
+ would mean it was not previously hashed. Make sure. */
+ gdb_assert (BLOCK_HASHTABLE (new) == 0);
+
/* Should chase pointers to old one. Fortunately, that`s just
the block`s function and inferior blocks */
if (BLOCK_FUNCTION (new) && SYMBOL_BLOCK_VALUE (BLOCK_FUNCTION (new)) == b)
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 8c46d7eb168..05ad413cc0a 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -47,7 +47,7 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
struct mem_region *n, *new;
/* lo == hi is a useless empty region */
- if (lo >= hi)
+ if (lo >= hi && hi != 0)
{
printf_unfiltered ("invalid memory region: low >= high\n");
return NULL;
@@ -57,8 +57,9 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
while (n)
{
/* overlapping node */
- if ((lo >= n->lo && lo < n->hi) ||
- (hi > n->lo && hi <= n->hi))
+ if ((lo >= n->lo && (lo < n->hi || n->hi == 0))
+ || (hi > n->lo && (hi <= n->hi || n->hi == 0))
+ || (lo <= n->lo && (hi >= n->hi || hi == 0)))
{
printf_unfiltered ("overlapping memory region\n");
return NULL;
@@ -111,7 +112,7 @@ lookup_mem_region (CORE_ADDR addr)
{
if (m->enabled_p == 1)
{
- if (addr >= m->lo && addr < m->hi)
+ if (addr >= m->lo && (addr < m->hi || m->hi == 0))
return m;
if (addr >= m->hi && lo < m->hi)
@@ -244,12 +245,22 @@ mem_info_command (char *args, int from_tty)
tmp = local_hex_string_custom ((unsigned long) m->lo, "016l");
printf_filtered ("%s ", tmp);
-
+
if (TARGET_ADDR_BIT <= 32)
- tmp = local_hex_string_custom ((unsigned long) m->hi, "08l");
+ {
+ if (m->hi == 0)
+ tmp = "0x100000000";
+ else
+ tmp = local_hex_string_custom ((unsigned long) m->hi, "08l");
+ }
else
- tmp = local_hex_string_custom ((unsigned long) m->hi, "016l");
-
+ {
+ if (m->hi == 0)
+ tmp = "0x10000000000000000";
+ else
+ tmp = local_hex_string_custom ((unsigned long) m->hi, "016l");
+ }
+
printf_filtered ("%s ", tmp);
/* Print a token for each attribute.
@@ -504,7 +515,7 @@ mem_delete_command (char *args, int from_tty)
}
void
-_initialize_mem ()
+_initialize_mem (void)
{
add_com ("mem", class_vars, mem_command,
"Define attributes for memory region.\n\
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index a750d8c2571..e5a162fa25f 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,13 @@
+2002-07-29 Andrew Cagney <ac131313@redhat.com>
+
+
+ * mi-cmd-var.c: Include "gdb_string.h".
+ * mi-cmd-disas.c: Ditto.
+
+2002-06-17 Keith Seitz <keiths@redhat.com>
+
+ * gdbmi.texinfo: Update command examples with real MI behavior.
+
2002-05-20 Keith Seitz <keiths@redhat.com>
* mi-main.c (captured_mi_execute_command): Add uiout parameter.
diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo
index f924214caa5..a71b7026964 100644
--- a/gdb/mi/gdbmi.texinfo
+++ b/gdb/mi/gdbmi.texinfo
@@ -8,7 +8,7 @@
@c @ifinfo
@c This file documents GDB/MI, a Machine Interface to GDB.
-@c Copyright 2000, 2001 Free Software Foundation, Inc.
+@c Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
@c Contributed by Cygnus Solutions.
@c Permission is granted to copy, distribute and/or modify this document
@@ -36,7 +36,7 @@
@c @page
@c @vskip 0pt plus 1filll
-@c Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
+@c Copyright @copyright{} 2000, 2001, 2002 Free Software Foundation, Inc.
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -355,7 +355,7 @@ following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
the output received from @sc{gdb/mi}.
@subsubheading Target Stop
-
+@c Ummm... There is no "-stop" command. This assumes async, no?
Here's an example of stopping the inferior process:
@example
@@ -378,7 +378,9 @@ Here's an example of a simple CLI command being passed through
@example
-> print 1+2
-<- ~3\n
+<- &"print 1+2\n"
+<- ~"$1 = 3\n"
+<- ^done
<- (@value{GDBP})
@end example
@@ -396,7 +398,7 @@ Here's what happens if you pass a non-existent command:
@example
-> -rubbish
-<- error,"Rubbish not found"
+<- ^error,msg="Undefined MI command: rubbish"
<- (@value{GDBP})
@end example
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index 70054c635c8..028dc0758f3 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -25,6 +25,7 @@
#include "mi-cmds.h"
#include "mi-getopt.h"
#include "ui-out.h"
+#include "gdb_string.h"
/* Disassemble functions. FIXME: these do not really belong here. We
should get rid of all the duplicate code in gdb that does the same
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 4848a4e29c1..cb5e939e9f1 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -28,6 +28,7 @@
#include "varobj.h"
#include "value.h"
#include <ctype.h>
+#include "gdb_string.h"
extern int varobjdebug; /* defined in varobj.c */
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 0d50d13826f..233d06bded2 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -88,8 +88,6 @@ struct mi_cmd mi_cmds[] =
{"gdb-show", "show %s", 0},
{"gdb-source", 0, 0},
{"gdb-version", "show version", 0},
- {"interpreter-set", 0, 0, mi_cmd_interpreter_set},
- {"interpreter-exec", 0, 0, mi_cmd_interpreter_exec},
{"kod-info", 0, 0},
{"kod-list", 0, 0},
{"kod-list-object-types", 0, 0},
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 8c650fc91e1..88775e6f961 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -27,7 +27,7 @@
enum mi_cmd_result
{
/* Report the command as ``done''. Display both the ``NNN^done''
- message and the completion prompt. */
+ message and the completion prompt. */
MI_CMD_DONE = 0,
/* The command is still running in the forground. Main loop should
display the completion prompt. */
@@ -75,8 +75,6 @@ extern mi_cmd_args_ftype mi_cmd_exec_step_instruction;
extern mi_cmd_args_ftype mi_cmd_exec_until;
extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
-extern mi_cmd_argv_ftype mi_cmd_interpreter_set;
-extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
@@ -124,6 +122,4 @@ extern int mi_debug_p;
/* Raw console output - FIXME: should this be a parameter? */
extern struct ui_file *raw_stdout;
-extern char *mi_error_message;
-void mi_execute_command (char *cmd, int from_tty);
#endif
diff --git a/gdb/mi/mi-events.c b/gdb/mi/mi-events.c
deleted file mode 100644
index 1d942a4d265..00000000000
--- a/gdb/mi/mi-events.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* MI Event Handlers
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "ui-out.h"
-#include "interps.h"
-#include "gdb.h"
-#include "breakpoint.h"
-
-#include "mi.h"
-
-void
-mi_interp_stack_changed_hook (void)
-{
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "stack_changed");
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-}
-
-void
-mi_interp_frame_changed_hook (int new_frame_number)
-{
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "frame_changed");
- ui_out_field_int (uiout, "frame", new_frame_number);
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-
-}
-
-void
-mi_interp_context_hook (int thread_id)
-{
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "thread_changed");
- ui_out_field_int (uiout, "thread", thread_id);
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-}
-
-void
-mi_interp_create_breakpoint_hook (struct breakpoint *bpt)
-{
- CORE_ADDR unusued_addr;
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- /* This is a little inefficient, but it probably isn't worth adding
- a gdb_breakpoint_query that takes a bpt structure... */
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "breakpoint_create");
- gdb_breakpoint_query (uiout, bpt->number);
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-}
-
-void
-mi_interp_modify_breakpoint_hook (struct breakpoint *bpt)
-{
-
- CORE_ADDR unusued_addr;
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- /* This is a little inefficient, but it probably isn't worth adding
- a gdb_breakpoint_query that takes a bpt structure... */
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "breakpoint_modify");
- gdb_breakpoint_query (uiout, bpt->number);
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-}
-
-void
-mi_interp_delete_breakpoint_hook (struct breakpoint *bpt)
-{
- CORE_ADDR unusued_addr;
- struct ui_out *saved_ui_out = uiout;
- struct mi_out *tmp_mi_out;
-
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
- else
- uiout = gdb_interpreter_ui_out (mi_interp);
-
- /* This is a little inefficient, but it probably isn't worth adding
- a gdb_breakpoint_query that takes a bpt structure... */
-
- ui_out_list_begin (uiout, "MI_HOOK_RESULT");
- ui_out_field_string (uiout, "HOOK_TYPE", "breakpoint_delete");
- ui_out_field_int (uiout, "bkptno", bpt->number);
- ui_out_list_end (uiout);
- uiout = saved_ui_out;
-}
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
deleted file mode 100644
index 9a918339870..00000000000
--- a/gdb/mi/mi-interp.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/* MI Interpreter Definitions and Commands
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "interps.h"
-#include "event-top.h"
-#include "event-loop.h"
-#include "inferior.h"
-#include "ui-out.h"
-#include "top.h"
-
-#include "mi.h"
-#include "mi-cmds.h"
-#include "mi-out.h"
-#include "mi-console.h"
-
-/* MI's output channels */
-struct ui_file *mi_stdout;
-struct ui_file *mi_stderr;
-struct ui_file *mi_stdlog;
-struct ui_file *mi_stdtarg;
-
-/* This is the interpreter for the mi... */
-struct gdb_interpreter *mi0_interp;
-struct gdb_interpreter *mi_interp;
-
-/* These are the interpreter setup, etc. functions for the MI interpreter */
-static int mi_interpreter_init (void *data);
-static int mi_interpreter_resume (void *data);
-static int mi_interpreter_do_one_event (void *data);
-static int mi_interpreter_suspend (void *data);
-static int mi_interpreter_delete (void *data);
-static int mi_interpreter_prompt (void *data, char *new_prompt);
-
-static void mi_execute_command_wrapper (char *cmd);
-static void mi_command_loop (int mi_version);
-static char *mi_input (char *);
-
-/* These are hooks that we put in place while doing interpreter_exec
- so we can report interesting things that happened "behind the mi's
- back" in this command */
-static int mi_interp_query_hook (const char *ctlstr, va_list ap);
-static void mi_interp_stack_changed_hook (void);
-static char *mi_interp_read_one_line_hook (char *prompt, int repeat,
- char *anno);
-
-static void mi0_command_loop (void);
-static void mi1_command_loop (void);
-
-static void mi_insert_notify_hooks (void);
-static void mi_remove_notify_hooks (void);
-
-int
-mi_interpreter_init (void *data)
-{
- /* Why is this a part of the mi architecture? */
-
- mi_setup_architecture_data ();
-
- /* HACK: We need to force stdout/stderr to point at the console. This avoids
- any potential side effects caused by legacy code that is still
- using the TUI / fputs_unfiltered_hook. So we set up output channels for
- this now, and swap them in when we are run. */
-
- raw_stdout = stdio_fileopen (stdout);
- /* Route normal output through the MIx */
- mi_stdout = mi_console_file_new (raw_stdout, "~");
- /* Route error and log output through the MI */
- mi_stderr = mi_console_file_new (raw_stdout, "&");
- mi_stdlog = mi_stderr;
- /* Route target output through the MI. */
- mi_stdtarg = mi_console_file_new (raw_stdout, "@");
-
- return 1;
-}
-
-int
-mi_interpreter_resume (void *data)
-{
- /* As per hack note in mi_interpreter_init, swap in the output channels... */
-
- gdb_setup_readline ();
- mi_register_gdbarch_swap ();
-
- if (event_loop_p)
- {
- /* These overwrite some of the initialization done in
- _intialize_event_loop. */
- call_readline = gdb_readline2;
- input_handler = mi_execute_command_wrapper;
- add_file_handler (input_fd, stdin_event_handler, 0);
- async_command_editing_p = 0;
- /* FIXME: This is a total hack for now. PB's use of the MI implicitly
- relies on a bug in the async support which allows asynchronous
- commands to leak through the commmand loop. The bug involves
- (but is not limited to) the fact that sync_execution was
- erroneously initialized to 0. Duplicate by initializing it
- thus here... */
- sync_execution = 0;
- }
-
- gdb_stdout = mi_stdout;
- /* Route error and log output through the MI */
- gdb_stderr = mi_stderr;
- gdb_stdlog = mi_stdlog;
- /* Route target output through the MI. */
- gdb_stdtarg = mi_stdtarg;
-
- /* Replace all the hooks that we know about. There really needs to be a better way
- of doing this... */
- clear_interpreter_hooks ();
-
- show_load_progress = mi_load_progress;
-
- /* If we're _the_ interpreter, take control. */
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- command_loop_hook = mi0_command_loop;
- else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI))
- command_loop_hook = mi1_command_loop;
- else
- return 0;
-
- return 1;
-}
-
-int
-mi_interpreter_suspend (void *data)
-{
- gdb_disable_readline ();
- return 1;
-}
-
-int
-mi_interpreter_delete (void *data)
-{
- return 1;
-}
-
-int
-mi_interpreter_prompt (void *data, char *new_prompt)
-{
- return 1;
-}
-
-int
-mi_do_one_event (void *data)
-{
- return 1;
-}
-
-void
-mi_interpreter_exec_continuation (struct continuation_arg *arg)
-{
- bpstat_do_actions (&stop_bpstat);
- if (!target_executing)
- {
- fputs_unfiltered ("*stopped", raw_stdout);
- mi_out_put (uiout, raw_stdout);
- fputs_unfiltered ("\n", raw_stdout);
- fputs_unfiltered ("(gdb) \n", raw_stdout);
- gdb_flush (raw_stdout);
- do_exec_cleanups (ALL_CLEANUPS);
- }
- else if (target_can_async_p ())
- {
- add_continuation (mi_interpreter_exec_continuation, NULL);
- }
-}
-
-enum mi_cmd_result
-mi_cmd_interpreter_exec (char *command, char **argv, int argc)
-{
- struct gdb_interpreter *old_interp, *interp_to_use;
- enum mi_cmd_result result = MI_CMD_DONE;
- int i, old_quiet;
- struct gdb_interpreter_procs *procs;
-
- if (argc < 2)
- {
- xasprintf (&mi_error_message,
- "Wrong # or arguments, should be \"%s interp cmd <cmd ...>\".",
- command);
- return MI_CMD_ERROR;
- }
-
- old_interp = gdb_current_interpreter ();
-
- interp_to_use = gdb_lookup_interpreter (argv[0]);
- if (interp_to_use == NULL)
- {
- xasprintf (&mi_error_message,
- "Could not find interpreter \"%s\".", argv[0]);
- return MI_CMD_ERROR;
- }
-
- procs = gdb_interpreter_get_procs (interp_to_use);
- if (!procs->exec_proc)
- {
- xasprintf (&mi_error_message,
- "Interpreter \"%s\" does not support command execution.",
- argv[0]);
- return MI_CMD_ERROR;
- }
- old_quiet = gdb_interpreter_set_quiet (interp_to_use, 1);
-
- if (!gdb_set_interpreter (interp_to_use))
- {
- xasprintf (&mi_error_message,
- "Could not switch to interpreter \"%s\".", argv[0]);
- return MI_CMD_ERROR;
- }
-
- /* Insert the MI out hooks, making sure to also call the interpreter's hooks
- if it has any. */
-
- mi_insert_notify_hooks ();
-
- /* Now run the code... */
-
- for (i = 1; i < argc; i++)
- {
- char *buff = NULL;
- /* Do this in a cleaner way... We want to force execution to be
- asynchronous for commands that run the target. */
- if (target_can_async_p () && (strcmp (argv[0], "console") == 0))
- {
- int len = strlen (argv[i]);
- buff = xmalloc (len + 2);
- memcpy (buff, argv[i], len);
- buff[len] = '&';
- buff[len + 1] = '\0';
- }
-
- /* We had to set sync_execution = 0 for the mi (well really for Project
- Builder's use of the mi - particularly so interrupting would work.
- But for console commands to work, we need to initialize it to 1 -
- since that is what the cli expects - before running the command,
- and then set it back to 0 when we are done. */
- sync_execution = 1;
- if (!procs->exec_proc (gdb_interpreter_get_data (interp_to_use), argv[i]))
- {
- xasprintf (&mi_error_message,
- "mi_interpreter_execute: error in command: \"%s\".",
- argv[i]);
-
- result = MI_CMD_ERROR;
- break;
- }
- xfree (buff);
- do_exec_error_cleanups (ALL_CLEANUPS);
- sync_execution = 0;
-
- }
-
- /* Now do the switch... */
-
- gdb_set_interpreter (old_interp);
- mi_remove_notify_hooks ();
- gdb_interpreter_set_quiet (interp_to_use, old_quiet);
-
- /* Okay, now let's see if the command set the inferior going...
- Tricky point - have to do this AFTER resetting the interpreter, since
- changing the interpreter will clear out all the continuations for
- that interpreter... */
-
- if (target_can_async_p () && target_executing)
- {
- fputs_unfiltered ("^running\n", raw_stdout);
- add_continuation (mi_interpreter_exec_continuation, NULL);
- }
-
- return result;
-}
-
-enum mi_cmd_result
-mi_cmd_interpreter_set (char *command, char **argv, int argc)
-{
- struct gdb_interpreter *interp;
- int result;
-
- if (argc != 1)
- {
- xasprintf (&mi_error_message,
- "mi_cmd_interpreter_set: wrong #of args, should be 1 ");
- return MI_CMD_ERROR;
- }
- interp = gdb_lookup_interpreter (argv[0]);
- if (interp == NULL)
- {
- xasprintf (&mi_error_message,
- "mi_cmd_interpreter_set: could not find interpreter %s",
- argv[0]);
- return MI_CMD_ERROR;
- }
-
- if (interp != gdb_current_interpreter ())
- {
- result = gdb_set_interpreter (interp);
- if (result != 1)
- {
- xasprintf (&mi_error_message,
- "mi_cmd_interpreter_set: error setting interpreter %s",
- argv[0]);
- return MI_CMD_ERROR;
- }
- }
-
- /* We don't want to put up the "done" and whatnot here, since we
- * are going over to another interpreter.
- */
- return MI_CMD_QUIET;
-}
-
-/*
- * mi_insert_notify_hooks - This inserts a number of hooks that are meant to produce
- * async-notify ("=") MI messages while running commands in another interpreter
- * using mi_interpreter_exec. The canonical use for this is to allow access to
- * the gdb CLI interpreter from within the MI, while still producing MI style output
- * when actions in the CLI command change gdb's state.
-*/
-
-static void
-mi_insert_notify_hooks (void)
-{
-
- create_breakpoint_hook = mi_interp_create_breakpoint_hook;
- delete_breakpoint_hook = mi_interp_delete_breakpoint_hook;
- modify_breakpoint_hook = mi_interp_modify_breakpoint_hook;
- selected_frame_level_changed_hook = mi_interp_frame_changed_hook;
- context_hook = mi_interp_context_hook;
- query_hook = mi_interp_query_hook;
-}
-
-static void
-mi_remove_notify_hooks ()
-{
- create_breakpoint_hook = NULL;
- delete_breakpoint_hook = NULL;
- modify_breakpoint_hook = NULL;
- selected_frame_level_changed_hook = NULL;
- context_hook = NULL;
- query_hook = NULL;
-}
-
-int
-mi_interp_query_hook (const char *ctlstr, va_list ap)
-{
- return 1;
-}
-
-char *
-mi_interp_read_one_line_hook (char *prompt, int repeat, char *anno)
-{
- static char buff[256];
- printf_unfiltered ("=read-one-line,prompt=\"%s\"\n", prompt);
- gdb_flush (gdb_stdout);
- (void) fgets (buff, sizeof (buff), stdin);
- buff[(strlen (buff) - 1)] = 0;
- return buff;
-}
-
-static void
-output_control_change_notification (char *notification)
-{
- printf_unfiltered ("^");
- printf_unfiltered ("%s\n", notification);
- gdb_flush (gdb_stdout);
-}
-
-static void
-mi_execute_command_wrapper (char *cmd)
-{
- mi_execute_command (cmd, stdin == instream);
-}
-
-static void
-mi0_command_loop (void)
-{
- mi_command_loop (0);
-}
-
-static void
-mi1_command_loop (void)
-{
- mi_command_loop (1);
-}
-
-static void
-mi_command_loop (int mi_version)
-{
- /* HACK: Force stdout/stderr to point at the console. This avoids
- any potential side effects caused by legacy code that is still
- using the TUI / fputs_unfiltered_hook */
- raw_stdout = stdio_fileopen (stdout);
- /* Route normal output through the MIx */
- gdb_stdout = mi_console_file_new (raw_stdout, "~");
- /* Route error and log output through the MI */
- gdb_stderr = mi_console_file_new (raw_stdout, "&");
- gdb_stdlog = gdb_stderr;
- /* Route target output through the MI. */
- gdb_stdtarg = mi_console_file_new (raw_stdout, "@");
- /* HACK: Poke the ui_out table directly. Should we be creating a
- mi_out object wired up to the above gdb_stdout / gdb_stderr? */
- uiout = mi_out_new (mi_version);
- /* HACK: Override any other interpreter hooks. We need to create a
- real event table and pass in that. */
- init_ui_hook = 0;
- /* command_loop_hook = 0; */
- print_frame_info_listing_hook = 0;
- query_hook = 0;
- warning_hook = 0;
- create_breakpoint_hook = 0;
- delete_breakpoint_hook = 0;
- modify_breakpoint_hook = 0;
- interactive_hook = 0;
- registers_changed_hook = 0;
- readline_begin_hook = 0;
- readline_hook = 0;
- readline_end_hook = 0;
- register_changed_hook = 0;
- memory_changed_hook = 0;
- context_hook = 0;
- target_wait_hook = 0;
- call_command_hook = 0;
- error_hook = 0;
- error_begin_hook = 0;
- show_load_progress = mi_load_progress;
- /* Turn off 8 bit strings in quoted output. Any character with the
- high bit set is printed using C's octal format. */
- sevenbit_strings = 1;
- /* Tell the world that we're alive */
- fputs_unfiltered ("(gdb) \n", raw_stdout);
- gdb_flush (raw_stdout);
- if (!event_loop_p)
- simplified_command_loop (mi_input, mi_execute_command);
- else
- start_event_loop ();
-}
-
-static char *
-mi_input (char *buf)
-{
- return gdb_readline (NULL);
-}
-
-void
-_initialize_mi_interp (void)
-{
- struct gdb_interpreter_procs procs =
- {
- mi_interpreter_init, /* init_proc */
- mi_interpreter_resume, /* resume_proc */
- NULL, /* do_one_event_proc */
- mi_interpreter_suspend, /* suspend_proc */
- mi_interpreter_delete, /* delete_proc */
- NULL, /* exec_proc */
- mi_interpreter_prompt /* prompt_proc */
- };
-
- if (mi0_interp == NULL)
- {
- mi0_interp =
- gdb_new_interpreter (GDB_INTERPRETER_MI0, NULL, mi_out_new (0),
- &procs);
- if (mi0_interp == NULL)
- error
- ("Couldn't allocate a new interpreter for the mi0 interpreter\n");
- if (gdb_add_interpreter (mi0_interp) != 1)
- error ("Couldn't add the mi0 interpreter to gdb.\n");
- }
-
- if (mi_interp == NULL)
- {
- mi_interp =
- gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (1),
- &procs);
- if (mi_interp == NULL)
- error
- ("Couldn't allocate a new interpreter for the mi interpreter\n");
- if (gdb_add_interpreter (mi_interp) != 1)
- error ("Couldn't add the mi interpreter to gdb.\n");
- }
-}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 1e9baed91e4..bd8cd67081d 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -33,7 +33,6 @@
#include "mi-console.h"
#include "ui-out.h"
#include "mi-out.h"
-#include "interps.h"
#include "event-loop.h"
#include "event-top.h"
#include "gdbcore.h" /* for write_memory() */
@@ -78,25 +77,27 @@ struct ui_file *raw_stdout;
/* The token of the last asynchronous command */
static char *last_async_command;
static char *previous_async_command;
-char *mi_error_message;
+static char *mi_error_message;
static char *old_regs;
extern void _initialize_mi_main (void);
-void mi_execute_command (char *cmd, int from_tty);
+static char *mi_input (char *);
+static void mi_execute_command (char *cmd, int from_tty);
static enum mi_cmd_result mi_cmd_execute (struct mi_parse *parse);
static void mi_execute_cli_command (const char *cli, char *args);
static enum mi_cmd_result mi_execute_async_cli_command (char *mi, char *args, int from_tty);
+static void mi_execute_command_wrapper (char *cmd);
void mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg);
static int register_changed_p (int regnum);
static int get_register (int regnum, int format);
-void mi_load_progress (const char *section_name,
- unsigned long sent_so_far,
- unsigned long total_section,
- unsigned long total_sent,
- unsigned long grand_total);
+static void mi_load_progress (const char *section_name,
+ unsigned long sent_so_far,
+ unsigned long total_section,
+ unsigned long total_sent,
+ unsigned long grand_total);
/* FIXME: these should go in some .h file, but infcmd.c doesn't have a
corresponding .h file. These wrappers will be obsolete anyway, once
@@ -1079,12 +1080,7 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
if (!target_can_async_p () || !target_executing)
{
- /* print the result if there were no errors
-
- Remember that on the way out of executing a command, you have
- to directly use the mi_interp's uiout, since the command could
- have reset the interpreter, in which case the current uiout
- will most likely crash in the mi_out_* routines. */
+ /* print the result if there were no errors */
if (args->rc == MI_CMD_DONE)
{
fputs_unfiltered (context->token, raw_stdout);
@@ -1132,21 +1128,15 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
/* FIXME: If the command string has something that looks like
a format spec (e.g. %s) we will get a core dump */
mi_execute_cli_command ("%s", context->command);
-
- /* If we changed interpreters, DON'T print out anything. */
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- {
- /* print the result */
- /* FIXME: Check for errors here. */
- fputs_unfiltered (context->token, raw_stdout);
- fputs_unfiltered ("^done", raw_stdout);
- mi_out_put (uiout, raw_stdout);
- mi_out_rewind (uiout);
- fputs_unfiltered ("\n", raw_stdout);
- args->action = EXECUTE_COMMAND_DISPLAY_PROMPT;
- args->rc = MI_CMD_DONE;
- }
+ /* print the result */
+ /* FIXME: Check for errors here. */
+ fputs_unfiltered (context->token, raw_stdout);
+ fputs_unfiltered ("^done", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ args->action = EXECUTE_COMMAND_DISPLAY_PROMPT;
+ args->rc = MI_CMD_DONE;
break;
}
@@ -1161,7 +1151,7 @@ mi_execute_command (char *cmd, int from_tty)
struct mi_parse *command;
struct captured_mi_execute_command_args args;
struct ui_out *saved_uiout = uiout;
- int result;
+ int result, rc;
/* This is to handle EOF (^D). We just quit gdb. */
/* FIXME: we should call some API function here. */
@@ -1199,13 +1189,10 @@ mi_execute_command (char *cmd, int from_tty)
mi_parse_free (command);
}
- if (args.rc != MI_CMD_QUIET)
- {
- fputs_unfiltered ("(gdb) \n", raw_stdout);
- gdb_flush (raw_stdout);
- /* print any buffered hook code */
- /* ..... */
- }
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+ /* print any buffered hook code */
+ /* ..... */
}
static enum mi_cmd_result
@@ -1272,6 +1259,12 @@ mi_cmd_execute (struct mi_parse *parse)
}
}
+static void
+mi_execute_command_wrapper (char *cmd)
+{
+ mi_execute_command (cmd, stdin == instream);
+}
+
/* FIXME: This is just a hack so we can get some extra commands going.
We don't want to channel things through the CLI, but call libgdb directly */
/* Use only for synchronous commands */
@@ -1374,7 +1367,13 @@ mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg)
do_exec_cleanups (ALL_CLEANUPS);
}
-void
+static char *
+mi_input (char *buf)
+{
+ return gdb_readline (NULL);
+}
+
+static void
mi_load_progress (const char *section_name,
unsigned long sent_so_far,
unsigned long total_section,
@@ -1386,8 +1385,7 @@ mi_load_progress (const char *section_name,
static char *previous_sect_name = NULL;
int new_section;
- if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
+ if (!interpreter_p || strncmp (interpreter_p, "mi", 2) != 0)
return;
update_threshold.tv_sec = 0;
@@ -1444,17 +1442,118 @@ mi_load_progress (const char *section_name,
}
}
-void
-mi_setup_architecture_data (void)
+static void
+mi_command_loop (int mi_version)
+{
+ /* HACK: Force stdout/stderr to point at the console. This avoids
+ any potential side effects caused by legacy code that is still
+ using the TUI / fputs_unfiltered_hook */
+ raw_stdout = stdio_fileopen (stdout);
+ /* Route normal output through the MIx */
+ gdb_stdout = mi_console_file_new (raw_stdout, "~");
+ /* Route error and log output through the MI */
+ gdb_stderr = mi_console_file_new (raw_stdout, "&");
+ gdb_stdlog = gdb_stderr;
+ /* Route target output through the MI. */
+ gdb_stdtarg = mi_console_file_new (raw_stdout, "@");
+
+ /* HACK: Poke the ui_out table directly. Should we be creating a
+ mi_out object wired up to the above gdb_stdout / gdb_stderr? */
+ uiout = mi_out_new (mi_version);
+
+ /* HACK: Override any other interpreter hooks. We need to create a
+ real event table and pass in that. */
+ init_ui_hook = 0;
+ /* command_loop_hook = 0; */
+ print_frame_info_listing_hook = 0;
+ query_hook = 0;
+ warning_hook = 0;
+ create_breakpoint_hook = 0;
+ delete_breakpoint_hook = 0;
+ modify_breakpoint_hook = 0;
+ interactive_hook = 0;
+ registers_changed_hook = 0;
+ readline_begin_hook = 0;
+ readline_hook = 0;
+ readline_end_hook = 0;
+ register_changed_hook = 0;
+ memory_changed_hook = 0;
+ context_hook = 0;
+ target_wait_hook = 0;
+ call_command_hook = 0;
+ error_hook = 0;
+ error_begin_hook = 0;
+ show_load_progress = mi_load_progress;
+
+ /* Turn off 8 bit strings in quoted output. Any character with the
+ high bit set is printed using C's octal format. */
+ sevenbit_strings = 1;
+
+ /* Tell the world that we're alive */
+ fputs_unfiltered ("(gdb) \n", raw_stdout);
+ gdb_flush (raw_stdout);
+
+ if (!event_loop_p)
+ simplified_command_loop (mi_input, mi_execute_command);
+ else
+ start_event_loop ();
+}
+
+static void
+mi0_command_loop (void)
+{
+ mi_command_loop (0);
+}
+
+static void
+mi1_command_loop (void)
+{
+ mi_command_loop (1);
+}
+
+static void
+setup_architecture_data (void)
{
/* don't trust REGISTER_BYTES to be zero. */
old_regs = xmalloc (REGISTER_BYTES + 1);
memset (old_regs, 0, REGISTER_BYTES + 1);
}
+static void
+mi_init_ui (char *arg0)
+{
+ /* Eventually this will contain code that takes control of the
+ console. */
+}
+
void
-mi_register_gdbarch_swap (void)
+_initialize_mi_main (void)
{
+ if (interpreter_p == NULL)
+ return;
+
+ /* If we're _the_ interpreter, take control. */
+ if (strcmp (interpreter_p, "mi0") == 0)
+ command_loop_hook = mi0_command_loop;
+ else if (strcmp (interpreter_p, "mi") == 0
+ || strcmp (interpreter_p, "mi1") == 0)
+ command_loop_hook = mi1_command_loop;
+ else
+ return;
+
+ init_ui_hook = mi_init_ui;
+ setup_architecture_data ();
register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
- register_gdbarch_swap (NULL, 0, mi_setup_architecture_data);
+ register_gdbarch_swap (NULL, 0, setup_architecture_data);
+ if (event_loop_p)
+ {
+ /* These overwrite some of the initialization done in
+ _intialize_event_loop. */
+ call_readline = gdb_readline2;
+ input_handler = mi_execute_command_wrapper;
+ add_file_handler (input_fd, stdin_event_handler, 0);
+ async_command_editing_p = 0;
+ }
+ /* FIXME: Should we notify main that we are here as a possible
+ interpreter? */
}
diff --git a/gdb/mi/mi.h b/gdb/mi/mi.h
deleted file mode 100644
index cc921e71660..00000000000
--- a/gdb/mi/mi.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* MI Internal Functions
- Copyright 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef MI_H
-#define MI_H
-/* The mi interpreters. */
-struct gdb_interpreter;
-extern struct gdb_interpreter *mi_interp;
-extern struct gdb_interpreter *mi0_interp;
-
-extern void mi_setup_architecture_data (void);
-extern void mi_register_gdbarch_swap (void);
-
-/* Events/Hooks */
-extern void mi_load_progress (const char *section_name,
- unsigned long sent_so_far,
- unsigned long total_section,
- unsigned long total_sent,
- unsigned long grand_total);
-extern void mi_interp_create_breakpoint_hook (struct breakpoint *bpt);
-extern void mi_interp_delete_breakpoint_hook (struct breakpoint *bpt);
-extern void mi_interp_modify_breakpoint_hook (struct breakpoint *bpt);
-extern void mi_interp_frame_changed_hook (int new_frame_number);
-extern void mi_interp_context_hook (int thread_id);
-
-#endif /* MI_H */
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 4fa1d911f08..b1ef28ffa5f 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -91,7 +91,7 @@ msymbol_hash_iw (const char *string)
++string;
}
}
- return hash % MINIMAL_SYMBOL_HASH_SIZE;
+ return hash;
}
/* Compute a hash code for a string. */
@@ -102,7 +102,7 @@ msymbol_hash (const char *string)
unsigned int hash = 0;
for (; *string; ++string)
hash = hash * 67 + *string - 113;
- return hash % MINIMAL_SYMBOL_HASH_SIZE;
+ return hash;
}
/* Add the minimal symbol SYM to an objfile's minsym hash table, TABLE. */
@@ -112,7 +112,7 @@ add_minsym_to_hash_table (struct minimal_symbol *sym,
{
if (sym->hash_next == NULL)
{
- unsigned int hash = msymbol_hash (SYMBOL_NAME (sym));
+ unsigned int hash = msymbol_hash (SYMBOL_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
sym->hash_next = table[hash];
table[hash] = sym;
}
@@ -126,7 +126,7 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
{
if (sym->demangled_hash_next == NULL)
{
- unsigned int hash = msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym));
+ unsigned int hash = msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
sym->demangled_hash_next = table[hash];
table[hash] = sym;
}
@@ -154,8 +154,8 @@ lookup_minimal_symbol (register const char *name, const char *sfile,
struct minimal_symbol *found_file_symbol = NULL;
struct minimal_symbol *trampoline_symbol = NULL;
- unsigned int hash = msymbol_hash (name);
- unsigned int dem_hash = msymbol_hash_iw (name);
+ unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
+ unsigned int dem_hash = msymbol_hash_iw (name) % MINIMAL_SYMBOL_HASH_SIZE;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
if (sfile != NULL)
diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c
new file mode 100644
index 00000000000..73183ca9e3b
--- /dev/null
+++ b/gdb/mips-irix-tdep.c
@@ -0,0 +1,95 @@
+/* Target-dependent code for the MIPS architecture running on IRIX,
+ for GDB, the GNU Debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "osabi.h"
+
+#include "elf-bfd.h"
+
+static void
+mips_irix_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
+ void *obj)
+{
+ enum gdb_osabi *os_ident_ptr = obj;
+ const char *name;
+ unsigned int sectsize;
+
+ name = bfd_get_section_name (abfd, sect);
+ sectsize = bfd_section_size (abfd, sect);
+
+ if (strncmp (name, ".MIPS.", 6) == 0 && sectsize > 0)
+ {
+ /* The presence of a section named with a ".MIPS." prefix is
+ indicative of an IRIX binary. */
+ *os_ident_ptr = GDB_OSABI_IRIX;
+ }
+}
+
+static enum gdb_osabi
+mips_irix_elf_osabi_sniffer (bfd *abfd)
+{
+ unsigned int elfosabi;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
+
+ /* If the generic sniffer gets a hit, return and let other sniffers
+ get a crack at it. */
+ bfd_map_over_sections (abfd,
+ generic_elf_osabi_sniff_abi_tag_sections,
+ &osabi);
+ if (osabi != GDB_OSABI_UNKNOWN)
+ return GDB_OSABI_UNKNOWN;
+
+ elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
+
+ if (elfosabi == ELFOSABI_NONE)
+ {
+ /* When elfosabi is ELFOSABI_NONE (0), then the ELF structures in the
+ file are conforming to the base specification for that machine
+ (there are no OS-specific extensions). In order to determine the
+ real OS in use we must look for OS notes that have been added.
+
+ For IRIX, we simply look for sections named with .MIPS. as
+ prefixes. */
+ bfd_map_over_sections (abfd,
+ mips_irix_elf_osabi_sniff_abi_tag_sections,
+ &osabi);
+ }
+ return osabi;
+}
+
+static void
+mips_irix_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+}
+
+void
+_initialize_mips_irix_tdep (void)
+{
+ /* Register an ELF OS ABI sniffer for IRIX binaries. */
+ gdbarch_register_osabi_sniffer (bfd_arch_mips,
+ bfd_target_elf_flavour,
+ mips_irix_elf_osabi_sniffer);
+
+ gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_IRIX,
+ mips_irix_init_abi);
+}
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 3706e2d8673..b8d41db2e3b 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -56,8 +56,8 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
/* Figure out where the longjmp will land.
We expect the first arg to be a pointer to the jmp_buf structure from
- which we extract the pc (JB_PC) that we will land at. The pc is copied
- into PC. This routine returns 1 on success. */
+ 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
mips_linux_get_longjmp_target (CORE_ADDR *pc)
@@ -67,8 +67,9 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc)
jb_addr = read_register (A0_REGNUM);
- if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
+ if (target_read_memory (jb_addr
+ + MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE,
+ buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
*pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
@@ -83,7 +84,9 @@ supply_gregset (elf_gregset_t *gregsetp)
{
int regi;
elf_greg_t *regp = *gregsetp;
- static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = EF_REG0; regi <= EF_REG31; regi++)
supply_register ((regi - EF_REG0), (char *)(regp + regi));
@@ -172,7 +175,9 @@ void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
register int regi;
- static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
+ char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+
+ memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 67409f6d18a..58e1a8b128d 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -61,14 +61,29 @@ enum
enum mips_abi
{
- MIPS_ABI_UNKNOWN,
+ MIPS_ABI_UNKNOWN = 0,
MIPS_ABI_N32,
MIPS_ABI_O32,
+ MIPS_ABI_N64,
MIPS_ABI_O64,
MIPS_ABI_EABI32,
- MIPS_ABI_EABI64
+ MIPS_ABI_EABI64,
+ MIPS_ABI_LAST
};
+static const char *mips_abi_string;
+
+static const char *mips_abi_strings[] = {
+ "auto",
+ "n32",
+ "o32",
+ "n64",
+ "o64",
+ "eabi32",
+ "eabi64",
+ NULL
+};
+
struct frame_extra_info
{
mips_extra_func_info_t proc_desc;
@@ -106,12 +121,6 @@ enum mips_fpu_type
#endif
static int mips_fpu_type_auto = 1;
static enum mips_fpu_type mips_fpu_type = MIPS_DEFAULT_FPU_TYPE;
-#define MIPS_FPU_TYPE mips_fpu_type
-
-/* Do not use "TARGET_IS_MIPS64" to test the size of floating point registers */
-#ifndef FP_REGISTER_DOUBLE
-#define FP_REGISTER_DOUBLE (REGISTER_VIRTUAL_SIZE(FP0_REGNUM) == 8)
-#endif
static int mips_debug = 0;
@@ -123,13 +132,12 @@ struct gdbarch_tdep
/* mips options */
enum mips_abi mips_abi;
- const char *mips_abi_string;
+ enum mips_abi found_abi;
enum mips_fpu_type mips_fpu_type;
int mips_last_arg_regnum;
int mips_last_fp_arg_regnum;
int mips_default_saved_regsize;
int mips_fp_register_double;
- int mips_regs_have_home_p;
int mips_default_stack_argsize;
int gdb_target_is_mips64;
int default_mask_address_p;
@@ -137,35 +145,18 @@ struct gdbarch_tdep
enum gdb_osabi osabi;
};
-#if GDB_MULTI_ARCH
-#undef MIPS_EABI
#define MIPS_EABI (gdbarch_tdep (current_gdbarch)->mips_abi == MIPS_ABI_EABI32 \
|| gdbarch_tdep (current_gdbarch)->mips_abi == MIPS_ABI_EABI64)
-#endif
-#if GDB_MULTI_ARCH
-#undef MIPS_LAST_FP_ARG_REGNUM
#define MIPS_LAST_FP_ARG_REGNUM (gdbarch_tdep (current_gdbarch)->mips_last_fp_arg_regnum)
-#endif
-#if GDB_MULTI_ARCH
-#undef MIPS_LAST_ARG_REGNUM
#define MIPS_LAST_ARG_REGNUM (gdbarch_tdep (current_gdbarch)->mips_last_arg_regnum)
-#endif
-#if GDB_MULTI_ARCH
-#undef MIPS_FPU_TYPE
#define MIPS_FPU_TYPE (gdbarch_tdep (current_gdbarch)->mips_fpu_type)
-#endif
/* Return the currently configured (or set) saved register size. */
-#if GDB_MULTI_ARCH
-#undef MIPS_DEFAULT_SAVED_REGSIZE
#define MIPS_DEFAULT_SAVED_REGSIZE (gdbarch_tdep (current_gdbarch)->mips_default_saved_regsize)
-#elif !defined (MIPS_DEFAULT_SAVED_REGSIZE)
-#define MIPS_DEFAULT_SAVED_REGSIZE MIPS_REGSIZE
-#endif
static const char *mips_saved_regsize_string = size_auto;
@@ -182,6 +173,97 @@ mips_saved_regsize (void)
return 4;
}
+/* Functions for setting and testing a bit in a minimal symbol that
+ marks it as 16-bit function. The MSB of the minimal symbol's
+ "info" field is used for this purpose. This field is already
+ being used to store the symbol size, so the assumption is
+ that the symbol size cannot exceed 2^31.
+
+ ELF_MAKE_MSYMBOL_SPECIAL tests whether an ELF symbol is "special",
+ i.e. refers to a 16-bit function, and sets a "special" bit in a
+ minimal symbol to mark it as a 16-bit function
+
+ MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
+ MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
+ the "info" field with the "special" bit masked out */
+
+static void
+mips_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
+{
+ if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_MIPS16)
+ {
+ MSYMBOL_INFO (msym) = (char *)
+ (((long) MSYMBOL_INFO (msym)) | 0x80000000);
+ SYMBOL_VALUE_ADDRESS (msym) |= 1;
+ }
+}
+
+static int
+msymbol_is_special (struct minimal_symbol *msym)
+{
+ return (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0);
+}
+
+static long
+msymbol_size (struct minimal_symbol *msym)
+{
+ return ((long) MSYMBOL_INFO (msym) & 0x7fffffff);
+}
+
+/* XFER a value from the big/little/left end of the register.
+ Depending on the size of the value it might occupy the entire
+ register or just part of it. Make an allowance for this, aligning
+ things accordingly. */
+
+static void
+mips_xfer_register (struct regcache *regcache, int reg_num, int length,
+ enum bfd_endian endian, bfd_byte *in, const bfd_byte *out,
+ int buf_offset)
+{
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ int reg_offset = 0;
+ /* Need to transfer the left or right part of the register, based on
+ the targets byte order. */
+ switch (endian)
+ {
+ case BFD_ENDIAN_BIG:
+ reg_offset = REGISTER_RAW_SIZE (reg_num) - length;
+ break;
+ case BFD_ENDIAN_LITTLE:
+ reg_offset = 0;
+ break;
+ case BFD_ENDIAN_UNKNOWN: /* Indicates no alignment. */
+ reg_offset = 0;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr,
+ "xfer $%d, reg offset %d, buf offset %d, length %d, ",
+ reg_num, reg_offset, buf_offset, length);
+ if (mips_debug && out != NULL)
+ {
+ int i;
+ fprintf_unfiltered (gdb_stdlog, "out ");
+ for (i = 0; i < length; i++)
+ fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]);
+ }
+ if (in != NULL)
+ regcache_raw_read_part (regcache, reg_num, reg_offset, length, in + buf_offset);
+ if (out != NULL)
+ regcache_raw_write_part (regcache, reg_num, reg_offset, length, out + buf_offset);
+ if (mips_debug && in != NULL)
+ {
+ int i;
+ fprintf_unfiltered (gdb_stdlog, "in ");
+ for (i = 0; i < length; i++)
+ fprintf_unfiltered (gdb_stdlog, "%02x", in[buf_offset + i]);
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, "\n");
+}
+
/* Determine if a MIPS3 or later cpu is operating in MIPS{1,2} FPU
compatiblity mode. A return value of 1 means that we have
physical 64-bit registers, but should treat them as 32-bit registers. */
@@ -212,31 +294,13 @@ mips2_fp_compat (void)
form double-precision values). Do not use "TARGET_IS_MIPS64" to
determine if the ABI is using double-precision registers. See also
MIPS_FPU_TYPE. */
-#if GDB_MULTI_ARCH
-#undef FP_REGISTER_DOUBLE
#define FP_REGISTER_DOUBLE (gdbarch_tdep (current_gdbarch)->mips_fp_register_double)
-#endif
-
-/* Does the caller allocate a ``home'' for each register used in the
- function call? The N32 ABI and MIPS_EABI do not, the others do. */
-
-#if GDB_MULTI_ARCH
-#undef MIPS_REGS_HAVE_HOME_P
-#define MIPS_REGS_HAVE_HOME_P (gdbarch_tdep (current_gdbarch)->mips_regs_have_home_p)
-#elif !defined (MIPS_REGS_HAVE_HOME_P)
-#define MIPS_REGS_HAVE_HOME_P (!MIPS_EABI)
-#endif
/* The amount of space reserved on the stack for registers. This is
different to MIPS_SAVED_REGSIZE as it determines the alignment of
data allocated after the registers have run out. */
-#if GDB_MULTI_ARCH
-#undef MIPS_DEFAULT_STACK_ARGSIZE
#define MIPS_DEFAULT_STACK_ARGSIZE (gdbarch_tdep (current_gdbarch)->mips_default_stack_argsize)
-#elif !defined (MIPS_DEFAULT_STACK_ARGSIZE)
-#define MIPS_DEFAULT_STACK_ARGSIZE (MIPS_DEFAULT_SAVED_REGSIZE)
-#endif
#define MIPS_STACK_ARGSIZE (mips_stack_argsize ())
@@ -253,17 +317,9 @@ mips_stack_argsize (void)
return 4;
}
-#if GDB_MULTI_ARCH
-#undef GDB_TARGET_IS_MIPS64
#define GDB_TARGET_IS_MIPS64 (gdbarch_tdep (current_gdbarch)->gdb_target_is_mips64 + 0)
-#endif
-#if GDB_MULTI_ARCH
-#undef MIPS_DEFAULT_MASK_ADDRESS_P
#define MIPS_DEFAULT_MASK_ADDRESS_P (gdbarch_tdep (current_gdbarch)->default_mask_address_p)
-#elif !defined (MIPS_DEFAULT_MASK_ADDRESS_P)
-#define MIPS_DEFAULT_MASK_ADDRESS_P (0)
-#endif
#define VM_MIN_ADDRESS (CORE_ADDR)0x400000
@@ -278,7 +334,7 @@ static CORE_ADDR heuristic_proc_start (CORE_ADDR);
static CORE_ADDR read_next_frame_reg (struct frame_info *, int);
-int mips_set_processor_type (char *);
+static int mips_set_processor_type (char *);
static void mips_show_processor_type_command (char *, int);
@@ -314,7 +370,7 @@ static struct cmd_list_element *showmipscmdlist = NULL;
char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES;
char **mips_processor_reg_names = mips_generic_reg_names;
-char *
+static const char *
mips_register_name (int i)
{
return mips_processor_reg_names[i];
@@ -425,6 +481,8 @@ static unsigned int heuristic_fence_post = 0;
#define PROC_REG_OFFSET(proc) ((proc)->pdr.regoffset)
#define PROC_FREG_OFFSET(proc) ((proc)->pdr.fregoffset)
#define PROC_PC_REG(proc) ((proc)->pdr.pcreg)
+/* FIXME drow/2002-06-10: If a pointer on the host is bigger than a long,
+ this will corrupt pdr.iline. Fortunately we don't use it. */
#define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->pdr.isym)
#define _PROC_MAGIC_ 0x0F0F0F0F
#define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_)
@@ -455,7 +513,7 @@ mips_print_extra_frame_info (struct frame_info *fi)
static int mips64_transfers_32bit_regs_p = 0;
-int
+static int
mips_register_raw_size (int reg_nr)
{
if (mips64_transfers_32bit_regs_p)
@@ -472,7 +530,7 @@ mips_register_raw_size (int reg_nr)
/* Convert between RAW and VIRTUAL registers. The RAW register size
defines the remote-gdb packet. */
-int
+static int
mips_register_convertible (int reg_nr)
{
if (mips64_transfers_32bit_regs_p)
@@ -481,7 +539,7 @@ mips_register_convertible (int reg_nr)
return (REGISTER_RAW_SIZE (reg_nr) > REGISTER_VIRTUAL_SIZE (reg_nr));
}
-void
+static void
mips_register_convert_to_virtual (int n, struct type *virtual_type,
char *raw_buf, char *virt_buf)
{
@@ -495,7 +553,7 @@ mips_register_convert_to_virtual (int n, struct type *virtual_type,
TYPE_LENGTH (virtual_type));
}
-void
+static void
mips_register_convert_to_raw (struct type *virtual_type, int n,
char *virt_buf, char *raw_buf)
{
@@ -510,20 +568,96 @@ mips_register_convert_to_raw (struct type *virtual_type, int n,
TYPE_LENGTH (virtual_type));
}
+void
+mips_register_convert_to_type (int regnum, struct type *type, char *buffer)
+{
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && REGISTER_RAW_SIZE (regnum) == 4
+ && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32
+ && TYPE_CODE(type) == TYPE_CODE_FLT
+ && TYPE_LENGTH(type) == 8)
+ {
+ char temp[4];
+ memcpy (temp, ((char *)(buffer))+4, 4);
+ memcpy (((char *)(buffer))+4, (buffer), 4);
+ memcpy (((char *)(buffer)), temp, 4);
+ }
+}
+
+void
+mips_register_convert_from_type (int regnum, struct type *type, char *buffer)
+{
+if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && REGISTER_RAW_SIZE (regnum) == 4
+ && (regnum) >= FP0_REGNUM && (regnum) < FP0_REGNUM + 32
+ && TYPE_CODE(type) == TYPE_CODE_FLT
+ && TYPE_LENGTH(type) == 8)
+ {
+ char temp[4];
+ memcpy (temp, ((char *)(buffer))+4, 4);
+ memcpy (((char *)(buffer))+4, (buffer), 4);
+ memcpy (((char *)(buffer)), temp, 4);
+ }
+}
+
+/* Return the GDB type object for the "standard" data type
+ of data in register REG.
+
+ Note: kevinb/2002-08-01: The definition below should faithfully
+ reproduce the behavior of each of the REGISTER_VIRTUAL_TYPE
+ definitions found in config/mips/tm-*.h. I'm concerned about
+ the ``FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM'' clause
+ though. In some cases FP_REGNUM is in this range, and I doubt
+ that this code is correct for the 64-bit case. */
+
+static struct type *
+mips_register_virtual_type (int reg)
+{
+ if (FP0_REGNUM <= reg && reg < FP0_REGNUM + 32)
+ {
+ /* Floating point registers... */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ return builtin_type_ieee_double_big;
+ else
+ return builtin_type_ieee_double_little;
+ }
+ else if (reg == PS_REGNUM /* CR */)
+ return builtin_type_uint32;
+ else if (FCRCS_REGNUM <= reg && reg <= LAST_EMBED_REGNUM)
+ return builtin_type_uint32;
+ else
+ {
+ /* Everything else...
+ Return type appropriate for width of register. */
+ if (MIPS_REGSIZE == TYPE_LENGTH (builtin_type_uint64))
+ return builtin_type_uint64;
+ else
+ return builtin_type_uint32;
+ }
+}
+
+/* TARGET_READ_SP -- Remove useless bits from the stack pointer. */
+
+static CORE_ADDR
+mips_read_sp (void)
+{
+ return ADDR_BITS_REMOVE (read_register (SP_REGNUM));
+}
+
/* Should the upper word of 64-bit addresses be zeroed? */
-enum cmd_auto_boolean mask_address_var = CMD_AUTO_BOOLEAN_AUTO;
+enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO;
static int
mips_mask_address_p (void)
{
switch (mask_address_var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
return 1;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
return 0;
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
return MIPS_DEFAULT_MASK_ADDRESS_P;
default:
internal_error (__FILE__, __LINE__,
@@ -533,17 +667,17 @@ mips_mask_address_p (void)
}
static void
-show_mask_address (char *cmd, int from_tty)
+show_mask_address (char *cmd, int from_tty, struct cmd_list_element *c)
{
switch (mask_address_var)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
printf_filtered ("The 32 bit mips address mask is enabled\n");
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
printf_filtered ("The 32 bit mips address mask is disabled\n");
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
printf_filtered ("The 32 bit address mask is set automatically. Currently %s\n",
mips_mask_address_p () ? "enabled" : "disabled");
break;
@@ -555,13 +689,51 @@ show_mask_address (char *cmd, int from_tty)
}
/* Should call_function allocate stack space for a struct return? */
-int
-mips_use_struct_convention (int gcc_p, struct type *type)
+
+static int
+mips_eabi_use_struct_convention (int gcc_p, struct type *type)
{
- if (MIPS_EABI)
- return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
- else
- return 1; /* Structures are returned by ref in extra arg0 */
+ return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
+}
+
+static int
+mips_n32n64_use_struct_convention (int gcc_p, struct type *type)
+{
+ return (TYPE_LENGTH (type) > 2 * MIPS_SAVED_REGSIZE);
+}
+
+static int
+mips_o32_use_struct_convention (int gcc_p, struct type *type)
+{
+ return 1; /* Structures are returned by ref in extra arg0. */
+}
+
+/* Should call_function pass struct by reference?
+ For each architecture, structs are passed either by
+ value or by reference, depending on their size. */
+
+static int
+mips_eabi_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ enum type_code typecode = TYPE_CODE (check_typedef (type));
+ int len = TYPE_LENGTH (check_typedef (type));
+
+ if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
+ return (len > MIPS_SAVED_REGSIZE);
+
+ return 0;
+}
+
+static int
+mips_n32n64_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ return 0; /* Assumption: N32/N64 never passes struct by ref. */
+}
+
+static int
+mips_o32_reg_struct_has_addr (int gcc_p, struct type *type)
+{
+ return 0; /* Assumption: O32/O64 never passes struct by ref. */
}
/* Tell if the program counter value in MEMADDR is in a MIPS16 function. */
@@ -580,7 +752,7 @@ pc_is_mips16 (bfd_vma memaddr)
MIPS16 or normal MIPS. */
sym = lookup_minimal_symbol_by_pc (memaddr);
if (sym)
- return MSYMBOL_IS_SPECIAL (sym);
+ return msymbol_is_special (sym);
else
return 0;
}
@@ -748,7 +920,7 @@ mips32_relative_offset (unsigned long inst)
/* Determine whate to set a single step breakpoint while considering
branch prediction */
-CORE_ADDR
+static CORE_ADDR
mips32_next_pc (CORE_ADDR pc)
{
unsigned long inst;
@@ -1064,7 +1236,6 @@ static CORE_ADDR
add_offset_16 (CORE_ADDR pc, int offset)
{
return ((offset << 2) | ((pc + 2) & (0xf0000000)));
-
}
static CORE_ADDR
@@ -1188,7 +1359,7 @@ extended_mips16_next_pc (CORE_ADDR pc,
return pc;
}
-CORE_ADDR
+static CORE_ADDR
mips16_next_pc (CORE_ADDR pc)
{
unsigned int insn = fetch_mips_16 (pc);
@@ -1210,9 +1381,17 @@ mips_next_pc (CORE_ADDR pc)
}
/* Guaranteed to set fci->saved_regs to some values (it never leaves it
- NULL). */
+ NULL).
-void
+ Note: kevinb/2002-08-09: The only caller of this function is (and
+ should remain) mips_frame_init_saved_regs(). In fact,
+ aside from calling mips_find_saved_regs(), mips_frame_init_saved_regs()
+ does nothing more than set frame->saved_regs[SP_REGNUM]. These two
+ functions should really be combined and now that there is only one
+ caller, it should be straightforward. (Watch out for multiple returns
+ though.) */
+
+static void
mips_find_saved_regs (struct frame_info *fci)
{
int ireg;
@@ -1362,9 +1541,20 @@ mips_find_saved_regs (struct frame_info *fci)
were saved. */
reg_position = fci->frame + PROC_FREG_OFFSET (proc_desc);
- /* The freg_offset points to where the first *double* register
- is saved. So skip to the high-order word. */
- if (!GDB_TARGET_IS_MIPS64)
+ /* Apparently, the freg_offset gives the offset to the first 64 bit
+ saved.
+
+ When the ABI specifies 64 bit saved registers, the FREG_OFFSET
+ designates the first saved 64 bit register.
+
+ When the ABI specifies 32 bit saved registers, the ``64 bit saved
+ DOUBLE'' consists of two adjacent 32 bit registers, Hence
+ FREG_OFFSET, designates the address of the lower register of the
+ register pair. Adjust the offset so that it designates the upper
+ register of the pair -- i.e., the address of the first saved 32
+ bit register. */
+
+ if (MIPS_SAVED_REGSIZE == 4)
reg_position += MIPS_SAVED_REGSIZE;
/* Fill in the offsets for the float registers which float_mask says
@@ -1379,6 +1569,23 @@ mips_find_saved_regs (struct frame_info *fci)
fci->saved_regs[PC_REGNUM] = fci->saved_regs[RA_REGNUM];
}
+/* Set up the 'saved_regs' array. This is a data structure containing
+ the addresses on the stack where each register has been saved, for
+ each stack frame. Registers that have not been saved will have
+ zero here. The stack pointer register is special: rather than the
+ address where the stack register has been saved, saved_regs[SP_REGNUM]
+ will have the actual value of the previous frame's stack register. */
+
+static void
+mips_frame_init_saved_regs (struct frame_info *frame)
+{
+ if (frame->saved_regs == NULL)
+ {
+ mips_find_saved_regs (frame);
+ }
+ frame->saved_regs[SP_REGNUM] = frame->frame;
+}
+
static CORE_ADDR
read_next_frame_reg (struct frame_info *fi, int regno)
{
@@ -1391,7 +1598,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
else
{
if (fi->saved_regs == NULL)
- mips_find_saved_regs (fi);
+ FRAME_INIT_SAVED_REGS (fi);
if (fi->saved_regs[regno])
return read_memory_integer (ADDR_BITS_REMOVE (fi->saved_regs[regno]), MIPS_SAVED_REGSIZE);
}
@@ -1474,12 +1681,12 @@ 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 = mips_skip_stub (pc);
+ tmp = SKIP_TRAMPOLINE_CODE (pc);
prev->pc = tmp ? tmp : pc;
}
-CORE_ADDR
+static CORE_ADDR
mips_frame_saved_pc (struct frame_info *frame)
{
CORE_ADDR saved_pc;
@@ -1932,6 +2139,30 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
return &temp_proc_desc;
}
+struct mips_objfile_private
+{
+ bfd_size_type size;
+ char *contents;
+};
+
+/* Global used to communicate between non_heuristic_proc_desc and
+ compare_pdr_entries within qsort (). */
+static bfd *the_bfd;
+
+static int
+compare_pdr_entries (const void *a, const void *b)
+{
+ CORE_ADDR lhs = bfd_get_32 (the_bfd, (bfd_byte *) a);
+ CORE_ADDR rhs = bfd_get_32 (the_bfd, (bfd_byte *) b);
+
+ if (lhs < rhs)
+ return -1;
+ else if (lhs == rhs)
+ return 0;
+ else
+ return 1;
+}
+
static mips_extra_func_info_t
non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
{
@@ -1939,23 +2170,145 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr)
mips_extra_func_info_t proc_desc;
struct block *b = block_for_pc (pc);
struct symbol *sym;
+ struct obj_section *sec;
+ struct mips_objfile_private *priv;
+
+ if (PC_IN_CALL_DUMMY (pc, 0, 0))
+ return NULL;
find_pc_partial_function (pc, NULL, &startaddr, NULL);
if (addrptr)
*addrptr = startaddr;
- if (b == NULL || PC_IN_CALL_DUMMY (pc, 0, 0))
- sym = NULL;
- else
+
+ priv = NULL;
+
+ sec = find_pc_section (pc);
+ if (sec != NULL)
{
- if (startaddr > BLOCK_START (b))
- /* This is the "pathological" case referred to in a comment in
- print_frame_info. It might be better to move this check into
- symbol reading. */
- sym = NULL;
- else
- sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, 0, NULL);
+ priv = (struct mips_objfile_private *) sec->objfile->obj_private;
+
+ /* Search the ".pdr" section generated by GAS. This includes most of
+ the information normally found in ECOFF PDRs. */
+
+ the_bfd = sec->objfile->obfd;
+ if (priv == NULL
+ && (the_bfd->format == bfd_object
+ && bfd_get_flavour (the_bfd) == bfd_target_elf_flavour
+ && elf_elfheader (the_bfd)->e_ident[EI_CLASS] == ELFCLASS64))
+ {
+ /* Right now GAS only outputs the address as a four-byte sequence.
+ This means that we should not bother with this method on 64-bit
+ targets (until that is fixed). */
+
+ priv = obstack_alloc (& sec->objfile->psymbol_obstack,
+ sizeof (struct mips_objfile_private));
+ priv->size = 0;
+ sec->objfile->obj_private = priv;
+ }
+ else if (priv == NULL)
+ {
+ asection *bfdsec;
+
+ priv = obstack_alloc (& sec->objfile->psymbol_obstack,
+ sizeof (struct mips_objfile_private));
+
+ bfdsec = bfd_get_section_by_name (sec->objfile->obfd, ".pdr");
+ if (bfdsec != NULL)
+ {
+ priv->size = bfd_section_size (sec->objfile->obfd, bfdsec);
+ priv->contents = obstack_alloc (& sec->objfile->psymbol_obstack,
+ priv->size);
+ bfd_get_section_contents (sec->objfile->obfd, bfdsec,
+ priv->contents, 0, priv->size);
+
+ /* In general, the .pdr section is sorted. However, in the
+ presence of multiple code sections (and other corner cases)
+ it can become unsorted. Sort it so that we can use a faster
+ binary search. */
+ qsort (priv->contents, priv->size / 32, 32, compare_pdr_entries);
+ }
+ else
+ priv->size = 0;
+
+ sec->objfile->obj_private = priv;
+ }
+ the_bfd = NULL;
+
+ if (priv->size != 0)
+ {
+ int low, mid, high;
+ char *ptr;
+
+ low = 0;
+ high = priv->size / 32;
+
+ do
+ {
+ CORE_ADDR pdr_pc;
+
+ mid = (low + high) / 2;
+
+ ptr = priv->contents + mid * 32;
+ pdr_pc = bfd_get_signed_32 (sec->objfile->obfd, ptr);
+ pdr_pc += ANOFFSET (sec->objfile->section_offsets,
+ SECT_OFF_TEXT (sec->objfile));
+ if (pdr_pc == startaddr)
+ break;
+ if (pdr_pc > startaddr)
+ high = mid;
+ else
+ low = mid + 1;
+ }
+ while (low != high);
+
+ if (low != high)
+ {
+ struct symbol *sym = find_pc_function (pc);
+
+ /* Fill in what we need of the proc_desc. */
+ proc_desc = (mips_extra_func_info_t)
+ obstack_alloc (&sec->objfile->psymbol_obstack,
+ sizeof (struct mips_extra_func_info));
+ PROC_LOW_ADDR (proc_desc) = startaddr;
+
+ /* Only used for dummy frames. */
+ PROC_HIGH_ADDR (proc_desc) = 0;
+
+ PROC_FRAME_OFFSET (proc_desc)
+ = bfd_get_32 (sec->objfile->obfd, ptr + 20);
+ PROC_FRAME_REG (proc_desc) = bfd_get_32 (sec->objfile->obfd,
+ ptr + 24);
+ PROC_FRAME_ADJUST (proc_desc) = 0;
+ PROC_REG_MASK (proc_desc) = bfd_get_32 (sec->objfile->obfd,
+ ptr + 4);
+ PROC_FREG_MASK (proc_desc) = bfd_get_32 (sec->objfile->obfd,
+ ptr + 12);
+ PROC_REG_OFFSET (proc_desc) = bfd_get_32 (sec->objfile->obfd,
+ ptr + 8);
+ PROC_FREG_OFFSET (proc_desc)
+ = bfd_get_32 (sec->objfile->obfd, ptr + 16);
+ PROC_PC_REG (proc_desc) = bfd_get_32 (sec->objfile->obfd,
+ ptr + 28);
+ proc_desc->pdr.isym = (long) sym;
+
+ return proc_desc;
+ }
+ }
}
+ if (b == NULL)
+ return NULL;
+
+ if (startaddr > BLOCK_START (b))
+ {
+ /* This is the "pathological" case referred to in a comment in
+ print_frame_info. It might be better to move this check into
+ symbol reading. */
+ return NULL;
+ }
+
+ sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, 0, NULL);
+
/* If we never found a PDR for this function in symbol reading, then
examine prologues to find the information. */
if (sym)
@@ -1991,7 +2344,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
{
struct symtab_and_line val;
struct symbol *proc_symbol =
- PROC_DESC_IS_DUMMY (proc_desc) ? 0 : PROC_SYMBOL (proc_desc);
+ PROC_DESC_IS_DUMMY (proc_desc) ? 0 : PROC_SYMBOL (proc_desc);
if (proc_symbol)
{
@@ -2003,8 +2356,8 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
if (!proc_symbol || pc < val.pc)
{
mips_extra_func_info_t found_heuristic =
- heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
- pc, next_frame, cur_frame);
+ heuristic_proc_desc (PROC_LOW_ADDR (proc_desc),
+ pc, next_frame, cur_frame);
if (found_heuristic)
proc_desc = found_heuristic;
}
@@ -2037,14 +2390,15 @@ static CORE_ADDR
get_frame_pointer (struct frame_info *frame,
mips_extra_func_info_t proc_desc)
{
- return ADDR_BITS_REMOVE (
- read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc)) +
- PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc));
+ return ADDR_BITS_REMOVE (read_next_frame_reg (frame,
+ PROC_FRAME_REG (proc_desc)) +
+ PROC_FRAME_OFFSET (proc_desc) -
+ PROC_FRAME_ADJUST (proc_desc));
}
-mips_extra_func_info_t cached_proc_desc;
+static mips_extra_func_info_t cached_proc_desc;
-CORE_ADDR
+static CORE_ADDR
mips_frame_chain (struct frame_info *frame)
{
mips_extra_func_info_t proc_desc;
@@ -2056,7 +2410,7 @@ mips_frame_chain (struct frame_info *frame)
/* Check if the PC is inside a call stub. If it is, fetch the
PC of the caller of that stub. */
- if ((tmp = mips_skip_stub (saved_pc)) != 0)
+ if ((tmp = SKIP_TRAMPOLINE_CODE (saved_pc)) != 0)
saved_pc = tmp;
/* Look up the procedure descriptor for this PC. */
@@ -2071,22 +2425,24 @@ mips_frame_chain (struct frame_info *frame)
we loop forever if we see a zero size frame. */
if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
&& 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)
+ /* The previous frame from a sigtramp frame might be frameless
+ and have frame size zero. */
+ && !frame->signal_handler_caller
+ /* Check if this is a call dummy frame. */
+ && frame->pc != CALL_DUMMY_ADDRESS ())
return 0;
else
return get_frame_pointer (frame, proc_desc);
}
-void
+static void
mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
{
int regnum;
/* Use proc_desc calculated in frame_chain */
mips_extra_func_info_t proc_desc =
- fci->next ? cached_proc_desc : find_proc_desc (fci->pc, fci->next, 1);
+ fci->next ? cached_proc_desc : find_proc_desc (fci->pc, fci->next, 1);
fci->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
@@ -2121,6 +2477,12 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
fci->saved_regs[PC_REGNUM]
= fci->saved_regs[RA_REGNUM];
+ /* Set value of previous frame's stack pointer. Remember that
+ saved_regs[SP_REGNUM] is special in that it contains the
+ value of the stack pointer register. The other saved_regs
+ values are addresses (in the inferior) at which a given
+ register's value may be found. */
+ fci->saved_regs[SP_REGNUM] = fci->frame;
}
}
@@ -2176,7 +2538,7 @@ fp_register_arg_p (enum type_code typecode, struct type *arg_type)
&& (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
&& TYPE_NFIELDS (arg_type) == 1
&& TYPE_CODE (TYPE_FIELD_TYPE (arg_type, 0)) == TYPE_CODE_FLT))
- && MIPS_FPU_TYPE != MIPS_FPU_NONE);
+ && MIPS_FPU_TYPE != MIPS_FPU_NONE);
}
/* On o32, argument passing in GPRs depends on the alignment of the type being
@@ -2208,12 +2570,18 @@ mips_type_needs_double_align (struct type *type)
return 0;
}
-CORE_ADDR
-mips_push_arguments (int nargs,
- struct value **args,
- CORE_ADDR sp,
- int struct_return,
- CORE_ADDR struct_addr)
+/* Macros to round N up or down to the next A boundary;
+ A must be a power of two. */
+
+#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
+#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
+
+static CORE_ADDR
+mips_eabi_push_arguments (int nargs,
+ struct value **args,
+ CORE_ADDR sp,
+ int struct_return,
+ CORE_ADDR struct_addr)
{
int argreg;
int float_argreg;
@@ -2221,44 +2589,40 @@ mips_push_arguments (int nargs,
int len = 0;
int stack_offset = 0;
- /* Macros to round N up or down to the next A boundary; A must be
- a power of two. */
-#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
-#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
-
/* First ensure that the stack and structure return address (if any)
- are properly aligned. The stack has to be at least 64-bit aligned
- even on 32-bit machines, because doubles must be 64-bit aligned.
- On at least one MIPS variant, stack frames need to be 128-bit
- aligned, so we round to this widest known alignment. */
+ are properly aligned. The stack has to be at least 64-bit
+ aligned even on 32-bit machines, because doubles must be 64-bit
+ aligned. For n32 and n64, stack frames need to be 128-bit
+ aligned, so we round to this widest known alignment. */
+
sp = ROUND_DOWN (sp, 16);
struct_addr = ROUND_DOWN (struct_addr, 16);
- /* Now make space on the stack for the args. We allocate more
+ /* Now make space on the stack for the args. We allocate more
than necessary for EABI, because the first few arguments are
- passed in registers, but that's OK. */
+ passed in registers, but that's OK. */
for (argnum = 0; argnum < nargs; argnum++)
- len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), MIPS_STACK_ARGSIZE);
+ len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ MIPS_STACK_ARGSIZE);
sp -= ROUND_UP (len, 16);
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog, "mips_push_arguments: sp=0x%lx allocated %d\n",
- (long) sp, ROUND_UP (len, 16));
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_eabi_push_arguments: sp=0x%s allocated %d\n",
+ paddr_nz (sp), ROUND_UP (len, 16));
/* Initialize the integer and float register pointers. */
argreg = A0_REGNUM;
float_argreg = FPA0_REGNUM;
- /* the struct_return pointer occupies the first parameter-passing reg */
+ /* The struct_return pointer occupies the first parameter-passing reg. */
if (struct_return)
{
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_push_arguments: struct_return reg=%d 0x%lx\n",
- argreg, (long) struct_addr);
+ "mips_eabi_push_arguments: struct_return reg=%d 0x%s\n",
+ argreg, paddr_nz (struct_addr));
write_register (argreg++, struct_addr);
- if (MIPS_REGS_HAVE_HOME_P)
- stack_offset += MIPS_STACK_ARGSIZE;
}
/* Now load as many as possible of the first arguments into
@@ -2267,7 +2631,7 @@ mips_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char valbuf[MAX_REGISTER_RAW_SIZE];
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -2275,13 +2639,12 @@ mips_push_arguments (int nargs,
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
- "mips_push_arguments: %d len=%d type=%d",
+ "mips_eabi_push_arguments: %d len=%d type=%d",
argnum + 1, len, (int) typecode);
/* The EABI passes structures that do not fit in a register by
- reference. In all other cases, pass the structure by value. */
- if (MIPS_EABI
- && len > MIPS_SAVED_REGSIZE
+ reference. */
+ if (len > MIPS_SAVED_REGSIZE
&& (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
{
store_address (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg));
@@ -2297,8 +2660,8 @@ mips_push_arguments (int nargs,
/* 32-bit ABIs always start floating point arguments in an
even-numbered floating point register. Round the FP register
up before the check to see if there are any FP registers
- left. Non MIPS_EABI targets also pass the FP in the integer
- registers so also round up normal registers. */
+ left. Non MIPS_EABI targets also pass the FP in the integer
+ registers so also round up normal registers. */
if (!FP_REGISTER_DOUBLE
&& fp_register_arg_p (typecode, arg_type))
{
@@ -2317,7 +2680,7 @@ mips_push_arguments (int nargs,
because those registers are normally skipped. */
/* MIPS_EABI squeezes a struct that contains a single floating
point value into an FP register instead of pushing it onto the
- stack. */
+ stack. */
if (fp_register_arg_p (typecode, arg_type)
&& float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
{
@@ -2332,13 +2695,6 @@ mips_push_arguments (int nargs,
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
float_argreg, phex (regval, 4));
write_register (float_argreg++, regval);
- if (!MIPS_EABI)
- {
- if (mips_debug)
- fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
- argreg, phex (regval, 4));
- write_register (argreg++, regval);
- }
/* Write the high word of the double to the odd register(s). */
regval = extract_unsigned_integer (val + 4 - low_offset, 4);
@@ -2346,42 +2702,801 @@ mips_push_arguments (int nargs,
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
float_argreg, phex (regval, 4));
write_register (float_argreg++, regval);
- if (!MIPS_EABI)
+ }
+ else
+ {
+ /* This is a floating point value that fits entirely
+ in a single register. */
+ /* On 32 bit ABI's the float_argreg is further adjusted
+ above to ensure that it is even register aligned. */
+ LONGEST regval = extract_unsigned_integer (val, len);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, len));
+ write_register (float_argreg++, regval);
+ }
+ }
+ else
+ {
+ /* Copy the argument to general registers or the stack in
+ register-sized pieces. Large arguments are split between
+ registers and stack. */
+ /* Note: structs whose size is not a multiple of MIPS_REGSIZE
+ are treated specially: Irix cc passes them in registers
+ where gcc sometimes puts them on the stack. For maximum
+ compatibility, we will put them in both places. */
+ int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) &&
+ (len % MIPS_SAVED_REGSIZE != 0));
+
+ /* Note: Floating-point values that didn't fit into an FP
+ register are only written to memory. */
+ while (len > 0)
+ {
+ /* Remember if the argument was written to the stack. */
+ int stack_used_p = 0;
+ int partial_len =
+ len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE;
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
+ partial_len);
+
+ /* Write this portion of the argument to the stack. */
+ if (argreg > MIPS_LAST_ARG_REGNUM
+ || odd_sized_struct
+ || fp_register_arg_p (typecode, arg_type))
{
+ /* Should shorter than int integer values be
+ promoted to int before being stored? */
+ int longword_offset = 0;
+ CORE_ADDR addr;
+ stack_used_p = 1;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ if (MIPS_STACK_ARGSIZE == 8 &&
+ (typecode == TYPE_CODE_INT ||
+ typecode == TYPE_CODE_PTR ||
+ typecode == TYPE_CODE_FLT) && len <= 4)
+ longword_offset = MIPS_STACK_ARGSIZE - len;
+ else if ((typecode == TYPE_CODE_STRUCT ||
+ typecode == TYPE_CODE_UNION) &&
+ TYPE_LENGTH (arg_type) < MIPS_STACK_ARGSIZE)
+ longword_offset = MIPS_STACK_ARGSIZE - len;
+ }
+
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
- argreg, phex (regval, 4));
- write_register (argreg++, regval);
+ {
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
+ paddr_nz (stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
+ paddr_nz (longword_offset));
+ }
+
+ addr = sp + stack_offset + longword_offset;
+
+ if (mips_debug)
+ {
+ int i;
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ paddr_nz (addr));
+ for (i = 0; i < partial_len; i++)
+ {
+ fprintf_unfiltered (gdb_stdlog, "%02x",
+ val[i] & 0xff);
+ }
+ }
+ write_memory (addr, val, partial_len);
}
+ /* Note!!! This is NOT an else clause. Odd sized
+ structs may go thru BOTH paths. Floating point
+ arguments will not. */
+ /* Write this portion of the argument to a general
+ purpose register. */
+ if (argreg <= MIPS_LAST_ARG_REGNUM
+ && !fp_register_arg_p (typecode, arg_type))
+ {
+ LONGEST regval = extract_unsigned_integer (val, partial_len);
+
+ if (mips_debug)
+ fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
+ argreg,
+ phex (regval, MIPS_SAVED_REGSIZE));
+ write_register (argreg, regval);
+ argreg++;
+ }
+
+ len -= partial_len;
+ val += partial_len;
+
+ /* Compute the the offset into the stack at which we
+ will copy the next parameter.
+
+ In the new EABI (and the NABI32), the stack_offset
+ only needs to be adjusted when it has been used. */
+
+ if (stack_used_p)
+ stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+ }
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, "\n");
+ }
+
+ /* Return adjusted stack pointer. */
+ return sp;
+}
+
+/* N32/N64 version of push_arguments. */
+
+static CORE_ADDR
+mips_n32n64_push_arguments (int nargs,
+ struct value **args,
+ CORE_ADDR sp,
+ int struct_return,
+ CORE_ADDR struct_addr)
+{
+ int argreg;
+ int float_argreg;
+ int argnum;
+ int len = 0;
+ int stack_offset = 0;
+
+ /* First ensure that the stack and structure return address (if any)
+ are properly aligned. The stack has to be at least 64-bit
+ aligned even on 32-bit machines, because doubles must be 64-bit
+ aligned. For n32 and n64, stack frames need to be 128-bit
+ aligned, so we round to this widest known alignment. */
+
+ sp = ROUND_DOWN (sp, 16);
+ struct_addr = ROUND_DOWN (struct_addr, 16);
+
+ /* Now make space on the stack for the args. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ MIPS_STACK_ARGSIZE);
+ sp -= ROUND_UP (len, 16);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_n32n64_push_arguments: sp=0x%s allocated %d\n",
+ paddr_nz (sp), ROUND_UP (len, 16));
+
+ /* Initialize the integer and float register pointers. */
+ argreg = A0_REGNUM;
+ float_argreg = FPA0_REGNUM;
+
+ /* The struct_return pointer occupies the first parameter-passing reg. */
+ if (struct_return)
+ {
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_n32n64_push_arguments: struct_return reg=%d 0x%s\n",
+ argreg, paddr_nz (struct_addr));
+ write_register (argreg++, struct_addr);
+ }
+
+ /* Now load as many as possible of the first arguments into
+ registers, and push the rest onto the stack. Loop thru args
+ from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ char *val;
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ int len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_n32n64_push_arguments: %d len=%d type=%d",
+ argnum + 1, len, (int) typecode);
+
+ val = (char *) VALUE_CONTENTS (arg);
+
+ if (fp_register_arg_p (typecode, arg_type)
+ && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
+ {
+ /* This is a floating point value that fits entirely
+ in a single register. */
+ /* On 32 bit ABI's the float_argreg is further adjusted
+ above to ensure that it is even register aligned. */
+ LONGEST regval = extract_unsigned_integer (val, len);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, len));
+ write_register (float_argreg++, regval);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, len));
+ write_register (argreg, regval);
+ argreg += 1;
+ }
+ else
+ {
+ /* Copy the argument to general registers or the stack in
+ register-sized pieces. Large arguments are split between
+ registers and stack. */
+ /* Note: structs whose size is not a multiple of MIPS_REGSIZE
+ are treated specially: Irix cc passes them in registers
+ where gcc sometimes puts them on the stack. For maximum
+ compatibility, we will put them in both places. */
+ int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) &&
+ (len % MIPS_SAVED_REGSIZE != 0));
+ /* Note: Floating-point values that didn't fit into an FP
+ register are only written to memory. */
+ while (len > 0)
+ {
+ /* Rememer if the argument was written to the stack. */
+ int stack_used_p = 0;
+ int partial_len = len < MIPS_SAVED_REGSIZE ?
+ len : MIPS_SAVED_REGSIZE;
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
+ partial_len);
+
+ /* Write this portion of the argument to the stack. */
+ if (argreg > MIPS_LAST_ARG_REGNUM
+ || odd_sized_struct
+ || fp_register_arg_p (typecode, arg_type))
+ {
+ /* Should shorter than int integer values be
+ promoted to int before being stored? */
+ int longword_offset = 0;
+ CORE_ADDR addr;
+ stack_used_p = 1;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ if (MIPS_STACK_ARGSIZE == 8 &&
+ (typecode == TYPE_CODE_INT ||
+ typecode == TYPE_CODE_PTR ||
+ typecode == TYPE_CODE_FLT) && len <= 4)
+ longword_offset = MIPS_STACK_ARGSIZE - len;
+ else if ((typecode == TYPE_CODE_STRUCT ||
+ typecode == TYPE_CODE_UNION) &&
+ TYPE_LENGTH (arg_type) < MIPS_STACK_ARGSIZE)
+ longword_offset = MIPS_STACK_ARGSIZE - len;
+ }
+
+ if (mips_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
+ paddr_nz (stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
+ paddr_nz (longword_offset));
+ }
+
+ addr = sp + stack_offset + longword_offset;
+
+ if (mips_debug)
+ {
+ int i;
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ paddr_nz (addr));
+ for (i = 0; i < partial_len; i++)
+ {
+ fprintf_unfiltered (gdb_stdlog, "%02x",
+ val[i] & 0xff);
+ }
+ }
+ write_memory (addr, val, partial_len);
+ }
+
+ /* Note!!! This is NOT an else clause. Odd sized
+ structs may go thru BOTH paths. Floating point
+ arguments will not. */
+ /* Write this portion of the argument to a general
+ purpose register. */
+ if (argreg <= MIPS_LAST_ARG_REGNUM
+ && !fp_register_arg_p (typecode, arg_type))
+ {
+ LONGEST regval = extract_unsigned_integer (val, partial_len);
+
+ /* A non-floating-point argument being passed in a
+ general register. If a struct or union, and if
+ the remaining length is smaller than the register
+ size, we have to adjust the register value on
+ big endian targets.
+
+ It does not seem to be necessary to do the
+ same for integral types.
+
+ cagney/2001-07-23: gdb/179: Also, GCC, when
+ outputting LE O32 with sizeof (struct) <
+ MIPS_SAVED_REGSIZE, generates a left shift as
+ part of storing the argument in a register a
+ register (the left shift isn't generated when
+ sizeof (struct) >= MIPS_SAVED_REGSIZE). Since it
+ is quite possible that this is GCC contradicting
+ the LE/O32 ABI, GDB has not been adjusted to
+ accommodate this. Either someone needs to
+ demonstrate that the LE/O32 ABI specifies such a
+ left shift OR this new ABI gets identified as
+ such and GDB gets tweaked accordingly. */
+
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && partial_len < MIPS_SAVED_REGSIZE
+ && (typecode == TYPE_CODE_STRUCT ||
+ typecode == TYPE_CODE_UNION))
+ regval <<= ((MIPS_SAVED_REGSIZE - partial_len) *
+ TARGET_CHAR_BIT);
+
+ if (mips_debug)
+ fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
+ argreg,
+ phex (regval, MIPS_SAVED_REGSIZE));
+ write_register (argreg, regval);
+ argreg++;
+ }
+
+ len -= partial_len;
+ val += partial_len;
+
+ /* Compute the the offset into the stack at which we
+ will copy the next parameter.
+
+ In N32 (N64?), the stack_offset only needs to be
+ adjusted when it has been used. */
+
+ if (stack_used_p)
+ stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+ }
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, "\n");
+ }
+
+ /* Return adjusted stack pointer. */
+ return sp;
+}
+
+/* O32 version of push_arguments. */
+
+static CORE_ADDR
+mips_o32_push_arguments (int nargs,
+ struct value **args,
+ CORE_ADDR sp,
+ int struct_return,
+ CORE_ADDR struct_addr)
+{
+ int argreg;
+ int float_argreg;
+ int argnum;
+ int len = 0;
+ int stack_offset = 0;
+
+ /* First ensure that the stack and structure return address (if any)
+ are properly aligned. The stack has to be at least 64-bit
+ aligned even on 32-bit machines, because doubles must be 64-bit
+ aligned. For n32 and n64, stack frames need to be 128-bit
+ aligned, so we round to this widest known alignment. */
+
+ sp = ROUND_DOWN (sp, 16);
+ struct_addr = ROUND_DOWN (struct_addr, 16);
+
+ /* Now make space on the stack for the args. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ MIPS_STACK_ARGSIZE);
+ sp -= ROUND_UP (len, 16);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o32_push_arguments: sp=0x%s allocated %d\n",
+ paddr_nz (sp), ROUND_UP (len, 16));
+
+ /* Initialize the integer and float register pointers. */
+ argreg = A0_REGNUM;
+ float_argreg = FPA0_REGNUM;
+
+ /* The struct_return pointer occupies the first parameter-passing reg. */
+ if (struct_return)
+ {
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o32_push_arguments: struct_return reg=%d 0x%s\n",
+ argreg, paddr_nz (struct_addr));
+ write_register (argreg++, struct_addr);
+ stack_offset += MIPS_STACK_ARGSIZE;
+ }
+
+ /* Now load as many as possible of the first arguments into
+ registers, and push the rest onto the stack. Loop thru args
+ from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ char *val;
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ int len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o32_push_arguments: %d len=%d type=%d",
+ argnum + 1, len, (int) typecode);
+
+ val = (char *) VALUE_CONTENTS (arg);
+
+ /* 32-bit ABIs always start floating point arguments in an
+ even-numbered floating point register. Round the FP register
+ up before the check to see if there are any FP registers
+ left. O32/O64 targets also pass the FP in the integer
+ registers so also round up normal registers. */
+ if (!FP_REGISTER_DOUBLE
+ && fp_register_arg_p (typecode, arg_type))
+ {
+ if ((float_argreg & 1))
+ float_argreg++;
+ }
+
+ /* Floating point arguments passed in registers have to be
+ treated specially. On 32-bit architectures, doubles
+ are passed in register pairs; the even register gets
+ the low word, and the odd register gets the high word.
+ On O32/O64, the first two floating point arguments are
+ also copied to general registers, because MIPS16 functions
+ don't use float registers for arguments. This duplication of
+ arguments in general registers can't hurt non-MIPS16 functions
+ because those registers are normally skipped. */
+
+ if (fp_register_arg_p (typecode, arg_type)
+ && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
+ {
+ if (!FP_REGISTER_DOUBLE && len == 8)
+ {
+ int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
+ unsigned long regval;
+
+ /* Write the low word of the double to the even register(s). */
+ regval = extract_unsigned_integer (val + low_offset, 4);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, 4));
+ write_register (float_argreg++, regval);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, 4));
+ write_register (argreg++, regval);
+
+ /* Write the high word of the double to the odd register(s). */
+ regval = extract_unsigned_integer (val + 4 - low_offset, 4);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, 4));
+ write_register (float_argreg++, regval);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, 4));
+ write_register (argreg++, regval);
}
else
{
/* This is a floating point value that fits entirely
in a single register. */
/* On 32 bit ABI's the float_argreg is further adjusted
- above to ensure that it is even register aligned. */
+ above to ensure that it is even register aligned. */
LONGEST regval = extract_unsigned_integer (val, len);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
float_argreg, phex (regval, len));
write_register (float_argreg++, regval);
- if (!MIPS_EABI)
+ /* CAGNEY: 32 bit MIPS ABI's always reserve two FP
+ registers for each argument. The below is (my
+ guess) to ensure that the corresponding integer
+ register has reserved the same space. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, len));
+ write_register (argreg, regval);
+ argreg += FP_REGISTER_DOUBLE ? 1 : 2;
+ }
+ /* Reserve space for the FP register. */
+ stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
+ }
+ else
+ {
+ /* Copy the argument to general registers or the stack in
+ register-sized pieces. Large arguments are split between
+ registers and stack. */
+ /* Note: structs whose size is not a multiple of MIPS_REGSIZE
+ are treated specially: Irix cc passes them in registers
+ where gcc sometimes puts them on the stack. For maximum
+ compatibility, we will put them in both places. */
+ int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) &&
+ (len % MIPS_SAVED_REGSIZE != 0));
+ /* Structures should be aligned to eight bytes (even arg registers)
+ on MIPS_ABI_O32, if their first member has double precision. */
+ if (MIPS_SAVED_REGSIZE < 8
+ && mips_type_needs_double_align (arg_type))
+ {
+ if ((argreg & 1))
+ argreg++;
+ }
+ /* Note: Floating-point values that didn't fit into an FP
+ register are only written to memory. */
+ while (len > 0)
+ {
+ /* Remember if the argument was written to the stack. */
+ int stack_used_p = 0;
+ int partial_len =
+ len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE;
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
+ partial_len);
+
+ /* Write this portion of the argument to the stack. */
+ if (argreg > MIPS_LAST_ARG_REGNUM
+ || odd_sized_struct
+ || fp_register_arg_p (typecode, arg_type))
{
- /* CAGNEY: 32 bit MIPS ABI's always reserve two FP
- registers for each argument. The below is (my
- guess) to ensure that the corresponding integer
- register has reserved the same space. */
+ /* Should shorter than int integer values be
+ promoted to int before being stored? */
+ int longword_offset = 0;
+ CORE_ADDR addr;
+ stack_used_p = 1;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ if (MIPS_STACK_ARGSIZE == 8 &&
+ (typecode == TYPE_CODE_INT ||
+ typecode == TYPE_CODE_PTR ||
+ typecode == TYPE_CODE_FLT) && len <= 4)
+ longword_offset = MIPS_STACK_ARGSIZE - len;
+ }
+
if (mips_debug)
- fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
- argreg, phex (regval, len));
+ {
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
+ paddr_nz (stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
+ paddr_nz (longword_offset));
+ }
+
+ addr = sp + stack_offset + longword_offset;
+
+ if (mips_debug)
+ {
+ int i;
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ paddr_nz (addr));
+ for (i = 0; i < partial_len; i++)
+ {
+ fprintf_unfiltered (gdb_stdlog, "%02x",
+ val[i] & 0xff);
+ }
+ }
+ write_memory (addr, val, partial_len);
+ }
+
+ /* Note!!! This is NOT an else clause. Odd sized
+ structs may go thru BOTH paths. Floating point
+ arguments will not. */
+ /* Write this portion of the argument to a general
+ purpose register. */
+ if (argreg <= MIPS_LAST_ARG_REGNUM
+ && !fp_register_arg_p (typecode, arg_type))
+ {
+ LONGEST regval = extract_signed_integer (val, partial_len);
+ /* Value may need to be sign extended, because
+ MIPS_REGSIZE != MIPS_SAVED_REGSIZE. */
+
+ /* A non-floating-point argument being passed in a
+ general register. If a struct or union, and if
+ the remaining length is smaller than the register
+ size, we have to adjust the register value on
+ big endian targets.
+
+ It does not seem to be necessary to do the
+ same for integral types.
+
+ Also don't do this adjustment on O64 binaries.
+
+ cagney/2001-07-23: gdb/179: Also, GCC, when
+ outputting LE O32 with sizeof (struct) <
+ MIPS_SAVED_REGSIZE, generates a left shift as
+ part of storing the argument in a register a
+ register (the left shift isn't generated when
+ sizeof (struct) >= MIPS_SAVED_REGSIZE). Since it
+ is quite possible that this is GCC contradicting
+ the LE/O32 ABI, GDB has not been adjusted to
+ accommodate this. Either someone needs to
+ demonstrate that the LE/O32 ABI specifies such a
+ left shift OR this new ABI gets identified as
+ such and GDB gets tweaked accordingly. */
+
+ if (MIPS_SAVED_REGSIZE < 8
+ && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ && partial_len < MIPS_SAVED_REGSIZE
+ && (typecode == TYPE_CODE_STRUCT ||
+ typecode == TYPE_CODE_UNION))
+ regval <<= ((MIPS_SAVED_REGSIZE - partial_len) *
+ TARGET_CHAR_BIT);
+
+ if (mips_debug)
+ fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
+ argreg,
+ phex (regval, MIPS_SAVED_REGSIZE));
write_register (argreg, regval);
- argreg += FP_REGISTER_DOUBLE ? 1 : 2;
+ argreg++;
+
+ /* Prevent subsequent floating point arguments from
+ being passed in floating point registers. */
+ float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1;
}
+
+ len -= partial_len;
+ val += partial_len;
+
+ /* Compute the the offset into the stack at which we
+ will copy the next parameter.
+
+ In older ABIs, the caller reserved space for
+ registers that contained arguments. This was loosely
+ refered to as their "home". Consequently, space is
+ always allocated. */
+
+ stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+ }
+ }
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, "\n");
+ }
+
+ /* Return adjusted stack pointer. */
+ return sp;
+}
+
+/* O64 version of push_arguments. */
+
+static CORE_ADDR
+mips_o64_push_arguments (int nargs,
+ struct value **args,
+ CORE_ADDR sp,
+ int struct_return,
+ CORE_ADDR struct_addr)
+{
+ int argreg;
+ int float_argreg;
+ int argnum;
+ int len = 0;
+ int stack_offset = 0;
+
+ /* First ensure that the stack and structure return address (if any)
+ are properly aligned. The stack has to be at least 64-bit
+ aligned even on 32-bit machines, because doubles must be 64-bit
+ aligned. For n32 and n64, stack frames need to be 128-bit
+ aligned, so we round to this widest known alignment. */
+
+ sp = ROUND_DOWN (sp, 16);
+ struct_addr = ROUND_DOWN (struct_addr, 16);
+
+ /* Now make space on the stack for the args. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
+ MIPS_STACK_ARGSIZE);
+ sp -= ROUND_UP (len, 16);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o64_push_arguments: sp=0x%s allocated %d\n",
+ paddr_nz (sp), ROUND_UP (len, 16));
+
+ /* Initialize the integer and float register pointers. */
+ argreg = A0_REGNUM;
+ float_argreg = FPA0_REGNUM;
+
+ /* The struct_return pointer occupies the first parameter-passing reg. */
+ if (struct_return)
+ {
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o64_push_arguments: struct_return reg=%d 0x%s\n",
+ argreg, paddr_nz (struct_addr));
+ write_register (argreg++, struct_addr);
+ stack_offset += MIPS_STACK_ARGSIZE;
+ }
+
+ /* Now load as many as possible of the first arguments into
+ registers, and push the rest onto the stack. Loop thru args
+ from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+ char *val;
+ char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ struct value *arg = args[argnum];
+ struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ int len = TYPE_LENGTH (arg_type);
+ enum type_code typecode = TYPE_CODE (arg_type);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_o64_push_arguments: %d len=%d type=%d",
+ argnum + 1, len, (int) typecode);
+
+ val = (char *) VALUE_CONTENTS (arg);
+
+ /* 32-bit ABIs always start floating point arguments in an
+ even-numbered floating point register. Round the FP register
+ up before the check to see if there are any FP registers
+ left. O32/O64 targets also pass the FP in the integer
+ registers so also round up normal registers. */
+ if (!FP_REGISTER_DOUBLE
+ && fp_register_arg_p (typecode, arg_type))
+ {
+ if ((float_argreg & 1))
+ float_argreg++;
+ }
+
+ /* Floating point arguments passed in registers have to be
+ treated specially. On 32-bit architectures, doubles
+ are passed in register pairs; the even register gets
+ the low word, and the odd register gets the high word.
+ On O32/O64, the first two floating point arguments are
+ also copied to general registers, because MIPS16 functions
+ don't use float registers for arguments. This duplication of
+ arguments in general registers can't hurt non-MIPS16 functions
+ because those registers are normally skipped. */
+
+ if (fp_register_arg_p (typecode, arg_type)
+ && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
+ {
+ if (!FP_REGISTER_DOUBLE && len == 8)
+ {
+ int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
+ unsigned long regval;
+
+ /* Write the low word of the double to the even register(s). */
+ regval = extract_unsigned_integer (val + low_offset, 4);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, 4));
+ write_register (float_argreg++, regval);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, 4));
+ write_register (argreg++, regval);
+
+ /* Write the high word of the double to the odd register(s). */
+ regval = extract_unsigned_integer (val + 4 - low_offset, 4);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, 4));
+ write_register (float_argreg++, regval);
+
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, 4));
+ write_register (argreg++, regval);
+ }
+ else
+ {
+ /* This is a floating point value that fits entirely
+ in a single register. */
+ /* On 32 bit ABI's the float_argreg is further adjusted
+ above to ensure that it is even register aligned. */
+ LONGEST regval = extract_unsigned_integer (val, len);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s",
+ float_argreg, phex (regval, len));
+ write_register (float_argreg++, regval);
+ /* CAGNEY: 32 bit MIPS ABI's always reserve two FP
+ registers for each argument. The below is (my
+ guess) to ensure that the corresponding integer
+ register has reserved the same space. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
+ argreg, phex (regval, len));
+ write_register (argreg, regval);
+ argreg += FP_REGISTER_DOUBLE ? 1 : 2;
}
- /* Reserve space for the FP register. */
- if (MIPS_REGS_HAVE_HOME_P)
- stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
+ /* Reserve space for the FP register. */
+ stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
}
else
{
@@ -2395,20 +3510,21 @@ mips_push_arguments (int nargs,
int odd_sized_struct = ((len > MIPS_SAVED_REGSIZE) &&
(len % MIPS_SAVED_REGSIZE != 0));
/* Structures should be aligned to eight bytes (even arg registers)
- on MIPS_ABI_O32 if their first member has double precision. */
- if (gdbarch_tdep (current_gdbarch)->mips_abi == MIPS_ABI_O32
+ on MIPS_ABI_O32, if their first member has double precision. */
+ if (MIPS_SAVED_REGSIZE < 8
&& mips_type_needs_double_align (arg_type))
{
if ((argreg & 1))
argreg++;
}
/* Note: Floating-point values that didn't fit into an FP
- register are only written to memory. */
+ register are only written to memory. */
while (len > 0)
{
- /* Rememer if the argument was written to the stack. */
+ /* Remember if the argument was written to the stack. */
int stack_used_p = 0;
- int partial_len = len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE;
+ int partial_len =
+ len < MIPS_SAVED_REGSIZE ? len : MIPS_SAVED_REGSIZE;
if (mips_debug)
fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -2431,18 +3547,14 @@ mips_push_arguments (int nargs,
typecode == TYPE_CODE_PTR ||
typecode == TYPE_CODE_FLT) && len <= 4)
longword_offset = MIPS_STACK_ARGSIZE - len;
- else if ((typecode == TYPE_CODE_STRUCT ||
- typecode == TYPE_CODE_UNION) &&
- TYPE_LENGTH (arg_type) < MIPS_STACK_ARGSIZE)
- longword_offset = MIPS_STACK_ARGSIZE - len;
}
if (mips_debug)
{
- fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%lx",
- (long) stack_offset);
- fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%lx",
- (long) longword_offset);
+ fprintf_unfiltered (gdb_stdlog, " - stack_offset=0x%s",
+ paddr_nz (stack_offset));
+ fprintf_unfiltered (gdb_stdlog, " longword_offset=0x%s",
+ paddr_nz (longword_offset));
}
addr = sp + stack_offset + longword_offset;
@@ -2450,10 +3562,12 @@ mips_push_arguments (int nargs,
if (mips_debug)
{
int i;
- fprintf_unfiltered (gdb_stdlog, " @0x%lx ", (long) addr);
+ fprintf_unfiltered (gdb_stdlog, " @0x%s ",
+ paddr_nz (addr));
for (i = 0; i < partial_len; i++)
{
- fprintf_unfiltered (gdb_stdlog, "%02x", val[i] & 0xff);
+ fprintf_unfiltered (gdb_stdlog, "%02x",
+ val[i] & 0xff);
}
}
write_memory (addr, val, partial_len);
@@ -2461,13 +3575,15 @@ mips_push_arguments (int nargs,
/* Note!!! This is NOT an else clause. Odd sized
structs may go thru BOTH paths. Floating point
- arguments will not. */
+ arguments will not. */
/* Write this portion of the argument to a general
- purpose register. */
+ purpose register. */
if (argreg <= MIPS_LAST_ARG_REGNUM
&& !fp_register_arg_p (typecode, arg_type))
{
- LONGEST regval = extract_unsigned_integer (val, partial_len);
+ LONGEST regval = extract_signed_integer (val, partial_len);
+ /* Value may need to be sign extended, because
+ MIPS_REGSIZE != MIPS_SAVED_REGSIZE. */
/* A non-floating-point argument being passed in a
general register. If a struct or union, and if
@@ -2478,8 +3594,7 @@ mips_push_arguments (int nargs,
It does not seem to be necessary to do the
same for integral types.
- Also don't do this adjustment on EABI and O64
- binaries.
+ Also don't do this adjustment on O64 binaries.
cagney/2001-07-23: gdb/179: Also, GCC, when
outputting LE O32 with sizeof (struct) <
@@ -2494,8 +3609,7 @@ mips_push_arguments (int nargs,
left shift OR this new ABI gets identified as
such and GDB gets tweaked accordingly. */
- if (!MIPS_EABI
- && MIPS_SAVED_REGSIZE < 8
+ if (MIPS_SAVED_REGSIZE < 8
&& TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& partial_len < MIPS_SAVED_REGSIZE
&& (typecode == TYPE_CODE_STRUCT ||
@@ -2510,11 +3624,9 @@ mips_push_arguments (int nargs,
write_register (argreg, regval);
argreg++;
- /* If this is the old ABI, prevent subsequent floating
- point arguments from being passed in floating point
- registers. */
- if (!MIPS_EABI)
- float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1;
+ /* Prevent subsequent floating point arguments from
+ being passed in floating point registers. */
+ float_argreg = MIPS_LAST_FP_ARG_REGNUM + 1;
}
len -= partial_len;
@@ -2526,13 +3638,9 @@ mips_push_arguments (int nargs,
In older ABIs, the caller reserved space for
registers that contained arguments. This was loosely
refered to as their "home". Consequently, space is
- always allocated.
+ always allocated. */
- In the new EABI (and the NABI32), the stack_offset
- only needs to be adjusted when it has been used.. */
-
- if (MIPS_REGS_HAVE_HOME_P || stack_used_p)
- stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
+ stack_offset += ROUND_UP (partial_len, MIPS_STACK_ARGSIZE);
}
}
if (mips_debug)
@@ -2543,7 +3651,7 @@ mips_push_arguments (int nargs,
return sp;
}
-CORE_ADDR
+static CORE_ADDR
mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
/* Set the return address register to point to the entry
@@ -2555,7 +3663,7 @@ mips_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
static void
mips_push_register (CORE_ADDR * sp, int regno)
{
- char buffer[MAX_REGISTER_RAW_SIZE];
+ char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
int regsize;
int offset;
if (MIPS_SAVED_REGSIZE < REGISTER_RAW_SIZE (regno))
@@ -2578,7 +3686,7 @@ mips_push_register (CORE_ADDR * sp, int regno)
/* MASK(i,j) == (1<<i) + (1<<(i+1)) + ... + (1<<j)). Assume i<=j<(MIPS_NUMREGS-1). */
#define MASK(i,j) (((1 << ((j)+1))-1) ^ ((1 << (i))-1))
-void
+static void
mips_push_dummy_frame (void)
{
int ireg;
@@ -2657,7 +3765,7 @@ mips_push_dummy_frame (void)
PROC_PC_REG (proc_desc) = RA_REGNUM;
}
-void
+static void
mips_pop_frame (void)
{
register int regnum;
@@ -2668,7 +3776,7 @@ mips_pop_frame (void)
write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
if (frame->saved_regs == NULL)
- mips_find_saved_regs (frame);
+ FRAME_INIT_SAVED_REGS (frame);
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
if (regnum != SP_REGNUM && regnum != PC_REGNUM
@@ -2677,6 +3785,7 @@ mips_pop_frame (void)
read_memory_integer (frame->saved_regs[regnum],
MIPS_SAVED_REGSIZE));
}
+
write_register (SP_REGNUM, new_sp);
flush_cached_frames ();
@@ -2715,6 +3824,13 @@ mips_pop_frame (void)
}
}
+static void
+mips_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ struct value **args, struct type *type, int gcc_p)
+{
+ write_register(T9_REGNUM, fun);
+}
+
/* Floating point register management.
Background: MIPS1 & 2 fp registers are 32 bits wide. To support
@@ -2834,7 +3950,7 @@ mips_read_fp_register_double (int regno, char *rare_buffer)
static void
mips_print_register (int regnum, int all)
{
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
/* Get the data in raw format. */
if (!frame_register_read (selected_frame, regnum, raw_buffer))
@@ -2851,7 +3967,7 @@ mips_print_register (int regnum, int all)
|| mips2_fp_compat ())
&& !((regnum - FP0_REGNUM) & 1))
{
- char dbuffer[2 * MAX_REGISTER_RAW_SIZE];
+ char *dbuffer = alloca (2 * MAX_REGISTER_RAW_SIZE);
mips_read_fp_register_double (regnum, dbuffer);
@@ -2986,7 +4102,7 @@ static int
do_gp_register_row (int regnum)
{
/* do values for GP (int) regs */
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */
int col, byte;
int start_regnum = regnum;
@@ -3044,7 +4160,7 @@ do_gp_register_row (int regnum)
/* MIPS_DO_REGISTERS_INFO(): called by "info register" command */
-void
+static void
mips_do_registers_info (int regnum, int fpregs)
{
if (regnum != -1) /* do one specified register */
@@ -3072,15 +4188,6 @@ mips_do_registers_info (int regnum, int fpregs)
}
}
-/* Return number of args passed to a frame. described by FIP.
- Can return -1, meaning no way to tell. */
-
-int
-mips_frame_num_args (struct frame_info *frame)
-{
- return -1;
-}
-
/* Is this a branch with a delay slot? */
static int is_delayed (unsigned long);
@@ -3319,7 +4426,7 @@ mips16_skip_prologue (CORE_ADDR pc)
We must skip more in the case where part of the prologue is in the
delay slot of a non-prologue instruction). */
-CORE_ADDR
+static CORE_ADDR
mips_skip_prologue (CORE_ADDR pc)
{
/* See if we can determine the end of the prologue via the symbol table.
@@ -3454,10 +4561,29 @@ return_value_location (struct type *valtype,
/* Given a return value in `regbuf' with a type `valtype', extract and
copy its value into `valbuf'. */
-void
-mips_extract_return_value (struct type *valtype,
- char regbuf[REGISTER_BYTES],
- char *valbuf)
+static void
+mips_eabi_extract_return_value (struct type *valtype,
+ char regbuf[REGISTER_BYTES],
+ char *valbuf)
+{
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memcpy (valbuf + lo.buf_offset,
+ regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
+ lo.len);
+
+ if (hi.len > 0)
+ memcpy (valbuf + hi.buf_offset,
+ regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset,
+ hi.len);
+}
+
+static void
+mips_o64_extract_return_value (struct type *valtype,
+ char regbuf[REGISTER_BYTES],
+ char *valbuf)
{
struct return_value_word lo;
struct return_value_word hi;
@@ -3476,10 +4602,34 @@ mips_extract_return_value (struct type *valtype,
/* Given a return value in `valbuf' with a type `valtype', write it's
value into the appropriate register. */
-void
-mips_store_return_value (struct type *valtype, char *valbuf)
+static void
+mips_eabi_store_return_value (struct type *valtype, char *valbuf)
+{
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ struct return_value_word lo;
+ struct return_value_word hi;
+ return_value_location (valtype, &hi, &lo);
+
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
+ write_register_bytes (REGISTER_BYTE (lo.reg),
+ raw_buffer,
+ REGISTER_RAW_SIZE (lo.reg));
+
+ if (hi.len > 0)
+ {
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+ memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
+ write_register_bytes (REGISTER_BYTE (hi.reg),
+ raw_buffer,
+ REGISTER_RAW_SIZE (hi.reg));
+ }
+}
+
+static void
+mips_o64_store_return_value (struct type *valtype, char *valbuf)
{
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -3500,10 +4650,274 @@ mips_store_return_value (struct type *valtype, char *valbuf)
}
}
+/* O32 ABI stuff. */
+
+static void
+mips_o32_xfer_return_value (struct type *type,
+ struct regcache *regcache,
+ bfd_byte *in, const bfd_byte *out)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && TYPE_LENGTH (type) == 4
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A single-precision floating-point value. It fits in the
+ least significant part of FP0. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
+ mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type),
+ TARGET_BYTE_ORDER, in, out, 0);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && TYPE_LENGTH (type) == 8
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A double-precision floating-point value. It fits in the
+ least significant part of FP0/FP1 but with byte ordering
+ based on the target (???). */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp0/$fp1\n");
+ switch (TARGET_BYTE_ORDER)
+ {
+ case BFD_ENDIAN_LITTLE:
+ mips_xfer_register (regcache, FP0_REGNUM + 0, 4,
+ TARGET_BYTE_ORDER, in, out, 0);
+ mips_xfer_register (regcache, FP0_REGNUM + 1, 4,
+ TARGET_BYTE_ORDER, in, out, 4);
+ break;
+ case BFD_ENDIAN_BIG:
+ mips_xfer_register (regcache, FP0_REGNUM + 1, 4,
+ TARGET_BYTE_ORDER, in, out, 0);
+ mips_xfer_register (regcache, FP0_REGNUM + 0, 4,
+ TARGET_BYTE_ORDER, in, out, 4);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ }
+#if 0
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && TYPE_NFIELDS (type) <= 2
+ && TYPE_NFIELDS (type) >= 1
+ && ((TYPE_NFIELDS (type) == 1
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT))
+ || (TYPE_NFIELDS (type) == 2
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT)
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
+ == TYPE_CODE_FLT)))
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A struct that contains one or two floats. Each value is part
+ in the least significant part of their floating point
+ register.. */
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ int regnum;
+ int field;
+ for (field = 0, regnum = FP0_REGNUM;
+ field < TYPE_NFIELDS (type);
+ field++, regnum += 2)
+ {
+ int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ / TARGET_CHAR_BIT);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset);
+ mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TARGET_BYTE_ORDER, in, out, offset);
+ }
+ }
+#endif
+#if 0
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* A structure or union. Extract the left justified value,
+ regardless of the byte order. I.e. DO NOT USE
+ mips_xfer_lower. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += REGISTER_RAW_SIZE (regnum), regnum++)
+ {
+ int xfer = REGISTER_RAW_SIZE (regnum);
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN,
+ in, out, offset);
+ }
+ }
+#endif
+ else
+ {
+ /* A scalar extract each part but least-significant-byte
+ justified. o32 thinks registers are 4 byte, regardless of
+ the ISA. mips_stack_argsize controls this. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += mips_stack_argsize (), regnum++)
+ {
+ int xfer = mips_stack_argsize ();
+ int pos = 0;
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER,
+ in, out, offset);
+ }
+ }
+}
+
+static void
+mips_o32_extract_return_value (struct type *type,
+ struct regcache *regcache,
+ void *valbuf)
+{
+ mips_o32_xfer_return_value (type, regcache, valbuf, NULL);
+}
+
+static void
+mips_o32_store_return_value (struct type *type, char *valbuf)
+{
+ mips_o32_xfer_return_value (type, current_regcache, NULL, valbuf);
+}
+
+/* N32/N44 ABI stuff. */
+
+static void
+mips_n32n64_xfer_return_value (struct type *type,
+ struct regcache *regcache,
+ bfd_byte *in, const bfd_byte *out)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A floating-point value belongs in the least significant part
+ of FP0. */
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
+ mips_xfer_register (regcache, FP0_REGNUM, TYPE_LENGTH (type),
+ TARGET_BYTE_ORDER, in, out, 0);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && TYPE_NFIELDS (type) <= 2
+ && TYPE_NFIELDS (type) >= 1
+ && ((TYPE_NFIELDS (type) == 1
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT))
+ || (TYPE_NFIELDS (type) == 2
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ == TYPE_CODE_FLT)
+ && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
+ == TYPE_CODE_FLT)))
+ && tdep->mips_fpu_type != MIPS_FPU_NONE)
+ {
+ /* A struct that contains one or two floats. Each value is part
+ in the least significant part of their floating point
+ register.. */
+ bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ int regnum;
+ int field;
+ for (field = 0, regnum = FP0_REGNUM;
+ field < TYPE_NFIELDS (type);
+ field++, regnum += 2)
+ {
+ int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ / TARGET_CHAR_BIT);
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", offset);
+ mips_xfer_register (regcache, regnum, TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TARGET_BYTE_ORDER, in, out, offset);
+ }
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* A structure or union. Extract the left justified value,
+ regardless of the byte order. I.e. DO NOT USE
+ mips_xfer_lower. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += REGISTER_RAW_SIZE (regnum), regnum++)
+ {
+ int xfer = REGISTER_RAW_SIZE (regnum);
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, regnum, xfer, BFD_ENDIAN_UNKNOWN,
+ in, out, offset);
+ }
+ }
+ else
+ {
+ /* A scalar extract each part but least-significant-byte
+ justified. */
+ int offset;
+ int regnum;
+ for (offset = 0, regnum = V0_REGNUM;
+ offset < TYPE_LENGTH (type);
+ offset += REGISTER_RAW_SIZE (regnum), regnum++)
+ {
+ int xfer = REGISTER_RAW_SIZE (regnum);
+ int pos = 0;
+ if (offset + xfer > TYPE_LENGTH (type))
+ xfer = TYPE_LENGTH (type) - offset;
+ if (mips_debug)
+ fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
+ offset, xfer, regnum);
+ mips_xfer_register (regcache, regnum, xfer, TARGET_BYTE_ORDER,
+ in, out, offset);
+ }
+ }
+}
+
+static void
+mips_n32n64_extract_return_value (struct type *type,
+ struct regcache *regcache,
+ void *valbuf)
+{
+ mips_n32n64_xfer_return_value (type, regcache, valbuf, NULL);
+}
+
+static void
+mips_n32n64_store_return_value (struct type *type, char *valbuf)
+{
+ mips_n32n64_xfer_return_value (type, current_regcache, NULL, valbuf);
+}
+
+static void
+mips_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ /* Nothing to do -- push_arguments does all the work. */
+}
+
+static CORE_ADDR
+mips_extract_struct_value_address (struct regcache *ignore)
+{
+ /* FIXME: This will only work at random. The caller passes the
+ struct_return address in V0, but it is not preserved. It may
+ still be there, or this may be a random value. */
+ return read_register (V0_REGNUM);
+}
+
/* Exported procedure: Is PC in the signal trampoline code */
-int
-in_sigtramp (CORE_ADDR pc, char *ignore)
+static int
+mips_pc_in_sigtramp (CORE_ADDR pc, char *ignore)
{
if (sigtramp_address == 0)
fixup_sigtramp ();
@@ -3567,10 +4981,7 @@ set_mipsfpu_single_command (char *args, int from_tty)
{
mips_fpu_type = MIPS_FPU_SINGLE;
mips_fpu_type_auto = 0;
- if (GDB_MULTI_ARCH)
- {
- gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_SINGLE;
- }
+ gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_SINGLE;
}
static void
@@ -3578,10 +4989,7 @@ set_mipsfpu_double_command (char *args, int from_tty)
{
mips_fpu_type = MIPS_FPU_DOUBLE;
mips_fpu_type_auto = 0;
- if (GDB_MULTI_ARCH)
- {
- gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_DOUBLE;
- }
+ gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_DOUBLE;
}
static void
@@ -3589,10 +4997,7 @@ set_mipsfpu_none_command (char *args, int from_tty)
{
mips_fpu_type = MIPS_FPU_NONE;
mips_fpu_type_auto = 0;
- if (GDB_MULTI_ARCH)
- {
- gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_NONE;
- }
+ gdbarch_tdep (current_gdbarch)->mips_fpu_type = MIPS_FPU_NONE;
}
static void
@@ -3635,7 +5040,7 @@ mips_show_processor_type_command (char *args, int from_tty)
/* Modify the actual processor type. */
-int
+static int
mips_set_processor_type (char *str)
{
int i;
@@ -3737,7 +5142,7 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
(if necessary) to point to the actual memory location where the
breakpoint should be inserted. */
-const unsigned char *
+static const unsigned char *
mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
@@ -3819,7 +5224,7 @@ mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
This function implements the SKIP_TRAMPOLINE_CODE macro.
*/
-CORE_ADDR
+static CORE_ADDR
mips_skip_stub (CORE_ADDR pc)
{
char *name;
@@ -3902,7 +5307,7 @@ mips_skip_stub (CORE_ADDR pc)
/* Return non-zero if the PC is inside a call thunk (aka stub or trampoline).
This implements the IN_SOLIB_CALL_TRAMPOLINE macro. */
-int
+static int
mips_in_call_stub (CORE_ADDR pc, char *name)
{
CORE_ADDR start_addr;
@@ -3930,7 +5335,7 @@ mips_in_call_stub (CORE_ADDR pc, char *name)
/* Return non-zero if the PC is inside a return thunk (aka stub or trampoline).
This implements the IN_SOLIB_RETURN_TRAMPOLINE macro. */
-int
+static int
mips_in_return_stub (CORE_ADDR pc, char *name)
{
CORE_ADDR start_addr;
@@ -3980,7 +5385,7 @@ mips_ignore_helper (CORE_ADDR pc)
point (e.g. programs in ROM) should define a symbol __CALL_DUMMY_ADDRESS
whose address is the location where the breakpoint should be placed. */
-CORE_ADDR
+static CORE_ADDR
mips_call_dummy_address (void)
{
struct minimal_symbol *sym;
@@ -4126,6 +5531,47 @@ mips_integer_to_address (struct type *type, void *buf)
TYPE_LENGTH (builtin_type_void_data_ptr));
}
+static void
+mips_find_abi_section (bfd *abfd, asection *sect, void *obj)
+{
+ enum mips_abi *abip = (enum mips_abi *) obj;
+ const char *name = bfd_get_section_name (abfd, sect);
+
+ if (*abip != MIPS_ABI_UNKNOWN)
+ return;
+
+ if (strncmp (name, ".mdebug.", 8) != 0)
+ return;
+
+ if (strcmp (name, ".mdebug.abi32") == 0)
+ *abip = MIPS_ABI_O32;
+ else if (strcmp (name, ".mdebug.abiN32") == 0)
+ *abip = MIPS_ABI_N32;
+ else if (strcmp (name, ".mdebug.abiN64") == 0)
+ *abip = MIPS_ABI_N64;
+ else if (strcmp (name, ".mdebug.abiO64") == 0)
+ *abip = MIPS_ABI_O64;
+ else if (strcmp (name, ".mdebug.eabi32") == 0)
+ *abip = MIPS_ABI_EABI32;
+ else if (strcmp (name, ".mdebug.eabi64") == 0)
+ *abip = MIPS_ABI_EABI64;
+ else
+ warning ("unsupported ABI %s.", name + 8);
+}
+
+static enum mips_abi
+global_mips_abi (void)
+{
+ int i;
+
+ for (i = 0; mips_abi_strings[i] != NULL; i++)
+ if (mips_abi_strings[i] == mips_abi_string)
+ return (enum mips_abi) i;
+
+ internal_error (__FILE__, __LINE__,
+ "unknown ABI string");
+}
+
static struct gdbarch *
mips_gdbarch_init (struct gdbarch_info info,
struct gdbarch_list *arches)
@@ -4135,7 +5581,7 @@ mips_gdbarch_init (struct gdbarch_info info,
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
int elf_flags;
- enum mips_abi mips_abi;
+ enum mips_abi mips_abi, found_abi, wanted_abi;
enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
/* Reset the disassembly info, in case it was set to something
@@ -4157,7 +5603,7 @@ mips_gdbarch_init (struct gdbarch_info info,
osabi = gdbarch_lookup_osabi (info.abfd);
}
- /* Check ELF_FLAGS to see if it specifies the ABI being used. */
+ /* Check ELF_FLAGS to see if it specifies the ABI being used. */
switch ((elf_flags & EF_MIPS_ABI))
{
case E_MIPS_ABI_O32:
@@ -4180,7 +5626,16 @@ mips_gdbarch_init (struct gdbarch_info info,
break;
}
- /* Try the architecture for any hint of the corect ABI */
+ /* GCC creates a pseudo-section whose name describes the ABI. */
+ if (mips_abi == MIPS_ABI_UNKNOWN && info.abfd != NULL)
+ bfd_map_over_sections (info.abfd, mips_find_abi_section, &mips_abi);
+
+ /* If we have no bfd, then mips_abi will still be MIPS_ABI_UNKNOWN.
+ Use the ABI from the last architecture if there is one. */
+ if (info.abfd == NULL && arches != NULL)
+ mips_abi = gdbarch_tdep (arches->gdbarch)->found_abi;
+
+ /* Try the architecture for any hint of the correct ABI. */
if (mips_abi == MIPS_ABI_UNKNOWN
&& info.bfd_arch_info != NULL
&& info.bfd_arch_info->arch == bfd_arch_mips)
@@ -4196,14 +5651,27 @@ mips_gdbarch_init (struct gdbarch_info info,
break;
case bfd_mach_mips8000:
case bfd_mach_mips10000:
- mips_abi = MIPS_ABI_N32;
+ /* On Irix, ELF64 executables use the N64 ABI. The
+ pseudo-sections which describe the ABI aren't present
+ on IRIX. (Even for executables created by gcc.) */
+ if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
+ && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64)
+ mips_abi = MIPS_ABI_N64;
+ else
+ mips_abi = MIPS_ABI_N32;
break;
}
}
-#ifdef MIPS_DEFAULT_ABI
+
if (mips_abi == MIPS_ABI_UNKNOWN)
- mips_abi = MIPS_DEFAULT_ABI;
-#endif
+ mips_abi = MIPS_ABI_O32;
+
+ /* Now that we have found what the ABI for this binary would be,
+ check whether the user is overriding it. */
+ found_abi = mips_abi;
+ wanted_abi = global_mips_abi ();
+ if (wanted_abi != MIPS_ABI_UNKNOWN)
+ mips_abi = wanted_abi;
if (gdbarch_debug)
{
@@ -4213,6 +5681,9 @@ mips_gdbarch_init (struct gdbarch_info info,
fprintf_unfiltered (gdb_stdlog,
"mips_gdbarch_init: mips_abi = %d\n",
mips_abi);
+ fprintf_unfiltered (gdb_stdlog,
+ "mips_gdbarch_init: found_mips_abi = %d\n",
+ found_abi);
}
/* try to find a pre-existing architecture */
@@ -4221,7 +5692,7 @@ mips_gdbarch_init (struct gdbarch_info info,
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
/* MIPS needs to be pedantic about which ABI the object is
- using. */
+ using. */
if (gdbarch_tdep (arches->gdbarch)->elf_flags != elf_flags)
continue;
if (gdbarch_tdep (arches->gdbarch)->mips_abi != mips_abi)
@@ -4230,88 +5701,115 @@ mips_gdbarch_init (struct gdbarch_info info,
return arches->gdbarch;
}
- /* Need a new architecture. Fill in a target specific vector. */
+ /* Need a new architecture. Fill in a target specific vector. */
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
tdep->elf_flags = elf_flags;
tdep->osabi = osabi;
- /* Initially set everything according to the default ABI/ISA. */
+ /* Initially set everything according to the default ABI/ISA. */
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_float_bit (gdbarch, 32);
set_gdbarch_double_bit (gdbarch, 64);
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_register_raw_size (gdbarch, mips_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ tdep->found_abi = found_abi;
tdep->mips_abi = mips_abi;
+ set_gdbarch_elf_make_msymbol_special (gdbarch,
+ mips_elf_make_msymbol_special);
+
switch (mips_abi)
{
case MIPS_ABI_O32:
- tdep->mips_abi_string = "o32";
+ set_gdbarch_push_arguments (gdbarch, mips_o32_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_o32_store_return_value);
+ set_gdbarch_extract_return_value (gdbarch, mips_o32_extract_return_value);
tdep->mips_default_saved_regsize = 4;
tdep->mips_default_stack_argsize = 4;
tdep->mips_fp_register_double = 0;
tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 4 - 1;
- tdep->mips_regs_have_home_p = 1;
tdep->gdb_target_is_mips64 = 0;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_o32_reg_struct_has_addr);
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_o32_use_struct_convention);
break;
case MIPS_ABI_O64:
- tdep->mips_abi_string = "o64";
+ set_gdbarch_push_arguments (gdbarch, mips_o64_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_o64_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value);
tdep->mips_default_saved_regsize = 8;
tdep->mips_default_stack_argsize = 8;
tdep->mips_fp_register_double = 1;
tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 4 - 1;
- tdep->mips_regs_have_home_p = 1;
tdep->gdb_target_is_mips64 = 1;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_o32_reg_struct_has_addr);
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_o32_use_struct_convention);
break;
case MIPS_ABI_EABI32:
- tdep->mips_abi_string = "eabi32";
+ set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value);
tdep->mips_default_saved_regsize = 4;
tdep->mips_default_stack_argsize = 4;
tdep->mips_fp_register_double = 0;
tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1;
- tdep->mips_regs_have_home_p = 0;
tdep->gdb_target_is_mips64 = 0;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_eabi_reg_struct_has_addr);
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_eabi_use_struct_convention);
break;
case MIPS_ABI_EABI64:
- tdep->mips_abi_string = "eabi64";
+ set_gdbarch_push_arguments (gdbarch, mips_eabi_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_eabi_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value);
tdep->mips_default_saved_regsize = 8;
tdep->mips_default_stack_argsize = 8;
tdep->mips_fp_register_double = 1;
tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1;
- tdep->mips_regs_have_home_p = 0;
tdep->gdb_target_is_mips64 = 1;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_eabi_reg_struct_has_addr);
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_eabi_use_struct_convention);
break;
case MIPS_ABI_N32:
- tdep->mips_abi_string = "n32";
- tdep->mips_default_saved_regsize = 4;
+ set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value);
+ set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value);
+ tdep->mips_default_saved_regsize = 8;
tdep->mips_default_stack_argsize = 8;
tdep->mips_fp_register_double = 1;
tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1;
- tdep->mips_regs_have_home_p = 0;
- tdep->gdb_target_is_mips64 = 0;
+ tdep->gdb_target_is_mips64 = 1;
tdep->default_mask_address_p = 0;
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
@@ -4327,21 +5825,46 @@ mips_gdbarch_init (struct gdbarch_info info,
tm_print_insn_info.mach = info.bfd_arch_info->mach;
else
tm_print_insn_info.mach = bfd_mach_mips8000;
+
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_n32n64_use_struct_convention);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_n32n64_reg_struct_has_addr);
break;
- default:
- tdep->mips_abi_string = "default";
- tdep->mips_default_saved_regsize = MIPS_REGSIZE;
- tdep->mips_default_stack_argsize = MIPS_REGSIZE;
- tdep->mips_fp_register_double = (REGISTER_VIRTUAL_SIZE (FP0_REGNUM) == 8);
+ case MIPS_ABI_N64:
+ set_gdbarch_push_arguments (gdbarch, mips_n32n64_push_arguments);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mips_n32n64_store_return_value);
+ set_gdbarch_extract_return_value (gdbarch, mips_n32n64_extract_return_value);
+ tdep->mips_default_saved_regsize = 8;
+ tdep->mips_default_stack_argsize = 8;
+ tdep->mips_fp_register_double = 1;
tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
tdep->mips_last_fp_arg_regnum = FPA0_REGNUM + 8 - 1;
- tdep->mips_regs_have_home_p = 1;
- tdep->gdb_target_is_mips64 = 0;
+ tdep->gdb_target_is_mips64 = 1;
tdep->default_mask_address_p = 0;
- set_gdbarch_long_bit (gdbarch, 32);
- set_gdbarch_ptr_bit (gdbarch, 32);
+ set_gdbarch_long_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
+
+ /* Set up the disassembler info, so that we get the right
+ register names from libopcodes. */
+ tm_print_insn_info.flavour = bfd_target_elf_flavour;
+ tm_print_insn_info.arch = bfd_arch_mips;
+ if (info.bfd_arch_info != NULL
+ && info.bfd_arch_info->arch == bfd_arch_mips
+ && info.bfd_arch_info->mach)
+ tm_print_insn_info.mach = info.bfd_arch_info->mach;
+ else
+ tm_print_insn_info.mach = bfd_mach_mips8000;
+
+ set_gdbarch_use_struct_convention (gdbarch,
+ mips_n32n64_use_struct_convention);
+ set_gdbarch_reg_struct_has_addr (gdbarch,
+ mips_n32n64_reg_struct_has_addr);
break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ "unknown ABI in switch");
}
/* FIXME: jlarmour/2000-04-07: There *is* a flag EF_MIPS_32BIT_MODE
@@ -4350,7 +5873,7 @@ mips_gdbarch_init (struct gdbarch_info info,
``We deliberately don't allow "-gp32" to set the MIPS_32BITMODE
flag in object files because to do so would make it impossible to
- link with libraries compiled without "-gp32". This is
+ link with libraries compiled without "-gp32". This is
unnecessarily restrictive.
We could solve this problem by adding "-gp32" multilibs to gcc,
@@ -4360,10 +5883,10 @@ mips_gdbarch_init (struct gdbarch_info info,
But even more unhelpfully, the default linker output target for
mips64-elf is elf32-bigmips, and has EF_MIPS_32BIT_MODE set, even
for 64-bit programs - you need to change the ABI to change this,
- and not all gcc targets support that currently. Therefore using
+ and not all gcc targets support that currently. Therefore using
this flag to detect 32-bit mode would do the wrong thing given
the current gcc - it would make GDB treat these 64-bit programs
- as 32-bit programs by default. */
+ as 32-bit programs by default. */
/* enable/disable the MIPS FPU */
if (!mips_fpu_type_auto)
@@ -4390,16 +5913,19 @@ mips_gdbarch_init (struct gdbarch_info info,
/* MIPS version of register names. NOTE: At present the MIPS
register name management is part way between the old -
#undef/#define REGISTER_NAMES and the new REGISTER_NAME(nr).
- Further work on it is required. */
+ Further work on it is required. */
+ /* NOTE: many targets (esp. embedded) do not go thru the
+ gdbarch_register_name vector at all, instead bypassing it
+ by defining REGISTER_NAMES. */
set_gdbarch_register_name (gdbarch, mips_register_name);
set_gdbarch_read_pc (gdbarch, mips_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
- set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
+ set_gdbarch_read_sp (gdbarch, mips_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
- /* Add/remove bits from an address. The MIPS needs be careful to
- ensure that all 32 bit addresses are sign extended to 64 bits. */
+ /* Add/remove bits from an address. The MIPS needs be careful to
+ ensure that all 32 bit addresses are sign extended to 64 bits. */
set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove);
/* There's a mess in stack frame creation. See comments in
@@ -4407,12 +5933,13 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
- /* Map debug register numbers onto internal register numbers. */
+ /* Map debug register numbers onto internal register numbers. */
set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum);
/* Initialize a frame */
set_gdbarch_init_extra_frame_info (gdbarch, mips_init_extra_frame_info);
+ set_gdbarch_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs);
/* MIPS version of CALL_DUMMY */
@@ -4421,19 +5948,36 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
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);
+ set_gdbarch_push_dummy_frame (gdbarch, mips_push_dummy_frame);
+ 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);
set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
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_push_arguments (gdbarch, mips_push_arguments);
- set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
+ set_gdbarch_register_convertible (gdbarch, mips_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch,
+ mips_register_convert_to_virtual);
+ set_gdbarch_register_convert_to_raw (gdbarch,
+ mips_register_convert_to_raw);
+
set_gdbarch_coerce_float_to_double (gdbarch, mips_coerce_float_to_double);
+ set_gdbarch_frame_chain (gdbarch, mips_frame_chain);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+ 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);
+
set_gdbarch_get_saved_register (gdbarch, mips_get_saved_register);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -4447,13 +5991,44 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_address_to_pointer (gdbarch, address_to_signed_pointer);
set_gdbarch_integer_to_address (gdbarch, mips_integer_to_address);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ /* There are MIPS targets which do not yet use this since they still
+ define REGISTER_VIRTUAL_TYPE. */
+ set_gdbarch_register_virtual_type (gdbarch, mips_register_virtual_type);
+ set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
+
+ set_gdbarch_do_registers_info (gdbarch, mips_do_registers_info);
+ set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch, osabi);
+ set_gdbarch_store_struct_return (gdbarch, mips_store_struct_return);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ mips_extract_struct_value_address);
+
+ set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_stub);
+
+ set_gdbarch_in_solib_call_trampoline (gdbarch, mips_in_call_stub);
+ set_gdbarch_in_solib_return_trampoline (gdbarch, mips_in_return_stub);
+
return gdbarch;
}
static void
+mips_abi_update (char *ignore_args, int from_tty,
+ struct cmd_list_element *c)
+{
+ struct gdbarch_info info;
+
+ /* Force the architecture to update, and (if it's a MIPS architecture)
+ mips_gdbarch_init will take care of the rest. */
+ gdbarch_info_init (&info);
+ gdbarch_update_p (info);
+}
+
+static void
mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
@@ -4494,7 +6069,7 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"mips_dump_tdep: tdep->mips_abi = %d (%s)\n",
tdep->mips_abi,
- tdep->mips_abi_string);
+ mips_abi_strings[tdep->mips_abi]);
fprintf_unfiltered (file,
"mips_dump_tdep: mips_mask_address_p() %d (default %d)\n",
mips_mask_address_p (),
@@ -4531,9 +6106,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n",
FP_REGISTER_DOUBLE);
fprintf_unfiltered (file,
- "mips_dump_tdep: MIPS_REGS_HAVE_HOME_P = %d\n",
- MIPS_REGS_HAVE_HOME_P);
- fprintf_unfiltered (file,
"mips_dump_tdep: MIPS_DEFAULT_STACK_ARGSIZE = %d\n",
MIPS_DEFAULT_STACK_ARGSIZE);
fprintf_unfiltered (file,
@@ -4563,9 +6135,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: CPLUS_MARKER = %c\n",
CPLUS_MARKER);
fprintf_unfiltered (file,
- "mips_dump_tdep: DEFAULT_MIPS_TYPE = %s\n",
- DEFAULT_MIPS_TYPE);
- fprintf_unfiltered (file,
"mips_dump_tdep: DO_REGISTERS_INFO # %s\n",
XSTRING (DO_REGISTERS_INFO));
fprintf_unfiltered (file,
@@ -4575,9 +6144,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: ECOFF_REG_TO_REGNUM # %s\n",
XSTRING (ECOFF_REG_TO_REGNUM (REGNUM)));
fprintf_unfiltered (file,
- "mips_dump_tdep: ELF_MAKE_MSYMBOL_SPECIAL # %s\n",
- XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (SYM, MSYM)));
- fprintf_unfiltered (file,
"mips_dump_tdep: FCRCS_REGNUM = %d\n",
FCRCS_REGNUM);
fprintf_unfiltered (file,
@@ -4674,11 +6240,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: MIPS_SAVED_REGSIZE = %d\n",
MIPS_SAVED_REGSIZE);
fprintf_unfiltered (file,
- "mips_dump_tdep: MSYMBOL_IS_SPECIAL = function?\n");
- fprintf_unfiltered (file,
- "mips_dump_tdep: MSYMBOL_SIZE # %s\n",
- XSTRING (MSYMBOL_SIZE (MSYM)));
- fprintf_unfiltered (file,
"mips_dump_tdep: OP_LDFPR = used?\n");
fprintf_unfiltered (file,
"mips_dump_tdep: OP_LDGPR = used?\n");
@@ -4870,6 +6431,11 @@ _initialize_mips_tdep (void)
static struct cmd_list_element *mipsfpulist = NULL;
struct cmd_list_element *c;
+ mips_abi_string = mips_abi_strings [MIPS_ABI_UNKNOWN];
+ if (MIPS_ABI_LAST + 1
+ != sizeof (mips_abi_strings) / sizeof (mips_abi_strings[0]))
+ internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
+
gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
if (!tm_print_insn) /* Someone may have already set it */
tm_print_insn = gdb_print_insn_mips;
@@ -4912,6 +6478,22 @@ This option can be set to one of:\n\
&setmipscmdlist),
&showmipscmdlist);
+ /* Allow the user to override the ABI. */
+ c = add_set_enum_cmd
+ ("abi", class_obscure, mips_abi_strings, &mips_abi_string,
+ "Set the ABI used by this program.\n"
+ "This option can be set to one of:\n"
+ " auto - the default ABI associated with the current binary\n"
+ " o32\n"
+ " o64\n"
+ " n32\n"
+ " n64\n"
+ " eabi32\n"
+ " eabi64",
+ &setmipscmdlist);
+ add_show_from_set (c, &showmipscmdlist);
+ set_cmd_sfunc (c, mips_abi_update);
+
/* Let the user turn off floating point and set the fence post for
heuristic_proc_start. */
@@ -4940,21 +6522,6 @@ This option can be set to one of:\n\
"Show current use of MIPS floating-point coprocessor target.",
&showlist);
-#if !GDB_MULTI_ARCH
- c = add_set_cmd ("processor", class_support, var_string_noescape,
- (char *) &tmp_mips_processor_type,
- "Set the type of MIPS processor in use.\n\
-Set this to be able to access processor-type-specific registers.\n\
-",
- &setlist);
- set_cmd_cfunc (c, mips_set_processor_type_command);
- c = add_show_from_set (c, &showlist);
- set_cmd_cfunc (c, mips_show_processor_type_command);
-
- tmp_mips_processor_type = xstrdup (DEFAULT_MIPS_TYPE);
- mips_set_processor_type_command (xstrdup (DEFAULT_MIPS_TYPE), 0);
-#endif
-
/* We really would like to have both "0" and "unlimited" work, but
command.c doesn't deal with that. So make it a var_zinteger
because the user can always use "999999" or some such for unlimited. */
@@ -4973,13 +6540,13 @@ search. The only need to set it is when debugging a stripped executable.",
/* Allow the user to control whether the upper bits of 64-bit
addresses should be zeroed. */
- c = add_set_auto_boolean_cmd ("mask-address", no_class, &mask_address_var,
- "Set zeroing of upper 32 bits of 64-bit addresses.\n\
-Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to allow GDB to determine\n\
-the correct value.\n",
- &setmipscmdlist);
- add_cmd ("mask-address", no_class, show_mask_address,
- "Show current mask-address value", &showmipscmdlist);
+ add_setshow_auto_boolean_cmd ("mask-address", no_class, &mask_address_var, "\
+Set zeroing of upper 32 bits of 64-bit addresses.\n\
+Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to \n\
+allow GDB to determine the correct value.\n", "\
+Show zeroing of upper 32 bits of 64-bit addresses.",
+ NULL, show_mask_address,
+ &setmipscmdlist, &showmipscmdlist);
/* Allow the user to control the size of 32 bit registers within the
raw remote packet. */
diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c
index 1126d3119d6..a8d7d72ef8e 100644
--- a/gdb/mn10200-tdep.c
+++ b/gdb/mn10200-tdep.c
@@ -21,7 +21,6 @@
#include "defs.h"
#include "frame.h"
#include "inferior.h"
-#include "obstack.h"
#include "target.h"
#include "value.h"
#include "bfd.h"
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 0a5704b1704..6e7bada4cad 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -23,7 +23,6 @@
#include "defs.h"
#include "frame.h"
#include "inferior.h"
-#include "obstack.h"
#include "target.h"
#include "value.h"
#include "bfd.h"
@@ -89,7 +88,7 @@ register_name (int reg, char **regs, long sizeof_regs)
return regs[reg];
}
-static char *
+static const char *
mn10300_generic_register_name (int reg)
{
static char *regs[] =
@@ -102,7 +101,7 @@ mn10300_generic_register_name (int reg)
}
-static char *
+static const char *
am33_register_name (int reg)
{
static char *regs[] =
@@ -1161,7 +1160,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Stack unwinding. */
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ 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);
@@ -1171,10 +1170,10 @@ mn10300_gdbarch_init (struct gdbarch_info info,
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);
- set_gdbarch_extract_return_value (gdbarch, mn10300_extract_return_value);
- set_gdbarch_extract_struct_value_address
+ set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address
(gdbarch, mn10300_extract_struct_value_address);
- set_gdbarch_store_return_value (gdbarch, mn10300_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return);
set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame);
set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue);
diff --git a/gdb/mon960-rom.c b/gdb/mon960-rom.c
index 2b7fe5fd58d..46f5784ed7c 100644
--- a/gdb/mon960-rom.c
+++ b/gdb/mon960-rom.c
@@ -30,6 +30,7 @@
#include "symtab.h"
#include "symfile.h" /* for generic_load */
#include "inferior.h" /* for write_pc() */
+#include "gdb_string.h"
#define USE_GENERIC_LOAD
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 81340d4be02..559c0a2f372 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -1174,7 +1174,7 @@ monitor_wait (ptid_t ptid, struct target_waitstatus *status)
static void
monitor_fetch_register (int regno)
{
- char *name;
+ const char *name;
char *zerobuf;
char *regbuf;
int i;
@@ -1183,7 +1183,10 @@ monitor_fetch_register (int regno)
zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
- name = current_monitor->regnames[regno];
+ if (current_monitor->regname != NULL)
+ name = current_monitor->regname (regno);
+ else
+ name = current_monitor->regnames[regno];
monitor_debug ("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)");
if (!name || (*name == '\0'))
@@ -1333,10 +1336,14 @@ monitor_fetch_registers (int regno)
static void
monitor_store_register (int regno)
{
- char *name;
+ const char *name;
ULONGEST val;
-
- name = current_monitor->regnames[regno];
+
+ if (current_monitor->regname != NULL)
+ name = current_monitor->regname (regno);
+ else
+ name = current_monitor->regnames[regno];
+
if (!name || (*name == '\0'))
{
monitor_debug ("MON Cannot store unknown register\n");
diff --git a/gdb/monitor.h b/gdb/monitor.h
index 85a44ff7e71..5d6138c4398 100644
--- a/gdb/monitor.h
+++ b/gdb/monitor.h
@@ -116,6 +116,9 @@ struct monitor_ops
struct target_ops *target; /* target operations */
int stopbits; /* number of stop bits */
char **regnames; /* array of register names in ascii */
+ /* deprecated: use regname instead */
+ const char *(*regname) (int index);
+ /* function for dynamic regname array */
int num_breakpoints; /* If set_break != NULL, number of supported
breakpoints */
int magic; /* Check value */
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 5d4a885674b..58c2e13c10c 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -36,7 +36,7 @@ static CORE_ADDR ns32k_get_enter_addr (CORE_ADDR);
static int ns32k_localcount (CORE_ADDR enter_pc);
static void flip_bytes (void *, int);
-static char *
+static const char *
ns32k_register_name_32082 (int regno)
{
static char *register_names[] =
@@ -55,7 +55,7 @@ ns32k_register_name_32082 (int regno)
return (register_names[regno]);
}
-static char *
+static const char *
ns32k_register_name_32382 (int regno)
{
static char *register_names[] =
@@ -337,51 +337,6 @@ ns32k_frame_locals_address (struct frame_info *frame)
return (frame->frame);
}
-static void
-ns32k_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
- struct frame_info *frame, int regnum,
- enum lval_type *lval)
-{
- CORE_ADDR addr;
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-
/* Code to initialize the addresses of the saved registers of frame described
by FRAME_INFO. This includes special registers such as pc and fp saved in
special ways in the stack frame. sp is even more special: the address we
@@ -614,15 +569,13 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 8);
- set_gdbarch_get_saved_register (gdbarch, ns32k_get_saved_register);
-
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Return value info */
set_gdbarch_store_struct_return (gdbarch, ns32k_store_struct_return);
- set_gdbarch_extract_return_value (gdbarch, ns32k_extract_return_value);
- set_gdbarch_store_return_value (gdbarch, ns32k_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
+ set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
ns32k_extract_struct_value_address);
/* Call dummy info */
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 32bda87b91d..9c5e49fde60 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1,6 +1,8 @@
/* GDB routines for manipulating objfiles.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@@ -30,11 +32,12 @@
#include "objfiles.h"
#include "gdb-stabs.h"
#include "target.h"
+#include "bcache.h"
#include <sys/types.h>
#include "gdb_stat.h"
#include <fcntl.h>
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "gdb_string.h"
#include "breakpoint.h"
@@ -269,10 +272,8 @@ allocate_objfile (bfd *abfd, int flags)
objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
memset (objfile, 0, sizeof (struct objfile));
objfile->md = NULL;
- obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->macro_cache.cache, 0, 0,
- xmalloc, xfree);
+ objfile->psymbol_cache = bcache_xmalloc ();
+ objfile->macro_cache = bcache_xmalloc ();
obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0, xmalloc,
xfree);
obstack_specify_allocation (&objfile->symbol_obstack, 0, 0, xmalloc,
@@ -483,8 +484,8 @@ free_objfile (struct objfile *objfile)
if (objfile->static_psymbols.list)
xmfree (objfile->md, objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
- free_bcache (&objfile->psymbol_cache);
- free_bcache (&objfile->macro_cache);
+ bcache_xfree (objfile->psymbol_cache);
+ bcache_xfree (objfile->macro_cache);
obstack_free (&objfile->psymbol_obstack, 0);
obstack_free (&objfile->symbol_obstack, 0);
obstack_free (&objfile->type_obstack, 0);
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index ed4e6b7b32f..d472efc62c9 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -1,6 +1,7 @@
/* Definitions for symbol file management in GDB.
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,6 +23,11 @@
#if !defined (OBJFILES_H)
#define OBJFILES_H
+#include "gdb_obstack.h" /* For obstack internals. */
+#include "symfile.h" /* For struct psymbol_allocation_list */
+
+struct bcache;
+
/* This structure maintains information on a per-objfile basis about the
"entry point" of the objfile, and the scope within which the entry point
exists. It is possible that gdb will see more than one objfile that is
@@ -276,8 +282,8 @@ struct objfile
/* A byte cache where we can stash arbitrary "chunks" of bytes that
will not change. */
- struct bcache psymbol_cache; /* Byte cache for partial syms */
- struct bcache macro_cache; /* Byte cache for macros */
+ struct bcache *psymbol_cache; /* Byte cache for partial syms */
+ struct bcache *macro_cache; /* Byte cache for macros */
/* Vectors of all partial symbols read in from file. The actual data
is stored in the psymbol_obstack. */
@@ -360,7 +366,7 @@ struct objfile
so that it gets freed automatically when reading a new object
file. */
- PTR obj_private;
+ void *obj_private;
/* Set of relocation offsets to apply to each section.
Currently on the psymbol_obstack (which makes no sense, but I'm
diff --git a/gdb/os9kread.c b/gdb/os9kread.c
index 498498ba2b5..767d6845642 100644
--- a/gdb/os9kread.c
+++ b/gdb/os9kread.c
@@ -1,1621 +1,1621 @@
-/* Read os9/os9k symbol tables and convert to internal format, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This module provides three functions: os9k_symfile_init,
- which initializes to read a symbol file; os9k_new_init, which
- discards existing cached information when all symbols are being
- discarded; and os9k_symfile_read, which reads a symbol table
- from a file.
-
- os9k_symfile_read only does the minimum work necessary for letting the
- user "name" things symbolically; it does not read the entire symtab.
- Instead, it reads the external and static symbols and puts them in partial
- symbol tables. When more extensive information is requested of a
- file, the corresponding partial symbol table is mutated into a full
- fledged symbol table by going back and reading the symbols
- for real. os9k_psymtab_to_symtab() is the function that does this */
-
-#include "defs.h"
-#include "gdb_string.h"
-#include "gdb_assert.h"
-#include <stdio.h>
-
-#if defined(USG) || defined(__CYGNUSCLIB__)
-#include <sys/types.h>
-#include <fcntl.h>
-#endif
-
-#include "obstack.h"
-#include "gdb_stat.h"
-#include "symtab.h"
-#include "breakpoint.h"
-#include "command.h"
-#include "target.h"
-#include "gdbcore.h" /* for bfd stuff */
-#include "libaout.h" /* FIXME Secret internal BFD stuff for a.out */
-#include "symfile.h"
-#include "objfiles.h"
-#include "buildsym.h"
-#include "gdb-stabs.h"
-#include "demangle.h"
-#include "language.h" /* Needed inside partial-stab.h */
-#include "complaints.h"
-#include "os9k.h"
-#include "stabsread.h"
-
-extern void _initialize_os9kread (void);
-
-/* Each partial symbol table entry contains a pointer to private data for the
- read_symtab() function to use when expanding a partial symbol table entry
- to a full symbol table entry.
-
- For dbxread this structure contains the offset within the file symbol table
- of first local symbol for this file, and count of the section
- of the symbol table devoted to this file's symbols (actually, the section
- bracketed may contain more than just this file's symbols). It also contains
- further information needed to locate the symbols if they are in an ELF file.
-
- If ldsymcnt is 0, the only reason for this thing's existence is the
- dependency list. Nothing else will happen when it is read in. */
-
-#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
-#define LDSYMCNT(p) (((struct symloc *)((p)->read_symtab_private))->ldsymnum)
-
-struct symloc
- {
- int ldsymoff;
- int ldsymnum;
- };
-
-/* Remember what we deduced to be the source language of this psymtab. */
-static enum language psymtab_language = language_unknown;
-
-/* keep partial symbol table file nested depth */
-static int psymfile_depth = 0;
-
-/* keep symbol table file nested depth */
-static int symfile_depth = 0;
-
-extern int previous_stab_code;
-
-/* Name of last function encountered. Used in Solaris to approximate
- object file boundaries. */
-static char *last_function_name;
-
-/* Complaints about the symbols we have encountered. */
-extern struct complaint lbrac_complaint;
-
-extern struct complaint unknown_symtype_complaint;
-
-extern struct complaint unknown_symchar_complaint;
-
-extern struct complaint lbrac_rbrac_complaint;
-
-extern struct complaint repeated_header_complaint;
-
-extern struct complaint repeated_header_name_complaint;
-
-#if 0
-static struct complaint lbrac_unmatched_complaint =
-{"unmatched Increment Block Entry before symtab pos %d", 0, 0};
-
-static struct complaint lbrac_mismatch_complaint =
-{"IBE/IDE symbol mismatch at symtab pos %d", 0, 0};
-#endif
-
-/* Local function prototypes */
-
-static void read_minimal_symbols (struct objfile *);
-
-static void os9k_read_ofile_symtab (struct partial_symtab *);
-
-static void os9k_psymtab_to_symtab (struct partial_symtab *);
-
-static void os9k_psymtab_to_symtab_1 (struct partial_symtab *);
-
-static void read_os9k_psymtab (struct objfile *, CORE_ADDR, int);
-
-static int fill_sym (FILE *, bfd *);
-
-static void os9k_symfile_init (struct objfile *);
-
-static void os9k_new_init (struct objfile *);
-
-static void os9k_symfile_read (struct objfile *, int);
-
-static void os9k_symfile_finish (struct objfile *);
-
-static void
-os9k_process_one_symbol (int, int, CORE_ADDR, char *,
- struct section_offsets *, struct objfile *);
-
-static struct partial_symtab *os9k_start_psymtab (struct objfile *, char *,
- CORE_ADDR, int, int,
- struct partial_symbol **,
- struct partial_symbol **);
-
-static struct partial_symtab *os9k_end_psymtab (struct partial_symtab *,
- char **, int, int, CORE_ADDR,
- struct partial_symtab **,
- int);
-
-static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *);
-
-#define HANDLE_RBRAC(val) \
- if ((val) > pst->texthigh) pst->texthigh = (val);
-
-#define SWAP_STBHDR(hdrp, abfd) \
- { \
- (hdrp)->fmtno = bfd_get_16(abfd, (unsigned char *)&(hdrp)->fmtno); \
- (hdrp)->crc = bfd_get_32(abfd, (unsigned char *)&(hdrp)->crc); \
- (hdrp)->offset = bfd_get_32(abfd, (unsigned char *)&(hdrp)->offset); \
- (hdrp)->nsym = bfd_get_32(abfd, (unsigned char *)&(hdrp)->nsym); \
- }
-#define SWAP_STBSYM(symp, abfd) \
- { \
- (symp)->value = bfd_get_32(abfd, (unsigned char *)&(symp)->value); \
- (symp)->type = bfd_get_16(abfd, (unsigned char *)&(symp)->type); \
- (symp)->stroff = bfd_get_32(abfd, (unsigned char *)&(symp)->stroff); \
- }
-#define N_DATA 0
-#define N_BSS 1
-#define N_RDATA 2
-#define N_IDATA 3
-#define N_TEXT 4
-#define N_ABS 6
-
-static void
-record_minimal_symbol (char *name, CORE_ADDR address, int type,
- struct objfile *objfile)
-{
- enum minimal_symbol_type ms_type;
-
- switch (type)
- {
- case N_TEXT:
- ms_type = mst_text;
- address += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- break;
- case N_DATA:
- ms_type = mst_data;
- break;
- case N_BSS:
- ms_type = mst_bss;
- break;
- case N_RDATA:
- ms_type = mst_bss;
- break;
- case N_IDATA:
- ms_type = mst_data;
- break;
- case N_ABS:
- ms_type = mst_abs;
- break;
- default:
- ms_type = mst_unknown;
- break;
- }
-
- prim_record_minimal_symbol (name, address, ms_type, objfile);
-}
-
-/* read and process .stb file and store in minimal symbol table */
-typedef char mhhdr[80];
-struct stbhdr
- {
- mhhdr comhdr;
- char *name;
- short fmtno;
- int crc;
- int offset;
- int nsym;
- char *pad;
- };
-struct stbsymbol
- {
- int value;
- short type;
- int stroff;
- };
-#define STBSYMSIZE 10
-
-static void
-read_minimal_symbols (struct objfile *objfile)
-{
- FILE *fp;
- bfd *abfd;
- struct stbhdr hdr;
- struct stbsymbol sym;
- int ch, i, j, off;
- char buf[64], buf1[128];
-
- fp = objfile->auxf1;
- if (fp == NULL)
- return;
- abfd = objfile->obfd;
- fread (&hdr.comhdr[0], sizeof (mhhdr), 1, fp);
- i = 0;
- ch = getc (fp);
- while (ch != -1)
- {
- buf[i] = (char) ch;
- i++;
- if (ch == 0)
- break;
- ch = getc (fp);
- };
- if (i % 2)
- ch = getc (fp);
- hdr.name = &buf[0];
-
- fread (&hdr.fmtno, sizeof (hdr.fmtno), 1, fp);
- fread (&hdr.crc, sizeof (hdr.crc), 1, fp);
- fread (&hdr.offset, sizeof (hdr.offset), 1, fp);
- fread (&hdr.nsym, sizeof (hdr.nsym), 1, fp);
- SWAP_STBHDR (&hdr, abfd);
-
- /* read symbols */
- init_minimal_symbol_collection ();
- off = hdr.offset;
- for (i = hdr.nsym; i > 0; i--)
- {
- fseek (fp, (long) off, 0);
- fread (&sym.value, sizeof (sym.value), 1, fp);
- fread (&sym.type, sizeof (sym.type), 1, fp);
- fread (&sym.stroff, sizeof (sym.stroff), 1, fp);
- SWAP_STBSYM (&sym, abfd);
- fseek (fp, (long) sym.stroff, 0);
- j = 0;
- ch = getc (fp);
- while (ch != -1)
- {
- buf1[j] = (char) ch;
- j++;
- if (ch == 0)
- break;
- ch = getc (fp);
- };
- record_minimal_symbol (buf1, sym.value, sym.type & 7, objfile);
- off += STBSYMSIZE;
- };
- install_minimal_symbols (objfile);
- return;
-}
-
-/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to os9k_symfile_init, which
- put all the relevant info into a "struct os9k_symfile_info",
- hung off the objfile structure.
-
- MAINLINE is true if we are reading the main symbol
- table (as opposed to a shared lib or dynamically loaded file). */
-
-static void
-os9k_symfile_read (struct objfile *objfile, int mainline)
-{
- bfd *sym_bfd;
- struct cleanup *back_to;
-
- sym_bfd = objfile->obfd;
- /* If we are reinitializing, or if we have never loaded syms yet, init */
- if (mainline
- || (objfile->global_psymbols.size == 0
- && objfile->static_psymbols.size == 0))
- init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
-
- free_pending_blocks ();
- back_to = make_cleanup (really_free_pendings, 0);
-
- make_cleanup_discard_minimal_symbols ();
- read_minimal_symbols (objfile);
-
- /* Now that the symbol table data of the executable file are all in core,
- process them and define symbols accordingly. */
- read_os9k_psymtab (objfile,
- DBX_TEXT_ADDR (objfile),
- DBX_TEXT_SIZE (objfile));
-
- do_cleanups (back_to);
-}
-
-/* Initialize anything that needs initializing when a completely new
- symbol file is specified (not just adding some symbols from another
- file, e.g. a shared library). */
-
-static void
-os9k_new_init (struct objfile *ignore)
-{
- stabsread_new_init ();
- buildsym_new_init ();
- psymfile_depth = 0;
-/*
- init_header_files ();
- */
-}
-
-/* os9k_symfile_init ()
- It is passed a struct objfile which contains, among other things,
- the BFD for the file whose symbols are being read, and a slot for a pointer
- to "private data" which we fill with goodies.
-
- Since BFD doesn't know how to read debug symbols in a format-independent
- way (and may never do so...), we have to do it ourselves. We will never
- be called unless this is an a.out (or very similar) file.
- FIXME, there should be a cleaner peephole into the BFD environment here. */
-
-static void
-os9k_symfile_init (struct objfile *objfile)
-{
- bfd *sym_bfd = objfile->obfd;
- char *name = bfd_get_filename (sym_bfd);
- char dbgname[512], stbname[512];
- FILE *symfile = 0;
- FILE *minfile = 0;
- asection *text_sect;
-
- strcpy (dbgname, name);
- strcat (dbgname, ".dbg");
- strcpy (stbname, name);
- strcat (stbname, ".stb");
-
- if ((symfile = fopen (dbgname, "r")) == NULL)
- {
- warning ("Symbol file %s not found", dbgname);
- }
- objfile->auxf2 = symfile;
-
- if ((minfile = fopen (stbname, "r")) == NULL)
- {
- warning ("Symbol file %s not found", stbname);
- }
- objfile->auxf1 = minfile;
-
- /* Allocate struct to keep track of the symfile */
- objfile->sym_stab_info = (struct dbx_symfile_info *)
- xmmalloc (objfile->md, sizeof (struct dbx_symfile_info));
- DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL;
-
- text_sect = bfd_get_section_by_name (sym_bfd, ".text");
- if (!text_sect)
- error ("Can't find .text section in file");
- DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
- DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
-
- DBX_SYMBOL_SIZE (objfile) = 0; /* variable size symbol */
- DBX_SYMCOUNT (objfile) = 0; /* used to be bfd_get_symcount(sym_bfd) */
- DBX_SYMTAB_OFFSET (objfile) = 0; /* used to be SYMBOL_TABLE_OFFSET */
-}
-
-/* Perform any local cleanups required when we are done with a particular
- objfile. I.E, we are in the process of discarding all symbol information
- for an objfile, freeing up all memory held for it, and unlinking the
- objfile struct from the global list of known objfiles. */
-
-static void
-os9k_symfile_finish (struct objfile *objfile)
-{
- if (objfile->sym_stab_info != NULL)
- {
- xmfree (objfile->md, objfile->sym_stab_info);
- }
-/*
- free_header_files ();
- */
-}
-
-
-struct st_dbghdr
-{
- int sync;
- short rev;
- int crc;
- short os;
- short cpu;
-};
-#define SYNC (int)0xefbefeca
-
-#define SWAP_DBGHDR(hdrp, abfd) \
- { \
- (hdrp)->sync = bfd_get_32(abfd, (unsigned char *)&(hdrp)->sync); \
- (hdrp)->rev = bfd_get_16(abfd, (unsigned char *)&(hdrp)->rev); \
- (hdrp)->crc = bfd_get_32(abfd, (unsigned char *)&(hdrp)->crc); \
- (hdrp)->os = bfd_get_16(abfd, (unsigned char *)&(hdrp)->os); \
- (hdrp)->cpu = bfd_get_16(abfd, (unsigned char *)&(hdrp)->cpu); \
- }
-
-#define N_SYM_CMPLR 0
-#define N_SYM_SLINE 1
-#define N_SYM_SYM 2
-#define N_SYM_LBRAC 3
-#define N_SYM_RBRAC 4
-#define N_SYM_SE 5
-
-struct internal_symstruct
- {
- short n_type;
- short n_desc;
- long n_value;
- char *n_strx;
- };
-static struct internal_symstruct symbol;
-static struct internal_symstruct *symbuf = &symbol;
-static char strbuf[4096];
-static struct st_dbghdr dbghdr;
-static short cmplrid;
-
-#define VER_PRE_ULTRAC ((short)4)
-#define VER_ULTRAC ((short)5)
-
-static int
-fill_sym (FILE *dbg_file, bfd *abfd)
-{
- short si, nmask;
- long li;
- int ii;
- char *p;
-
- int nbytes = fread (&si, sizeof (si), 1, dbg_file);
- if (nbytes == 0)
- return 0;
- if (nbytes < 0)
- perror_with_name ("reading .dbg file.");
- symbuf->n_desc = 0;
- symbuf->n_value = 0;
- symbuf->n_strx = NULL;
- symbuf->n_type = bfd_get_16 (abfd, (unsigned char *) &si);
- symbuf->n_type = 0xf & symbuf->n_type;
- switch (symbuf->n_type)
- {
- case N_SYM_CMPLR:
- fread (&si, sizeof (si), 1, dbg_file);
- symbuf->n_desc = bfd_get_16 (abfd, (unsigned char *) &si);
- cmplrid = symbuf->n_desc & 0xff;
- break;
- case N_SYM_SLINE:
- fread (&li, sizeof (li), 1, dbg_file);
- symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li);
- fread (&li, sizeof (li), 1, dbg_file);
- li = bfd_get_32 (abfd, (unsigned char *) &li);
- symbuf->n_strx = (char *) (li >> 12);
- symbuf->n_desc = li & 0xfff;
- break;
- case N_SYM_SYM:
- fread (&li, sizeof (li), 1, dbg_file);
- symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li);
- si = 0;
- do
- {
- ii = getc (dbg_file);
- strbuf[si++] = (char) ii;
- }
- while (ii != 0 || si % 2 != 0);
- symbuf->n_strx = strbuf;
- p = (char *) strchr (strbuf, ':');
- if (!p)
- break;
- if ((p[1] == 'F' || p[1] == 'f') && cmplrid == VER_PRE_ULTRAC)
- {
- fread (&si, sizeof (si), 1, dbg_file);
- nmask = bfd_get_16 (abfd, (unsigned char *) &si);
- for (ii = 0; ii < nmask; ii++)
- fread (&si, sizeof (si), 1, dbg_file);
- }
- break;
- case N_SYM_LBRAC:
- fread (&li, sizeof (li), 1, dbg_file);
- symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li);
- break;
- case N_SYM_RBRAC:
- fread (&li, sizeof (li), 1, dbg_file);
- symbuf->n_value = bfd_get_32 (abfd, (unsigned char *) &li);
- break;
- case N_SYM_SE:
- break;
- }
- return 1;
-}
-
-/* Given pointers to an a.out symbol table in core containing dbx
- style data, setup partial_symtab's describing each source file for
- which debugging information is available.
- SYMFILE_NAME is the name of the file we are reading from. */
-
-static void
-read_os9k_psymtab (struct objfile *objfile, CORE_ADDR text_addr, int text_size)
-{
- register struct internal_symstruct *bufp = 0; /* =0 avoids gcc -Wall glitch */
- register char *namestring;
- int past_first_source_file = 0;
- CORE_ADDR last_o_file_start = 0;
-#if 0
- struct cleanup *back_to;
-#endif
- bfd *abfd;
- FILE *fp;
-
- /* End of the text segment of the executable file. */
- static CORE_ADDR end_of_text_addr;
-
- /* Current partial symtab */
- static struct partial_symtab *pst = 0;
-
- /* List of current psymtab's include files */
- char **psymtab_include_list;
- int includes_allocated;
- int includes_used;
-
- /* Index within current psymtab dependency list */
- struct partial_symtab **dependency_list;
- int dependencies_used, dependencies_allocated;
-
- includes_allocated = 30;
- includes_used = 0;
- psymtab_include_list = (char **) alloca (includes_allocated *
- sizeof (char *));
-
- dependencies_allocated = 30;
- dependencies_used = 0;
- dependency_list =
- (struct partial_symtab **) alloca (dependencies_allocated *
- sizeof (struct partial_symtab *));
-
- last_source_file = NULL;
-
-#ifdef END_OF_TEXT_DEFAULT
- end_of_text_addr = END_OF_TEXT_DEFAULT;
-#else
- end_of_text_addr = text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))
- + text_size; /* Relocate */
-#endif
-
- abfd = objfile->obfd;
- fp = objfile->auxf2;
- if (!fp)
- return;
-
- fread (&dbghdr.sync, sizeof (dbghdr.sync), 1, fp);
- fread (&dbghdr.rev, sizeof (dbghdr.rev), 1, fp);
- fread (&dbghdr.crc, sizeof (dbghdr.crc), 1, fp);
- fread (&dbghdr.os, sizeof (dbghdr.os), 1, fp);
- fread (&dbghdr.cpu, sizeof (dbghdr.cpu), 1, fp);
- SWAP_DBGHDR (&dbghdr, abfd);
-
- symnum = 0;
- while (1)
- {
- int ret;
- long cursymoffset;
-
- /* Get the symbol for this run and pull out some info */
- QUIT; /* allow this to be interruptable */
- cursymoffset = ftell (objfile->auxf2);
- ret = fill_sym (objfile->auxf2, abfd);
- if (ret <= 0)
- break;
- else
- symnum++;
- bufp = symbuf;
-
- /* Special case to speed up readin. */
- if (bufp->n_type == (short) N_SYM_SLINE)
- continue;
-
-#define CUR_SYMBOL_VALUE bufp->n_value
- /* partial-stab.h */
-
- switch (bufp->n_type)
- {
- char *p;
-
- case N_SYM_CMPLR:
- continue;
-
- case N_SYM_SE:
- CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- if (psymfile_depth == 1 && pst)
- {
- os9k_end_psymtab (pst, psymtab_include_list, includes_used,
- symnum, CUR_SYMBOL_VALUE,
- dependency_list, dependencies_used);
- pst = (struct partial_symtab *) 0;
- includes_used = 0;
- dependencies_used = 0;
- }
- psymfile_depth--;
- continue;
-
- case N_SYM_SYM: /* Typedef or automatic variable. */
- namestring = bufp->n_strx;
- p = (char *) strchr (namestring, ':');
- if (!p)
- continue; /* Not a debugging symbol. */
-
- /* Main processing section for debugging symbols which
- the initial read through the symbol tables needs to worry
- about. If we reach this point, the symbol which we are
- considering is definitely one we are interested in.
- p must also contain the (valid) index into the namestring
- which indicates the debugging type symbol. */
-
- switch (p[1])
- {
- case 'S':
- {
- unsigned long valu;
- enum language tmp_language;
- char *str, *p;
- int n;
-
- valu = CUR_SYMBOL_VALUE;
- if (valu)
- valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- past_first_source_file = 1;
-
- p = strchr (namestring, ':');
- if (p)
- n = p - namestring;
- else
- n = strlen (namestring);
- str = alloca (n + 1);
- strncpy (str, namestring, n);
- str[n] = '\0';
-
- if (psymfile_depth == 0)
- {
- if (!pst)
- pst = os9k_start_psymtab (objfile,
- str, valu,
- cursymoffset,
- symnum - 1,
- objfile->global_psymbols.next,
- objfile->static_psymbols.next);
- }
- else
- { /* this is a include file */
- tmp_language = deduce_language_from_filename (str);
- if (tmp_language != language_unknown
- && (tmp_language != language_c
- || psymtab_language != language_cplus))
- psymtab_language = tmp_language;
-
-/*
- if (pst && STREQ (str, pst->filename))
- continue;
- {
- register int i;
- for (i = 0; i < includes_used; i++)
- if (STREQ (str, psymtab_include_list[i]))
- {
- i = -1;
- break;
- }
- if (i == -1)
- continue;
- }
- */
-
- psymtab_include_list[includes_used++] = str;
- if (includes_used >= includes_allocated)
- {
- char **orig = psymtab_include_list;
-
- psymtab_include_list = (char **)
- alloca ((includes_allocated *= 2) * sizeof (char *));
- memcpy ((PTR) psymtab_include_list, (PTR) orig,
- includes_used * sizeof (char *));
- }
-
- }
- psymfile_depth++;
- continue;
- }
-
- case 'v':
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- &objfile->static_psymbols,
- 0, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
- continue;
- case 'V':
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_STATIC,
- &objfile->global_psymbols,
- 0, CUR_SYMBOL_VALUE,
- psymtab_language, objfile);
- continue;
-
- case 'T':
- if (p != namestring) /* a name is there, not just :T... */
- {
- add_psymbol_to_list (namestring, p - namestring,
- STRUCT_NAMESPACE, LOC_TYPEDEF,
- &objfile->static_psymbols,
- CUR_SYMBOL_VALUE, 0,
- psymtab_language, objfile);
- if (p[2] == 't')
- {
- /* Also a typedef with the same name. */
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- &objfile->static_psymbols,
- CUR_SYMBOL_VALUE, 0, psymtab_language,
- objfile);
- p += 1;
- }
- /* The semantics of C++ state that "struct foo { ... }"
- also defines a typedef for "foo". Unfortuantely, cfront
- never makes the typedef when translating from C++ to C.
- We make the typedef here so that "ptype foo" works as
- expected for cfront translated code. */
- else if (psymtab_language == language_cplus)
- {
- /* Also a typedef with the same name. */
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- &objfile->static_psymbols,
- CUR_SYMBOL_VALUE, 0, psymtab_language,
- objfile);
- }
- }
- goto check_enum;
- case 't':
- if (p != namestring) /* a name is there, not just :T... */
- {
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_TYPEDEF,
- &objfile->static_psymbols,
- CUR_SYMBOL_VALUE, 0,
- psymtab_language, objfile);
- }
- check_enum:
- /* If this is an enumerated type, we need to
- add all the enum constants to the partial symbol
- table. This does not cover enums without names, e.g.
- "enum {a, b} c;" in C, but fortunately those are
- rare. There is no way for GDB to find those from the
- enum type without spending too much time on it. Thus
- to solve this problem, the compiler needs to put out the
- enum in a nameless type. GCC2 does this. */
-
- /* We are looking for something of the form
- <name> ":" ("t" | "T") [<number> "="] "e" <size>
- {<constant> ":" <value> ","} ";". */
-
- /* Skip over the colon and the 't' or 'T'. */
- p += 2;
- /* This type may be given a number. Also, numbers can come
- in pairs like (0,26). Skip over it. */
- while ((*p >= '0' && *p <= '9')
- || *p == '(' || *p == ',' || *p == ')'
- || *p == '=')
- p++;
-
- if (*p++ == 'e')
- {
- /* We have found an enumerated type. skip size */
- while (*p >= '0' && *p <= '9')
- p++;
- /* According to comments in read_enum_type
- a comma could end it instead of a semicolon.
- I don't know where that happens.
- Accept either. */
- while (*p && *p != ';' && *p != ',')
- {
- char *q;
-
- /* Check for and handle cretinous dbx symbol name
- continuation!
- if (*p == '\\')
- p = next_symbol_text (objfile);
- */
-
- /* Point to the character after the name
- of the enum constant. */
- for (q = p; *q && *q != ':'; q++)
- ;
- /* Note that the value doesn't matter for
- enum constants in psymtabs, just in symtabs. */
- add_psymbol_to_list (p, q - p,
- VAR_NAMESPACE, LOC_CONST,
- &objfile->static_psymbols, 0,
- 0, psymtab_language, objfile);
- /* Point past the name. */
- p = q;
- /* Skip over the value. */
- while (*p && *p != ',')
- p++;
- /* Advance past the comma. */
- if (*p)
- p++;
- }
- }
- continue;
- case 'c':
- /* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_CONST,
- &objfile->static_psymbols, CUR_SYMBOL_VALUE,
- 0, psymtab_language, objfile);
- continue;
-
- case 'f':
- CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- if (pst && pst->textlow == 0)
- pst->textlow = CUR_SYMBOL_VALUE;
-
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
- &objfile->static_psymbols, CUR_SYMBOL_VALUE,
- 0, psymtab_language, objfile);
- continue;
-
- case 'F':
- CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
- if (pst && pst->textlow == 0)
- pst->textlow = CUR_SYMBOL_VALUE;
-
- add_psymbol_to_list (namestring, p - namestring,
- VAR_NAMESPACE, LOC_BLOCK,
- &objfile->global_psymbols, CUR_SYMBOL_VALUE,
- 0, psymtab_language, objfile);
- continue;
-
- case 'p':
- case 'l':
- case 's':
- continue;
-
- case ':':
- /* It is a C++ nested symbol. We don't need to record it
- (I don't think); if we try to look up foo::bar::baz,
- then symbols for the symtab containing foo should get
- read in, I think. */
- /* Someone says sun cc puts out symbols like
- /foo/baz/maclib::/usr/local/bin/maclib,
- which would get here with a symbol type of ':'. */
- continue;
-
- default:
- /* Unexpected symbol descriptor. The second and subsequent stabs
- of a continued stab can show up here. The question is
- whether they ever can mimic a normal stab--it would be
- nice if not, since we certainly don't want to spend the
- time searching to the end of every string looking for
- a backslash. */
-
- complain (&unknown_symchar_complaint, p[1]);
- continue;
- }
-
- case N_SYM_RBRAC:
- CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-#ifdef HANDLE_RBRAC
- HANDLE_RBRAC (CUR_SYMBOL_VALUE);
- continue;
-#endif
- case N_SYM_LBRAC:
- continue;
-
- default:
- /* If we haven't found it yet, ignore it. It's probably some
- new type we don't know about yet. */
- complain (&unknown_symtype_complaint,
- local_hex_string ((unsigned long) bufp->n_type));
- continue;
- }
- }
-
- DBX_SYMCOUNT (objfile) = symnum;
-
- /* If there's stuff to be cleaned up, clean it up. */
- if (DBX_SYMCOUNT (objfile) > 0
-/*FIXME, does this have a bug at start address 0? */
- && last_o_file_start
- && objfile->ei.entry_point < bufp->n_value
- && objfile->ei.entry_point >= last_o_file_start)
- {
- objfile->ei.entry_file_lowpc = last_o_file_start;
- objfile->ei.entry_file_highpc = bufp->n_value;
- }
-
- if (pst)
- {
- os9k_end_psymtab (pst, psymtab_include_list, includes_used,
- symnum, end_of_text_addr,
- dependency_list, dependencies_used);
- }
-/*
- do_cleanups (back_to);
- */
-}
-
-/* Allocate and partially fill a partial symtab. It will be
- completely filled at the end of the symbol list.
-
- SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR
- is the address relative to which its symbols are (incremental) or 0
- (normal). */
-
-
-static struct partial_symtab *
-os9k_start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
- int ldsymoff, int ldsymcnt,
- struct partial_symbol **global_syms,
- struct partial_symbol **static_syms)
-{
- struct partial_symtab *result =
- start_psymtab_common (objfile, objfile->section_offsets,
- filename, textlow, global_syms, static_syms);
-
- result->read_symtab_private = (char *)
- obstack_alloc (&objfile->psymbol_obstack, sizeof (struct symloc));
-
- LDSYMOFF (result) = ldsymoff;
- LDSYMCNT (result) = ldsymcnt;
- result->read_symtab = os9k_psymtab_to_symtab;
-
- /* Deduce the source language from the filename for this psymtab. */
- psymtab_language = deduce_language_from_filename (filename);
- return result;
-}
-
-/* Close off the current usage of PST.
- Returns PST or NULL if the partial symtab was empty and thrown away.
- FIXME: List variables and peculiarities of same. */
-
-static struct partial_symtab *
-os9k_end_psymtab (struct partial_symtab *pst, char **include_list,
- int num_includes, int capping_symbol_cnt,
- CORE_ADDR capping_text,
- struct partial_symtab **dependency_list,
- int number_dependencies)
-{
- int i;
- struct partial_symtab *p1;
- struct objfile *objfile = pst->objfile;
-
- if (capping_symbol_cnt != -1)
- LDSYMCNT (pst) = capping_symbol_cnt - LDSYMCNT (pst);
-
- /* Under Solaris, the N_SO symbols always have a value of 0,
- instead of the usual address of the .o file. Therefore,
- we have to do some tricks to fill in texthigh and textlow.
- The first trick is in partial-stab.h: if we see a static
- or global function, and the textlow for the current pst
- is still 0, then we use that function's address for
- the textlow of the pst.
-
- Now, to fill in texthigh, we remember the last function seen
- in the .o file (also in partial-stab.h). Also, there's a hack in
- bfd/elf.c and gdb/elfread.c to pass the ELF st_size field
- to here via the misc_info field. Therefore, we can fill in
- a reliable texthigh by taking the address plus size of the
- last function in the file.
-
- Unfortunately, that does not cover the case where the last function
- in the file is static. See the paragraph below for more comments
- on this situation.
-
- Finally, if we have a valid textlow for the current file, we run
- down the partial_symtab_list filling in previous texthighs that
- are still unknown. */
-
- if (pst->texthigh == 0 && last_function_name)
- {
- char *p;
- int n;
- struct minimal_symbol *minsym;
-
- p = strchr (last_function_name, ':');
- if (p == NULL)
- p = last_function_name;
- n = p - last_function_name;
- p = alloca (n + 1);
- strncpy (p, last_function_name, n);
- p[n] = 0;
-
- minsym = lookup_minimal_symbol (p, NULL, objfile);
-
- if (minsym)
- {
- pst->texthigh = SYMBOL_VALUE_ADDRESS (minsym) + (long) MSYMBOL_INFO (minsym);
- }
- else
- {
- /* This file ends with a static function, and it's
- difficult to imagine how hard it would be to track down
- the elf symbol. Luckily, most of the time no one will notice,
- since the next file will likely be compiled with -g, so
- the code below will copy the first fuction's start address
- back to our texthigh variable. (Also, if this file is the
- last one in a dynamically linked program, texthigh already
- has the right value.) If the next file isn't compiled
- with -g, then the last function in this file winds up owning
- all of the text space up to the next -g file, or the end (minus
- shared libraries). This only matters for single stepping,
- and even then it will still work, except that it will single
- step through all of the covered functions, instead of setting
- breakpoints around them as it usualy does. This makes it
- pretty slow, but at least it doesn't fail.
-
- We can fix this with a fairly big change to bfd, but we need
- to coordinate better with Cygnus if we want to do that. FIXME. */
- }
- last_function_name = NULL;
- }
-
- /* this test will be true if the last .o file is only data */
- if (pst->textlow == 0)
- pst->textlow = pst->texthigh;
-
- /* If we know our own starting text address, then walk through all other
- psymtabs for this objfile, and if any didn't know their ending text
- address, set it to our starting address. Take care to not set our
- own ending address to our starting address, nor to set addresses on
- `dependency' files that have both textlow and texthigh zero. */
- if (pst->textlow)
- {
- ALL_OBJFILE_PSYMTABS (objfile, p1)
- {
- if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst)
- {
- p1->texthigh = pst->textlow;
- /* if this file has only data, then make textlow match texthigh */
- if (p1->textlow == 0)
- p1->textlow = p1->texthigh;
- }
- }
- }
-
- /* End of kludge for patching Solaris textlow and texthigh. */
-
- pst->n_global_syms =
- objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset);
- pst->n_static_syms =
- objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset);
-
- pst->number_of_dependencies = number_dependencies;
- if (number_dependencies)
- {
- pst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
- number_dependencies * sizeof (struct partial_symtab *));
- memcpy (pst->dependencies, dependency_list,
- number_dependencies * sizeof (struct partial_symtab *));
- }
- else
- pst->dependencies = 0;
-
- for (i = 0; i < num_includes; i++)
- {
- struct partial_symtab *subpst =
- allocate_psymtab (include_list[i], objfile);
-
- subpst->section_offsets = pst->section_offsets;
- subpst->read_symtab_private =
- (char *) obstack_alloc (&objfile->psymbol_obstack,
- sizeof (struct symloc));
- LDSYMOFF (subpst) =
- LDSYMCNT (subpst) =
- subpst->textlow =
- subpst->texthigh = 0;
-
- /* We could save slight bits of space by only making one of these,
- shared by the entire set of include files. FIXME-someday. */
- subpst->dependencies = (struct partial_symtab **)
- obstack_alloc (&objfile->psymbol_obstack,
- sizeof (struct partial_symtab *));
- subpst->dependencies[0] = pst;
- subpst->number_of_dependencies = 1;
-
- subpst->globals_offset =
- subpst->n_global_syms =
- subpst->statics_offset =
- subpst->n_static_syms = 0;
-
- subpst->readin = 0;
- subpst->symtab = 0;
- subpst->read_symtab = pst->read_symtab;
- }
-
- sort_pst_symbols (pst);
-
- /* If there is already a psymtab or symtab for a file of this name,
- remove it.
- (If there is a symtab, more drastic things also happen.)
- This happens in VxWorks. */
- free_named_symtabs (pst->filename);
-
- if (num_includes == 0
- && number_dependencies == 0
- && pst->n_global_syms == 0
- && pst->n_static_syms == 0)
- {
- /* Throw away this psymtab, it's empty. We can't deallocate it, since
- it is on the obstack, but we can forget to chain it on the list. */
- /* Indicate that psymtab was thrown away. */
-
- discard_psymtab (pst);
-
- pst = (struct partial_symtab *) NULL;
- }
- return pst;
-}
-
-static void
-os9k_psymtab_to_symtab_1 (struct partial_symtab *pst)
-{
- struct cleanup *old_chain;
- int i;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
-
- /* Read in all partial symtabs on which this one is dependent */
- for (i = 0; i < pst->number_of_dependencies; i++)
- if (!pst->dependencies[i]->readin)
- {
- /* Inform about additional files that need to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", gdb_stdout);
- wrap_here ("");
- fputs_filtered ("and ", gdb_stdout);
- wrap_here ("");
- printf_filtered ("%s...", pst->dependencies[i]->filename);
- wrap_here (""); /* Flush output */
- gdb_flush (gdb_stdout);
- }
- os9k_psymtab_to_symtab_1 (pst->dependencies[i]);
- }
-
- if (LDSYMCNT (pst)) /* Otherwise it's a dummy */
- {
- /* Init stuff necessary for reading in symbols */
- stabsread_init ();
- buildsym_init ();
- old_chain = make_cleanup (really_free_pendings, 0);
-
- /* Read in this file's symbols */
- os9k_read_ofile_symtab (pst);
- sort_symtab_syms (pst->symtab);
- do_cleanups (old_chain);
- }
-
- pst->readin = 1;
-}
-
-/* Read in all of the symbols for a given psymtab for real.
- Be verbose about it if the user wants that. */
-
-static void
-os9k_psymtab_to_symtab (struct partial_symtab *pst)
-{
- bfd *sym_bfd;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
-
- if (LDSYMCNT (pst) || pst->number_of_dependencies)
- {
- /* Print the message now, before reading the string table,
- to avoid disconcerting pauses. */
- if (info_verbose)
- {
- printf_filtered ("Reading in symbols for %s...", pst->filename);
- gdb_flush (gdb_stdout);
- }
-
- sym_bfd = pst->objfile->obfd;
- os9k_psymtab_to_symtab_1 (pst);
-
- /* Match with global symbols. This only needs to be done once,
- after all of the symtabs and dependencies have been read in. */
- scan_file_globals (pst->objfile);
-
- /* Finish up the debug error message. */
- if (info_verbose)
- printf_filtered ("done.\n");
- }
-}
-
-/* Read in a defined section of a specific object file's symbols. */
-static void
-os9k_read_ofile_symtab (struct partial_symtab *pst)
-{
- register struct internal_symstruct *bufp;
- unsigned char type;
- unsigned max_symnum;
- register bfd *abfd;
- struct objfile *objfile;
- int sym_offset; /* Offset to start of symbols to read */
- CORE_ADDR text_offset; /* Start of text segment for symbols */
- int text_size; /* Size of text segment for symbols */
- FILE *dbg_file;
-
- objfile = pst->objfile;
- sym_offset = LDSYMOFF (pst);
- max_symnum = LDSYMCNT (pst);
- text_offset = pst->textlow;
- text_size = pst->texthigh - pst->textlow;
-
- current_objfile = objfile;
- subfile_stack = NULL;
- last_source_file = NULL;
-
- abfd = objfile->obfd;
- dbg_file = objfile->auxf2;
-
-#if 0
- /* It is necessary to actually read one symbol *before* the start
- of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL
- occurs before the N_SO symbol.
- Detecting this in read_dbx_symtab
- would slow down initial readin, so we look for it here instead. */
- if (!processing_acc_compilation && sym_offset >= (int) symbol_size)
- {
- fseek (objefile->auxf2, sym_offset, SEEK_CUR);
- fill_sym (objfile->auxf2, abfd);
- bufp = symbuf;
-
- processing_gcc_compilation = 0;
- if (bufp->n_type == N_TEXT)
- {
- if (STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL))
- processing_gcc_compilation = 1;
- else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL))
- processing_gcc_compilation = 2;
- }
-
- /* Try to select a C++ demangling based on the compilation unit
- producer. */
-
- if (processing_gcc_compilation)
- {
- if (AUTO_DEMANGLING)
- {
- set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
- }
- }
- }
- else
- {
- /* The N_SO starting this symtab is the first symbol, so we
- better not check the symbol before it. I'm not this can
- happen, but it doesn't hurt to check for it. */
- bfd_seek (symfile_bfd, sym_offset, SEEK_CUR);
- processing_gcc_compilation = 0;
- }
-#endif /* 0 */
-
- fseek (dbg_file, (long) sym_offset, 0);
-/*
- if (bufp->n_type != (unsigned char)N_SYM_SYM)
- error("First symbol in segment of executable not a source symbol");
- */
-
- for (symnum = 0; symnum < max_symnum; symnum++)
- {
- QUIT; /* Allow this to be interruptable */
- fill_sym (dbg_file, abfd);
- bufp = symbuf;
- type = bufp->n_type;
-
- os9k_process_one_symbol ((int) type, (int) bufp->n_desc,
- (CORE_ADDR) bufp->n_value, bufp->n_strx, pst->section_offsets, objfile);
-
- /* We skip checking for a new .o or -l file; that should never
- happen in this routine. */
-#if 0
- else
- if (type == N_TEXT)
- {
- /* I don't think this code will ever be executed, because
- the GCC_COMPILED_FLAG_SYMBOL usually is right before
- the N_SO symbol which starts this source file.
- However, there is no reason not to accept
- the GCC_COMPILED_FLAG_SYMBOL anywhere. */
-
- if (STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL))
- processing_gcc_compilation = 1;
- else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL))
- processing_gcc_compilation = 2;
-
- if (AUTO_DEMANGLING)
- {
- set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
- }
- }
- else if (type & N_EXT || type == (unsigned char) N_TEXT
- || type == (unsigned char) N_NBTEXT
- )
- {
- /* Global symbol: see if we came across a dbx defintion for
- a corresponding symbol. If so, store the value. Remove
- syms from the chain when their values are stored, but
- search the whole chain, as there may be several syms from
- different files with the same name. */
- /* This is probably not true. Since the files will be read
- in one at a time, each reference to a global symbol will
- be satisfied in each file as it appears. So we skip this
- section. */
- ;
- }
-#endif /* 0 */
- }
-
- current_objfile = NULL;
-
- /* In a Solaris elf file, this variable, which comes from the
- value of the N_SO symbol, will still be 0. Luckily, text_offset,
- which comes from pst->textlow is correct. */
- if (last_source_start_addr == 0)
- last_source_start_addr = text_offset;
- pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
- end_stabs ();
-}
-
-
-/* This handles a single symbol from the symbol-file, building symbols
- into a GDB symtab. It takes these arguments and an implicit argument.
-
- TYPE is the type field of the ".stab" symbol entry.
- DESC is the desc field of the ".stab" entry.
- VALU is the value field of the ".stab" entry.
- NAME is the symbol name, in our address space.
- SECTION_OFFSETS is a set of amounts by which the sections of this object
- file were relocated when it was loaded into memory.
- All symbols that refer
- to memory locations need to be offset by these amounts.
- OBJFILE is the object file from which we are reading symbols.
- It is used in end_symtab. */
-
-static void
-os9k_process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
- struct section_offsets *section_offsets,
- struct objfile *objfile)
-{
- register struct context_stack *new;
- /* The stab type used for the definition of the last function.
- N_STSYM or N_GSYM for SunOS4 acc; N_FUN for other compilers. */
- static int function_stab_type = 0;
-
-#if 0
- /* Something is wrong if we see real data before
- seeing a source file name. */
- if (last_source_file == NULL && type != (unsigned char) N_SO)
- {
- /* Ignore any symbols which appear before an N_SO symbol.
- Currently no one puts symbols there, but we should deal
- gracefully with the case. A complain()t might be in order,
- but this should not be an error (). */
- return;
- }
-#endif /* 0 */
-
- switch (type)
- {
- case N_SYM_LBRAC:
- /* On most machines, the block addresses are relative to the
- N_SO, the linker did not relocate them (sigh). */
- valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- new = push_context (desc, valu);
- break;
-
- case N_SYM_RBRAC:
- valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- new = pop_context ();
-
-#if !defined (OS9K_VARIABLES_INSIDE_BLOCK)
-#define OS9K_VARIABLES_INSIDE_BLOCK(desc, gcc_p) 1
-#endif
-
- if (!OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
- local_symbols = new->locals;
-
- if (context_stack_depth > 1)
- {
- /* This is not the outermost LBRAC...RBRAC pair in the function,
- its local symbols preceded it, and are the ones just recovered
- from the context stack. Define the block for them (but don't
- bother if the block contains no symbols. Should we complain
- on blocks without symbols? I can't think of any useful purpose
- for them). */
- if (local_symbols != NULL)
- {
- /* Muzzle a compiler bug that makes end < start. (which
- compilers? Is this ever harmful?). */
- if (new->start_addr > valu)
- {
- complain (&lbrac_rbrac_complaint);
- new->start_addr = valu;
- }
- /* Make a block for the local symbols within. */
- finish_block (0, &local_symbols, new->old_blocks,
- new->start_addr, valu, objfile);
- }
- }
- else
- {
- if (context_stack_depth == 0)
- {
- within_function = 0;
- /* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, valu, objfile);
- }
- else
- {
- /* attach local_symbols to the end of new->locals */
- if (!new->locals)
- new->locals = local_symbols;
- else
- {
- struct pending *p;
-
- p = new->locals;
- while (p->next)
- p = p->next;
- p->next = local_symbols;
- }
- }
- }
-
- if (OS9K_VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
- /* Now pop locals of block just finished. */
- local_symbols = new->locals;
- break;
-
-
- case N_SYM_SLINE:
- /* This type of "symbol" really just records
- one line-number -- core-address correspondence.
- Enter it in the line list for this symbol table. */
- /* Relocate for dynamic loading and for ELF acc fn-relative syms. */
- valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- /* FIXME: loses if sizeof (char *) > sizeof (int) */
- gdb_assert (sizeof (name) <= sizeof (int));
- record_line (current_subfile, (int) name, valu);
- break;
-
- /* The following symbol types need to have the appropriate offset added
- to their value; then we process symbol definitions in the name. */
- case N_SYM_SYM:
-
- if (name)
- {
- char deftype;
- char *dirn, *n;
- char *p = strchr (name, ':');
- if (p == NULL)
- deftype = '\0';
- else
- deftype = p[1];
-
-
- switch (deftype)
- {
- case 'S':
- valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- n = strrchr (name, '/');
- if (n != NULL)
- {
- *n = '\0';
- n++;
- dirn = name;
- }
- else
- {
- n = name;
- dirn = NULL;
- }
- *p = '\0';
- if (symfile_depth++ == 0)
- {
- if (last_source_file)
- {
- end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
- end_stabs ();
- }
- start_stabs ();
- os9k_stabs = 1;
- start_symtab (n, dirn, valu);
- record_debugformat ("OS9");
- }
- else
- {
- push_subfile ();
- start_subfile (n, dirn != NULL ? dirn : current_subfile->dirname);
- }
- break;
-
- case 'f':
- case 'F':
- valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- function_stab_type = type;
-
- within_function = 1;
- new = push_context (0, valu);
- new->name = define_symbol (valu, name, desc, type, objfile);
- break;
-
- case 'V':
- case 'v':
- valu += ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
- define_symbol (valu, name, desc, type, objfile);
- break;
-
- default:
- define_symbol (valu, name, desc, type, objfile);
- break;
- }
- }
- break;
-
- case N_SYM_SE:
- if (--symfile_depth != 0)
- start_subfile (pop_subfile (), current_subfile->dirname);
- break;
-
- default:
- complain (&unknown_symtype_complaint,
- local_hex_string ((unsigned long) type));
- /* FALLTHROUGH */
- break;
-
- case N_SYM_CMPLR:
- break;
- }
- previous_stab_code = type;
-}
-
-static struct sym_fns os9k_sym_fns =
-{
- bfd_target_os9k_flavour,
- os9k_new_init, /* sym_new_init: init anything gbl to entire symtab */
- os9k_symfile_init, /* sym_init: read initial info, setup for sym_read() */
- os9k_symfile_read, /* sym_read: read a symbol file into symtab */
- os9k_symfile_finish, /* sym_finish: finished with file, cleanup */
- default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
- NULL /* next: pointer to next struct sym_fns */
-};
-
-void
-_initialize_os9kread (void)
-{
- add_symtab_fns (&os9k_sym_fns);
-}
+// 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 <stdio.h>
+// OBSOLETE
+// OBSOLETE #if defined(USG) || defined(__CYGNUSCLIB__)
+// OBSOLETE #include <sys/types.h>
+// OBSOLETE #include <fcntl.h>
+// 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 <name> ":" ("t" | "T") [<number> "="] "e" <size>
+// OBSOLETE {<constant> ":" <value> ","} ";". */
+// 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 4186cbd5245..83eb767c0b7 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -40,6 +40,10 @@ static const char * const gdb_osabi_names[] =
"NetBSD a.out",
"NetBSD ELF",
"Windows CE",
+ "DJGPP",
+ "NetWare",
+ "Irix",
+ "LynxOS",
"ARM EABI v1",
"ARM EABI v2",
@@ -228,13 +232,8 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch,
if (osabi == GDB_OSABI_UNKNOWN)
{
- /* Don't complain about not knowing the OS ABI if we don't
- have an inferior. */
- if (info.abfd)
- fprintf_filtered
- (gdb_stderr, "GDB doesn't recognize the OS ABI of the inferior. "
- "Attempting to continue with the default %s settings",
- bfd_printable_arch_mach (arch_info->arch, arch_info->mach));
+ /* Don't complain about an unknown OSABI. Assume the user knows
+ what they are doing. */
return;
}
@@ -405,6 +404,15 @@ generic_elf_osabi_sniffer (bfd *abfd)
break;
}
+ if (osabi == GDB_OSABI_UNKNOWN)
+ {
+ /* The FreeBSD folks have been naughty; they stored the string
+ "FreeBSD" in the padding of the e_ident field of the ELF
+ header to "brand" their ELF binaries in FreeBSD 3.x. */
+ if (strcmp (&elf_elfheader (abfd)->e_ident[8], "FreeBSD") == 0)
+ osabi = GDB_OSABI_FREEBSD_ELF;
+ }
+
return osabi;
}
diff --git a/gdb/osabi.h b/gdb/osabi.h
index 23e7025d9d5..f62bde71c4e 100644
--- a/gdb/osabi.h
+++ b/gdb/osabi.h
@@ -37,6 +37,10 @@ enum gdb_osabi
GDB_OSABI_NETBSD_AOUT,
GDB_OSABI_NETBSD_ELF,
GDB_OSABI_WINCE,
+ GDB_OSABI_GO32,
+ GDB_OSABI_NETWARE,
+ GDB_OSABI_IRIX,
+ GDB_OSABI_LYNXOS,
GDB_OSABI_ARM_EABI_V1,
GDB_OSABI_ARM_EABI_V2,
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 7333f6d04a0..fbdd3f69e18 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -104,9 +104,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define yycheck pascal_yycheck
#ifndef YYDEBUG
-#define YYDEBUG 0 /* Default to no yydebug support */
+#define YYDEBUG 1 /* Default to yydebug support */
#endif
+#define YYFPRINTF parser_fprintf
+
int yyparse (void);
static int yylex (void);
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index e8de7884f1d..293de70b575 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -21,7 +21,7 @@
/* This file is derived from p-typeprint.c */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index c8060a237ac..06a821605fe 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -21,7 +21,7 @@
/* This file is derived from c-valprint.c */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c
index 0058cbf6ead..fce8fea0365 100644
--- a/gdb/pa64solib.c
+++ b/gdb/pa64solib.c
@@ -1,5 +1,6 @@
/* Handle HP ELF shared libraries for GDB, the GNU Debugger.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -47,7 +48,6 @@
#include "gdb-stabs.h"
#include "gdb_stat.h"
#include "gdbcmd.h"
-#include "assert.h"
#include "language.h"
#include "regcache.h"
@@ -109,7 +109,7 @@ static int pa64_solib_st_size_threshold_exceeded;
typedef struct
{
CORE_ADDR dld_flags_addr;
- long long dld_flags;
+ LONGEST dld_flags;
sec_ptr dyninfo_sect;
boolean have_read_dld_descriptor;
boolean is_valid;
@@ -251,7 +251,7 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
/* Now find the true lowest section in the shared library. */
sec = NULL;
- bfd_map_over_sections (tmp_bfd, find_lowest_section, (PTR) &sec);
+ bfd_map_over_sections (tmp_bfd, find_lowest_section, &sec);
if (sec)
{
@@ -283,7 +283,7 @@ pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
sizeof (obj_private_data_t));
obj_private->unwind_info = NULL;
obj_private->so_info = NULL;
- so->objfile->obj_private = (PTR) obj_private;
+ so->objfile->obj_private = obj_private;
}
obj_private = (obj_private_data_t *) so->objfile->obj_private;
@@ -1224,13 +1224,13 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
if (storage_needed > 0)
{
symbol_table = (asymbol **) xmalloc (storage_needed);
- back_to = make_cleanup (xfree, (PTR) symbol_table);
+ back_to = make_cleanup (xfree, symbol_table);
number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
for (i = 0; i < number_of_symbols; i++)
{
sym = *symbol_table++;
- if (STREQ (sym->name, symname))
+ if (strcmp (sym->name, symname) == 0)
{
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
diff --git a/gdb/parse.c b/gdb/parse.c
index bc81f221b52..c5de0af3334 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1366,6 +1366,23 @@ build_parse (void)
NULL);
}
+/* This function avoids direct calls to fprintf
+ in the parser generated debug code. */
+void
+parser_fprintf (FILE *x, const char *y, ...)
+{
+ va_list args;
+ va_start (args, y);
+ if (x == stderr)
+ vfprintf_unfiltered (gdb_stderr, y, args);
+ else
+ {
+ fprintf_unfiltered (gdb_stderr, " Unknown FILE used.\n");
+ vfprintf_unfiltered (gdb_stderr, y, args);
+ }
+ va_end (args);
+}
+
void
_initialize_parse (void)
{
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 7db1c77e123..748208ae6d1 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -41,7 +41,7 @@ extern struct block *expression_context_block;
the block that we want to evaluate expressions at. When debugging
C or C++ code, we use this to find the exact line we're at, and
then look up the macro definitions active at that point. */
-CORE_ADDR expression_context_pc;
+extern CORE_ADDR expression_context_pc;
/* The innermost context required by the stack and register variables
we've encountered so far. */
@@ -216,4 +216,9 @@ struct op_print
extern int target_map_name_to_register (char *, int);
+/* Function used to avoid direct calls to fprintf
+ in the code generated by the bison parser. */
+
+extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
+
#endif /* PARSER_DEFS_H */
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 25616c0f047..721e05f8c24 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -475,21 +475,7 @@ store_inferior_registers (int regno)
void
supply_gregset (gdb_gregset_t *gregsetp)
{
- int regi;
- register elf_greg_t *regp = (elf_greg_t *) gregsetp;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- for (regi = 0; regi < 32; regi++)
- supply_register (regi, (char *) (regp + regi));
-
- supply_register (PC_REGNUM, (char *) (regp + PT_NIP));
- supply_register (tdep->ppc_lr_regnum, (char *) (regp + PT_LNK));
- supply_register (tdep->ppc_cr_regnum, (char *) (regp + PT_CCR));
- supply_register (tdep->ppc_xer_regnum, (char *) (regp + PT_XER));
- supply_register (tdep->ppc_ctr_regnum, (char *) (regp + PT_CTR));
- if (tdep->ppc_mq_regnum != -1)
- supply_register (tdep->ppc_mq_regnum, (char *) (regp + PT_MQ));
- supply_register (tdep->ppc_ps_regnum, (char *) (regp + PT_MSR));
+ ppc_linux_supply_gregset ((char *) gregsetp);
}
void
@@ -525,12 +511,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
void
supply_fpregset (gdb_fpregset_t * fpregsetp)
{
- int regi;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- for (regi = 0; regi < 32; regi++)
- supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
- supply_register (tdep->ppc_fpscr_regnum, (char *) (*fpregsetp + 32));
+ ppc_linux_supply_fpregset ((char *) fpregsetp);
}
/* Given a pointer to a floating point register set in /proc format
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index f358274140b..6adfe297170 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -411,293 +411,6 @@ ppc_linux_frame_chain (struct frame_info *thisframe)
return rs6000_frame_chain (thisframe);
}
-/* FIXME: Move the following to rs6000-tdep.c (or some other file where
- it may be used generically by ports which use either the SysV ABI or
- the EABI */
-
-/* Until November 2001, gcc was not complying to the SYSV ABI for
- returning structures less than or equal to 8 bytes in size. It was
- returning everything in memory. When this was corrected, it wasn't
- fixed for native platforms. */
-int
-ppc_sysv_abi_broken_use_struct_convention (int gcc_p, struct type *value_type)
-{
- if (TYPE_LENGTH (value_type) == 16
- && TYPE_VECTOR (value_type))
- return 0;
-
- return generic_use_struct_convention (gcc_p, value_type);
-}
-
-/* Structures 8 bytes or less long are returned in the r3 & r4
- registers, according to the SYSV ABI. */
-int
-ppc_sysv_abi_use_struct_convention (int gcc_p, struct type *value_type)
-{
- if (TYPE_LENGTH (value_type) == 16
- && TYPE_VECTOR (value_type))
- return 0;
-
- return (TYPE_LENGTH (value_type) > 8);
-}
-
-/* round2 rounds x up to the nearest multiple of s assuming that s is a
- power of 2 */
-
-#undef round2
-#define round2(x,s) ((((long) (x) - 1) & ~(long)((s)-1)) + (s))
-
-/* Pass the arguments in either registers, or in the stack. Using the
- ppc sysv ABI, the first eight words of the argument list (that might
- be less than eight parameters if some parameters occupy more than one
- word) are passed in r3..r10 registers. float and double parameters are
- passed in fpr's, in addition to that. Rest of the parameters if any
- are passed in user stack.
-
- If the function is returning a structure, then the return address is passed
- in r3, then the first 7 words of the parametes can be passed in registers,
- starting from r4. */
-
-CORE_ADDR
-ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
-{
- int argno;
- /* Next available general register for non-float, non-vector arguments. */
- int greg;
- /* Next available floating point register for float arguments. */
- int freg;
- /* Next available vector register for vector arguments. */
- int vreg;
- int argstkspace;
- int structstkspace;
- int argoffset;
- int structoffset;
- struct value *arg;
- struct type *type;
- int len;
- char old_sp_buf[4];
- CORE_ADDR saved_sp;
-
- greg = struct_return ? 4 : 3;
- freg = 1;
- vreg = 2;
- argstkspace = 0;
- structstkspace = 0;
-
- /* Figure out how much new stack space is required for arguments
- which don't fit in registers. Unlike the PowerOpen ABI, the
- SysV ABI doesn't reserve any extra space for parameters which
- are put in registers. */
- for (argno = 0; argno < nargs; argno++)
- {
- arg = args[argno];
- type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- {
- if (freg <= 8)
- freg++;
- else
- {
- /* SysV ABI converts floats to doubles when placed in
- memory and requires 8 byte alignment */
- if (argstkspace & 0x4)
- argstkspace += 4;
- argstkspace += 8;
- }
- }
- else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */
- {
- if (greg > 9)
- {
- greg = 11;
- if (argstkspace & 0x4)
- argstkspace += 4;
- argstkspace += 8;
- }
- else
- {
- if ((greg & 1) == 0)
- greg++;
- greg += 2;
- }
- }
- else if (!TYPE_VECTOR (type))
- {
- if (len > 4
- || TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- /* Rounding to the nearest multiple of 8 may not be necessary,
- but it is safe. Particularly since we don't know the
- field types of the structure */
- structstkspace += round2 (len, 8);
- }
- if (greg <= 10)
- greg++;
- else
- argstkspace += 4;
- }
- else
- {
- if (len == 16
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
- {
- if (vreg <= 13)
- vreg++;
- else
- {
- /* Vector arguments must be aligned to 16 bytes on
- the stack. */
- argstkspace += round2 (argstkspace, 16);
- argstkspace += 16;
- }
- }
- }
- }
-
- /* Get current SP location */
- saved_sp = read_sp ();
-
- sp -= argstkspace + structstkspace;
-
- /* Allocate space for backchain and callee's saved lr */
- sp -= 8;
-
- /* Make sure that we maintain 16 byte alignment */
- sp &= ~0x0f;
-
- /* Update %sp before proceeding any further */
- write_register (SP_REGNUM, sp);
-
- /* write the backchain */
- store_address (old_sp_buf, 4, saved_sp);
- write_memory (sp, old_sp_buf, 4);
-
- argoffset = 8;
- structoffset = argoffset + argstkspace;
- freg = 1;
- greg = 3;
- vreg = 2;
- /* Fill in r3 with the return structure, if any */
- if (struct_return)
- {
- char val_buf[4];
- store_address (val_buf, 4, struct_addr);
- memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
- greg++;
- }
- /* Now fill in the registers and stack... */
- for (argno = 0; argno < nargs; argno++)
- {
- arg = args[argno];
- type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- {
- if (freg <= 8)
- {
- if (len > 8)
- printf_unfiltered (
- "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + freg)],
- VALUE_CONTENTS (arg), len);
- freg++;
- }
- else
- {
- /* SysV ABI converts floats to doubles when placed in
- memory and requires 8 byte alignment */
- /* FIXME: Convert floats to doubles */
- if (argoffset & 0x4)
- argoffset += 4;
- write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len);
- argoffset += 8;
- }
- }
- else if (TYPE_CODE (type) == TYPE_CODE_INT && len == 8) /* long long */
- {
- if (greg > 9)
- {
- greg = 11;
- if (argoffset & 0x4)
- argoffset += 4;
- write_memory (sp + argoffset, (char *) VALUE_CONTENTS (arg), len);
- argoffset += 8;
- }
- else
- {
- if ((greg & 1) == 0)
- greg++;
-
- memcpy (&registers[REGISTER_BYTE (greg)],
- VALUE_CONTENTS (arg), 4);
- memcpy (&registers[REGISTER_BYTE (greg + 1)],
- VALUE_CONTENTS (arg) + 4, 4);
- greg += 2;
- }
- }
- else if (!TYPE_VECTOR (type))
- {
- char val_buf[4];
- if (len > 4
- || TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- write_memory (sp + structoffset, VALUE_CONTENTS (arg), len);
- store_address (val_buf, 4, sp + structoffset);
- structoffset += round2 (len, 8);
- }
- else
- {
- memset (val_buf, 0, 4);
- memcpy (val_buf, VALUE_CONTENTS (arg), len);
- }
- if (greg <= 10)
- {
- memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
- greg++;
- }
- else
- {
- write_memory (sp + argoffset, val_buf, 4);
- argoffset += 4;
- }
- }
- else
- {
- if (len == 16
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
- {
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- char *v_val_buf = alloca (16);
- memset (v_val_buf, 0, 16);
- memcpy (v_val_buf, VALUE_CONTENTS (arg), len);
- if (vreg <= 13)
- {
- memcpy (&registers[REGISTER_BYTE (tdep->ppc_vr0_regnum
- + vreg)],
- v_val_buf, 16);
- vreg++;
- }
- else
- {
- write_memory (sp + argoffset, v_val_buf, 16);
- argoffset += 16;
- }
- }
- }
- }
-
- target_store_registers (-1);
- return sp;
-}
-
/* ppc_linux_memory_remove_breakpoints attempts to remove a breakpoint
in much the same fashion as memory_remove_breakpoint in mem-break.c,
but is careful not to write back the previous contents if the code
@@ -886,3 +599,127 @@ ppc_linux_svr4_fetch_link_map_offsets (void)
return lmp;
}
+
+enum {
+ ELF_NGREG = 48,
+ ELF_NFPREG = 33,
+ ELF_NVRREG = 33
+};
+
+enum {
+ ELF_GREGSET_SIZE = (ELF_NGREG * 4),
+ ELF_FPREGSET_SIZE = (ELF_NFPREG * 8)
+};
+
+void
+ppc_linux_supply_gregset (char *buf)
+{
+ int regi;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (regi, buf + 4 * regi);
+
+ supply_register (PC_REGNUM, buf + 4 * PPC_LINUX_PT_NIP);
+ supply_register (tdep->ppc_lr_regnum, buf + 4 * PPC_LINUX_PT_LNK);
+ supply_register (tdep->ppc_cr_regnum, buf + 4 * PPC_LINUX_PT_CCR);
+ supply_register (tdep->ppc_xer_regnum, buf + 4 * PPC_LINUX_PT_XER);
+ supply_register (tdep->ppc_ctr_regnum, buf + 4 * PPC_LINUX_PT_CTR);
+ if (tdep->ppc_mq_regnum != -1)
+ supply_register (tdep->ppc_mq_regnum, buf + 4 * PPC_LINUX_PT_MQ);
+ supply_register (tdep->ppc_ps_regnum, buf + 4 * PPC_LINUX_PT_MSR);
+}
+
+void
+ppc_linux_supply_fpregset (char *buf)
+{
+ int regi;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (FP0_REGNUM + regi, buf + 8 * regi);
+
+ /* The FPSCR is stored in the low order word of the last doubleword in the
+ fpregset. */
+ supply_register (tdep->ppc_fpscr_regnum, buf + 8 * 32 + 4);
+}
+
+/*
+ Use a local version of this function to get the correct types for regsets.
+*/
+
+static void
+fetch_core_registers (char *core_reg_sect,
+ unsigned core_reg_size,
+ int which,
+ CORE_ADDR reg_addr)
+{
+ if (which == 0)
+ {
+ if (core_reg_size == ELF_GREGSET_SIZE)
+ ppc_linux_supply_gregset (core_reg_sect);
+ else
+ warning ("wrong size gregset struct in core file");
+ }
+ else if (which == 2)
+ {
+ if (core_reg_size == ELF_FPREGSET_SIZE)
+ ppc_linux_supply_fpregset (core_reg_sect);
+ else
+ warning ("wrong size fpregset struct in core file");
+ }
+}
+
+/* Register that we are able to handle ELF file formats using standard
+ procfs "regset" structures. */
+
+static struct core_fns ppc_linux_regset_core_fns =
+{
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+static void
+ppc_linux_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* Until November 2001, gcc was not complying to the SYSV ABI for
+ returning structures less than or equal to 8 bytes in size. It was
+ returning everything in memory. When this was corrected, it wasn't
+ fixed for native platforms. */
+ set_gdbarch_use_struct_convention (gdbarch,
+ ppc_sysv_abi_broken_use_struct_convention);
+
+ if (tdep->wordsize == 4)
+ {
+ /* Note: kevinb/2002-04-12: See note in rs6000_gdbarch_init regarding
+ *_push_arguments(). The same remarks hold for the methods below. */
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ ppc_linux_frameless_function_invocation);
+ set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain);
+ set_gdbarch_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch,
+ ppc_linux_frame_init_saved_regs);
+ set_gdbarch_init_extra_frame_info (gdbarch,
+ ppc_linux_init_extra_frame_info);
+
+ set_gdbarch_memory_remove_breakpoint (gdbarch,
+ ppc_linux_memory_remove_breakpoint);
+ set_solib_svr4_fetch_link_map_offsets
+ (gdbarch, ppc_linux_svr4_fetch_link_map_offsets);
+ }
+}
+
+void
+_initialize_ppc_linux_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_powerpc, GDB_OSABI_LINUX,
+ ppc_linux_init_abi);
+ add_core_fns (&ppc_linux_regset_core_fns);
+}
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 3da66ad1405..48c5647e5da 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -22,6 +22,8 @@
#ifndef PPC_TDEP_H
#define PPC_TDEP_H
+#include "osabi.h"
+
struct frame_info;
struct value;
@@ -37,6 +39,8 @@ CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int,
CORE_ADDR);
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
+void ppc_linux_supply_gregset (char *buf);
+void ppc_linux_supply_fpregset (char *buf);
/* From rs6000-tdep.c... */
@@ -52,7 +56,7 @@ int altivec_register_p (int regno);
struct gdbarch_tdep
{
int wordsize; /* size in bytes of fixed-point word */
- int osabi; /* OS / ABI from ELF header */
+ enum gdb_osabi osabi; /* OS / ABI from ELF header */
int *regoff; /* byte offsets in register arrays */
const struct reg *regs; /* from current variant */
int ppc_gp0_regnum; /* GPR register 0 */
@@ -68,6 +72,8 @@ struct gdbarch_tdep
int ppc_mq_regnum; /* Multiply/Divide extension register */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
+ int ppc_ev0_regnum; /* First ev register */
+ int ppc_ev31_regnum; /* Last ev register */
int lr_frame_offset; /* Offset to ABI specific location where
link register is saved. */
};
diff --git a/gdb/ppcnbsd-nat.c b/gdb/ppcnbsd-nat.c
index 2e43ce46411..ce097d7a59d 100644
--- a/gdb/ppcnbsd-nat.c
+++ b/gdb/ppcnbsd-nat.c
@@ -25,8 +25,6 @@
#include "defs.h"
#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
#include "ppc-tdep.h"
#include "ppcnbsd-tdep.h"
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index 16662fd6287..6fabab7c5b4 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -200,12 +200,8 @@ static void
ppcnbsd_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
- /* Until November 2001, gcc was not complying to the SYSV ABI for
- returning structures less than or equal to 8 bytes in size. It was
- returning everything in memory. When this was corrected, it wasn't
- fixed for native platforms. */
- set_gdbarch_use_struct_convention (gdbarch,
- ppc_sysv_abi_broken_use_struct_convention);
+ /* Stop at main. */
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_solib_svr4_fetch_link_map_offsets (gdbarch,
nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index de306f0b98f..2e57050105f 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -40,6 +40,7 @@
#include "objfiles.h" /* ditto */
#include "completer.h" /* for completion functions */
#include "ui-out.h"
+#include "gdb_assert.h"
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@@ -1785,6 +1786,10 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
if (func)
{
b = SYMBOL_BLOCK_VALUE (func);
+ /* Function blocks are order sensitive, and thus should not be
+ hashed. */
+ gdb_assert (BLOCK_HASHTABLE (b) == 0);
+
ALL_BLOCK_SYMBOLS (b, i, sym)
{
QUIT;
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index 2d3ca9ffbf2..a74882db7e2 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -36,7 +36,9 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/procfs.h>
+#ifdef HAVE_SYS_PROC_H
#include <sys/proc.h> /* for struct proc */
+#endif
#ifdef HAVE_SYS_USER_H
#include <sys/user.h> /* for struct user */
#endif
@@ -395,9 +397,13 @@ static struct trans rw_table[] = {
#ifdef PCCSIG /* solaris */
{ PCCSIG, "PCCSIG", "clear current signal" },
#endif
+#ifdef PCDSTOP /* solaris */
{ PCDSTOP, "PCDSTOP", "post stop request" },
+#endif
{ PCKILL, "PCKILL", "post a signal" },
+#ifdef PCNICE /* solaris */
{ PCNICE, "PCNICE", "set nice priority" },
+#endif
#ifdef PCREAD /* solaris */
{ PCREAD, "PCREAD", "read from the address space" },
{ PCWRITE, "PCWRITE", "write to the address space" },
@@ -417,7 +423,9 @@ static struct trans rw_table[] = {
{ PCSEXIT, "PCSEXIT", "set traced syscall exit set" },
{ PCSFAULT, "PCSFAULT", "set traced fault set" },
{ PCSFPREG, "PCSFPREG", "set floating point registers" },
+#ifdef PCHOLD /* solaris */
{ PCSHOLD, "PCSHOLD", "set signal mask" },
+#endif
{ PCSREG, "PCSREG", "set general registers" },
{ PCSSIG, "PCSSIG", "set current signal" },
{ PCSTOP, "PCSTOP", "post stop request and wait" },
@@ -431,7 +439,9 @@ static struct trans rw_table[] = {
#ifdef PCTWSTOP /* solaris */
{ PCTWSTOP, "PCTWSTOP", "wait for stop, with timeout arg" },
#endif
+#ifdef PCUNKILL /* solaris */
{ PCUNKILL, "PCUNKILL", "delete a pending signal" },
+#endif
#ifdef PCUNSET /* solaris */
{ PCUNSET, "PCUNSET", "unset modes" },
#endif
@@ -516,12 +526,14 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
(sysset_t *) &arg[1], 0);
break;
+#ifdef PCSHOLD
case PCSHOLD:
fprintf (procfs_file ? procfs_file : stdout,
"write (PCSHOLD) ");
proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
(sigset_t *) &arg[1], 0);
break;
+#endif
case PCSSIG:
fprintf (procfs_file ? procfs_file : stdout,
"write (PCSSIG) ");
@@ -540,10 +552,14 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
fprintf (procfs_file ? procfs_file : stdout, "clearFlt ");
if (arg[1] & PRSTEP)
fprintf (procfs_file ? procfs_file : stdout, "step ");
+#ifdef PRSABORT
if (arg[1] & PRSABORT)
fprintf (procfs_file ? procfs_file : stdout, "syscallAbort ");
+#endif
+#ifdef PRSTOP
if (arg[1] & PRSTOP)
fprintf (procfs_file ? procfs_file : stdout, "stopReq ");
+#endif
fprintf (procfs_file ? procfs_file : stdout, "\n");
break;
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 55e0496bc78..79f55758dfe 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -136,6 +136,8 @@ static int proc_find_memory_regions (int (*) (CORE_ADDR,
static char * procfs_make_note_section (bfd *, int *);
+static int procfs_can_use_hw_breakpoint (int, int, int);
+
struct target_ops procfs_ops; /* the target vector */
static void
@@ -183,6 +185,7 @@ init_procfs_ops (void)
procfs_ops.to_has_thread_control = tc_schedlock;
procfs_ops.to_find_memory_regions = proc_find_memory_regions;
procfs_ops.to_make_corefile_notes = procfs_make_note_section;
+ procfs_ops.to_can_use_hw_breakpoint = procfs_can_use_hw_breakpoint;
procfs_ops.to_magic = OPS_MAGIC;
}
@@ -5138,6 +5141,37 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
return 0;
}
+/* Return non-zero if we can set a hardware watchpoint of type TYPE. TYPE
+ is one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint,
+ or bp_hardware_watchpoint. CNT is the number of watchpoints used so
+ far.
+
+ Note: procfs_can_use_hw_breakpoint() is not yet used by all
+ procfs.c targets due to the fact that some of them still define
+ TARGET_CAN_USE_HARDWARE_WATCHPOINT. */
+
+static int
+procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
+{
+#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
+ return 0;
+#else
+ /* Due to the way that proc_set_watchpoint() is implemented, host
+ and target pointers must be of the same size. If they are not,
+ we can't use hardware watchpoints. This limitation is due to the
+ fact that proc_set_watchpoint() calls address_to_host_pointer();
+ a close inspection of address_to_host_pointer will reveal that
+ an internal error will be generated when the host and target
+ pointer sizes are different. */
+ if (sizeof (void *) != TYPE_LENGTH (builtin_type_void_data_ptr))
+ return 0;
+
+ /* Other tests here??? */
+
+ return 1;
+#endif
+}
+
/*
* Function: stopped_by_watchpoint
*
@@ -5431,8 +5465,7 @@ proc_find_memory_regions (int (*func) (CORE_ADDR,
*/
static char *
-mappingflags (flags)
- long flags;
+mappingflags (long flags)
{
static char asciiflags[8];
diff --git a/gdb/rdi-share/devsw.c b/gdb/rdi-share/devsw.c
index 6ad0e4de91d..214b8179936 100644
--- a/gdb/rdi-share/devsw.c
+++ b/gdb/rdi-share/devsw.c
@@ -53,7 +53,7 @@ static void openLogFile ()
/* The following line is equivalent to: */
/* setlinebuf (angelDebugLogFile); */
setvbuf(angelDebugLogFile, (char *)NULL, _IOLBF, 0);
-#if defined(__CYGWIN32__) || defined(__CYGWIN__)
+#if defined(__CYGWIN__)
setmode(fileno(angelDebugLogFile), O_TEXT);
#endif
}
diff --git a/gdb/rdi-share/host.h b/gdb/rdi-share/host.h
index 2fdbf5f4541..9944c15b714 100644
--- a/gdb/rdi-share/host.h
+++ b/gdb/rdi-share/host.h
@@ -29,14 +29,6 @@
# define offsetof(T, member) ((char *)&(((T *)0)->member) - (char *)0)
#endif
-/* If under Cygwin, provide backwards compatibility with older
- Cygwin compilers that don't define the current cpp define. */
-#ifdef __CYGWIN32__
-#ifndef __CYGWIN__
-#define __CYGWIN__
-#endif
-#endif
-
/* A temporary sop to older compilers */
#if defined (__NetBSD__) || defined (unix)
# ifndef __unix /* (good for long-term portability?) */
@@ -52,7 +44,7 @@
#endif
#if defined(_WIN32)
# define COMPILING_ON_WIN32 1
-# if !defined(__CYGWIN32__)
+# if !defined(__CYGWIN__)
# define COMPILING_ON_WINDOWS 1
# endif
#endif
diff --git a/gdb/rdi-share/hostchan.c b/gdb/rdi-share/hostchan.c
index 3114c52d2f7..483bc5be4d2 100644
--- a/gdb/rdi-share/hostchan.c
+++ b/gdb/rdi-share/hostchan.c
@@ -556,7 +556,7 @@ static unsigned long tv_diff(const struct timeval *time_now,
- ((time_was->tv_sec * 1000000) + time_was->tv_usec) );
}
-#if !defined(__unix) && !defined(__CYGWIN32__)
+#if !defined(__unix) && !defined(__CYGWIN__)
static void gettimeofday( struct timeval *time_now, void *dummy )
{
time_t t = clock();
diff --git a/gdb/rdi-share/hostchan.h b/gdb/rdi-share/hostchan.h
index 3e6d26fd792..b60804d4379 100644
--- a/gdb/rdi-share/hostchan.h
+++ b/gdb/rdi-share/hostchan.h
@@ -15,14 +15,6 @@
#ifndef angsd_hostchan_h
#define angsd_hostchan_h
-/* If under Cygwin, provide backwards compatibility with older
- Cygwin compilers that don't define the current cpp define. */
-#ifdef __CYGWIN32__
-#ifndef __CYGWIN__
-#define __CYGWIN__
-#endif
-#endif
-
/* A temporary sop to older compilers */
#if defined (__NetBSD__) || defined (unix)
# ifndef __unix /* (good for long-term portability?) */
@@ -31,7 +23,7 @@
#endif
/* struct timeval */
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
# include <sys/time.h>
#else
# include "winsock.h"
diff --git a/gdb/rdi-share/serdrv.c b/gdb/rdi-share/serdrv.c
index 91f8f196b2f..bff6a1892e4 100644
--- a/gdb/rdi-share/serdrv.c
+++ b/gdb/rdi-share/serdrv.c
@@ -254,7 +254,7 @@ static int SerialOpen(const char *name, const char *arg)
serial_reset();
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
Unix_ioctlNonBlocking();
#endif
diff --git a/gdb/rdi-share/serpardr.c b/gdb/rdi-share/serpardr.c
index 604d0480613..fad05481402 100644
--- a/gdb/rdi-share/serpardr.c
+++ b/gdb/rdi-share/serpardr.c
@@ -278,7 +278,7 @@ static int SerparOpen(const char *name, const char *arg)
serpar_reset();
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
Unix_ioctlNonBlocking();
#endif
diff --git a/gdb/rdi-share/unixcomm.c b/gdb/rdi-share/unixcomm.c
index 0abd4115a29..2204d6d59fd 100644
--- a/gdb/rdi-share/unixcomm.c
+++ b/gdb/rdi-share/unixcomm.c
@@ -96,7 +96,7 @@
#define PARPORT2 "/dev/par1"
#endif
-#if defined(_WIN32) || defined (__CYGWIN32__)
+#if defined(_WIN32) || defined (__CYGWIN__)
#define SERIAL_PREFIX "com"
#define SERPORT1 "com1"
#define SERPORT2 "com2"
@@ -248,7 +248,7 @@ extern int Unix_IsSerialInUse(void)
extern int Unix_OpenSerial(const char *name)
{
-#if defined(BSD) || defined(__CYGWIN32__)
+#if defined(BSD) || defined(__CYGWIN__)
serpfd = open(name, O_RDWR);
#else
serpfd = open(name, O_RDWR | O_NONBLOCK);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 11ed8c4f70d..e483de08cfd 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1,6 +1,7 @@
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -26,6 +27,8 @@
#include "gdbcmd.h"
#include "regcache.h"
#include "gdb_assert.h"
+#include "gdb_string.h"
+#include "gdbcmd.h" /* For maintenanceprintlist. */
/*
* DATA STRUCTURE
@@ -33,6 +36,358 @@
* Here is the actual register cache.
*/
+/* Per-architecture object describing the layout of a register cache.
+ Computed once when the architecture is created */
+
+struct gdbarch_data *regcache_descr_handle;
+
+struct regcache_descr
+{
+ /* The architecture this descriptor belongs to. */
+ struct gdbarch *gdbarch;
+
+ /* Is this a ``legacy'' register cache? Such caches reserve space
+ for raw and pseudo registers and allow access to both. */
+ int legacy_p;
+
+ /* The raw register cache. This should contain just [0
+ .. NUM_RAW_REGISTERS). However, for older targets, it contains
+ space for the full [0 .. NUM_RAW_REGISTERS +
+ NUM_PSEUDO_REGISTERS). */
+ int nr_raw_registers;
+ long sizeof_raw_registers;
+ long sizeof_raw_register_valid_p;
+
+ /* The cooked register space. Each cooked register in the range
+ [0..NR_RAW_REGISTERS) is direct-mapped onto the corresponding raw
+ register. The remaining [NR_RAW_REGISTERS
+ .. NR_COOKED_REGISTERS) (a.k.a. pseudo regiters) are mapped onto
+ both raw registers and memory by the architecture methods
+ gdbarch_register_read and gdbarch_register_write. */
+ int nr_cooked_registers;
+
+ /* Offset and size (in 8 bit bytes), of reach register in the
+ register cache. All registers (including those in the range
+ [NR_RAW_REGISTERS .. NR_COOKED_REGISTERS) are given an offset.
+ Assigning all registers an offset makes it possible to keep
+ legacy code, such as that found in read_register_bytes() and
+ write_register_bytes() working. */
+ long *register_offset;
+ long *sizeof_register;
+
+ /* Useful constant. Largest of all the registers. */
+ long max_register_size;
+};
+
+static void *
+init_legacy_regcache_descr (struct gdbarch *gdbarch)
+{
+ int i;
+ struct regcache_descr *descr;
+ /* FIXME: cagney/2002-05-11: gdbarch_data() should take that
+ ``gdbarch'' as a parameter. */
+ gdb_assert (gdbarch != NULL);
+
+ descr = XMALLOC (struct regcache_descr);
+ descr->gdbarch = gdbarch;
+ descr->legacy_p = 1;
+
+ /* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers
+ in the register buffer. Unfortunatly some architectures do. */
+ descr->nr_cooked_registers = NUM_REGS + NUM_PSEUDO_REGS;
+ descr->nr_raw_registers = descr->nr_cooked_registers;
+ descr->sizeof_raw_register_valid_p = descr->nr_cooked_registers;
+
+ /* FIXME: cagney/2002-05-11: Instead of using REGISTER_BYTE() this
+ code should compute the offets et.al. at runtime. This currently
+ isn't possible because some targets overlap register locations -
+ see the mess in read_register_bytes() and write_register_bytes()
+ registers. */
+ descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long);
+ descr->register_offset = XCALLOC (descr->nr_cooked_registers, long);
+ descr->max_register_size = 0;
+ for (i = 0; i < descr->nr_cooked_registers; i++)
+ {
+ descr->register_offset[i] = REGISTER_BYTE (i);
+ descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
+ if (descr->max_register_size < REGISTER_RAW_SIZE (i))
+ descr->max_register_size = REGISTER_RAW_SIZE (i);
+ }
+
+ /* Come up with the real size of the registers buffer. */
+ descr->sizeof_raw_registers = REGISTER_BYTES; /* OK use. */
+ for (i = 0; i < descr->nr_cooked_registers; i++)
+ {
+ long regend;
+ /* Keep extending the buffer so that there is always enough
+ space for all registers. The comparison is necessary since
+ legacy code is free to put registers in random places in the
+ buffer separated by holes. Once REGISTER_BYTE() is killed
+ this can be greatly simplified. */
+ /* FIXME: cagney/2001-12-04: This code shouldn't need to use
+ REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
+ buffer out so that certain registers just happen to overlap.
+ Ulgh! New targets use gdbarch's register read/write and
+ entirely avoid this uglyness. */
+ regend = descr->register_offset[i] + descr->sizeof_register[i];
+ if (descr->sizeof_raw_registers < regend)
+ descr->sizeof_raw_registers = regend;
+ }
+ return descr;
+}
+
+static void *
+init_regcache_descr (struct gdbarch *gdbarch)
+{
+ int i;
+ struct regcache_descr *descr;
+ gdb_assert (gdbarch != NULL);
+
+ /* If an old style architecture, construct the register cache
+ description using all the register macros. */
+ if (!gdbarch_pseudo_register_read_p (gdbarch)
+ && !gdbarch_pseudo_register_write_p (gdbarch))
+ return init_legacy_regcache_descr (gdbarch);
+
+ descr = XMALLOC (struct regcache_descr);
+ descr->gdbarch = gdbarch;
+ descr->legacy_p = 0;
+
+ /* Total size of the register space. The raw registers are mapped
+ directly onto the raw register cache while the pseudo's are
+ either mapped onto raw-registers or memory. */
+ descr->nr_cooked_registers = NUM_REGS + NUM_PSEUDO_REGS;
+
+ /* Construct a strictly RAW register cache. Don't allow pseudo's
+ into the register cache. */
+ descr->nr_raw_registers = NUM_REGS;
+
+ /* FIXME: cagney/2002-08-13: Overallocate the register_valid_p
+ array. This pretects GDB from erant code that accesses elements
+ of the global register_valid_p[] array in the range [NUM_REGS
+ .. NUM_REGS + NUM_PSEUDO_REGS). */
+ descr->sizeof_raw_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS;
+
+ /* Lay out the register cache. The pseud-registers are included in
+ the layout even though their value isn't stored in the register
+ cache. Some code, via read_register_bytes() access a register
+ using an offset/length rather than a register number.
+
+ NOTE: cagney/2002-05-22: Only REGISTER_VIRTUAL_TYPE() needs to be
+ used when constructing the register cache. It is assumed that
+ register raw size, virtual size and type length of the type are
+ all the same. */
+
+ {
+ long offset = 0;
+ descr->sizeof_register = XCALLOC (descr->nr_cooked_registers, long);
+ descr->register_offset = XCALLOC (descr->nr_cooked_registers, long);
+ descr->max_register_size = 0;
+ for (i = 0; i < descr->nr_cooked_registers; i++)
+ {
+ descr->sizeof_register[i] = TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
+ descr->register_offset[i] = offset;
+ offset += descr->sizeof_register[i];
+ if (descr->max_register_size < descr->sizeof_register[i])
+ descr->max_register_size = descr->sizeof_register[i];
+ }
+ /* Set the real size of the register cache buffer. */
+ /* FIXME: cagney/2002-05-22: Should only need to allocate space
+ for the raw registers. Unfortunatly some code still accesses
+ the register array directly using the global registers[].
+ Until that code has been purged, play safe and over allocating
+ the register buffer. Ulgh! */
+ descr->sizeof_raw_registers = offset;
+ /* = descr->register_offset[descr->nr_raw_registers]; */
+ }
+
+#if 0
+ /* Sanity check. Confirm that the assumptions about gdbarch are
+ true. The REGCACHE_DESCR_HANDLE is set before doing the checks
+ so that targets using the generic methods supplied by regcache
+ don't go into infinite recursion trying to, again, create the
+ regcache. */
+ set_gdbarch_data (gdbarch, regcache_descr_handle, descr);
+ for (i = 0; i < descr->nr_cooked_registers; i++)
+ {
+ gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
+ gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
+ gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
+ }
+ /* gdb_assert (descr->sizeof_raw_registers == REGISTER_BYTES (i)); */
+#endif
+
+ return descr;
+}
+
+static struct regcache_descr *
+regcache_descr (struct gdbarch *gdbarch)
+{
+ return gdbarch_data (gdbarch, regcache_descr_handle);
+}
+
+static void
+xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr)
+{
+ struct regcache_descr *descr = ptr;
+ if (descr == NULL)
+ return;
+ xfree (descr->register_offset);
+ xfree (descr->sizeof_register);
+ descr->register_offset = NULL;
+ descr->sizeof_register = NULL;
+ xfree (descr);
+}
+
+/* The register cache for storing raw register values. */
+
+struct regcache
+{
+ struct regcache_descr *descr;
+ char *raw_registers;
+ char *raw_register_valid_p;
+ /* If a value isn't in the cache should the corresponding target be
+ queried for a value. */
+ int passthrough_p;
+};
+
+struct regcache *
+regcache_xmalloc (struct gdbarch *gdbarch)
+{
+ struct regcache_descr *descr;
+ struct regcache *regcache;
+ gdb_assert (gdbarch != NULL);
+ descr = regcache_descr (gdbarch);
+ regcache = XMALLOC (struct regcache);
+ regcache->descr = descr;
+ regcache->raw_registers
+ = XCALLOC (descr->sizeof_raw_registers, char);
+ regcache->raw_register_valid_p
+ = XCALLOC (descr->sizeof_raw_register_valid_p, char);
+ regcache->passthrough_p = 0;
+ return regcache;
+}
+
+void
+regcache_xfree (struct regcache *regcache)
+{
+ if (regcache == NULL)
+ return;
+ xfree (regcache->raw_registers);
+ xfree (regcache->raw_register_valid_p);
+ xfree (regcache);
+}
+
+void
+do_regcache_xfree (void *data)
+{
+ regcache_xfree (data);
+}
+
+struct cleanup *
+make_cleanup_regcache_xfree (struct regcache *regcache)
+{
+ return make_cleanup (do_regcache_xfree, regcache);
+}
+
+void
+regcache_cpy (struct regcache *dst, struct regcache *src)
+{
+ int i;
+ char *buf;
+ gdb_assert (src != NULL && dst != NULL);
+ gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
+ gdb_assert (src != dst);
+ /* FIXME: cagney/2002-05-17: To say this bit is bad is being polite.
+ It keeps the existing code working where things rely on going
+ through to the register cache. */
+ if (src == current_regcache && src->descr->legacy_p)
+ {
+ /* ULGH!!!! Old way. Use REGISTER bytes and let code below
+ untangle fetch. */
+ read_register_bytes (0, dst->raw_registers, REGISTER_BYTES);
+ return;
+ }
+ /* FIXME: cagney/2002-05-17: To say this bit is bad is being polite.
+ It keeps the existing code working where things rely on going
+ through to the register cache. */
+ if (dst == current_regcache && dst->descr->legacy_p)
+ {
+ /* ULGH!!!! Old way. Use REGISTER bytes and let code below
+ untangle fetch. */
+ write_register_bytes (0, src->raw_registers, REGISTER_BYTES);
+ return;
+ }
+ buf = alloca (src->descr->max_register_size);
+ for (i = 0; i < src->descr->nr_raw_registers; i++)
+ {
+ /* Should we worry about the valid bit here? */
+ regcache_raw_read (src, i, buf);
+ regcache_raw_write (dst, i, buf);
+ }
+}
+
+void
+regcache_cpy_no_passthrough (struct regcache *dst, struct regcache *src)
+{
+ int i;
+ gdb_assert (src != NULL && dst != NULL);
+ gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
+ /* NOTE: cagney/2002-05-17: Don't let the caller do a no-passthrough
+ move of data into the current_regcache(). Doing this would be
+ silly - it would mean that valid_p would be completly invalid. */
+ gdb_assert (dst != current_regcache);
+ memcpy (dst->raw_registers, src->raw_registers,
+ dst->descr->sizeof_raw_registers);
+ memcpy (dst->raw_register_valid_p, src->raw_register_valid_p,
+ dst->descr->sizeof_raw_register_valid_p);
+}
+
+struct regcache *
+regcache_dup (struct regcache *src)
+{
+ struct regcache *newbuf;
+ gdb_assert (current_regcache != NULL);
+ newbuf = regcache_xmalloc (src->descr->gdbarch);
+ regcache_cpy (newbuf, src);
+ return newbuf;
+}
+
+struct regcache *
+regcache_dup_no_passthrough (struct regcache *src)
+{
+ struct regcache *newbuf;
+ gdb_assert (current_regcache != NULL);
+ newbuf = regcache_xmalloc (src->descr->gdbarch);
+ regcache_cpy_no_passthrough (newbuf, src);
+ return newbuf;
+}
+
+int
+regcache_valid_p (struct regcache *regcache, int regnum)
+{
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ return regcache->raw_register_valid_p[regnum];
+}
+
+char *
+deprecated_grub_regcache_for_registers (struct regcache *regcache)
+{
+ return regcache->raw_registers;
+}
+
+char *
+deprecated_grub_regcache_for_register_valid (struct regcache *regcache)
+{
+ return regcache->raw_register_valid_p;
+}
+
+/* Global structure containing the current regcache. */
+/* FIXME: cagney/2002-05-11: The two global arrays registers[] and
+ register_valid[] currently point into this structure. */
+struct regcache *current_regcache;
+
/* NOTE: this is a write-through cache. There is no "dirty" bit for
recording if the register values have been changed (eg. by the
user). Therefore all registers must be written back to the
@@ -81,7 +436,9 @@ register_cached (int regnum)
void
set_register_cached (int regnum, int state)
{
- register_valid[regnum] = state;
+ gdb_assert (regnum >= 0);
+ gdb_assert (regnum < current_regcache->descr->nr_raw_registers);
+ current_regcache->raw_register_valid_p[regnum] = state;
}
/* REGISTER_CHANGED
@@ -97,10 +454,9 @@ register_changed (int regnum)
else return a pointer to the start of the cache buffer. */
static char *
-register_buffer (int regnum)
+register_buffer (struct regcache *regcache, int regnum)
{
- gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
- return &registers[REGISTER_BYTE (regnum)];
+ return regcache->raw_registers + regcache->descr->register_offset[regnum];
}
/* Return whether register REGNUM is a real register. */
@@ -111,46 +467,6 @@ real_register (int regnum)
return regnum >= 0 && regnum < NUM_REGS;
}
-/* Return whether register REGNUM is a pseudo register. */
-
-static int
-pseudo_register (int regnum)
-{
- return regnum >= NUM_REGS && regnum < NUM_REGS + NUM_PSEUDO_REGS;
-}
-
-/* Fetch register REGNUM into the cache. */
-
-static void
-fetch_register (int regnum)
-{
- /* NOTE: cagney/2001-12-04: Legacy targets were using fetch/store
- pseudo-register as a way of handling registers that needed to be
- constructed from one or more raw registers. New targets instead
- use gdbarch register read/write. */
- if (FETCH_PSEUDO_REGISTER_P ()
- && pseudo_register (regnum))
- FETCH_PSEUDO_REGISTER (regnum);
- else
- target_fetch_registers (regnum);
-}
-
-/* Write register REGNUM cached value to the target. */
-
-static void
-store_register (int regnum)
-{
- /* NOTE: cagney/2001-12-04: Legacy targets were using fetch/store
- pseudo-register as a way of handling registers that needed to be
- constructed from one or more raw registers. New targets instead
- use gdbarch register read/write. */
- if (STORE_PSEUDO_REGISTER_P ()
- && pseudo_register (regnum))
- STORE_PSEUDO_REGISTER (regnum);
- else
- target_store_registers (regnum);
-}
-
/* Low level examining and depositing of registers.
The caller is responsible for making sure that the inferior is
@@ -176,7 +492,7 @@ registers_changed (void)
gdb gives control to the user (ie watchpoints). */
alloca (0);
- for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
+ for (i = 0; i < current_regcache->descr->nr_raw_registers; i++)
set_register_cached (i, 0);
if (registers_changed_hook)
@@ -309,37 +625,129 @@ legacy_read_register_gen (int regnum, char *myaddr)
}
if (!register_cached (regnum))
- fetch_register (regnum);
+ target_fetch_registers (regnum);
- memcpy (myaddr, register_buffer (regnum),
+ memcpy (myaddr, register_buffer (current_regcache, regnum),
REGISTER_RAW_SIZE (regnum));
}
void
-regcache_read (int rawnum, char *buf)
+regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
+{
+ gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ if (regcache->descr->legacy_p
+ && regcache->passthrough_p)
+ {
+ gdb_assert (regcache == current_regcache);
+ /* For moment, just use underlying legacy code. Ulgh!!! This
+ silently and very indirectly updates the regcache's regcache
+ via the global register_valid[]. */
+ legacy_read_register_gen (regnum, buf);
+ return;
+ }
+ /* Make certain that the register cache is up-to-date with respect
+ to the current thread. This switching shouldn't be necessary
+ only there is still only one target side register cache. Sigh!
+ On the bright side, at least there is a regcache object. */
+ if (regcache->passthrough_p)
+ {
+ gdb_assert (regcache == current_regcache);
+ if (! ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+ if (!register_cached (regnum))
+ target_fetch_registers (regnum);
+ }
+ /* Copy the value directly into the register cache. */
+ memcpy (buf, (regcache->raw_registers
+ + regcache->descr->register_offset[regnum]),
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
+regcache_raw_read_signed (struct regcache *regcache, int regnum, LONGEST *val)
{
- gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
- /* For moment, just use underlying legacy code. Ulgh!!! */
- legacy_read_register_gen (rawnum, buf);
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_raw_read (regcache, regnum, buf);
+ (*val) = extract_signed_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
+regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
+ ULONGEST *val)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_raw_read (regcache, regnum, buf);
+ (*val) = extract_unsigned_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
}
void
read_register_gen (int regnum, char *buf)
{
- if (! gdbarch_register_read_p (current_gdbarch))
+ gdb_assert (current_regcache != NULL);
+ gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
+ if (current_regcache->descr->legacy_p)
{
legacy_read_register_gen (regnum, buf);
return;
}
- gdbarch_register_read (current_gdbarch, regnum, buf);
+ regcache_cooked_read (current_regcache, regnum, buf);
}
+void
+regcache_cooked_read (struct regcache *regcache, int regnum, void *buf)
+{
+ gdb_assert (regnum >= 0);
+ gdb_assert (regnum < regcache->descr->nr_cooked_registers);
+ if (regnum < regcache->descr->nr_raw_registers)
+ regcache_raw_read (regcache, regnum, buf);
+ else
+ gdbarch_pseudo_register_read (regcache->descr->gdbarch, regcache,
+ regnum, buf);
+}
+
+void
+regcache_cooked_read_signed (struct regcache *regcache, int regnum,
+ LONGEST *val)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_cooked_read (regcache, regnum, buf);
+ (*val) = extract_signed_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
+regcache_cooked_read_unsigned (struct regcache *regcache, int regnum,
+ ULONGEST *val)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_cooked_read (regcache, regnum, buf);
+ (*val) = extract_unsigned_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
/* Write register REGNUM at MYADDR to the target. MYADDR points at
REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */
static void
-legacy_write_register_gen (int regnum, char *myaddr)
+legacy_write_register_gen (int regnum, const void *myaddr)
{
int size;
gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
@@ -362,35 +770,97 @@ legacy_write_register_gen (int regnum, char *myaddr)
/* If we have a valid copy of the register, and new value == old
value, then don't bother doing the actual store. */
if (register_cached (regnum)
- && memcmp (register_buffer (regnum), myaddr, size) == 0)
+ && (memcmp (register_buffer (current_regcache, regnum), myaddr, size)
+ == 0))
return;
else
target_prepare_to_store ();
}
- memcpy (register_buffer (regnum), myaddr, size);
+ memcpy (register_buffer (current_regcache, regnum), myaddr, size);
set_register_cached (regnum, 1);
- store_register (regnum);
+ target_store_registers (regnum);
}
void
-regcache_write (int rawnum, char *buf)
+regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
{
- gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
- /* For moment, just use underlying legacy code. Ulgh!!! */
- legacy_write_register_gen (rawnum, buf);
+ gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+
+ if (regcache->passthrough_p
+ && regcache->descr->legacy_p)
+ {
+ /* For moment, just use underlying legacy code. Ulgh!!! This
+ silently and very indirectly updates the regcache's buffers
+ via the globals register_valid[] and registers[]. */
+ gdb_assert (regcache == current_regcache);
+ legacy_write_register_gen (regnum, buf);
+ return;
+ }
+
+ /* On the sparc, writing %g0 is a no-op, so we don't even want to
+ change the registers array if something writes to this register. */
+ if (CANNOT_STORE_REGISTER (regnum))
+ return;
+
+ /* Handle the simple case first -> not write through so just store
+ value in cache. */
+ if (!regcache->passthrough_p)
+ {
+ memcpy ((regcache->raw_registers
+ + regcache->descr->register_offset[regnum]), buf,
+ regcache->descr->sizeof_register[regnum]);
+ regcache->raw_register_valid_p[regnum] = 1;
+ return;
+ }
+
+ /* Make certain that the correct cache is selected. */
+ gdb_assert (regcache == current_regcache);
+ if (! ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+
+ /* If we have a valid copy of the register, and new value == old
+ value, then don't bother doing the actual store. */
+ if (regcache_valid_p (regcache, regnum)
+ && (memcmp (register_buffer (regcache, regnum), buf,
+ regcache->descr->sizeof_register[regnum]) == 0))
+ return;
+
+ target_prepare_to_store ();
+ memcpy (register_buffer (regcache, regnum), buf,
+ regcache->descr->sizeof_register[regnum]);
+ regcache->raw_register_valid_p[regnum] = 1;
+ target_store_registers (regnum);
}
void
write_register_gen (int regnum, char *buf)
{
- if (! gdbarch_register_write_p (current_gdbarch))
+ gdb_assert (current_regcache != NULL);
+ gdb_assert (current_regcache->descr->gdbarch == current_gdbarch);
+ if (current_regcache->descr->legacy_p)
{
legacy_write_register_gen (regnum, buf);
return;
}
- gdbarch_register_write (current_gdbarch, regnum, buf);
+ regcache_cooked_write (current_regcache, regnum, buf);
+}
+
+void
+regcache_cooked_write (struct regcache *regcache, int regnum, const void *buf)
+{
+ gdb_assert (regnum >= 0);
+ gdb_assert (regnum < regcache->descr->nr_cooked_registers);
+ if (regnum < regcache->descr->nr_raw_registers)
+ regcache_raw_write (regcache, regnum, buf);
+ else
+ gdbarch_pseudo_register_write (regcache->descr->gdbarch, regcache,
+ regnum, buf);
}
/* Copy INLEN bytes of consecutive data from memory at MYADDR
@@ -441,11 +911,91 @@ write_register_bytes (int myregstart, char *myaddr, int inlen)
myaddr + (overlapstart - myregstart),
overlapend - overlapstart);
- store_register (regnum);
+ target_store_registers (regnum);
}
}
}
+/* Perform a partial register transfer using a read, modify, write
+ operation. */
+
+typedef void (regcache_read_ftype) (struct regcache *regcache, int regnum,
+ void *buf);
+typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum,
+ const void *buf);
+
+void
+regcache_xfer_part (struct regcache *regcache, int regnum,
+ int offset, int len, void *in, const void *out,
+ regcache_read_ftype *read, regcache_write_ftype *write)
+{
+ struct regcache_descr *descr = regcache->descr;
+ bfd_byte *reg = alloca (descr->max_register_size);
+ gdb_assert (offset >= 0 && offset <= descr->sizeof_register[regnum]);
+ gdb_assert (len >= 0 && offset + len <= descr->sizeof_register[regnum]);
+ /* Something to do? */
+ if (offset + len == 0)
+ return;
+ /* Read (when needed) ... */
+ if (in != NULL
+ || offset > 0
+ || offset + len < descr->sizeof_register[regnum])
+ {
+ gdb_assert (read != NULL);
+ read (regcache, regnum, reg);
+ }
+ /* ... modify ... */
+ if (in != NULL)
+ memcpy (in, reg + offset, len);
+ if (out != NULL)
+ memcpy (reg + offset, out, len);
+ /* ... write (when needed). */
+ if (out != NULL)
+ {
+ gdb_assert (write != NULL);
+ write (regcache, regnum, reg);
+ }
+}
+
+void
+regcache_raw_read_part (struct regcache *regcache, int regnum,
+ int offset, int len, void *buf)
+{
+ struct regcache_descr *descr = regcache->descr;
+ gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers);
+ regcache_xfer_part (regcache, regnum, offset, len, buf, NULL,
+ regcache_raw_read, regcache_raw_write);
+}
+
+void
+regcache_raw_write_part (struct regcache *regcache, int regnum,
+ int offset, int len, const void *buf)
+{
+ struct regcache_descr *descr = regcache->descr;
+ gdb_assert (regnum >= 0 && regnum < descr->nr_raw_registers);
+ regcache_xfer_part (regcache, regnum, offset, len, NULL, buf,
+ regcache_raw_read, regcache_raw_write);
+}
+
+void
+regcache_cooked_read_part (struct regcache *regcache, int regnum,
+ int offset, int len, void *buf)
+{
+ struct regcache_descr *descr = regcache->descr;
+ gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers);
+ regcache_xfer_part (regcache, regnum, offset, len, buf, NULL,
+ regcache_cooked_read, regcache_cooked_write);
+}
+
+void
+regcache_cooked_write_part (struct regcache *regcache, int regnum,
+ int offset, int len, const void *buf)
+{
+ struct regcache_descr *descr = regcache->descr;
+ gdb_assert (regnum >= 0 && regnum < descr->nr_cooked_registers);
+ regcache_xfer_part (regcache, regnum, offset, len, NULL, buf,
+ regcache_cooked_read, regcache_cooked_write);
+}
/* Return the contents of register REGNUM as an unsigned integer. */
@@ -552,7 +1102,7 @@ write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid)
fact, and report it to the users of read_register and friends. */
void
-supply_register (int regnum, char *val)
+supply_register (int regnum, const void *val)
{
#if 1
if (! ptid_equal (registers_ptid, inferior_ptid))
@@ -564,10 +1114,10 @@ supply_register (int regnum, char *val)
set_register_cached (regnum, 1);
if (val)
- memcpy (register_buffer (regnum), val,
+ memcpy (register_buffer (current_regcache, regnum), val,
REGISTER_RAW_SIZE (regnum));
else
- memset (register_buffer (regnum), '\000',
+ memset (register_buffer (current_regcache, regnum), '\000',
REGISTER_RAW_SIZE (regnum));
/* On some architectures, e.g. HPPA, there are a few stray bits in
@@ -576,18 +1126,20 @@ supply_register (int regnum, char *val)
/* NOTE: cagney/2001-03-16: The macro CLEAN_UP_REGISTER_VALUE is
going to be deprecated. Instead architectures will leave the raw
register value as is and instead clean things up as they pass
- through the method gdbarch_register_read() clean up the
+ through the method gdbarch_pseudo_register_read() clean up the
values. */
#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
- DEPRECATED_CLEAN_UP_REGISTER_VALUE (regnum, register_buffer (regnum));
+ DEPRECATED_CLEAN_UP_REGISTER_VALUE \
+ (regnum, register_buffer (current_regcache, regnum));
#endif
}
void
regcache_collect (int regnum, void *buf)
{
- memcpy (buf, register_buffer (regnum), REGISTER_RAW_SIZE (regnum));
+ memcpy (buf, register_buffer (current_regcache, regnum),
+ REGISTER_RAW_SIZE (regnum));
}
@@ -755,37 +1307,250 @@ reg_flush_command (char *command, int from_tty)
static void
build_regcache (void)
{
+ current_regcache = regcache_xmalloc (current_gdbarch);
+ current_regcache->passthrough_p = 1;
+ registers = deprecated_grub_regcache_for_registers (current_regcache);
+ register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
+}
+
+static void
+dump_endian_bytes (struct ui_file *file, enum bfd_endian endian,
+ const unsigned char *buf, long len)
+{
int i;
- int sizeof_register_valid;
- /* Come up with the real size of the registers buffer. */
- int sizeof_registers = REGISTER_BYTES; /* OK use. */
- for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
+ switch (endian)
{
- long regend;
- /* Keep extending the buffer so that there is always enough
- space for all registers. The comparison is necessary since
- legacy code is free to put registers in random places in the
- buffer separated by holes. Once REGISTER_BYTE() is killed
- this can be greatly simplified. */
- /* FIXME: cagney/2001-12-04: This code shouldn't need to use
- REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
- buffer out so that certain registers just happen to overlap.
- Ulgh! New targets use gdbarch's register read/write and
- entirely avoid this uglyness. */
- regend = REGISTER_BYTE (i) + REGISTER_RAW_SIZE (i);
- if (sizeof_registers < regend)
- sizeof_registers = regend;
+ case BFD_ENDIAN_BIG:
+ for (i = 0; i < len; i++)
+ fprintf_unfiltered (file, "%02x", buf[i]);
+ break;
+ case BFD_ENDIAN_LITTLE:
+ for (i = len - 1; i >= 0; i--)
+ fprintf_unfiltered (file, "%02x", buf[i]);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "Bad switch");
}
- registers = xmalloc (sizeof_registers);
- sizeof_register_valid = ((NUM_REGS + NUM_PSEUDO_REGS)
- * sizeof (*register_valid));
- register_valid = xmalloc (sizeof_register_valid);
- memset (register_valid, 0, sizeof_register_valid);
+}
+
+enum regcache_dump_what
+{
+ regcache_dump_none, regcache_dump_raw, regcache_dump_cooked
+};
+
+static void
+regcache_dump (struct regcache *regcache, struct ui_file *file,
+ enum regcache_dump_what what_to_dump)
+{
+ struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
+ int regnum;
+ int footnote_nr = 0;
+ int footnote_register_size = 0;
+ int footnote_register_offset = 0;
+ int footnote_register_type_name_null = 0;
+ long register_offset = 0;
+ unsigned char *buf = alloca (regcache->descr->max_register_size);
+
+#if 0
+ fprintf_unfiltered (file, "legacy_p %d\n", regcache->descr->legacy_p);
+ fprintf_unfiltered (file, "nr_raw_registers %d\n",
+ regcache->descr->nr_raw_registers);
+ fprintf_unfiltered (file, "nr_cooked_registers %d\n",
+ regcache->descr->nr_cooked_registers);
+ fprintf_unfiltered (file, "sizeof_raw_registers %ld\n",
+ regcache->descr->sizeof_raw_registers);
+ fprintf_unfiltered (file, "sizeof_raw_register_valid_p %ld\n",
+ regcache->descr->sizeof_raw_register_valid_p);
+ fprintf_unfiltered (file, "max_register_size %ld\n",
+ regcache->descr->max_register_size);
+ fprintf_unfiltered (file, "NUM_REGS %d\n", NUM_REGS);
+ fprintf_unfiltered (file, "NUM_PSEUDO_REGS %d\n", NUM_PSEUDO_REGS);
+#endif
+
+ gdb_assert (regcache->descr->nr_cooked_registers
+ == (NUM_REGS + NUM_PSEUDO_REGS));
+
+ for (regnum = -1; regnum < regcache->descr->nr_cooked_registers; regnum++)
+ {
+ /* Name. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %-10s", "Name");
+ else
+ {
+ const char *p = REGISTER_NAME (regnum);
+ if (p == NULL)
+ p = "";
+ else if (p[0] == '\0')
+ p = "''";
+ fprintf_unfiltered (file, " %-10s", p);
+ }
+
+ /* Number. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %4s", "Nr");
+ else
+ fprintf_unfiltered (file, " %4d", regnum);
+
+ /* Relative number. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %4s", "Rel");
+ else if (regnum < NUM_REGS)
+ fprintf_unfiltered (file, " %4d", regnum);
+ else
+ fprintf_unfiltered (file, " %4d", (regnum - NUM_REGS));
+
+ /* Offset. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %6s ", "Offset");
+ else
+ {
+ fprintf_unfiltered (file, " %6ld",
+ regcache->descr->register_offset[regnum]);
+ if (register_offset != regcache->descr->register_offset[regnum]
+ || register_offset != REGISTER_BYTE (regnum))
+ {
+ if (!footnote_register_offset)
+ footnote_register_offset = ++footnote_nr;
+ fprintf_unfiltered (file, "*%d", footnote_register_offset);
+ }
+ else
+ fprintf_unfiltered (file, " ");
+ register_offset = (regcache->descr->register_offset[regnum]
+ + regcache->descr->sizeof_register[regnum]);
+ }
+
+ /* Size. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %5s ", "Size");
+ else
+ {
+ fprintf_unfiltered (file, " %5ld",
+ regcache->descr->sizeof_register[regnum]);
+ if ((regcache->descr->sizeof_register[regnum]
+ != REGISTER_RAW_SIZE (regnum))
+ || (regcache->descr->sizeof_register[regnum]
+ != REGISTER_VIRTUAL_SIZE (regnum))
+ || (regcache->descr->sizeof_register[regnum]
+ != TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum)))
+ )
+ {
+ if (!footnote_register_size)
+ footnote_register_size = ++footnote_nr;
+ fprintf_unfiltered (file, "*%d", footnote_register_size);
+ }
+ else
+ fprintf_unfiltered (file, " ");
+ }
+
+ /* Type. */
+ if (regnum < 0)
+ fprintf_unfiltered (file, " %-20s", "Type");
+ else
+ {
+ static const char blt[] = "builtin_type";
+ const char *t = TYPE_NAME (REGISTER_VIRTUAL_TYPE (regnum));
+ if (t == NULL)
+ {
+ char *n;
+ if (!footnote_register_type_name_null)
+ footnote_register_type_name_null = ++footnote_nr;
+ xasprintf (&n, "*%d", footnote_register_type_name_null);
+ make_cleanup (xfree, n);
+ t = n;
+ }
+ /* Chop a leading builtin_type. */
+ if (strncmp (t, blt, strlen (blt)) == 0)
+ t += strlen (blt);
+ fprintf_unfiltered (file, " %-20s", t);
+ }
+
+ /* Value, raw. */
+ if (what_to_dump == regcache_dump_raw)
+ {
+ if (regnum < 0)
+ fprintf_unfiltered (file, "Raw value");
+ else if (regnum >= regcache->descr->nr_raw_registers)
+ fprintf_unfiltered (file, "<cooked>");
+ else if (!regcache_valid_p (regcache, regnum))
+ fprintf_unfiltered (file, "<invalid>");
+ else
+ {
+ regcache_raw_read (regcache, regnum, buf);
+ fprintf_unfiltered (file, "0x");
+ dump_endian_bytes (file, TARGET_BYTE_ORDER, buf,
+ REGISTER_RAW_SIZE (regnum));
+ }
+ }
+
+ /* Value, cooked. */
+ if (what_to_dump == regcache_dump_cooked)
+ {
+ if (regnum < 0)
+ fprintf_unfiltered (file, "Cooked value");
+ else
+ {
+ regcache_cooked_read (regcache, regnum, buf);
+ fprintf_unfiltered (file, "0x");
+ dump_endian_bytes (file, TARGET_BYTE_ORDER, buf,
+ REGISTER_VIRTUAL_SIZE (regnum));
+ }
+ }
+
+ fprintf_unfiltered (file, "\n");
+ }
+
+ if (footnote_register_size)
+ fprintf_unfiltered (file, "*%d: Inconsistent register sizes.\n",
+ footnote_register_size);
+ if (footnote_register_offset)
+ fprintf_unfiltered (file, "*%d: Inconsistent register offsets.\n",
+ footnote_register_offset);
+ if (footnote_register_type_name_null)
+ fprintf_unfiltered (file,
+ "*%d: Register type's name NULL.\n",
+ footnote_register_type_name_null);
+ do_cleanups (cleanups);
+}
+
+static void
+regcache_print (char *args, enum regcache_dump_what what_to_dump)
+{
+ if (args == NULL)
+ regcache_dump (current_regcache, gdb_stdout, what_to_dump);
+ else
+ {
+ struct ui_file *file = gdb_fopen (args, "w");
+ if (file == NULL)
+ perror_with_name ("maintenance print architecture");
+ regcache_dump (current_regcache, file, what_to_dump);
+ ui_file_delete (file);
+ }
+}
+
+static void
+maintenance_print_registers (char *args, int from_tty)
+{
+ regcache_print (args, regcache_dump_none);
+}
+
+static void
+maintenance_print_raw_registers (char *args, int from_tty)
+{
+ regcache_print (args, regcache_dump_raw);
+}
+
+static void
+maintenance_print_cooked_registers (char *args, int from_tty)
+{
+ regcache_print (args, regcache_dump_cooked);
}
void
_initialize_regcache (void)
{
+ regcache_descr_handle = register_gdbarch_data (init_regcache_descr,
+ xfree_regcache_descr);
+ REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (&registers, sizeof (registers), NULL);
register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_regcache);
@@ -796,4 +1561,21 @@ _initialize_regcache (void)
/* Initialize the thread/process associated with the current set of
registers. For now, -1 is special, and means `no current process'. */
registers_ptid = pid_to_ptid (-1);
+
+ add_cmd ("registers", class_maintenance,
+ maintenance_print_registers,
+ "Print the internal register configuration.\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
+ add_cmd ("raw-registers", class_maintenance,
+ maintenance_print_raw_registers,
+ "Print the internal register configuration including raw values.\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
+ add_cmd ("cooked-registers", class_maintenance,
+ maintenance_print_cooked_registers,
+ "Print the internal register configuration including cooked values.\
+Takes an optional file parameter.",
+ &maintenanceprintlist);
+
}
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 4e854d31667..da91fd69325 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -1,6 +1,7 @@
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,17 +23,68 @@
#ifndef REGCACHE_H
#define REGCACHE_H
+struct regcache;
+struct gdbarch;
+
+extern struct regcache *current_regcache;
+
+void regcache_xfree (struct regcache *regcache);
+struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache);
+struct regcache *regcache_xmalloc (struct gdbarch *gdbarch);
+
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
regcache. */
-void regcache_read (int rawnum, char *buf);
-void regcache_write (int rawnum, char *buf);
+void regcache_raw_read (struct regcache *regcache, int rawnum, void *buf);
+void regcache_raw_write (struct regcache *regcache, int rawnum,
+ const void *buf);
+extern void regcache_raw_read_signed (struct regcache *regcache,
+ int regnum, LONGEST *val);
+extern void regcache_raw_read_unsigned (struct regcache *regcache,
+ int regnum, ULONGEST *val);
+
+/* Partial transfer of a raw registers. These perform read, modify,
+ write style operations. */
+
+void regcache_raw_read_part (struct regcache *regcache, int regnum,
+ int offset, int len, void *buf);
+void regcache_raw_write_part (struct regcache *regcache, int regnum,
+ int offset, int len, const void *buf);
+
+int regcache_valid_p (struct regcache *regcache, int regnum);
+
+/* Transfer a cooked register [0..NUM_REGS+NUM_PSEUDO_REGS). */
+void regcache_cooked_read (struct regcache *regcache, int rawnum, void *buf);
+void regcache_cooked_write (struct regcache *regcache, int rawnum,
+ const void *buf);
+
+/* NOTE: cagney/2002-08-13: At present GDB has no reliable mechanism
+ for indicating when a ``cooked'' register was constructed from
+ invalid or unavailable ``raw'' registers. One fairly easy way of
+ adding such a mechanism would be for the cooked functions to return
+ a register valid indication. Given the possibility of such a
+ change, the extract functions below use a reference parameter,
+ rather than a function result. */
+
+/* Read a register as a signed/unsigned quantity. */
+extern void regcache_cooked_read_signed (struct regcache *regcache,
+ int regnum, LONGEST *val);
+extern void regcache_cooked_read_unsigned (struct regcache *regcache,
+ int regnum, ULONGEST *val);
+
+/* Partial transfer of a cooked register. These perform read, modify,
+ write style operations. */
+
+void regcache_cooked_read_part (struct regcache *regcache, int regnum,
+ int offset, int len, void *buf);
+void regcache_cooked_write_part (struct regcache *regcache, int regnum,
+ int offset, int len, const void *buf);
/* Transfer a raw register [0..NUM_REGS) between the regcache and the
target. These functions are called by the target in response to a
target_fetch_registers() or target_store_registers(). */
-extern void supply_register (int regnum, char *val);
+extern void supply_register (int regnum, const void *val);
extern void regcache_collect (int regnum, void *buf);
@@ -47,6 +99,23 @@ extern char *registers;
extern signed char *register_valid;
+/* Copy/duplicate the contents of a register cache. By default, the
+ operation is pass-through. Writes to DST and reads from SRC will
+ go through to the target.
+
+ The ``cpy'' functions can not have overlapping SRC and DST buffers.
+
+ ``no passthrough'' versions do not go through to the target. They
+ only transfer values already in the cache. */
+
+extern struct regcache *regcache_dup (struct regcache *regcache);
+extern struct regcache *regcache_dup_no_passthrough (struct regcache *regcache);
+extern void regcache_cpy (struct regcache *dest, struct regcache *src);
+extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache *src);
+
+extern char *deprecated_grub_regcache_for_registers (struct regcache *);
+extern char *deprecated_grub_regcache_for_register_valid (struct regcache *);
+
extern int register_cached (int regnum);
extern void set_register_cached (int regnum, int state);
diff --git a/gdb/remote-bug.c b/gdb/remote-bug.c
index f74ce9768e2..a6ffb8ec66d 100644
--- a/gdb/remote-bug.c
+++ b/gdb/remote-bug.c
@@ -1,1027 +1,1027 @@
-/* Remote debugging interface for Motorola's MVME187BUG monitor, an embedded
- monitor for the m88k.
-
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
-
- Contributed by Cygnus Support. Written by K. Richard Pixley.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "gdb_string.h"
-#include "regcache.h"
-#include <ctype.h>
-#include <fcntl.h>
-#include <setjmp.h>
-#include <errno.h>
-
-#include "terminal.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-
-#include "serial.h"
-#include "remote-utils.h"
-
-/* External data declarations */
-extern int stop_soon_quietly; /* for wait_for_inferior */
-
-/* Forward data declarations */
-extern struct target_ops bug_ops; /* Forward declaration */
-
-/* Forward function declarations */
-static int bug_clear_breakpoints (void);
-
-static int bug_read_memory (CORE_ADDR memaddr,
- unsigned char *myaddr, int len);
-
-static int bug_write_memory (CORE_ADDR memaddr,
- unsigned char *myaddr, int len);
-
-/* This variable is somewhat arbitrary. It's here so that it can be
- set from within a running gdb. */
-
-static int srec_max_retries = 3;
-
-/* Each S-record download to the target consists of an S0 header
- record, some number of S3 data records, and one S7 termination
- record. I call this download a "frame". Srec_frame says how many
- bytes will be represented in each frame. */
-
-#define SREC_SIZE 160
-static int srec_frame = SREC_SIZE;
-
-/* This variable determines how many bytes will be represented in each
- S3 s-record. */
-
-static int srec_bytes = 40;
-
-/* At one point it appeared to me as though the bug monitor could not
- really be expected to receive two sequential characters at 9600
- baud reliably. Echo-pacing is an attempt to force data across the
- line even in this condition. Specifically, in echo-pace mode, each
- character is sent one at a time and we look for the echo before
- sending the next. This is excruciatingly slow. */
-
-static int srec_echo_pace = 0;
-
-/* How long to wait after an srec for a possible error message.
- Similar to the above, I tried sleeping after sending each S3 record
- in hopes that I might actually see error messages from the bug
- monitor. This might actually work if we were to use sleep
- intervals smaller than 1 second. */
-
-static int srec_sleep = 0;
-
-/* Every srec_noise records, flub the checksum. This is a debugging
- feature. Set the variable to something other than 1 in order to
- inject *deliberate* checksum errors. One might do this if one
- wanted to test error handling and recovery. */
-
-static int srec_noise = 0;
-
-/* Called when SIGALRM signal sent due to alarm() timeout. */
-
-/* Number of SIGTRAPs we need to simulate. That is, the next
- NEED_ARTIFICIAL_TRAP calls to bug_wait should just return
- SIGTRAP without actually waiting for anything. */
-
-static int need_artificial_trap = 0;
-
-/*
- * Download a file specified in 'args', to the bug.
- */
-
-static void
-bug_load (char *args, int fromtty)
-{
- bfd *abfd;
- asection *s;
- char buffer[1024];
-
- sr_check_open ();
-
- inferior_ptid = null_ptid;
- abfd = bfd_openr (args, 0);
- if (!abfd)
- {
- printf_filtered ("Unable to open file %s\n", args);
- return;
- }
-
- if (bfd_check_format (abfd, bfd_object) == 0)
- {
- printf_filtered ("File is not an object file\n");
- return;
- }
-
- s = abfd->sections;
- while (s != (asection *) NULL)
- {
- srec_frame = SREC_SIZE;
- if (s->flags & SEC_LOAD)
- {
- int i;
-
- char *buffer = xmalloc (srec_frame);
-
- printf_filtered ("%s\t: 0x%4lx .. 0x%4lx ", s->name, s->vma, s->vma + s->_raw_size);
- gdb_flush (gdb_stdout);
- for (i = 0; i < s->_raw_size; i += srec_frame)
- {
- if (srec_frame > s->_raw_size - i)
- srec_frame = s->_raw_size - i;
-
- bfd_get_section_contents (abfd, s, buffer, i, srec_frame);
- bug_write_memory (s->vma + i, buffer, srec_frame);
- printf_filtered ("*");
- gdb_flush (gdb_stdout);
- }
- printf_filtered ("\n");
- xfree (buffer);
- }
- s = s->next;
- }
- sprintf (buffer, "rs ip %lx", (unsigned long) abfd->start_address);
- sr_write_cr (buffer);
- gr_expect_prompt ();
-}
-
-#if 0
-static char *
-get_word (char **p)
-{
- char *s = *p;
- char *word;
- char *copy;
- size_t len;
-
- while (isspace (*s))
- s++;
-
- word = s;
-
- len = 0;
-
- while (*s && !isspace (*s))
- {
- s++;
- len++;
-
- }
- copy = xmalloc (len + 1);
- memcpy (copy, word, len);
- copy[len] = 0;
- *p = s;
- return copy;
-}
-#endif
-
-static struct gr_settings bug_settings =
-{
- "Bug>", /* prompt */
- &bug_ops, /* ops */
- bug_clear_breakpoints, /* clear_all_breakpoints */
- gr_generic_checkin, /* checkin */
-};
-
-static char *cpu_check_strings[] =
-{
- "=",
- "Invalid Register",
-};
-
-static void
-bug_open (char *args, int from_tty)
-{
- if (args == NULL)
- args = "";
-
- gr_open (args, from_tty, &bug_settings);
- /* decide *now* whether we are on an 88100 or an 88110 */
- sr_write_cr ("rs cr06");
- sr_expect ("rs cr06");
-
- switch (gr_multi_scan (cpu_check_strings, 0))
- {
- case 0: /* this is an m88100 */
- target_is_m88110 = 0;
- break;
- case 1: /* this is an m88110 */
- target_is_m88110 = 1;
- break;
- default:
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
- }
-}
-
-/* Tell the remote machine to resume. */
-
-void
-bug_resume (ptid_t ptid, int step, enum target_signal sig)
-{
- if (step)
- {
- sr_write_cr ("t");
-
- /* Force the next bug_wait to return a trap. Not doing anything
- about I/O from the target means that the user has to type
- "continue" to see any. FIXME, this should be fixed. */
- need_artificial_trap = 1;
- }
- else
- sr_write_cr ("g");
-
- return;
-}
-
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
-
-static char *wait_strings[] =
-{
- "At Breakpoint",
- "Exception: Data Access Fault (Local Bus Timeout)",
- "\r8??\?-Bug>", /* The '\?' avoids creating a trigraph */
- "\r197-Bug>",
- NULL,
-};
-
-ptid_t
-bug_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- int old_timeout = sr_get_timeout ();
- int old_immediate_quit = immediate_quit;
-
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
-
- /* read off leftovers from resume so that the rest can be passed
- back out as stdout. */
- if (need_artificial_trap == 0)
- {
- sr_expect ("Effective address: ");
- (void) sr_get_hex_word ();
- sr_expect ("\r\n");
- }
-
- sr_set_timeout (-1); /* Don't time out -- user program is running. */
- immediate_quit = 1; /* Helps ability to QUIT */
-
- switch (gr_multi_scan (wait_strings, need_artificial_trap == 0))
- {
- case 0: /* breakpoint case */
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_TRAP;
- /* user output from the target can be discarded here. (?) */
- gr_expect_prompt ();
- break;
-
- case 1: /* bus error */
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_BUS;
- /* user output from the target can be discarded here. (?) */
- gr_expect_prompt ();
- break;
-
- case 2: /* normal case */
- case 3:
- if (need_artificial_trap != 0)
- {
- /* stepping */
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_TRAP;
- need_artificial_trap--;
- break;
- }
- else
- {
- /* exit case */
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
- break;
- }
-
- case -1: /* trouble */
- default:
- fprintf_filtered (gdb_stderr,
- "Trouble reading target during wait\n");
- break;
- }
-
- sr_set_timeout (old_timeout);
- immediate_quit = old_immediate_quit;
- return inferior_ptid;
-}
-
-/* Return the name of register number REGNO
- in the form input and output by bug.
-
- Returns a pointer to a static buffer containing the answer. */
-static char *
-get_reg_name (int regno)
-{
- static char *rn[] =
- {
- "r00", "r01", "r02", "r03", "r04", "r05", "r06", "r07",
- "r08", "r09", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
- "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
-
- /* these get confusing because we omit a few and switch some ordering around. */
-
- "cr01", /* 32 = psr */
- "fcr62", /* 33 = fpsr */
- "fcr63", /* 34 = fpcr */
- "ip", /* this is something of a cheat. */
- /* 35 = sxip */
- "cr05", /* 36 = snip */
- "cr06", /* 37 = sfip */
-
- "x00", "x01", "x02", "x03", "x04", "x05", "x06", "x07",
- "x08", "x09", "x10", "x11", "x12", "x13", "x14", "x15",
- "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
- "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31",
- };
-
- return rn[regno];
-}
-
-#if 0 /* not currently used */
-/* Read from remote while the input matches STRING. Return zero on
- success, -1 on failure. */
-
-static int
-bug_scan (char *s)
-{
- int c;
-
- while (*s)
- {
- c = sr_readchar ();
- if (c != *s++)
- {
- fflush (stdout);
- printf ("\nNext character is '%c' - %d and s is \"%s\".\n", c, c, --s);
- return (-1);
- }
- }
-
- return (0);
-}
-#endif /* never */
-
-static int
-bug_srec_write_cr (char *s)
-{
- char *p = s;
-
- if (srec_echo_pace)
- for (p = s; *p; ++p)
- {
- if (sr_get_debug () > 0)
- printf ("%c", *p);
-
- do
- serial_write (sr_get_desc (), p, 1);
- while (sr_pollchar () != *p);
- }
- else
- {
- sr_write_cr (s);
-/* return(bug_scan (s) || bug_scan ("\n")); */
- }
-
- return (0);
-}
-
-/* Store register REGNO, or all if REGNO == -1. */
-
-static void
-bug_fetch_register (int regno)
-{
- sr_check_open ();
-
- if (regno == -1)
- {
- int i;
-
- for (i = 0; i < NUM_REGS; ++i)
- bug_fetch_register (i);
- }
- else if (target_is_m88110 && regno == SFIP_REGNUM)
- {
- /* m88110 has no sfip. */
- long l = 0;
- supply_register (regno, (char *) &l);
- }
- else if (regno < XFP_REGNUM)
- {
- char buffer[MAX_REGISTER_RAW_SIZE];
-
- sr_write ("rs ", 3);
- sr_write_cr (get_reg_name (regno));
- sr_expect ("=");
- store_unsigned_integer (buffer, REGISTER_RAW_SIZE (regno),
- sr_get_hex_word ());
- gr_expect_prompt ();
- supply_register (regno, buffer);
- }
- else
- {
- /* Float register so we need to parse a strange data format. */
- long p;
- unsigned char fpreg_buf[10];
-
- sr_write ("rs ", 3);
- sr_write (get_reg_name (regno), strlen (get_reg_name (regno)));
- sr_write_cr (";d");
- sr_expect ("rs");
- sr_expect (get_reg_name (regno));
- sr_expect (";d");
- sr_expect ("=");
-
- /* sign */
- p = sr_get_hex_digit (1);
- fpreg_buf[0] = p << 7;
-
- /* exponent */
- sr_expect ("_");
- p = sr_get_hex_digit (1);
- fpreg_buf[0] += (p << 4);
- fpreg_buf[0] += sr_get_hex_digit (1);
-
- fpreg_buf[1] = sr_get_hex_digit (1) << 4;
-
- /* fraction */
- sr_expect ("_");
- fpreg_buf[1] += sr_get_hex_digit (1);
-
- fpreg_buf[2] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[3] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[4] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[5] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[6] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[7] = (sr_get_hex_digit (1) << 4) + sr_get_hex_digit (1);
- fpreg_buf[8] = 0;
- fpreg_buf[9] = 0;
-
- gr_expect_prompt ();
- supply_register (regno, fpreg_buf);
- }
-
- return;
-}
-
-/* Store register REGNO, or all if REGNO == -1. */
-
-static void
-bug_store_register (int regno)
-{
- char buffer[1024];
- sr_check_open ();
-
- if (regno == -1)
- {
- int i;
-
- for (i = 0; i < NUM_REGS; ++i)
- bug_store_register (i);
- }
- else
- {
- char *regname;
-
- regname = get_reg_name (regno);
-
- if (target_is_m88110 && regno == SFIP_REGNUM)
- return;
- else if (regno < XFP_REGNUM)
- sprintf (buffer, "rs %s %08lx",
- regname,
- (long) read_register (regno));
- else
- {
- unsigned char *fpreg_buf =
- (unsigned char *) &registers[REGISTER_BYTE (regno)];
-
- sprintf (buffer, "rs %s %1x_%02x%1x_%1x%02x%02x%02x%02x%02x%02x;d",
- regname,
- /* sign */
- (fpreg_buf[0] >> 7) & 0xf,
- /* exponent */
- fpreg_buf[0] & 0x7f,
- (fpreg_buf[1] >> 8) & 0xf,
- /* fraction */
- fpreg_buf[1] & 0xf,
- fpreg_buf[2],
- fpreg_buf[3],
- fpreg_buf[4],
- fpreg_buf[5],
- fpreg_buf[6],
- fpreg_buf[7]);
- }
-
- sr_write_cr (buffer);
- gr_expect_prompt ();
- }
-
- return;
-}
-
-/* Transfer LEN bytes between GDB address MYADDR and target address
- MEMADDR. If WRITE is non-zero, transfer them to the target,
- otherwise transfer them from the target. TARGET is unused.
-
- Returns the number of bytes transferred. */
-
-int
-bug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- int res;
-
- if (len <= 0)
- return 0;
-
- if (write)
- res = bug_write_memory (memaddr, myaddr, len);
- else
- res = bug_read_memory (memaddr, myaddr, len);
-
- return res;
-}
-
-static void
-start_load (void)
-{
- char *command;
-
- command = (srec_echo_pace ? "lo 0 ;x" : "lo 0");
-
- sr_write_cr (command);
- sr_expect (command);
- sr_expect ("\r\n");
- bug_srec_write_cr ("S0030000FC");
- return;
-}
-
-/* This is an extremely vulnerable and fragile function. I've made
- considerable attempts to make this deterministic, but I've
- certainly forgotten something. The trouble is that S-records are
- only a partial file format, not a protocol. Worse, apparently the
- m88k bug monitor does not run in real time while receiving
- S-records. Hence, we must pay excruciating attention to when and
- where error messages are returned, and what has actually been sent.
-
- Each call represents a chunk of memory to be sent to the target.
- We break that chunk into an S0 header record, some number of S3
- data records each containing srec_bytes, and an S7 termination
- record. */
-
-static char *srecord_strings[] =
-{
- "S-RECORD",
- "-Bug>",
- NULL,
-};
-
-static int
-bug_write_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
-{
- int done;
- int checksum;
- int x;
- int retries;
- char *buffer = alloca ((srec_bytes + 8) << 1);
-
- retries = 0;
-
- do
- {
- done = 0;
-
- if (retries > srec_max_retries)
- return (-1);
-
- if (retries > 0)
- {
- if (sr_get_debug () > 0)
- printf ("\n<retrying...>\n");
-
- /* This gr_expect_prompt call is extremely important. Without
- it, we will tend to resend our packet so fast that it
- will arrive before the bug monitor is ready to receive
- it. This would lead to a very ugly resend loop. */
-
- gr_expect_prompt ();
- }
-
- start_load ();
-
- while (done < len)
- {
- int thisgo;
- int idx;
- char *buf = buffer;
- CORE_ADDR address;
-
- checksum = 0;
- thisgo = len - done;
- if (thisgo > srec_bytes)
- thisgo = srec_bytes;
-
- address = memaddr + done;
- sprintf (buf, "S3%02X%08lX", thisgo + 4 + 1, (long) address);
- buf += 12;
-
- checksum += (thisgo + 4 + 1
- + (address & 0xff)
- + ((address >> 8) & 0xff)
- + ((address >> 16) & 0xff)
- + ((address >> 24) & 0xff));
-
- for (idx = 0; idx < thisgo; idx++)
- {
- sprintf (buf, "%02X", myaddr[idx + done]);
- checksum += myaddr[idx + done];
- buf += 2;
- }
-
- if (srec_noise > 0)
- {
- /* FIXME-NOW: insert a deliberate error every now and then.
- This is intended for testing/debugging the error handling
- stuff. */
- static int counter = 0;
- if (++counter > srec_noise)
- {
- counter = 0;
- ++checksum;
- }
- }
-
- sprintf (buf, "%02X", ~checksum & 0xff);
- bug_srec_write_cr (buffer);
-
- if (srec_sleep != 0)
- sleep (srec_sleep);
-
- /* This pollchar is probably redundant to the gr_multi_scan
- below. Trouble is, we can't be sure when or where an
- error message will appear. Apparently, when running at
- full speed from a typical sun4, error messages tend to
- appear to arrive only *after* the s7 record. */
-
- if ((x = sr_pollchar ()) != 0)
- {
- if (sr_get_debug () > 0)
- printf ("\n<retrying...>\n");
-
- ++retries;
-
- /* flush any remaining input and verify that we are back
- at the prompt level. */
- gr_expect_prompt ();
- /* start all over again. */
- start_load ();
- done = 0;
- continue;
- }
-
- done += thisgo;
- }
-
- bug_srec_write_cr ("S7060000000000F9");
- ++retries;
-
- /* Having finished the load, we need to figure out whether we
- had any errors. */
- }
- while (gr_multi_scan (srecord_strings, 0) == 0);;
-
- return (0);
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns errno value.
- * sb/sh instructions don't work on unaligned addresses, when TU=1.
- */
-
-/* Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns errno value. */
-static int
-bug_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
-{
- char request[100];
- char *buffer;
- char *p;
- char type;
- char size;
- unsigned char c;
- unsigned int inaddr;
- unsigned int checksum;
-
- sprintf (request, "du 0 %lx:&%d", (long) memaddr, len);
- sr_write_cr (request);
-
- p = buffer = alloca (len);
-
- /* scan up through the header */
- sr_expect ("S0030000FC");
-
- while (p < buffer + len)
- {
- /* scan off any white space. */
- while (sr_readchar () != 'S');;
-
- /* what kind of s-rec? */
- type = sr_readchar ();
-
- /* scan record size */
- sr_get_hex_byte (&size);
- checksum = size;
- --size;
- inaddr = 0;
-
- switch (type)
- {
- case '7':
- case '8':
- case '9':
- goto done;
-
- case '3':
- sr_get_hex_byte (&c);
- inaddr = (inaddr << 8) + c;
- checksum += c;
- --size;
- /* intentional fall through */
- case '2':
- sr_get_hex_byte (&c);
- inaddr = (inaddr << 8) + c;
- checksum += c;
- --size;
- /* intentional fall through */
- case '1':
- sr_get_hex_byte (&c);
- inaddr = (inaddr << 8) + c;
- checksum += c;
- --size;
- sr_get_hex_byte (&c);
- inaddr = (inaddr << 8) + c;
- checksum += c;
- --size;
- break;
-
- default:
- /* bonk */
- error ("reading s-records.");
- }
-
- if (inaddr < memaddr
- || (memaddr + len) < (inaddr + size))
- error ("srec out of memory range.");
-
- if (p != buffer + inaddr - memaddr)
- error ("srec out of sequence.");
-
- for (; size; --size, ++p)
- {
- sr_get_hex_byte (p);
- checksum += *p;
- }
-
- sr_get_hex_byte (&c);
- if (c != (~checksum & 0xff))
- error ("bad s-rec checksum");
- }
-
-done:
- gr_expect_prompt ();
- if (p != buffer + len)
- return (1);
-
- memcpy (myaddr, buffer, len);
- return (0);
-}
-
-#define MAX_BREAKS 16
-static int num_brkpts = 0;
-
-/* Insert a breakpoint at ADDR. SAVE is normally the address of the
- pattern buffer where the instruction that the breakpoint overwrites
- is saved. It is unused here since the bug is responsible for
- saving/restoring the original instruction. */
-
-static int
-bug_insert_breakpoint (CORE_ADDR addr, char *save)
-{
- sr_check_open ();
-
- if (num_brkpts < MAX_BREAKS)
- {
- char buffer[100];
-
- num_brkpts++;
- sprintf (buffer, "br %lx", (long) addr);
- sr_write_cr (buffer);
- gr_expect_prompt ();
- return (0);
- }
- else
- {
- fprintf_filtered (gdb_stderr,
- "Too many break points, break point not installed\n");
- return (1);
- }
-
-}
-
-/* Remove a breakpoint at ADDR. SAVE is normally the previously
- saved pattern, but is unused here since the bug is responsible
- for saving/restoring instructions. */
-
-static int
-bug_remove_breakpoint (CORE_ADDR addr, char *save)
-{
- if (num_brkpts > 0)
- {
- char buffer[100];
-
- num_brkpts--;
- sprintf (buffer, "nobr %lx", (long) addr);
- sr_write_cr (buffer);
- gr_expect_prompt ();
-
- }
- return (0);
-}
-
-/* Clear the bugs notion of what the break points are */
-static int
-bug_clear_breakpoints (void)
-{
-
- if (sr_is_open ())
- {
- sr_write_cr ("nobr");
- sr_expect ("nobr");
- gr_expect_prompt ();
- }
- num_brkpts = 0;
- return (0);
-}
-
-struct target_ops bug_ops;
-
-static void
-init_bug_ops (void)
-{
- bug_ops.to_shortname = "bug";
- "Remote BUG monitor",
- bug_ops.to_longname = "Use the mvme187 board running the BUG monitor connected by a serial line.";
- bug_ops.to_doc = " ";
- bug_ops.to_open = bug_open;
- bug_ops.to_close = gr_close;
- bug_ops.to_attach = 0;
- bug_ops.to_post_attach = NULL;
- bug_ops.to_require_attach = NULL;
- bug_ops.to_detach = gr_detach;
- bug_ops.to_require_detach = NULL;
- bug_ops.to_resume = bug_resume;
- bug_ops.to_wait = bug_wait;
- bug_ops.to_post_wait = NULL;
- bug_ops.to_fetch_registers = bug_fetch_register;
- bug_ops.to_store_registers = bug_store_register;
- bug_ops.to_prepare_to_store = gr_prepare_to_store;
- bug_ops.to_xfer_memory = bug_xfer_memory;
- bug_ops.to_files_info = gr_files_info;
- bug_ops.to_insert_breakpoint = bug_insert_breakpoint;
- bug_ops.to_remove_breakpoint = bug_remove_breakpoint;
- bug_ops.to_terminal_init = 0;
- bug_ops.to_terminal_inferior = 0;
- bug_ops.to_terminal_ours_for_output = 0;
- bug_ops.to_terminal_ours = 0;
- bug_ops.to_terminal_info = 0;
- bug_ops.to_kill = gr_kill;
- bug_ops.to_load = bug_load;
- bug_ops.to_lookup_symbol = 0;
- bug_ops.to_create_inferior = gr_create_inferior;
- bug_ops.to_post_startup_inferior = NULL;
- bug_ops.to_acknowledge_created_inferior = NULL;
- bug_ops.to_clone_and_follow_inferior = NULL;
- bug_ops.to_post_follow_inferior_by_clone = NULL;
- bug_ops.to_insert_fork_catchpoint = NULL;
- bug_ops.to_remove_fork_catchpoint = NULL;
- bug_ops.to_insert_vfork_catchpoint = NULL;
- bug_ops.to_remove_vfork_catchpoint = NULL;
- bug_ops.to_has_forked = NULL;
- bug_ops.to_has_vforked = NULL;
- bug_ops.to_can_follow_vfork_prior_to_exec = NULL;
- bug_ops.to_post_follow_vfork = NULL;
- bug_ops.to_insert_exec_catchpoint = NULL;
- bug_ops.to_remove_exec_catchpoint = NULL;
- bug_ops.to_has_execd = NULL;
- bug_ops.to_reported_exec_events_per_exec_call = NULL;
- bug_ops.to_has_exited = NULL;
- bug_ops.to_mourn_inferior = gr_mourn;
- bug_ops.to_can_run = 0;
- bug_ops.to_notice_signals = 0;
- bug_ops.to_thread_alive = 0;
- bug_ops.to_stop = 0;
- bug_ops.to_pid_to_exec_file = NULL;
- bug_ops.to_stratum = process_stratum;
- bug_ops.DONT_USE = 0;
- bug_ops.to_has_all_memory = 1;
- bug_ops.to_has_memory = 1;
- bug_ops.to_has_stack = 1;
- bug_ops.to_has_registers = 0;
- bug_ops.to_has_execution = 0;
- bug_ops.to_sections = 0;
- bug_ops.to_sections_end = 0;
- bug_ops.to_magic = OPS_MAGIC; /* Always the last thing */
-} /* init_bug_ops */
-
-void
-_initialize_remote_bug (void)
-{
- init_bug_ops ();
- add_target (&bug_ops);
-
- add_show_from_set
- (add_set_cmd ("srec-bytes", class_support, var_uinteger,
- (char *) &srec_bytes,
- "\
-Set the number of bytes represented in each S-record.\n\
-This affects the communication protocol with the remote target.",
- &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_cmd ("srec-max-retries", class_support, var_uinteger,
- (char *) &srec_max_retries,
- "\
-Set the number of retries for shipping S-records.\n\
-This affects the communication protocol with the remote target.",
- &setlist),
- &showlist);
-
-#if 0
- /* This needs to set SREC_SIZE, not srec_frame which gets changed at the
- end of a download. But do we need the option at all? */
- add_show_from_set
- (add_set_cmd ("srec-frame", class_support, var_uinteger,
- (char *) &srec_frame,
- "\
-Set the number of bytes in an S-record frame.\n\
-This affects the communication protocol with the remote target.",
- &setlist),
- &showlist);
-#endif /* 0 */
-
- add_show_from_set
- (add_set_cmd ("srec-noise", class_support, var_zinteger,
- (char *) &srec_noise,
- "\
-Set number of S-record to send before deliberately flubbing a checksum.\n\
-Zero means flub none at all. This affects the communication protocol\n\
-with the remote target.",
- &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_cmd ("srec-sleep", class_support, var_zinteger,
- (char *) &srec_sleep,
- "\
-Set number of seconds to sleep after an S-record for a possible error message to arrive.\n\
-This affects the communication protocol with the remote target.",
- &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_cmd ("srec-echo-pace", class_support, var_boolean,
- (char *) &srec_echo_pace,
- "\
-Set echo-verification.\n\
-When on, use verification by echo when downloading S-records. This is\n\
-much slower, but generally more reliable.",
- &setlist),
- &showlist);
-}
+// 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 <ctype.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE #include <setjmp.h>
+// OBSOLETE #include <errno.h>
+// 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 *) &registers[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<retrying...>\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<retrying...>\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-es.c b/gdb/remote-es.c
index e489254bcc0..24183cc43a8 100644
--- a/gdb/remote-es.c
+++ b/gdb/remote-es.c
@@ -136,9 +136,9 @@ static int es1800_insert_breakpoint (CORE_ADDR, char *);
static void es1800_files_info (struct target_ops *);
-static int
-es1800_xfer_inferior_memory (CORE_ADDR, char *, int, int,
- struct mem_attrib *, struct target_ops *);
+static int es1800_xfer_inferior_memory (CORE_ADDR, char *, int, int,
+ struct mem_attrib *,
+ struct target_ops *);
static void es1800_prepare_to_store (void);
diff --git a/gdb/remote-est.c b/gdb/remote-est.c
index e045a8951cd..0a1d7af60c2 100644
--- a/gdb/remote-est.c
+++ b/gdb/remote-est.c
@@ -76,12 +76,24 @@ est_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes a "r30".
*/
-static char *est_regnames[NUM_REGS] =
+static const char *
+est_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC",
-};
+
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC",
+ };
+
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -143,7 +155,8 @@ init_est_cmds (void)
est_cmds.cmd_end = NULL; /* optional command terminator */
est_cmds.target = &est_ops; /* target operations */
est_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- est_cmds.regnames = est_regnames; /* registers names */
+ est_cmds.regnames = NULL;
+ est_cmds.regname = est_regname; /*register names*/
est_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
} /* init_est_cmds */
diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c
index 679dfad919e..ffbe7d850df 100644
--- a/gdb/remote-nindy.c
+++ b/gdb/remote-nindy.c
@@ -1,762 +1,762 @@
-/* Memory-access and commands for remote NINDY process, for GDB.
-
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
-
- Contributed by Intel Corporation. Modified from remote.c by Chris Benenati.
-
- GDB is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY. No author or distributor accepts responsibility to anyone
- for the consequences of using it or for whether it serves any
- particular purpose or works at all, unless he says so in writing.
- Refer to the GDB General Public License for full details.
-
- Everyone is granted permission to copy, modify and redistribute GDB,
- but only under the conditions described in the GDB General Public
- License. A copy of this license is supposed to have been given to you
- along with GDB so you can know your rights and responsibilities. It
- should be in a file named COPYING. Among other things, the copyright
- notice and this notice must be preserved on all copies.
-
- In other words, go ahead and share GDB, but don't try to stop
- anyone else from sharing it farther. Help stamp out software hoarding! */
-
-/*
- Except for the data cache routines, this file bears little resemblence
- to remote.c. A new (although similar) protocol has been specified, and
- portions of the code are entirely dependent on having an i80960 with a
- NINDY ROM monitor at the other end of the line.
- */
-
-/*****************************************************************************
- *
- * REMOTE COMMUNICATION PROTOCOL BETWEEN GDB960 AND THE NINDY ROM MONITOR.
- *
- *
- * MODES OF OPERATION
- * ----- -- ---------
- *
- * As far as NINDY is concerned, GDB is always in one of two modes: command
- * mode or passthrough mode.
- *
- * In command mode (the default) pre-defined packets containing requests
- * are sent by GDB to NINDY. NINDY never talks except in reponse to a request.
- *
- * Once the the user program is started, GDB enters passthrough mode, to give
- * the user program access to the terminal. GDB remains in this mode until
- * NINDY indicates that the program has stopped.
- *
- *
- * PASSTHROUGH MODE
- * ----------- ----
- *
- * GDB writes all input received from the keyboard directly to NINDY, and writes
- * all characters received from NINDY directly to the monitor.
- *
- * Keyboard input is neither buffered nor echoed to the monitor.
- *
- * GDB remains in passthrough mode until NINDY sends a single ^P character,
- * to indicate that the user process has stopped.
- *
- * Note:
- * GDB assumes NINDY performs a 'flushreg' when the user program stops.
- *
- *
- * COMMAND MODE
- * ------- ----
- *
- * All info (except for message ack and nak) is transferred between gdb
- * and the remote processor in messages of the following format:
- *
- * <info>#<checksum>
- *
- * where
- * # is a literal character
- *
- * <info> ASCII information; all numeric information is in the
- * form of hex digits ('0'-'9' and lowercase 'a'-'f').
- *
- * <checksum>
- * is a pair of ASCII hex digits representing an 8-bit
- * checksum formed by adding together each of the
- * characters in <info>.
- *
- * The receiver of a message always sends a single character to the sender
- * to indicate that the checksum was good ('+') or bad ('-'); the sender
- * re-transmits the entire message over until a '+' is received.
- *
- * In response to a command NINDY always sends back either data or
- * a result code of the form "Xnn", where "nn" are hex digits and "X00"
- * means no errors. (Exceptions: the "s" and "c" commands don't respond.)
- *
- * SEE THE HEADER OF THE FILE "gdb.c" IN THE NINDY MONITOR SOURCE CODE FOR A
- * FULL DESCRIPTION OF LEGAL COMMANDS.
- *
- * SEE THE FILE "stop.h" IN THE NINDY MONITOR SOURCE CODE FOR A LIST
- * OF STOP CODES.
- *
- ***************************************************************************/
-
-#include "defs.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <setjmp.h>
-
-#include "frame.h"
-#include "inferior.h"
-#include "bfd.h"
-#include "symfile.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "floatformat.h"
-#include "regcache.h"
-
-#include <sys/file.h>
-#include <ctype.h>
-#include "serial.h"
-#include "nindy-share/env.h"
-#include "nindy-share/stop.h"
-#include "remote-utils.h"
-
-extern int unlink ();
-extern char *getenv ();
-extern char *mktemp ();
-
-extern void generic_mourn_inferior ();
-
-extern struct target_ops nindy_ops;
-extern FILE *instream;
-
-extern char ninStopWhy ();
-extern int ninMemGet ();
-extern int ninMemPut ();
-
-int nindy_initial_brk; /* nonzero if want to send an initial BREAK to nindy */
-int nindy_old_protocol; /* nonzero if want to use old protocol */
-char *nindy_ttyname; /* name of tty to talk to nindy on, or null */
-
-#define DLE '\020' /* Character NINDY sends to indicate user program has
- * halted. */
-#define TRUE 1
-#define FALSE 0
-
-/* From nindy-share/nindy.c. */
-extern struct serial *nindy_serial;
-
-static int have_regs = 0; /* 1 iff regs read since i960 last halted */
-static int regs_changed = 0; /* 1 iff regs were modified since last read */
-
-extern char *exists ();
-
-static void nindy_fetch_registers (int);
-
-static void nindy_store_registers (int);
-
-static char *savename;
-
-static void
-nindy_close (int quitting)
-{
- if (nindy_serial != NULL)
- serial_close (nindy_serial);
- nindy_serial = NULL;
-
- if (savename)
- xfree (savename);
- savename = 0;
-}
-
-/* Open a connection to a remote debugger.
- FIXME, there should be "set" commands for the options that are
- now specified with gdb command-line options (old_protocol,
- and initial_brk). */
-void
-nindy_open (char *name, /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
- int from_tty)
-{
- char baudrate[1024];
-
- if (!name)
- error_no_arg ("serial port device name");
-
- target_preopen (from_tty);
-
- nindy_close (0);
-
- have_regs = regs_changed = 0;
-
- /* Allow user to interrupt the following -- we could hang if there's
- no NINDY at the other end of the remote tty. */
- immediate_quit++;
- /* If baud_rate is -1, then ninConnect will not recognize the baud rate
- and will deal with the situation in a (more or less) reasonable
- fashion. */
- sprintf (baudrate, "%d", baud_rate);
- ninConnect (name, baudrate,
- nindy_initial_brk, !from_tty, nindy_old_protocol);
- immediate_quit--;
-
- if (nindy_serial == NULL)
- {
- perror_with_name (name);
- }
-
- savename = savestring (name, strlen (name));
- push_target (&nindy_ops);
-
- target_fetch_registers (-1);
-
- init_thread_list ();
- init_wait_for_inferior ();
- clear_proceed_status ();
- normal_stop ();
-}
-
-/* User-initiated quit of nindy operations. */
-
-static void
-nindy_detach (char *name, int from_tty)
-{
- if (name)
- error ("Too many arguments");
- pop_target ();
-}
-
-static void
-nindy_files_info (void)
-{
- /* FIXME: this lies about the baud rate if we autobauded. */
- printf_unfiltered ("\tAttached to %s at %d bits per second%s%s.\n", savename,
- baud_rate,
- nindy_old_protocol ? " in old protocol" : "",
- nindy_initial_brk ? " with initial break" : "");
-}
-
-/* Return the number of characters in the buffer BUF before
- the first DLE character. N is maximum number of characters to
- consider. */
-
-static
-int
-non_dle (char *buf, int n)
-{
- int i;
-
- for (i = 0; i < n; i++)
- {
- if (buf[i] == DLE)
- {
- break;
- }
- }
- return i;
-}
-
-/* Tell the remote machine to resume. */
-
-void
-nindy_resume (ptid_t ptid, int step, enum target_signal siggnal)
-{
- if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
- warning ("Can't send signals to remote NINDY targets.");
-
- if (regs_changed)
- {
- nindy_store_registers (-1);
- regs_changed = 0;
- }
- have_regs = 0;
- ninGo (step);
-}
-
-/* FIXME, we can probably use the normal terminal_inferior stuff here.
- We have to do terminal_inferior and then set up the passthrough
- settings initially. Thereafter, terminal_ours and terminal_inferior
- will automatically swap the settings around for us. */
-
-struct clean_up_tty_args
-{
- serial_ttystate state;
- struct serial *serial;
-};
-static struct clean_up_tty_args tty_args;
-
-static void
-clean_up_tty (PTR ptrarg)
-{
- struct clean_up_tty_args *args = (struct clean_up_tty_args *) ptrarg;
- serial_set_tty_state (args->serial, args->state);
- xfree (args->state);
- warning ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
-}
-
-/* Recover from ^Z or ^C while remote process is running */
-static void (*old_ctrlc) ();
-#ifdef SIGTSTP
-static void (*old_ctrlz) ();
-#endif
-
-static void
-clean_up_int (void)
-{
- serial_set_tty_state (tty_args.serial, tty_args.state);
- xfree (tty_args.state);
-
- signal (SIGINT, old_ctrlc);
-#ifdef SIGTSTP
- signal (SIGTSTP, old_ctrlz);
-#endif
- error ("\n\nYou may need to reset the 80960 and/or reload your program.\n");
-}
-
-/* Wait until the remote machine stops. While waiting, operate in passthrough
- * mode; i.e., pass everything NINDY sends to gdb_stdout, and everything from
- * stdin to NINDY.
- *
- * Return to caller, storing status in 'status' just as `wait' would.
- */
-
-static ptid_t
-nindy_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- fd_set fds;
- int c;
- char buf[2];
- int i, n;
- unsigned char stop_exit;
- unsigned char stop_code;
- struct cleanup *old_cleanups;
- long ip_value, fp_value, sp_value; /* Reg values from stop */
-
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
-
- /* OPERATE IN PASSTHROUGH MODE UNTIL NINDY SENDS A DLE CHARACTER */
-
- /* Save current tty attributes, and restore them when done. */
- tty_args.serial = serial_fdopen (0);
- tty_args.state = serial_get_tty_state (tty_args.serial);
- old_ctrlc = signal (SIGINT, clean_up_int);
-#ifdef SIGTSTP
- old_ctrlz = signal (SIGTSTP, clean_up_int);
-#endif
-
- old_cleanups = make_cleanup (clean_up_tty, &tty_args);
-
- /* Pass input from keyboard to NINDY as it arrives. NINDY will interpret
- <CR> and perform echo. */
- /* This used to set CBREAK and clear ECHO and CRMOD. I hope this is close
- enough. */
- serial_raw (tty_args.serial);
-
- while (1)
- {
- /* Input on remote */
- c = serial_readchar (nindy_serial, -1);
- if (c == SERIAL_ERROR)
- {
- error ("Cannot read from serial line");
- }
- else if (c == 0x1b) /* ESC */
- {
- c = serial_readchar (nindy_serial, -1);
- c &= ~0x40;
- }
- else if (c != 0x10) /* DLE */
- /* Write out any characters preceding DLE */
- {
- buf[0] = (char) c;
- write (1, buf, 1);
- }
- else
- {
- stop_exit = ninStopWhy (&stop_code,
- &ip_value, &fp_value, &sp_value);
- if (!stop_exit && (stop_code == STOP_SRQ))
- {
- immediate_quit++;
- ninSrq ();
- immediate_quit--;
- }
- else
- {
- /* Get out of loop */
- supply_register (IP_REGNUM,
- (char *) &ip_value);
- supply_register (FP_REGNUM,
- (char *) &fp_value);
- supply_register (SP_REGNUM,
- (char *) &sp_value);
- break;
- }
- }
- }
-
- serial_set_tty_state (tty_args.serial, tty_args.state);
- xfree (tty_args.state);
- discard_cleanups (old_cleanups);
-
- if (stop_exit)
- {
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = stop_code;
- }
- else
- {
- /* nindy has some special stop code need to be handled */
- if (stop_code == STOP_GDB_BPT)
- stop_code = TRACE_STEP;
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = i960_fault_to_signal (stop_code);
- }
- return inferior_ptid;
-}
-
-/* Read the remote registers into the block REGS. */
-
-/* This is the block that ninRegsGet and ninRegsPut handles. */
-struct nindy_regs
-{
- char local_regs[16 * 4];
- char global_regs[16 * 4];
- char pcw_acw[2 * 4];
- char ip[4];
- char tcw[4];
- char fp_as_double[4 * 8];
-};
-
-static void
-nindy_fetch_registers (int regno)
-{
- struct nindy_regs nindy_regs;
- int regnum;
-
- immediate_quit++;
- ninRegsGet ((char *) &nindy_regs);
- immediate_quit--;
-
- memcpy (&registers[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4);
- memcpy (&registers[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4);
- memcpy (&registers[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4);
- memcpy (&registers[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4);
- memcpy (&registers[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4);
- memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8);
-
- registers_fetched ();
-}
-
-static void
-nindy_prepare_to_store (void)
-{
- /* Fetch all regs if they aren't already here. */
- read_register_bytes (0, NULL, REGISTER_BYTES);
-}
-
-static void
-nindy_store_registers (int regno)
-{
- struct nindy_regs nindy_regs;
- int regnum;
-
- memcpy (nindy_regs.local_regs, &registers[REGISTER_BYTE (R0_REGNUM)], 16 * 4);
- memcpy (nindy_regs.global_regs, &registers[REGISTER_BYTE (G0_REGNUM)], 16 * 4);
- memcpy (nindy_regs.pcw_acw, &registers[REGISTER_BYTE (PCW_REGNUM)], 2 * 4);
- memcpy (nindy_regs.ip, &registers[REGISTER_BYTE (IP_REGNUM)], 1 * 4);
- memcpy (nindy_regs.tcw, &registers[REGISTER_BYTE (TCW_REGNUM)], 1 * 4);
- memcpy (nindy_regs.fp_as_double, &registers[REGISTER_BYTE (FP0_REGNUM)], 8 * 4);
-
- immediate_quit++;
- ninRegsPut ((char *) &nindy_regs);
- immediate_quit--;
-}
-
-/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. Copy to inferior if
- SHOULD_WRITE is nonzero. Returns the length copied. TARGET is
- unused. */
-
-int
-nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
- int should_write, struct mem_attrib *attrib,
- struct target_ops *target)
-{
- int res;
-
- if (len <= 0)
- return 0;
-
- if (should_write)
- res = ninMemPut (memaddr, myaddr, len);
- else
- res = ninMemGet (memaddr, myaddr, len);
-
- return res;
-}
-
-static void
-nindy_create_inferior (char *execfile, char *args, char **env)
-{
- int entry_pt;
- int pid;
-
- if (args && *args)
- error ("Can't pass arguments to remote NINDY process");
-
- if (execfile == 0 || exec_bfd == 0)
- error ("No executable file specified");
-
- entry_pt = (int) bfd_get_start_address (exec_bfd);
-
- pid = 42;
-
- /* The "process" (board) is already stopped awaiting our commands, and
- the program is already downloaded. We just set its PC and go. */
-
- inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior below */
-
- clear_proceed_status ();
-
- /* Tell wait_for_inferior that we've started a new process. */
- init_wait_for_inferior ();
-
- /* Set up the "saved terminal modes" of the inferior
- based on what modes we are starting it with. */
- target_terminal_init ();
-
- /* Install inferior's terminal modes. */
- target_terminal_inferior ();
-
- /* insert_step_breakpoint (); FIXME, do we need this? */
- /* Let 'er rip... */
- proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
-}
-
-static void
-reset_command (char *args, int from_tty)
-{
- if (nindy_serial == NULL)
- {
- error ("No target system to reset -- use 'target nindy' command.");
- }
- if (query ("Really reset the target system?", 0, 0))
- {
- serial_send_break (nindy_serial);
- tty_flush (nindy_serial);
- }
-}
-
-void
-nindy_kill (char *args, int from_tty)
-{
- return; /* Ignore attempts to kill target system */
-}
-
-/* Clean up when a program exits.
-
- The program actually lives on in the remote processor's RAM, and may be
- run again without a download. Don't leave it full of breakpoint
- instructions. */
-
-void
-nindy_mourn_inferior (void)
-{
- remove_breakpoints ();
- unpush_target (&nindy_ops);
- generic_mourn_inferior (); /* Do all the proper things now */
-}
-
-/* Pass the args the way catch_errors wants them. */
-static int
-nindy_open_stub (char *arg)
-{
- nindy_open (arg, 1);
- return 1;
-}
-
-static void
-nindy_load (char *filename, int from_tty)
-{
- asection *s;
- /* Can't do unix style forking on a VMS system, so we'll use bfd to do
- all the work for us
- */
-
- bfd *file = bfd_openr (filename, 0);
- if (!file)
- {
- perror_with_name (filename);
- return;
- }
-
- if (!bfd_check_format (file, bfd_object))
- {
- error ("can't prove it's an object file\n");
- return;
- }
-
- for (s = file->sections; s; s = s->next)
- {
- if (s->flags & SEC_LOAD)
- {
- char *buffer = xmalloc (s->_raw_size);
- bfd_get_section_contents (file, s, buffer, 0, s->_raw_size);
- printf ("Loading section %s, size %x vma %x\n",
- s->name,
- s->_raw_size,
- s->vma);
- ninMemPut (s->vma, buffer, s->_raw_size);
- xfree (buffer);
- }
- }
- bfd_close (file);
-}
-
-static int
-load_stub (char *arg)
-{
- target_load (arg, 1);
- return 1;
-}
-
-/* This routine is run as a hook, just before the main command loop is
- entered. If gdb is configured for the i960, but has not had its
- nindy target specified yet, this will loop prompting the user to do so.
-
- Unlike the loop provided by Intel, we actually let the user get out
- of this with a RETURN. This is useful when e.g. simply examining
- an i960 object file on the host system. */
-
-void
-nindy_before_main_loop (void)
-{
- char ttyname[100];
- char *p, *p2;
-
- while (target_stack->target_ops != &nindy_ops) /* What is this crap??? */
- { /* remote tty not specified yet */
- if (instream == stdin)
- {
- printf_unfiltered ("\nAttach /dev/ttyNN -- specify NN, or \"quit\" to quit: ");
- gdb_flush (gdb_stdout);
- }
- fgets (ttyname, sizeof (ttyname) - 1, stdin);
-
- /* Strip leading and trailing whitespace */
- for (p = ttyname; isspace (*p); p++)
- {
- ;
- }
- if (*p == '\0')
- {
- return; /* User just hit spaces or return, wants out */
- }
- for (p2 = p; !isspace (*p2) && (*p2 != '\0'); p2++)
- {
- ;
- }
- *p2 = '\0';
- if (STREQ ("quit", p))
- {
- exit (1);
- }
-
- if (catch_errors (nindy_open_stub, p, "", RETURN_MASK_ALL))
- {
- /* Now that we have a tty open for talking to the remote machine,
- download the executable file if one was specified. */
- if (exec_bfd)
- {
- catch_errors (load_stub, bfd_get_filename (exec_bfd), "",
- RETURN_MASK_ALL);
- }
- }
- }
-}
-
-/* Define the target subroutine names */
-
-struct target_ops nindy_ops;
-
-static void
-init_nindy_ops (void)
-{
- nindy_ops.to_shortname = "nindy";
- "Remote serial target in i960 NINDY-specific protocol",
- nindy_ops.to_longname = "Use a remote i960 system running NINDY connected by a serial line.\n\
-Specify the name of the device the serial line is connected to.\n\
-The speed (baud rate), whether to use the old NINDY protocol,\n\
-and whether to send a break on startup, are controlled by options\n\
-specified when you started GDB.";
- nindy_ops.to_doc = "";
- nindy_ops.to_open = nindy_open;
- nindy_ops.to_close = nindy_close;
- nindy_ops.to_attach = 0;
- nindy_ops.to_post_attach = NULL;
- nindy_ops.to_require_attach = NULL;
- nindy_ops.to_detach = nindy_detach;
- nindy_ops.to_require_detach = NULL;
- nindy_ops.to_resume = nindy_resume;
- nindy_ops.to_wait = nindy_wait;
- nindy_ops.to_post_wait = NULL;
- nindy_ops.to_fetch_registers = nindy_fetch_registers;
- nindy_ops.to_store_registers = nindy_store_registers;
- nindy_ops.to_prepare_to_store = nindy_prepare_to_store;
- nindy_ops.to_xfer_memory = nindy_xfer_inferior_memory;
- nindy_ops.to_files_info = nindy_files_info;
- nindy_ops.to_insert_breakpoint = memory_insert_breakpoint;
- nindy_ops.to_remove_breakpoint = memory_remove_breakpoint;
- nindy_ops.to_terminal_init = 0;
- nindy_ops.to_terminal_inferior = 0;
- nindy_ops.to_terminal_ours_for_output = 0;
- nindy_ops.to_terminal_ours = 0;
- nindy_ops.to_terminal_info = 0; /* Terminal crud */
- nindy_ops.to_kill = nindy_kill;
- nindy_ops.to_load = nindy_load;
- nindy_ops.to_lookup_symbol = 0; /* lookup_symbol */
- nindy_ops.to_create_inferior = nindy_create_inferior;
- nindy_ops.to_post_startup_inferior = NULL;
- nindy_ops.to_acknowledge_created_inferior = NULL;
- nindy_ops.to_clone_and_follow_inferior = NULL;
- nindy_ops.to_post_follow_inferior_by_clone = NULL;
- nindy_ops.to_insert_fork_catchpoint = NULL;
- nindy_ops.to_remove_fork_catchpoint = NULL;
- nindy_ops.to_insert_vfork_catchpoint = NULL;
- nindy_ops.to_remove_vfork_catchpoint = NULL;
- nindy_ops.to_has_forked = NULL;
- nindy_ops.to_has_vforked = NULL;
- nindy_ops.to_can_follow_vfork_prior_to_exec = NULL;
- nindy_ops.to_post_follow_vfork = NULL;
- nindy_ops.to_insert_exec_catchpoint = NULL;
- nindy_ops.to_remove_exec_catchpoint = NULL;
- nindy_ops.to_has_execd = NULL;
- nindy_ops.to_reported_exec_events_per_exec_call = NULL;
- nindy_ops.to_has_exited = NULL;
- nindy_ops.to_mourn_inferior = nindy_mourn_inferior;
- nindy_ops.to_can_run = 0; /* can_run */
- nindy_ops.to_notice_signals = 0; /* notice_signals */
- nindy_ops.to_thread_alive = 0; /* to_thread_alive */
- nindy_ops.to_stop = 0; /* to_stop */
- nindy_ops.to_pid_to_exec_file = NULL;
- nindy_ops.to_stratum = process_stratum;
- nindy_ops.DONT_USE = 0; /* next */
- nindy_ops.to_has_all_memory = 1;
- nindy_ops.to_has_memory = 1;
- nindy_ops.to_has_stack = 1;
- nindy_ops.to_has_registers = 1;
- nindy_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */
- nindy_ops.to_sections = 0;
- nindy_ops.to_sections_end = 0; /* Section pointers */
- nindy_ops.to_magic = OPS_MAGIC; /* Always the last thing */
-}
-
-void
-_initialize_nindy (void)
-{
- init_nindy_ops ();
- add_target (&nindy_ops);
- add_com ("reset", class_obscure, reset_command,
- "Send a 'break' to the remote target system.\n\
-Only useful if the target has been equipped with a circuit\n\
-to perform a hard reset when a break is detected.");
-}
+// 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 * <info>#<checksum>
+// OBSOLETE *
+// OBSOLETE * where
+// OBSOLETE * # is a literal character
+// OBSOLETE *
+// OBSOLETE * <info> ASCII information; all numeric information is in the
+// OBSOLETE * form of hex digits ('0'-'9' and lowercase 'a'-'f').
+// OBSOLETE *
+// OBSOLETE * <checksum>
+// OBSOLETE * is a pair of ASCII hex digits representing an 8-bit
+// OBSOLETE * checksum formed by adding together each of the
+// OBSOLETE * characters in <info>.
+// 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 <signal.h>
+// OBSOLETE #include <sys/types.h>
+// OBSOLETE #include <setjmp.h>
+// 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 <sys/file.h>
+// OBSOLETE #include <ctype.h>
+// 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 <CR> 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 (&registers[REGISTER_BYTE (R0_REGNUM)], nindy_regs.local_regs, 16 * 4);
+// OBSOLETE memcpy (&registers[REGISTER_BYTE (G0_REGNUM)], nindy_regs.global_regs, 16 * 4);
+// OBSOLETE memcpy (&registers[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2 * 4);
+// OBSOLETE memcpy (&registers[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1 * 4);
+// OBSOLETE memcpy (&registers[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1 * 4);
+// OBSOLETE memcpy (&registers[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, &registers[REGISTER_BYTE (R0_REGNUM)], 16 * 4);
+// OBSOLETE memcpy (nindy_regs.global_regs, &registers[REGISTER_BYTE (G0_REGNUM)], 16 * 4);
+// OBSOLETE memcpy (nindy_regs.pcw_acw, &registers[REGISTER_BYTE (PCW_REGNUM)], 2 * 4);
+// OBSOLETE memcpy (nindy_regs.ip, &registers[REGISTER_BYTE (IP_REGNUM)], 1 * 4);
+// OBSOLETE memcpy (nindy_regs.tcw, &registers[REGISTER_BYTE (TCW_REGNUM)], 1 * 4);
+// OBSOLETE memcpy (nindy_regs.fp_as_double, &registers[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
index 436c3d272a6..31336b61ff2 100644
--- a/gdb/remote-nrom.c
+++ b/gdb/remote-nrom.c
@@ -1,351 +1,351 @@
-/* Remote debugging with the XLNT Designs, Inc (XDI) NetROM.
- Copyright 1990, 1991, 1992, 1995, 1998, 1999, 2000
- Free Software Foundation, Inc.
- Contributed by:
- Roger Moyers
- XLNT Designs, Inc.
- 15050 Avenue of Science, Suite 106
- San Diego, CA 92128
- (619)487-9320
- roger@xlnt.com
- Adapted from work done at Cygnus Support in remote-nindy.c,
- later merged in by Stan Shebs at Cygnus.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "gdbcmd.h"
-#include "serial.h"
-#include "target.h"
-
-/* Default ports used to talk with the NetROM. */
-
-#define DEFAULT_NETROM_LOAD_PORT 1236
-#define DEFAULT_NETROM_CONTROL_PORT 1237
-
-static void nrom_close (int quitting);
-
-/* New commands. */
-
-static void nrom_passthru (char *, int);
-
-/* We talk to the NetROM over these sockets. */
-
-static struct serial *load_desc = NULL;
-static struct serial *ctrl_desc = NULL;
-
-static int load_port = DEFAULT_NETROM_LOAD_PORT;
-static int control_port = DEFAULT_NETROM_CONTROL_PORT;
-
-static char nrom_hostname[100];
-
-/* Forward data declaration. */
-
-extern struct target_ops nrom_ops;
-
-/* Scan input from the remote system, until STRING is found. Print chars that
- don't match. */
-
-static int
-expect (char *string)
-{
- char *p = string;
- int c;
-
- immediate_quit++;
-
- while (1)
- {
- c = serial_readchar (ctrl_desc, 5);
-
- if (c == *p++)
- {
- if (*p == '\0')
- {
- immediate_quit--;
- return 0;
- }
- }
- else
- {
- fputc_unfiltered (c, gdb_stdout);
- p = string;
- if (c == *p)
- p++;
- }
- }
-}
-
-static void
-nrom_kill (void)
-{
- nrom_close (0);
-}
-
-static struct serial *
-open_socket (char *name, int port)
-{
- char sockname[100];
- struct serial *desc;
-
- sprintf (sockname, "%s:%d", name, port);
- desc = serial_open (sockname);
- if (!desc)
- perror_with_name (sockname);
-
- return desc;
-}
-
-static void
-load_cleanup (void)
-{
- serial_close (load_desc);
- load_desc = NULL;
-}
-
-/* Download a file specified in ARGS to the netROM. */
-
-static void
-nrom_load (char *args, int fromtty)
-{
- int fd, rd_amt, fsize;
- bfd *pbfd;
- asection *section;
- char *downloadstring = "download 0\n";
- struct cleanup *old_chain;
-
- /* Tell the netrom to get ready to download. */
- if (serial_write (ctrl_desc, downloadstring, strlen (downloadstring)))
- error ("nrom_load: control_send() of `%s' failed", downloadstring);
-
- expect ("Waiting for a connection...\n");
-
- load_desc = open_socket (nrom_hostname, load_port);
-
- old_chain = make_cleanup (load_cleanup, 0);
-
- pbfd = bfd_openr (args, 0);
-
- if (pbfd)
- {
- make_cleanup (bfd_close, pbfd);
-
- if (!bfd_check_format (pbfd, bfd_object))
- error ("\"%s\": not in executable format: %s",
- args, bfd_errmsg (bfd_get_error ()));
-
- for (section = pbfd->sections; section; section = section->next)
- {
- if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC)
- {
- bfd_vma section_address;
- unsigned long section_size;
- const char *section_name;
-
- section_name = bfd_get_section_name (pbfd, section);
- section_address = bfd_get_section_vma (pbfd, section);
- section_size = bfd_section_size (pbfd, section);
-
- if (bfd_get_section_flags (pbfd, section) & SEC_LOAD)
- {
- file_ptr fptr;
-
- printf_filtered ("[Loading section %s at %x (%d bytes)]\n",
- section_name, section_address,
- section_size);
-
- fptr = 0;
-
- while (section_size > 0)
- {
- char buffer[1024];
- int count;
-
- count = min (section_size, 1024);
-
- bfd_get_section_contents (pbfd, section, buffer, fptr,
- count);
-
- serial_write (load_desc, buffer, count);
- section_address += count;
- fptr += count;
- section_size -= count;
- }
- }
- else
- /* BSS and such */
- {
- printf_filtered ("[section %s: not loading]\n",
- section_name);
- }
- }
- }
- }
- else
- error ("\"%s\": Could not open", args);
-
- do_cleanups (old_chain);
-}
-
-/* Open a connection to the remote NetROM devices. */
-
-static void
-nrom_open (char *name, int from_tty)
-{
- int errn;
-
- if (!name || strchr (name, '/') || strchr (name, ':'))
- error (
- "To open a NetROM connection, you must specify the hostname\n\
-or IP address of the NetROM device you wish to use.");
-
- strcpy (nrom_hostname, name);
-
- target_preopen (from_tty);
-
- unpush_target (&nrom_ops);
-
- ctrl_desc = open_socket (nrom_hostname, control_port);
-
- push_target (&nrom_ops);
-
- if (from_tty)
- printf_filtered ("Connected to NetROM device \"%s\"\n", nrom_hostname);
-}
-
-/* Close out all files and local state before this target loses control. */
-
-static void
-nrom_close (int quitting)
-{
- if (load_desc)
- serial_close (load_desc);
- if (ctrl_desc)
- serial_close (ctrl_desc);
-}
-
-/* Pass arguments directly to the NetROM. */
-
-static void
-nrom_passthru (char *args, int fromtty)
-{
- char buf[1024];
-
- sprintf (buf, "%s\n", args);
- if (serial_write (ctrl_desc, buf, strlen (buf)))
- error ("nrom_reset: control_send() of `%s'failed", args);
-}
-
-static void
-nrom_mourn (void)
-{
- unpush_target (&nrom_ops);
- generic_mourn_inferior ();
-}
-
-/* Define the target vector. */
-
-struct target_ops nrom_ops;
-
-static void
-init_nrom_ops (void)
-{
- nrom_ops.to_shortname = "nrom";
- nrom_ops.to_longname = "Remote XDI `NetROM' target";
- nrom_ops.to_doc = "Remote debug using a NetROM over Ethernet";
- nrom_ops.to_open = nrom_open;
- nrom_ops.to_close = nrom_close;
- nrom_ops.to_attach = NULL;
- nrom_ops.to_post_attach = NULL;
- nrom_ops.to_require_attach = NULL;
- nrom_ops.to_detach = NULL;
- nrom_ops.to_require_detach = NULL;
- nrom_ops.to_resume = NULL;
- nrom_ops.to_wait = NULL;
- nrom_ops.to_post_wait = NULL;
- nrom_ops.to_fetch_registers = NULL;
- nrom_ops.to_store_registers = NULL;
- nrom_ops.to_prepare_to_store = NULL;
- nrom_ops.to_xfer_memory = NULL;
- nrom_ops.to_files_info = NULL;
- nrom_ops.to_insert_breakpoint = NULL;
- nrom_ops.to_remove_breakpoint = NULL;
- nrom_ops.to_terminal_init = NULL;
- nrom_ops.to_terminal_inferior = NULL;
- nrom_ops.to_terminal_ours_for_output = NULL;
- nrom_ops.to_terminal_ours = NULL;
- nrom_ops.to_terminal_info = NULL;
- nrom_ops.to_kill = nrom_kill;
- nrom_ops.to_load = nrom_load;
- nrom_ops.to_lookup_symbol = NULL;
- nrom_ops.to_create_inferior = NULL;
- nrom_ops.to_post_startup_inferior = NULL;
- nrom_ops.to_acknowledge_created_inferior = NULL;
- nrom_ops.to_clone_and_follow_inferior = NULL;
- nrom_ops.to_post_follow_inferior_by_clone = NULL;
- nrom_ops.to_insert_fork_catchpoint = NULL;
- nrom_ops.to_remove_fork_catchpoint = NULL;
- nrom_ops.to_insert_vfork_catchpoint = NULL;
- nrom_ops.to_remove_vfork_catchpoint = NULL;
- nrom_ops.to_has_forked = NULL;
- nrom_ops.to_has_vforked = NULL;
- nrom_ops.to_can_follow_vfork_prior_to_exec = NULL;
- nrom_ops.to_post_follow_vfork = NULL;
- nrom_ops.to_insert_exec_catchpoint = NULL;
- nrom_ops.to_remove_exec_catchpoint = NULL;
- nrom_ops.to_has_execd = NULL;
- nrom_ops.to_reported_exec_events_per_exec_call = NULL;
- nrom_ops.to_has_exited = NULL;
- nrom_ops.to_mourn_inferior = nrom_mourn;
- nrom_ops.to_can_run = NULL;
- nrom_ops.to_notice_signals = 0;
- nrom_ops.to_thread_alive = 0;
- nrom_ops.to_stop = 0;
- nrom_ops.to_pid_to_exec_file = NULL;
- nrom_ops.to_stratum = download_stratum;
- nrom_ops.DONT_USE = NULL;
- nrom_ops.to_has_all_memory = 1;
- nrom_ops.to_has_memory = 1;
- nrom_ops.to_has_stack = 1;
- nrom_ops.to_has_registers = 1;
- nrom_ops.to_has_execution = 0;
- nrom_ops.to_sections = NULL;
- nrom_ops.to_sections_end = NULL;
- nrom_ops.to_magic = OPS_MAGIC;
-}
-
-void
-_initialize_remote_nrom (void)
-{
- init_nrom_ops ();
- add_target (&nrom_ops);
-
- add_show_from_set (
- add_set_cmd ("nrom_load_port", no_class, var_zinteger, (char *) &load_port,
- "Set the port to use for NetROM downloads\n", &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("nrom_control_port", no_class, var_zinteger, (char *) &control_port,
- "Set the port to use for NetROM debugger services\n", &setlist),
- &showlist);
-
- add_cmd ("nrom", no_class, nrom_passthru,
- "Pass arguments as command to NetROM",
- &cmdlist);
-}
+// 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
index 0a703ebd3a5..5a7dd3410f9 100644
--- a/gdb/remote-os9k.c
+++ b/gdb/remote-os9k.c
@@ -1,1234 +1,1234 @@
-/* Remote debugging interface for boot monitors, for GDB.
-
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This file was derived from remote-eb.c, which did a similar job, but for
- an AMD-29K running EBMON. That file was in turn derived from remote.c
- as mentioned in the following comment (left in for comic relief):
-
- "This is like remote.c but is for a different situation--
- having a PC running os9000 hook up with a unix machine with
- a serial line, and running ctty com2 on the PC. os9000 has a debug
- monitor called ROMBUG running. Not to mention that the PC
- has PC/NFS, so it can access the same executables that gdb can,
- over the net in real time."
-
- In reality, this module talks to a debug monitor called 'ROMBUG', which
- We communicate with ROMBUG via a direct serial line, the network version
- of ROMBUG is not available yet.
- */
-
-/* FIXME This file needs to be rewritten if it's to work again, either
- to self-contained or to use the new monitor interface. */
-
-#include "defs.h"
-#include "gdbcore.h"
-#include "target.h"
-#include "gdb_string.h"
-#include <sys/types.h>
-#include "command.h"
-#include "serial.h"
-#include "monitor.h"
-#include "remote-utils.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdb-stabs.h"
-#include "regcache.h"
-
-struct cmd_list_element *showlist;
-extern struct target_ops rombug_ops; /* Forward declaration */
-extern struct monitor_ops rombug_cmds; /* Forward declaration */
-extern struct cmd_list_element *setlist;
-extern struct cmd_list_element *unsetlist;
-extern int attach_flag;
-
-static void rombug_close ();
-static void rombug_fetch_register ();
-static void rombug_fetch_registers ();
-static void rombug_store_register ();
-#if 0
-static int sr_get_debug (); /* flag set by "set remotedebug" */
-#endif
-static int hashmark; /* flag set by "set hash" */
-static int rombug_is_open = 0;
-
-/* FIXME: Replace with sr_get_debug (). */
-#define LOG_FILE "monitor.log"
-FILE *log_file;
-static int monitor_log = 0;
-static int tty_xon = 0;
-static int tty_xoff = 0;
-
-static int timeout = 10;
-static int is_trace_mode = 0;
-/* Descriptor for I/O to remote machine. Initialize it to NULL */
-static struct serial *monitor_desc = NULL;
-
-static CORE_ADDR bufaddr = 0;
-static int buflen = 0;
-static char readbuf[16];
-
-/* Send data to monitor. Works just like printf. */
-static void
-printf_monitor (char *pattern,...)
-{
- va_list args;
- char buf[200];
- int i;
-
- va_start (args, pattern);
-
- vsprintf (buf, pattern, args);
- va_end (args);
-
- if (serial_write (monitor_desc, buf, strlen (buf)))
- fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n",
- safe_strerror (errno));
-}
-
-/* Read a character from the remote system, doing all the fancy timeout stuff */
-static int
-readchar (int timeout)
-{
- int c;
-
- c = serial_readchar (monitor_desc, timeout);
-
- if (sr_get_debug ())
- putchar (c & 0x7f);
-
- if (monitor_log && isascii (c))
- putc (c & 0x7f, log_file);
-
- if (c >= 0)
- return c & 0x7f;
-
- if (c == SERIAL_TIMEOUT)
- {
- if (timeout == 0)
- return c; /* Polls shouldn't generate timeout errors */
-
- error ("Timeout reading from remote system.");
- }
-
- perror_with_name ("remote-monitor");
-}
-
-/* Scan input from the remote system, until STRING is found. If DISCARD is
- non-zero, then discard non-matching input, else print it out.
- Let the user break out immediately. */
-static void
-expect (char *string, int discard)
-{
- char *p = string;
- int c;
-
- if (sr_get_debug ())
- printf ("Expecting \"%s\"\n", string);
-
- immediate_quit++;
- while (1)
- {
- c = readchar (timeout);
- if (!isascii (c))
- continue;
- if (c == *p++)
- {
- if (*p == '\0')
- {
- immediate_quit--;
- if (sr_get_debug ())
- printf ("\nMatched\n");
- return;
- }
- }
- else
- {
- if (!discard)
- {
- fwrite (string, 1, (p - 1) - string, stdout);
- putchar ((char) c);
- fflush (stdout);
- }
- p = string;
- }
- }
-}
-
-/* Keep discarding input until we see the ROMBUG prompt.
-
- The convention for dealing with the prompt is that you
- o give your command
- o *then* wait for the prompt.
-
- Thus the last thing that a procedure does with the serial line
- will be an expect_prompt(). Exception: rombug_resume does not
- wait for the prompt, because the terminal is being handed over
- to the inferior. However, the next thing which happens after that
- is a rombug_wait which does wait for the prompt.
- Note that this includes abnormal exit, e.g. error(). This is
- necessary to prevent getting into states from which we can't
- recover. */
-static void
-expect_prompt (int discard)
-{
- if (monitor_log)
- /* This is a convenient place to do this. The idea is to do it often
- enough that we never lose much data if we terminate abnormally. */
- fflush (log_file);
-
- if (is_trace_mode)
- {
- expect ("trace", discard);
- }
- else
- {
- expect (PROMPT, discard);
- }
-}
-
-/* Get a hex digit from the remote system & return its value.
- If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */
-static int
-get_hex_digit (int ignore_space)
-{
- int ch;
- while (1)
- {
- ch = readchar (timeout);
- if (ch >= '0' && ch <= '9')
- return ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- return ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- return ch - 'a' + 10;
- else if (ch == ' ' && ignore_space)
- ;
- else
- {
- expect_prompt (1);
- error ("Invalid hex digit from remote system.");
- }
- }
-}
-
-/* Get a byte from monitor and put it in *BYT. Accept any number
- leading spaces. */
-static void
-get_hex_byte (char *byt)
-{
- int val;
-
- val = get_hex_digit (1) << 4;
- val |= get_hex_digit (0);
- *byt = val;
-}
-
-/* Get N 32-bit words from remote, each preceded by a space,
- and put them in registers starting at REGNO. */
-static void
-get_hex_regs (int n, int regno)
-{
- long val;
- int i;
- unsigned char b;
-
- for (i = 0; i < n; i++)
- {
- int j;
-
- val = 0;
- for (j = 0; j < 4; j++)
- {
- get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- val = (val << 8) + b;
- else
- val = val + (b << (j * 8));
- }
- supply_register (regno++, (char *) &val);
- }
-}
-
-/* This is called not only when we first attach, but also when the
- user types "run" after having attached. */
-static void
-rombug_create_inferior (char *execfile, char *args, char **env)
-{
- int entry_pt;
-
- if (args && *args)
- error ("Can't pass arguments to remote ROMBUG process");
-
- if (execfile == 0 || exec_bfd == 0)
- error ("No executable file specified");
-
- entry_pt = (int) bfd_get_start_address (exec_bfd);
-
- if (monitor_log)
- fputs ("\nIn Create_inferior()", log_file);
-
-
-/* The "process" (board) is already stopped awaiting our commands, and
- the program is already downloaded. We just set its PC and go. */
-
- init_wait_for_inferior ();
- proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0);
-}
-
-/* Open a connection to a remote debugger.
- NAME is the filename used for communication. */
-
-static char dev_name[100];
-
-static void
-rombug_open (char *args, int from_tty)
-{
- if (args == NULL)
- error ("Use `target RomBug DEVICE-NAME' to use a serial port, or \n\
-`target RomBug HOST-NAME:PORT-NUMBER' to use a network connection.");
-
- target_preopen (from_tty);
-
- if (rombug_is_open)
- unpush_target (&rombug_ops);
-
- strcpy (dev_name, args);
- monitor_desc = serial_open (dev_name);
- if (monitor_desc == NULL)
- perror_with_name (dev_name);
-
- /* if baud rate is set by 'set remotebaud' */
- if (serial_setbaudrate (monitor_desc, sr_get_baud_rate ()))
- {
- serial_close (monitor_desc);
- perror_with_name ("RomBug");
- }
- serial_raw (monitor_desc);
- if (tty_xon || tty_xoff)
- {
- struct hardware_ttystate
- {
- struct termios t;
- }
- *tty_s;
-
- tty_s = (struct hardware_ttystate *) serial_get_tty_state (monitor_desc);
- if (tty_xon)
- tty_s->t.c_iflag |= IXON;
- if (tty_xoff)
- tty_s->t.c_iflag |= IXOFF;
- serial_set_tty_state (monitor_desc, (serial_ttystate) tty_s);
- }
-
- rombug_is_open = 1;
-
- log_file = fopen (LOG_FILE, "w");
- if (log_file == NULL)
- perror_with_name (LOG_FILE);
-
- push_monitor (&rombug_cmds);
- printf_monitor ("\r"); /* CR wakes up monitor */
- expect_prompt (1);
- push_target (&rombug_ops);
- attach_flag = 1;
-
- if (from_tty)
- printf ("Remote %s connected to %s\n", target_shortname,
- dev_name);
-
- rombug_fetch_registers ();
-
- printf_monitor ("ov e \r");
- expect_prompt (1);
- bufaddr = 0;
- buflen = 0;
-}
-
-/*
- * Close out all files and local state before this target loses control.
- */
-
-static void
-rombug_close (int quitting)
-{
- if (rombug_is_open)
- {
- serial_close (monitor_desc);
- monitor_desc = NULL;
- rombug_is_open = 0;
- }
-
- if (log_file)
- {
- if (ferror (log_file))
- fprintf_unfiltered (gdb_stderr, "Error writing log file.\n");
- if (fclose (log_file) != 0)
- fprintf_unfiltered (gdb_stderr, "Error closing log file.\n");
- log_file = 0;
- }
-}
-
-int
-rombug_link (char *mod_name, CORE_ADDR *text_reloc)
-{
- int i, j;
- unsigned long val;
- unsigned char b;
-
- printf_monitor ("l %s \r", mod_name);
- expect_prompt (1);
- printf_monitor (".r \r");
- expect (REG_DELIM, 1);
- for (i = 0; i <= 7; i++)
- {
- val = 0;
- for (j = 0; j < 4; j++)
- {
- get_hex_byte (&b);
- val = (val << 8) + b;
- }
- }
- expect_prompt (1);
- *text_reloc = val;
- return 1;
-}
-
-/* Terminate the open connection to the remote debugger.
- Use this when you want to detach and do something else
- with your gdb. */
-static void
-rombug_detach (int from_tty)
-{
- if (attach_flag)
- {
- printf_monitor (GO_CMD);
- attach_flag = 0;
- }
- pop_target (); /* calls rombug_close to do the real work */
- if (from_tty)
- printf ("Ending remote %s debugging\n", target_shortname);
-}
-
-/*
- * Tell the remote machine to resume.
- */
-static void
-rombug_resume (ptid_t ptid, int step, enum target_signal sig)
-{
- if (monitor_log)
- fprintf (log_file, "\nIn Resume (step=%d, sig=%d)\n", step, sig);
-
- if (step)
- {
- is_trace_mode = 1;
- printf_monitor (STEP_CMD);
- /* wait for the echo. **
- expect (STEP_CMD, 1);
- */
- }
- else
- {
- printf_monitor (GO_CMD);
- /* swallow the echo. **
- expect (GO_CMD, 1);
- */
- }
- bufaddr = 0;
- buflen = 0;
-}
-
-/*
- * Wait until the remote machine stops, then return,
- * storing status in status just as `wait' would.
- */
-
-static ptid *
-rombug_wait (ptid_t ptid, struct target_waitstatus *status)
-{
- int old_timeout = timeout;
- struct section_offsets *offs;
- CORE_ADDR addr, pc;
- struct obj_section *obj_sec;
-
- if (monitor_log)
- fputs ("\nIn wait ()", log_file);
-
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
-
- timeout = -1; /* Don't time out -- user program is running. */
- expect ("eax:", 0); /* output any message before register display */
- expect_prompt (1); /* Wait for prompt, outputting extraneous text */
-
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_TRAP;
- timeout = old_timeout;
- rombug_fetch_registers ();
- bufaddr = 0;
- buflen = 0;
- pc = read_register (PC_REGNUM);
- addr = read_register (DATABASE_REG);
- obj_sec = find_pc_section (pc);
- if (obj_sec != NULL)
- {
- if (obj_sec->objfile != symfile_objfile)
- new_symfile_objfile (obj_sec->objfile, 1, 0);
- offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
- memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
- offs->offsets[SECT_OFF_DATA (symfile_objfile)] = addr;
- offs->offsets[SECT_OFF_BSS (symfile_objfile)] = addr;
-
- objfile_relocate (symfile_objfile, offs);
- }
-
- return inferior_ptid;
-}
-
-/* Return the name of register number regno in the form input and output by
- monitor. Currently, register_names just happens to contain exactly what
- monitor wants. Lets take advantage of that just as long as possible! */
-
-static char *
-get_reg_name (int regno)
-{
- static char buf[50];
- char *p;
- char *b;
-
- b = buf;
-
- if (regno < 0)
- return ("");
-/*
- for (p = REGISTER_NAME (regno); *p; p++)
- *b++ = toupper(*p);
- *b = '\000';
- */
- p = (char *) REGISTER_NAME (regno);
- return p;
-/*
- return buf;
- */
-}
-
-/* read the remote registers into the block regs. */
-
-static void
-rombug_fetch_registers (void)
-{
- int regno, j, i;
- long val;
- unsigned char b;
-
- printf_monitor (GET_REG);
- expect ("eax:", 1);
- expect ("\n", 1);
- get_hex_regs (1, 0);
- get_hex_regs (1, 3);
- get_hex_regs (1, 1);
- get_hex_regs (1, 2);
- get_hex_regs (1, 6);
- get_hex_regs (1, 7);
- get_hex_regs (1, 5);
- get_hex_regs (1, 4);
- for (regno = 8; regno <= 15; regno++)
- {
- expect (REG_DELIM, 1);
- if (regno >= 8 && regno <= 13)
- {
- val = 0;
- for (j = 0; j < 2; j++)
- {
- get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- val = (val << 8) + b;
- else
- val = val + (b << (j * 8));
- }
-
- if (regno == 8)
- i = 10;
- if (regno >= 9 && regno <= 12)
- i = regno + 3;
- if (regno == 13)
- i = 11;
- supply_register (i, (char *) &val);
- }
- else if (regno == 14)
- {
- get_hex_regs (1, PC_REGNUM);
- }
- else if (regno == 15)
- {
- get_hex_regs (1, 9);
- }
- else
- {
- val = 0;
- supply_register (regno, (char *) &val);
- }
- }
- is_trace_mode = 0;
- expect_prompt (1);
-}
-
-/* Fetch register REGNO, or all registers if REGNO is -1.
- Returns errno value. */
-static void
-rombug_fetch_register (int regno)
-{
- int val, j;
- unsigned char b;
-
- if (monitor_log)
- {
- fprintf (log_file, "\nIn Fetch Register (reg=%s)\n", get_reg_name (regno));
- fflush (log_file);
- }
-
- if (regno < 0)
- {
- rombug_fetch_registers ();
- }
- else
- {
- char *name = get_reg_name (regno);
- printf_monitor (GET_REG);
- if (regno >= 10 && regno <= 15)
- {
- expect ("\n", 1);
- expect ("\n", 1);
- expect (name, 1);
- expect (REG_DELIM, 1);
- val = 0;
- for (j = 0; j < 2; j++)
- {
- get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- val = (val << 8) + b;
- else
- val = val + (b << (j * 8));
- }
- supply_register (regno, (char *) &val);
- }
- else if (regno == 8 || regno == 9)
- {
- expect ("\n", 1);
- expect ("\n", 1);
- expect ("\n", 1);
- expect (name, 1);
- expect (REG_DELIM, 1);
- get_hex_regs (1, regno);
- }
- else
- {
- expect (name, 1);
- expect (REG_DELIM, 1);
- expect ("\n", 1);
- get_hex_regs (1, 0);
- get_hex_regs (1, 3);
- get_hex_regs (1, 1);
- get_hex_regs (1, 2);
- get_hex_regs (1, 6);
- get_hex_regs (1, 7);
- get_hex_regs (1, 5);
- get_hex_regs (1, 4);
- }
- expect_prompt (1);
- }
- return;
-}
-
-/* Store the remote registers from the contents of the block REGS. */
-
-static void
-rombug_store_registers (void)
-{
- int regno;
-
- for (regno = 0; regno <= PC_REGNUM; regno++)
- rombug_store_register (regno);
-
- registers_changed ();
-}
-
-/* Store register REGNO, or all if REGNO == 0.
- return errno value. */
-static void
-rombug_store_register (int regno)
-{
- char *name;
-
- if (monitor_log)
- fprintf (log_file, "\nIn Store_register (regno=%d)\n", regno);
-
- if (regno == -1)
- rombug_store_registers ();
- else
- {
- if (sr_get_debug ())
- printf ("Setting register %s to 0x%x\n", get_reg_name (regno), read_register (regno));
-
- name = get_reg_name (regno);
- if (name == 0)
- return;
- printf_monitor (SET_REG, name, read_register (regno));
-
- is_trace_mode = 0;
- expect_prompt (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
- that registers contains all the registers from the program being
- debugged. */
-
-static void
-rombug_prepare_to_store (void)
-{
- /* Do nothing, since we can store individual regs */
-}
-
-static void
-rombug_files_info (void)
-{
- printf ("\tAttached to %s at %d baud.\n",
- dev_name, sr_get_baud_rate ());
-}
-
-/* Copy LEN bytes of data from debugger memory at MYADDR
- to inferior's memory at MEMADDR. Returns length moved. */
-static int
-rombug_write_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
-{
- int i;
- char buf[10];
-
- if (monitor_log)
- fprintf (log_file, "\nIn Write_inferior_memory (memaddr=%x, len=%d)\n", memaddr, len);
-
- printf_monitor (MEM_SET_CMD, memaddr);
- for (i = 0; i < len; i++)
- {
- expect (CMD_DELIM, 1);
- printf_monitor ("%x \r", myaddr[i]);
- if (sr_get_debug ())
- printf ("\nSet 0x%x to 0x%x\n", memaddr + i, myaddr[i]);
- }
- expect (CMD_DELIM, 1);
- if (CMD_END)
- printf_monitor (CMD_END);
- is_trace_mode = 0;
- expect_prompt (1);
-
- bufaddr = 0;
- buflen = 0;
- return len;
-}
-
-/* Read LEN bytes from inferior memory at MEMADDR. Put the result
- at debugger address MYADDR. Returns length moved. */
-static int
-rombug_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
-{
- int i, j;
-
- /* Number of bytes read so far. */
- int count;
-
- /* Starting address of this pass. */
- unsigned long startaddr;
-
- /* Number of bytes to read in this pass. */
- int len_this_pass;
-
- if (monitor_log)
- fprintf (log_file, "\nIn Read_inferior_memory (memaddr=%x, len=%d)\n", memaddr, len);
-
- /* Note that this code works correctly if startaddr is just less
- than UINT_MAX (well, really CORE_ADDR_MAX if there was such a
- thing). That is, something like
- rombug_read_bytes (CORE_ADDR_MAX - 4, foo, 4)
- works--it never adds len To memaddr and gets 0. */
- /* However, something like
- rombug_read_bytes (CORE_ADDR_MAX - 3, foo, 4)
- doesn't need to work. Detect it and give up if there's an attempt
- to do that. */
- if (((memaddr - 1) + len) < memaddr)
- {
- errno = EIO;
- return 0;
- }
- if (bufaddr <= memaddr && (memaddr + len) <= (bufaddr + buflen))
- {
- memcpy (myaddr, &readbuf[memaddr - bufaddr], len);
- return len;
- }
-
- startaddr = memaddr;
- count = 0;
- while (count < len)
- {
- len_this_pass = 16;
- if ((startaddr % 16) != 0)
- len_this_pass -= startaddr % 16;
- if (len_this_pass > (len - count))
- len_this_pass = (len - count);
- if (sr_get_debug ())
- printf ("\nDisplay %d bytes at %x\n", len_this_pass, startaddr);
-
- printf_monitor (MEM_DIS_CMD, startaddr, 8);
- expect ("- ", 1);
- for (i = 0; i < 16; i++)
- {
- get_hex_byte (&readbuf[i]);
- }
- bufaddr = startaddr;
- buflen = 16;
- memcpy (&myaddr[count], readbuf, len_this_pass);
- count += len_this_pass;
- startaddr += len_this_pass;
- expect (CMD_DELIM, 1);
- }
- if (CMD_END)
- printf_monitor (CMD_END);
- is_trace_mode = 0;
- expect_prompt (1);
-
- return len;
-}
-
-/* Transfer LEN bytes between GDB address MYADDR and target address
- MEMADDR. If WRITE is non-zero, transfer them to the target,
- otherwise transfer them from the target. TARGET is unused.
-
- Returns the number of bytes transferred. */
-
-static int
-rombug_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
- int write, struct mem_attrib *attrib,
- struct target_ops *target)
-{
- if (write)
- return rombug_write_inferior_memory (memaddr, myaddr, len);
- else
- return rombug_read_inferior_memory (memaddr, myaddr, len);
-}
-
-static void
-rombug_kill (char *args, int from_tty)
-{
- return; /* ignore attempts to kill target system */
-}
-
-/* Clean up when a program exits.
- The program actually lives on in the remote processor's RAM, and may be
- run again without a download. Don't leave it full of breakpoint
- instructions. */
-
-static void
-rombug_mourn_inferior (void)
-{
- remove_breakpoints ();
- generic_mourn_inferior (); /* Do all the proper things now */
-}
-
-#define MAX_MONITOR_BREAKPOINTS 16
-
-static CORE_ADDR breakaddr[MAX_MONITOR_BREAKPOINTS] =
-{0};
-
-static int
-rombug_insert_breakpoint (CORE_ADDR addr, char *shadow)
-{
- int i;
- CORE_ADDR bp_addr = addr;
- int bp_size = 0;
-
- if (monitor_log)
- fprintf (log_file, "\nIn Insert_breakpoint (addr=%x)\n", addr);
- BREAKPOINT_FROM_PC (&bp_addr, &bp_size);
-
- for (i = 0; i <= MAX_MONITOR_BREAKPOINTS; i++)
- if (breakaddr[i] == 0)
- {
- breakaddr[i] = addr;
- if (sr_get_debug ())
- printf ("Breakpoint at %x\n", addr);
- rombug_read_inferior_memory (bp_addr, shadow, bp_size);
- printf_monitor (SET_BREAK_CMD, addr);
- is_trace_mode = 0;
- expect_prompt (1);
- return 0;
- }
-
- fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for monitor\n");
- return 1;
-}
-
-/*
- * _remove_breakpoint -- Tell the monitor to remove a breakpoint
- */
-static int
-rombug_remove_breakpoint (CORE_ADDR addr, char *shadow)
-{
- int i;
-
- if (monitor_log)
- fprintf (log_file, "\nIn Remove_breakpoint (addr=%x)\n", addr);
-
- for (i = 0; i < MAX_MONITOR_BREAKPOINTS; i++)
- if (breakaddr[i] == addr)
- {
- breakaddr[i] = 0;
- printf_monitor (CLR_BREAK_CMD, addr);
- is_trace_mode = 0;
- expect_prompt (1);
- return 0;
- }
-
- fprintf_unfiltered (gdb_stderr,
- "Can't find breakpoint associated with 0x%x\n", addr);
- return 1;
-}
-
-/* Load a file. This is usually an srecord, which is ascii. No
- protocol, just sent line by line. */
-
-#define DOWNLOAD_LINE_SIZE 100
-static void
-rombug_load (char *arg)
-{
-/* this part comment out for os9* */
-#if 0
- FILE *download;
- char buf[DOWNLOAD_LINE_SIZE];
- int i, bytes_read;
-
- if (sr_get_debug ())
- printf ("Loading %s to monitor\n", arg);
-
- download = fopen (arg, "r");
- if (download == NULL)
- {
- error (sprintf (buf, "%s Does not exist", arg));
- return;
- }
-
- printf_monitor (LOAD_CMD);
-/* expect ("Waiting for S-records from host... ", 1); */
-
- while (!feof (download))
- {
- bytes_read = fread (buf, sizeof (char), DOWNLOAD_LINE_SIZE, download);
- if (hashmark)
- {
- putchar ('.');
- fflush (stdout);
- }
-
- if (serial_write (monitor_desc, buf, bytes_read))
- {
- fprintf_unfiltered (gdb_stderr,
- "serial_write failed: (while downloading) %s\n",
- safe_strerror (errno));
- break;
- }
- i = 0;
- while (i++ <= 200000)
- {
- }; /* Ugly HACK, probably needs flow control */
- if (bytes_read < DOWNLOAD_LINE_SIZE)
- {
- if (!feof (download))
- error ("Only read %d bytes\n", bytes_read);
- break;
- }
- }
-
- if (hashmark)
- {
- putchar ('\n');
- }
- if (!feof (download))
- error ("Never got EOF while downloading");
- fclose (download);
-#endif /* 0 */
-}
-
-/* Put a command string, in args, out to MONITOR.
- Output from MONITOR is placed on the users terminal until the prompt
- is seen. */
-
-static void
-rombug_command (char *args, int fromtty)
-{
- if (monitor_desc == NULL)
- error ("monitor target not open.");
-
- if (monitor_log)
- fprintf (log_file, "\nIn command (args=%s)\n", args);
-
- if (!args)
- error ("Missing command.");
-
- printf_monitor ("%s\r", args);
- expect_prompt (0);
-}
-
-#if 0
-/* Connect the user directly to MONITOR. This command acts just like the
- 'cu' or 'tip' command. Use <CR>~. or <CR>~^D to break out. */
-
-static struct ttystate ttystate;
-
-static void
-cleanup_tty (void)
-{
- printf ("\r\n[Exiting connect mode]\r\n");
- /*serial_restore(0, &ttystate); */
-}
-
-static void
-connect_command (char *args, int fromtty)
-{
- fd_set readfds;
- int numfds;
- int c;
- char cur_esc = 0;
-
- dont_repeat ();
-
- if (monitor_desc == NULL)
- error ("monitor target not open.");
-
- if (args)
- fprintf ("This command takes no args. They have been ignored.\n");
-
- printf ("[Entering connect mode. Use ~. or ~^D to escape]\n");
-
- serial_raw (0, &ttystate);
-
- make_cleanup (cleanup_tty, 0);
-
- FD_ZERO (&readfds);
-
- while (1)
- {
- do
- {
- FD_SET (0, &readfds);
- FD_SET (deprecated_serial_fd (monitor_desc), &readfds);
- numfds = select (sizeof (readfds) * 8, &readfds, 0, 0, 0);
- }
- while (numfds == 0);
-
- if (numfds < 0)
- perror_with_name ("select");
-
- if (FD_ISSET (0, &readfds))
- { /* tty input, send to monitor */
- c = getchar ();
- if (c < 0)
- perror_with_name ("connect");
-
- printf_monitor ("%c", c);
- switch (cur_esc)
- {
- case 0:
- if (c == '\r')
- cur_esc = c;
- break;
- case '\r':
- if (c == '~')
- cur_esc = c;
- else
- cur_esc = 0;
- break;
- case '~':
- if (c == '.' || c == '\004')
- return;
- else
- cur_esc = 0;
- }
- }
-
- if (FD_ISSET (deprecated_serial_fd (monitor_desc), &readfds))
- {
- while (1)
- {
- c = readchar (0);
- if (c < 0)
- break;
- putchar (c);
- }
- fflush (stdout);
- }
- }
-}
-#endif
-
-/*
- * Define the monitor command strings. Since these are passed directly
- * through to a printf style function, we need can include formatting
- * strings. We also need a CR or LF on the end.
- */
-#warning FIXME: monitor interface pattern strings, stale struct decl
-struct monitor_ops rombug_cmds =
-{
- "g \r", /* execute or usually GO command */
- "g \r", /* continue command */
- "t \r", /* single step */
- "b %x\r", /* set a breakpoint */
- "k %x\r", /* clear a breakpoint */
- "c %x\r", /* set memory to a value */
- "d %x %d\r", /* display memory */
- "$%08X", /* prompt memory commands use */
- ".%s %x\r", /* set a register */
- ":", /* delimiter between registers */
- ". \r", /* read a register */
- "mf \r", /* download command */
- "RomBug: ", /* monitor command prompt */
- ": ", /* end-of-command delimitor */
- ".\r" /* optional command terminator */
-};
-
-struct target_ops rombug_ops;
-
-static void
-init_rombug_ops (void)
-{
- rombug_ops.to_shortname = "rombug";
- rombug_ops.to_longname = "Microware's ROMBUG debug monitor";
- rombug_ops.to_doc = "Use a remote computer running the ROMBUG debug monitor.\n\
-Specify the serial device it is connected to (e.g. /dev/ttya).",
- rombug_ops.to_open = rombug_open;
- rombug_ops.to_close = rombug_close;
- rombug_ops.to_attach = 0;
- rombug_ops.to_post_attach = NULL;
- rombug_ops.to_require_attach = NULL;
- rombug_ops.to_detach = rombug_detach;
- rombug_ops.to_require_detach = NULL;
- rombug_ops.to_resume = rombug_resume;
- rombug_ops.to_wait = rombug_wait;
- rombug_ops.to_post_wait = NULL;
- rombug_ops.to_fetch_registers = rombug_fetch_register;
- rombug_ops.to_store_registers = rombug_store_register;
- rombug_ops.to_prepare_to_store = rombug_prepare_to_store;
- rombug_ops.to_xfer_memory = rombug_xfer_inferior_memory;
- rombug_ops.to_files_info = rombug_files_info;
- rombug_ops.to_insert_breakpoint = rombug_insert_breakpoint;
- rombug_ops.to_remove_breakpoint = rombug_remove_breakpoint; /* Breakpoints */
- rombug_ops.to_terminal_init = 0;
- rombug_ops.to_terminal_inferior = 0;
- rombug_ops.to_terminal_ours_for_output = 0;
- rombug_ops.to_terminal_ours = 0;
- rombug_ops.to_terminal_info = 0; /* Terminal handling */
- rombug_ops.to_kill = rombug_kill;
- rombug_ops.to_load = rombug_load; /* load */
- rombug_ops.to_lookup_symbol = rombug_link; /* lookup_symbol */
- rombug_ops.to_create_inferior = rombug_create_inferior;
- rombug_ops.to_post_startup_inferior = NULL;
- rombug_ops.to_acknowledge_created_inferior = NULL;
- rombug_ops.to_clone_and_follow_inferior = NULL;
- rombug_ops.to_post_follow_inferior_by_clone = NULL;
- rombug_ops.to_insert_fork_catchpoint = NULL;
- rombug_ops.to_remove_fork_catchpoint = NULL;
- rombug_ops.to_insert_vfork_catchpoint = NULL;
- rombug_ops.to_remove_vfork_catchpoint = NULL;
- rombug_ops.to_has_forked = NULL;
- rombug_ops.to_has_vforked = NULL;
- rombug_ops.to_can_follow_vfork_prior_to_exec = NULL;
- rombug_ops.to_post_follow_vfork = NULL;
- rombug_ops.to_insert_exec_catchpoint = NULL;
- rombug_ops.to_remove_exec_catchpoint = NULL;
- rombug_ops.to_has_execd = NULL;
- rombug_ops.to_reported_exec_events_per_exec_call = NULL;
- rombug_ops.to_has_exited = NULL;
- rombug_ops.to_mourn_inferior = rombug_mourn_inferior;
- rombug_ops.to_can_run = 0; /* can_run */
- rombug_ops.to_notice_signals = 0; /* notice_signals */
- rombug_ops.to_thread_alive = 0;
- rombug_ops.to_stop = 0; /* to_stop */
- rombug_ops.to_pid_to_exec_file = NULL;
- rombug_ops.to_stratum = process_stratum;
- rombug_ops.DONT_USE = 0; /* next */
- rombug_ops.to_has_all_memory = 1;
- rombug_ops.to_has_memory = 1;
- rombug_ops.to_has_stack = 1;
- rombug_ops.to_has_registers = 1;
- rombug_ops.to_has_execution = 1; /* has execution */
- rombug_ops.to_sections = 0;
- rombug_ops.to_sections_end = 0; /* Section pointers */
- rombug_ops.to_magic = OPS_MAGIC; /* Always the last thing */
-}
-
-void
-_initialize_remote_os9k (void)
-{
- init_rombug_ops ();
- add_target (&rombug_ops);
-
- add_show_from_set (
- add_set_cmd ("hash", no_class, var_boolean, (char *) &hashmark,
- "Set display of activity while downloading a file.\nWhen enabled, a period \'.\' is displayed.",
- &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("timeout", no_class, var_zinteger,
- (char *) &timeout,
- "Set timeout in seconds for remote MIPS serial I/O.",
- &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("remotelog", no_class, var_zinteger,
- (char *) &monitor_log,
- "Set monitor activity log on(=1) or off(=0).",
- &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("remotexon", no_class, var_zinteger,
- (char *) &tty_xon,
- "Set remote tty line XON control",
- &setlist),
- &showlist);
-
- add_show_from_set (
- add_set_cmd ("remotexoff", no_class, var_zinteger,
- (char *) &tty_xoff,
- "Set remote tty line XOFF control",
- &setlist),
- &showlist);
-
- add_com ("rombug <command>", class_obscure, rombug_command,
- "Send a command to the debug monitor.");
-#if 0
- add_com ("connect", class_obscure, connect_command,
- "Connect the terminal directly up to a serial based command monitor.\nUse <CR>~. or <CR>~^D to break out.");
-#endif
-}
+// 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 <sys/types.h>
+// 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 <CR>~. or <CR>~^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 <command>", 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 <CR>~. or <CR>~^D to break out.");
+// OBSOLETE #endif
+// OBSOLETE }
diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c
index 5243f9bd28f..228e3d98c37 100644
--- a/gdb/remote-rdi.c
+++ b/gdb/remote-rdi.c
@@ -1041,24 +1041,24 @@ _initialize_remote_rdi (void)
"Withough an argument, it will display current state.\n",
&maintenancelist);
- add_show_from_set
- (add_set_boolean_cmd
- ("rdiromatzero", no_class, &rom_at_zero,
- "Set target has ROM at addr 0.\n"
- "A true value disables vector catching, false enables vector catching.\n"
- "This is evaluated at the time the 'target rdi' command is executed\n",
- &setlist),
- &showlist);
-
- add_show_from_set
- (add_set_boolean_cmd
- ("rdiheartbeat", no_class, &rdi_heartbeat,
- "Set enable for ADP heartbeat packets.\n"
- "I don't know why you would want this. If you enable them,\n"
- "it will confuse ARM and EPI JTAG interface boxes as well\n"
- "as the Angel Monitor.\n",
- &setlist),
- &showlist);
+ add_setshow_boolean_cmd
+ ("rdiromatzero", no_class, &rom_at_zero,
+ "Set target has ROM at addr 0.\n"
+ "A true value disables vector catching, false enables vector catching.\n"
+ "This is evaluated at the time the 'target rdi' command is executed\n",
+ "Show if target has ROM at addr 0.\n",
+ NULL, NULL,
+ &setlist, &showlist);
+
+ add_setshow_boolean_cmd
+ ("rdiheartbeat", no_class, &rdi_heartbeat,
+ "Set enable for ADP heartbeat packets.\n"
+ "I don't know why you would want this. If you enable them,\n"
+ "it will confuse ARM and EPI JTAG interface boxes as well\n"
+ "as the Angel Monitor.\n",
+ "Show enable for ADP heartbeat packets.\n",
+ NULL, NULL,
+ &setlist, &showlist);
}
/* A little dummy to make linking with the library succeed. */
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 280e79cdad4..34a42abb1fa 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -41,7 +41,7 @@
#include "defs.h"
#include "inferior.h"
#include "value.h"
-#include "callback.h"
+#include "gdb/callback.h"
#include "command.h"
#include <ctype.h>
#include <fcntl.h>
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 1d037c8fa79..221efe45674 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -35,11 +35,13 @@
#include "terminal.h"
#include "target.h"
#include "gdbcore.h"
-#include "callback.h"
-#include "remote-sim.h"
+#include "gdb/callback.h"
+#include "gdb/remote-sim.h"
#include "remote-utils.h"
#include "command.h"
#include "regcache.h"
+#include "gdb_assert.h"
+#include "sim-regno.h"
/* Prototypes */
@@ -276,46 +278,72 @@ gdb_os_error (host_callback * p, const char *format,...)
}
}
+int
+one2one_register_sim_regno (int regnum)
+{
+ /* Only makes sense to supply raw registers. */
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS);
+ return regnum;
+}
+
static void
gdbsim_fetch_register (int regno)
{
- static int warn_user = 1;
if (regno == -1)
{
for (regno = 0; regno < NUM_REGS; regno++)
gdbsim_fetch_register (regno);
+ return;
}
- else if (REGISTER_NAME (regno) != NULL
- && *REGISTER_NAME (regno) != '\0')
+
+ switch (REGISTER_SIM_REGNO (regno))
{
- char buf[MAX_REGISTER_RAW_SIZE];
- int nr_bytes;
- if (REGISTER_SIM_REGNO (regno) >= 0)
+ case LEGACY_SIM_REGNO_IGNORE:
+ break;
+ case SIM_REGNO_DOES_NOT_EXIST:
+ {
+ /* For moment treat a `does not exist' register the same way
+ as an ``unavailable'' register. */
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ int nr_bytes;
+ memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ supply_register (regno, buf);
+ set_register_cached (regno, -1);
+ break;
+ }
+ default:
+ {
+ static int warn_user = 1;
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ int nr_bytes;
+ gdb_assert (regno >= 0 && regno < NUM_REGS);
+ memset (buf, 0, MAX_REGISTER_RAW_SIZE);
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
buf, REGISTER_RAW_SIZE (regno));
- else
- nr_bytes = 0;
- if (nr_bytes == 0)
- /* register not applicable, supply zero's */
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
- else if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)
- && warn_user)
- {
- fprintf_unfiltered (gdb_stderr,
- "Size of register %s (%d/%d) incorrect (%d instead of %d))",
- REGISTER_NAME (regno),
- regno, REGISTER_SIM_REGNO (regno),
- nr_bytes, REGISTER_RAW_SIZE (regno));
- warn_user = 0;
- }
- supply_register (regno, buf);
- if (sr_get_debug ())
- {
- printf_filtered ("gdbsim_fetch_register: %d", regno);
- /* FIXME: We could print something more intelligible. */
- dump_mem (buf, REGISTER_RAW_SIZE (regno));
- }
+ if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno) && warn_user)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "Size of register %s (%d/%d) incorrect (%d instead of %d))",
+ REGISTER_NAME (regno),
+ regno, REGISTER_SIM_REGNO (regno),
+ nr_bytes, REGISTER_RAW_SIZE (regno));
+ warn_user = 0;
+ }
+ /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
+ indicatingthat GDB and the SIM have different ideas about
+ which registers are fetchable. */
+ /* Else if (nr_bytes < 0): an old simulator, that doesn't
+ think to return the register size. Just assume all is ok. */
+ supply_register (regno, buf);
+ if (sr_get_debug ())
+ {
+ printf_filtered ("gdbsim_fetch_register: %d", regno);
+ /* FIXME: We could print something more intelligible. */
+ dump_mem (buf, REGISTER_RAW_SIZE (regno));
+ }
+ break;
+ }
}
}
@@ -327,10 +355,9 @@ gdbsim_store_register (int regno)
{
for (regno = 0; regno < NUM_REGS; regno++)
gdbsim_store_register (regno);
+ return;
}
- else if (REGISTER_NAME (regno) != NULL
- && *REGISTER_NAME (regno) != '\0'
- && REGISTER_SIM_REGNO (regno) >= 0)
+ else if (REGISTER_SIM_REGNO (regno) >= 0)
{
char tmp[MAX_REGISTER_RAW_SIZE];
int nr_bytes;
@@ -341,6 +368,9 @@ gdbsim_store_register (int regno)
if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno))
internal_error (__FILE__, __LINE__,
"Register size different to expected");
+ /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
+ indicatingthat GDB and the SIM have different ideas about
+ which registers are fetchable. */
if (sr_get_debug ())
{
printf_filtered ("gdbsim_store_register: %d", regno);
diff --git a/gdb/remote-vx29k.c b/gdb/remote-vx29k.c
deleted file mode 100644
index 798cd088396..00000000000
--- a/gdb/remote-vx29k.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Am29k-dependent portions of the RPC protocol
-
- Contributed by Wind River Systems.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-
-#include "vx-share/regPacket.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-#ifdef _AIX /* IBM claims "void *malloc()" not char * */
-#define malloc bogon_malloc
-#endif
-
-#include <rpc/rpc.h>
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-/* Flag set if target has fpu */
-
-extern int target_has_fp;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target.
- REGNO is the register to read, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_read_register (int regno)
-{
- char am29k_greg_packet[AM29K_GREG_PLEN];
- char am29k_fpreg_packet[AM29K_FPREG_PLEN];
-
- /* Get general-purpose registers. When copying values into
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- net_read_registers (am29k_greg_packet, AM29K_GREG_PLEN, PTRACE_GETREGS);
-
- /* Now copy the register values into registers[].
- Note that this code depends on the ordering of the REGNUMs
- as defined in "tm-29k.h". */
-
- bcopy (&am29k_greg_packet[AM29K_R_GR96],
- &registers[REGISTER_BYTE (GR96_REGNUM)], 160 * AM29K_GREG_SIZE);
- bcopy (&am29k_greg_packet[AM29K_R_VAB],
- &registers[REGISTER_BYTE (VAB_REGNUM)], 15 * AM29K_GREG_SIZE);
- registers[REGISTER_BYTE (INTE_REGNUM)] = am29k_greg_packet[AM29K_R_INTE];
- bcopy (&am29k_greg_packet[AM29K_R_RSP],
- &registers[REGISTER_BYTE (GR1_REGNUM)], 5 * AM29K_GREG_SIZE);
-
- /* PAD For now, don't care about exop register */
-
- memset (&registers[REGISTER_BYTE (EXO_REGNUM)], '\0', AM29K_GREG_SIZE);
-
- /* If the target has floating point registers, fetch them.
- Otherwise, zero the floating point register values in
- registers[] for good measure, even though we might not
- need to. */
-
- if (target_has_fp)
- {
- net_read_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
- PTRACE_GETFPREGS);
- registers[REGISTER_BYTE (FPE_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPE];
- registers[REGISTER_BYTE (FPS_REGNUM)] = am29k_fpreg_packet[AM29K_R_FPS];
-
- /* PAD For now, don't care about registers (?) AI0 to q */
-
- memset (&registers[REGISTER_BYTE (161)], '\0', 21 * AM29K_FPREG_SIZE);
- }
- else
- {
- memset (&registers[REGISTER_BYTE (FPE_REGNUM)], '\0', AM29K_FPREG_SIZE);
- memset (&registers[REGISTER_BYTE (FPS_REGNUM)], '\0', AM29K_FPREG_SIZE);
-
- /* PAD For now, don't care about registers (?) AI0 to q */
-
- memset (&registers[REGISTER_BYTE (161)], '\0', 21 * AM29K_FPREG_SIZE);
- }
-
- /* Mark the register cache valid. */
-
- registers_fetched ();
-}
-
-/* Store a register or registers into the VxWorks target.
- REGNO is the register to store, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_write_register (int regno)
-{
- char am29k_greg_packet[AM29K_GREG_PLEN];
- char am29k_fpreg_packet[AM29K_FPREG_PLEN];
-
- /* Store general purpose registers. When copying values from
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- bcopy (&registers[REGISTER_BYTE (GR96_REGNUM)],
- &am29k_greg_packet[AM29K_R_GR96], 160 * AM29K_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (VAB_REGNUM)],
- &am29k_greg_packet[AM29K_R_VAB], 15 * AM29K_GREG_SIZE);
- am29k_greg_packet[AM29K_R_INTE] = registers[REGISTER_BYTE (INTE_REGNUM)];
- bcopy (&registers[REGISTER_BYTE (GR1_REGNUM)],
- &am29k_greg_packet[AM29K_R_RSP], 5 * AM29K_GREG_SIZE);
-
- net_write_registers (am29k_greg_packet, AM29K_GREG_PLEN, PTRACE_SETREGS);
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
- am29k_fpreg_packet[AM29K_R_FPE] = registers[REGISTER_BYTE (FPE_REGNUM)];
- am29k_fpreg_packet[AM29K_R_FPS] = registers[REGISTER_BYTE (FPS_REGNUM)];
-
- net_write_registers (am29k_fpreg_packet, AM29K_FPREG_PLEN,
- PTRACE_SETFPREGS);
- }
-}
-
-/* VxWorks zeroes fp when the task is initialized; we use this
- to terminate the frame chain. Chain means here the nominal address of
- a frame, that is, the return address (lr0) address in the stack. To
- obtain the frame pointer (lr1) contents, we must add 4 bytes.
- Note : may be we should modify init_frame_info() to get the frame pointer
- and store it into the frame_info struct rather than reading its
- contents when FRAME_CHAIN_VALID is invoked. THISFRAME is unused. */
-
-int
-vx29k_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- int fp_contents;
-
- read_memory ((CORE_ADDR) (chain + 4), (char *) &fp_contents, 4);
- return (fp_contents != 0);
-}
diff --git a/gdb/remote-vx960.c b/gdb/remote-vx960.c
index 08568bc4ca6..87435da259f 100644
--- a/gdb/remote-vx960.c
+++ b/gdb/remote-vx960.c
@@ -1,160 +1,160 @@
-/* i80960-dependent portions of the RPC protocol
- used with a VxWorks target
-
- Contributed by Wind River Systems.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include "defs.h"
-
-#include "vx-share/regPacket.h"
-#include "frame.h"
-#include "inferior.h"
-#include "target.h"
-#include "gdbcore.h"
-#include "command.h"
-#include "symtab.h"
-#include "symfile.h" /* for struct complaint */
-#include "regcache.h"
-
-#include "gdb_string.h"
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-
-#ifdef _AIX /* IBM claims "void *malloc()" not char * */
-#define malloc bogon_malloc
-#endif
-
-#include <rpc/rpc.h>
-#include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
-#include <netdb.h>
-#include "vx-share/ptrace.h"
-#include "vx-share/xdr_ptrace.h"
-#include "vx-share/xdr_ld.h"
-#include "vx-share/xdr_rdb.h"
-#include "vx-share/dbgRpcLib.h"
-
-/* get rid of value.h if possible */
-#include <value.h>
-#include <symtab.h>
-
-/* Flag set if target has fpu */
-
-extern int target_has_fp;
-
-/* 960 floating point format descriptor, from "i960-tdep.c." */
-
-extern struct ext_format ext_format_i960;
-
-/* Generic register read/write routines in remote-vx.c. */
-
-extern void net_read_registers ();
-extern void net_write_registers ();
-
-/* Read a register or registers from the VxWorks target.
- REGNO is the register to read, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_read_register (int regno)
-{
- char i960_greg_packet[I960_GREG_PLEN];
- char i960_fpreg_packet[I960_FPREG_PLEN];
-
- /* Get general-purpose registers. When copying values into
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- net_read_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_GETREGS);
-
- bcopy (&i960_greg_packet[I960_R_R0],
- &registers[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE);
- bcopy (&i960_greg_packet[I960_R_G0],
- &registers[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE);
- bcopy (&i960_greg_packet[I960_R_PCW],
- &registers[REGISTER_BYTE (PCW_REGNUM)], sizeof (int));
- bcopy (&i960_greg_packet[I960_R_ACW],
- &registers[REGISTER_BYTE (ACW_REGNUM)], sizeof (int));
- bcopy (&i960_greg_packet[I960_R_TCW],
- &registers[REGISTER_BYTE (TCW_REGNUM)], sizeof (int));
-
- /* If the target has floating point registers, fetch them.
- Otherwise, zero the floating point register values in
- registers[] for good measure, even though we might not
- need to. */
-
- if (target_has_fp)
- {
- net_read_registers (i960_fpreg_packet, I960_FPREG_PLEN,
- PTRACE_GETFPREGS);
- bcopy (&i960_fpreg_packet[I960_R_FP0],
- &registers[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
- }
- else
- bzero (&registers[REGISTER_BYTE (FP0_REGNUM)],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
-
- /* Mark the register cache valid. */
-
- registers_fetched ();
-}
-
-/* Store a register or registers into the VxWorks target.
- REGNO is the register to store, or -1 for all; currently,
- it is ignored. FIXME look at regno to improve efficiency. */
-
-void
-vx_write_register (int regno)
-{
- char i960_greg_packet[I960_GREG_PLEN];
- char i960_fpreg_packet[I960_FPREG_PLEN];
-
- /* Store floating-point registers. When copying values from
- registers [], don't assume that a location in registers []
- is properly aligned for the target data type. */
-
- bcopy (&registers[REGISTER_BYTE (R0_REGNUM)],
- &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (G0_REGNUM)],
- &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE);
- bcopy (&registers[REGISTER_BYTE (PCW_REGNUM)],
- &i960_greg_packet[I960_R_PCW], sizeof (int));
- bcopy (&registers[REGISTER_BYTE (ACW_REGNUM)],
- &i960_greg_packet[I960_R_ACW], sizeof (int));
- bcopy (&registers[REGISTER_BYTE (TCW_REGNUM)],
- &i960_greg_packet[I960_R_TCW], sizeof (int));
-
- net_write_registers (i960_greg_packet, I960_GREG_PLEN, PTRACE_SETREGS);
-
- /* Store floating point registers if the target has them. */
-
- if (target_has_fp)
- {
- bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)],
- &i960_fpreg_packet[I960_R_FP0],
- REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
-
- net_write_registers (i960_fpreg_packet, I960_FPREG_PLEN,
- PTRACE_SETFPREGS);
- }
-}
+// 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 <stdio.h>
+// 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 <errno.h>
+// OBSOLETE #include <fcntl.h>
+// OBSOLETE #include <sys/types.h>
+// OBSOLETE #include <sys/time.h>
+// OBSOLETE #include <sys/socket.h>
+// OBSOLETE
+// OBSOLETE #ifdef _AIX /* IBM claims "void *malloc()" not char * */
+// OBSOLETE #define malloc bogon_malloc
+// OBSOLETE #endif
+// OBSOLETE
+// OBSOLETE #include <rpc/rpc.h>
+// OBSOLETE #include <sys/time.h> /* UTek's <rpc/rpc.h> doesn't #incl this */
+// OBSOLETE #include <netdb.h>
+// 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 <value.h>
+// OBSOLETE #include <symtab.h>
+// 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 &registers[REGISTER_BYTE (R0_REGNUM)], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_G0],
+// OBSOLETE &registers[REGISTER_BYTE (G0_REGNUM)], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_PCW],
+// OBSOLETE &registers[REGISTER_BYTE (PCW_REGNUM)], sizeof (int));
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_ACW],
+// OBSOLETE &registers[REGISTER_BYTE (ACW_REGNUM)], sizeof (int));
+// OBSOLETE bcopy (&i960_greg_packet[I960_R_TCW],
+// OBSOLETE &registers[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 &registers[REGISTER_BYTE (FP0_REGNUM)],
+// OBSOLETE REGISTER_RAW_SIZE (FP0_REGNUM) * 4);
+// OBSOLETE }
+// OBSOLETE else
+// OBSOLETE bzero (&registers[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 (&registers[REGISTER_BYTE (R0_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_R0], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&registers[REGISTER_BYTE (G0_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_G0], 16 * I960_GREG_SIZE);
+// OBSOLETE bcopy (&registers[REGISTER_BYTE (PCW_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_PCW], sizeof (int));
+// OBSOLETE bcopy (&registers[REGISTER_BYTE (ACW_REGNUM)],
+// OBSOLETE &i960_greg_packet[I960_R_ACW], sizeof (int));
+// OBSOLETE bcopy (&registers[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 (&registers[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/remote.c b/gdb/remote.c
index a1b90b7a5a4..1584d6bc7d4 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -94,9 +94,8 @@ static void remote_async_open (char *name, int from_tty);
static void extended_remote_open (char *name, int from_tty);
static void extended_remote_async_open (char *name, int from_tty);
-static void remote_open_1 (char *, int, struct target_ops *, int extended_p);
-static void remote_async_open_1 (char *, int, struct target_ops *,
- int extended_p);
+static void remote_open_1 (char *, int, struct target_ops *, int extended_p,
+ int async_p);
static void remote_close (int quitting);
@@ -205,10 +204,6 @@ static void show_packet_config_cmd (struct packet_config *config);
static void update_packet_config (struct packet_config *config);
-/* Define the target subroutine names */
-
-void open_remote_target (char *, int, struct target_ops *, int);
-
void _initialize_remote (void);
/* Description of the remote protocol. Strictly speaking, when the
@@ -250,11 +245,12 @@ struct remote_state
long remote_packet_size;
};
+
/* Handle for retreving the remote protocol data from gdbarch. */
static struct gdbarch_data *remote_gdbarch_data_handle;
static struct remote_state *
-get_remote_state ()
+get_remote_state (void)
{
return gdbarch_data (current_gdbarch, remote_gdbarch_data_handle);
}
@@ -340,7 +336,17 @@ packet_reg_from_pnum (struct remote_state *rs, LONGEST pnum)
return NULL;
}
-/* */
+/* FIXME: graces/2002-08-08: These variables should eventually be
+ bound to an instance of the target object (as in gdbarch-tdep()),
+ when such a thing exists. */
+
+/* This is set to the data address of the access causing the target
+ to stop for a watchpoint. */
+static CORE_ADDR remote_watch_data_address;
+
+/* This is non-zero if taregt stopped for a watchpoint. */
+static int remote_stopped_by_watchpoint_p;
+
static struct target_ops remote_ops;
@@ -583,7 +589,7 @@ struct packet_config
{
char *name;
char *title;
- enum cmd_auto_boolean detect;
+ enum auto_boolean detect;
enum packet_support support;
};
@@ -602,13 +608,13 @@ update_packet_config (struct packet_config *config)
{
switch (config->detect)
{
- case CMD_AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_TRUE:
config->support = PACKET_ENABLE;
break;
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_FALSE:
config->support = PACKET_DISABLE;
break;
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
config->support = PACKET_SUPPORT_UNKNOWN;
break;
}
@@ -632,12 +638,12 @@ show_packet_config_cmd (struct packet_config *config)
}
switch (config->detect)
{
- case CMD_AUTO_BOOLEAN_AUTO:
+ case AUTO_BOOLEAN_AUTO:
printf_filtered ("Support for remote protocol `%s' (%s) packet is auto-detected, currently %s.\n",
config->name, config->title, support);
break;
- case CMD_AUTO_BOOLEAN_TRUE:
- case CMD_AUTO_BOOLEAN_FALSE:
+ case AUTO_BOOLEAN_TRUE:
+ case AUTO_BOOLEAN_FALSE:
printf_filtered ("Support for remote protocol `%s' (%s) packet is currently %s.\n",
config->name, config->title, support);
break;
@@ -648,11 +654,8 @@ static void
add_packet_config_cmd (struct packet_config *config,
char *name,
char *title,
- void (*set_func) (char *args, int from_tty,
- struct cmd_list_element *
- c),
- void (*show_func) (char *name,
- int from_tty),
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_remote_list,
struct cmd_list_element **show_remote_list,
int legacy)
@@ -664,7 +667,7 @@ add_packet_config_cmd (struct packet_config *config,
char *cmd_name;
config->name = name;
config->title = title;
- config->detect = CMD_AUTO_BOOLEAN_AUTO;
+ config->detect = AUTO_BOOLEAN_AUTO;
config->support = PACKET_SUPPORT_UNKNOWN;
xasprintf (&set_doc, "Set use of remote protocol `%s' (%s) packet",
name, title);
@@ -672,12 +675,10 @@ add_packet_config_cmd (struct packet_config *config,
name, title);
/* set/show TITLE-packet {auto,on,off} */
xasprintf (&cmd_name, "%s-packet", title);
- set_cmd = add_set_auto_boolean_cmd (cmd_name, class_obscure,
- &config->detect, set_doc,
- set_remote_list);
- set_cmd_sfunc (set_cmd, set_func);
- show_cmd = add_cmd (cmd_name, class_obscure, show_func, show_doc,
- show_remote_list);
+ add_setshow_auto_boolean_cmd (cmd_name, class_obscure,
+ &config->detect, set_doc, show_doc,
+ set_func, show_func,
+ set_remote_list, show_remote_list);
/* set/show remote NAME-packet {auto,on,off} -- legacy */
if (legacy)
{
@@ -730,7 +731,7 @@ packet_ok (const char *buf, struct packet_config *config)
switch (config->support)
{
case PACKET_ENABLE:
- if (config->detect == CMD_AUTO_BOOLEAN_AUTO)
+ if (config->detect == AUTO_BOOLEAN_AUTO)
/* If the stub previously indicated that the packet was
supported then there is a protocol error.. */
error ("Protocol error: %s (%s) conflicting enabled responses.",
@@ -765,7 +766,8 @@ set_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty)
+show_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_qSymbol);
}
@@ -781,7 +783,8 @@ set_remote_protocol_e_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_e_packet_cmd (char *args, int from_tty)
+show_remote_protocol_e_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_e);
}
@@ -798,7 +801,8 @@ set_remote_protocol_E_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_E_packet_cmd (char *args, int from_tty)
+show_remote_protocol_E_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_E);
}
@@ -816,7 +820,8 @@ set_remote_protocol_P_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_P_packet_cmd (char *args, int from_tty)
+show_remote_protocol_P_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_P);
}
@@ -846,7 +851,8 @@ set_remote_protocol_Z_software_bp_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_software_bp_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_software_bp_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_SOFTWARE_BP]);
}
@@ -859,7 +865,8 @@ set_remote_protocol_Z_hardware_bp_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_hardware_bp_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_hardware_bp_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_HARDWARE_BP]);
}
@@ -872,7 +879,8 @@ set_remote_protocol_Z_write_wp_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_write_wp_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_write_wp_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_WRITE_WP]);
}
@@ -885,7 +893,8 @@ set_remote_protocol_Z_read_wp_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_read_wp_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_read_wp_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_READ_WP]);
}
@@ -898,7 +907,8 @@ set_remote_protocol_Z_access_wp_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_access_wp_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_access_wp_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_ACCESS_WP]);
}
@@ -906,7 +916,7 @@ show_remote_protocol_Z_access_wp_packet_cmd (char *args, int from_tty)
/* For compatibility with older distributions. Provide a ``set remote
Z-packet ...'' command that updates all the Z packet types. */
-static enum cmd_auto_boolean remote_Z_packet_detect;
+static enum auto_boolean remote_Z_packet_detect;
static void
set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
@@ -921,7 +931,8 @@ set_remote_protocol_Z_packet_cmd (char *args, int from_tty,
}
static void
-show_remote_protocol_Z_packet_cmd (char *args, int from_tty)
+show_remote_protocol_Z_packet_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
int i;
for (i = 0; i < NR_Z_PACKET_TYPES; i++)
@@ -962,8 +973,8 @@ set_remote_protocol_binary_download_cmd (char *args,
}
static void
-show_remote_protocol_binary_download_cmd (char *args,
- int from_tty)
+show_remote_protocol_binary_download_cmd (char *args, int from_tty,
+ struct cmd_list_element *c)
{
show_packet_config_cmd (&remote_protocol_binary_download);
}
@@ -1102,7 +1113,7 @@ struct gdb_ext_thread_info
#define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES*2)
-char *unpack_varlen_hex (char *buff, int *result);
+char *unpack_varlen_hex (char *buff, ULONGEST *result);
static char *unpack_nibble (char *buf, int *val);
@@ -1223,7 +1234,7 @@ stub_unpack_int (char *buff, int fieldlength)
char *
unpack_varlen_hex (char *buff, /* packet to parse */
- int *result)
+ ULONGEST *result)
{
int nibble;
int retval = 0;
@@ -2144,14 +2155,14 @@ remote_start_remote (struct ui_out *uiout, void *dummy)
static void
remote_open (char *name, int from_tty)
{
- remote_open_1 (name, from_tty, &remote_ops, 0);
+ remote_open_1 (name, from_tty, &remote_ops, 0, 0);
}
/* Just like remote_open, but with asynchronous support. */
static void
remote_async_open (char *name, int from_tty)
{
- remote_async_open_1 (name, from_tty, &remote_async_ops, 0);
+ remote_open_1 (name, from_tty, &remote_async_ops, 0, 1);
}
/* Open a connection to a remote debugger using the extended
@@ -2160,14 +2171,16 @@ remote_async_open (char *name, int from_tty)
static void
extended_remote_open (char *name, int from_tty)
{
- remote_open_1 (name, from_tty, &extended_remote_ops, 1 /*extended_p */ );
+ remote_open_1 (name, from_tty, &extended_remote_ops, 1 /*extended_p */,
+ 0 /* async_p */);
}
/* Just like extended_remote_open, but with asynchronous support. */
static void
extended_remote_async_open (char *name, int from_tty)
{
- remote_async_open_1 (name, from_tty, &extended_async_remote_ops, 1 /*extended_p */ );
+ remote_open_1 (name, from_tty, &extended_async_remote_ops,
+ 1 /*extended_p */, 1 /* async_p */);
}
/* Generic code for opening a connection to a remote target. */
@@ -2248,7 +2261,7 @@ remote_serial_open (char *name)
static void
remote_open_1 (char *name, int from_tty, struct target_ops *target,
- int extended_p)
+ int extended_p, int async_p)
{
int ex;
struct remote_state *rs = get_remote_state ();
@@ -2258,7 +2271,8 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
"(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).");
/* See FIXME above */
- wait_forever_enabled_p = 1;
+ if (!async_p)
+ wait_forever_enabled_p = 1;
target_preopen (from_tty);
@@ -2308,6 +2322,22 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
someday have a notion of debugging several processes. */
inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
+
+ if (async_p)
+ {
+ /* With this target we start out by owning the terminal. */
+ remote_async_terminal_ours_p = 1;
+
+ /* FIXME: cagney/1999-09-23: During the initial connection it is
+ assumed that the target is already ready and able to respond to
+ requests. Unfortunately remote_start_remote() eventually calls
+ wait_for_inferior() with no timeout. wait_forever_enabled_p gets
+ around this. Eventually a mechanism that allows
+ wait_for_inferior() to expect/get timeouts will be
+ implemented. */
+ wait_forever_enabled_p = 0;
+ }
+
#ifdef SOLIB_CREATE_INFERIOR_HOOK
/* First delete any symbols previously loaded from shared libraries. */
no_shared_libraries (NULL, 0);
@@ -2336,126 +2366,13 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
if (ex < 0)
{
pop_target ();
+ if (async_p)
+ wait_forever_enabled_p = 1;
throw_exception (ex);
}
- if (extended_p)
- {
- /* Tell the remote that we are using the extended protocol. */
- char *buf = alloca (rs->remote_packet_size);
- putpkt ("!");
- getpkt (buf, (rs->remote_packet_size), 0);
- }
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
- /* FIXME: need a master target_open vector from which all
- remote_opens can be called, so that stuff like this can
- go there. Failing that, the following code must be copied
- to the open function for any remote target that wants to
- support svr4 shared libraries. */
-
- /* Set up to detect and load shared libraries. */
- if (exec_bfd) /* No use without an exec file. */
- {
- SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
- remote_check_symbols (symfile_objfile);
- }
-#endif
-}
-
-/* Just like remote_open but with asynchronous support. */
-static void
-remote_async_open_1 (char *name, int from_tty, struct target_ops *target,
- int extended_p)
-{
- int ex;
- struct remote_state *rs = get_remote_state ();
- if (name == 0)
- error ("To open a remote debug connection, you need to specify what\n"
- "serial device is attached to the remote system\n"
- "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).");
-
- target_preopen (from_tty);
-
- unpush_target (target);
-
- remote_desc = remote_serial_open (name);
- if (!remote_desc)
- perror_with_name (name);
-
- if (baud_rate != -1)
- {
- if (serial_setbaudrate (remote_desc, baud_rate))
- {
- serial_close (remote_desc);
- perror_with_name (name);
- }
- }
-
- serial_raw (remote_desc);
-
- /* If there is something sitting in the buffer we might take it as a
- response to a command, which would be bad. */
- serial_flush_input (remote_desc);
-
- if (from_tty)
- {
- puts_filtered ("Remote debugging using ");
- puts_filtered (name);
- puts_filtered ("\n");
- }
-
- push_target (target); /* Switch to using remote target now */
-
- init_all_packet_configs ();
-
- general_thread = -2;
- continue_thread = -2;
-
- /* Probe for ability to use "ThreadInfo" query, as required. */
- use_threadinfo_query = 1;
- use_threadextra_query = 1;
-
- /* Without this, some commands which require an active target (such
- as kill) won't work. This variable serves (at least) double duty
- as both the pid of the target process (if it has such), and as a
- flag indicating that a target is active. These functions should
- be split out into seperate variables, especially since GDB will
- someday have a notion of debugging several processes. */
- inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
-
- /* With this target we start out by owning the terminal. */
- remote_async_terminal_ours_p = 1;
-
- /* FIXME: cagney/1999-09-23: During the initial connection it is
- assumed that the target is already ready and able to respond to
- requests. Unfortunately remote_start_remote() eventually calls
- wait_for_inferior() with no timeout. wait_forever_enabled_p gets
- around this. Eventually a mechanism that allows
- wait_for_inferior() to expect/get timeouts will be
- implemented. */
- wait_forever_enabled_p = 0;
-
-#ifdef SOLIB_CREATE_INFERIOR_HOOK
- /* First delete any symbols previously loaded from shared libraries. */
- no_shared_libraries (NULL, 0);
-#endif
-
- /* Start the remote connection; if error, discard this target. See
- the comments in remote_open_1() for further details such as the
- need to re-throw the exception. */
- ex = catch_exceptions (uiout,
- remote_start_remote, NULL,
- "Couldn't establish connection to remote"
- " target\n",
- RETURN_MASK_ALL);
- if (ex < 0)
- {
- pop_target ();
- wait_forever_enabled_p = 1;
- throw_exception (ex);
- }
-
- wait_forever_enabled_p = 1;
+ if (async_p)
+ wait_forever_enabled_p = 1;
if (extended_p)
{
@@ -3002,7 +2919,8 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
{
struct remote_state *rs = get_remote_state ();
unsigned char *buf = alloca (rs->remote_packet_size);
- int thread_num = -1;
+ ULONGEST thread_num = -1;
+ ULONGEST addr;
status->kind = TARGET_WAITKIND_EXITED;
status->value.integer = 0;
@@ -3020,6 +2938,8 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
if (target_wait_loop_hook)
(*target_wait_loop_hook) ();
+ remote_stopped_by_watchpoint_p = 0;
+
switch (buf[0])
{
case 'E': /* Error of some sort */
@@ -3043,24 +2963,52 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
unsigned char *p1;
char *p_temp;
int fieldsize;
+ LONGEST pnum = 0;
+
+ /* If the packet contains a register number save it in pnum
+ and set p1 to point to the character following it.
+ Otherwise p1 points to p. */
+
+ /* If this packet is an awatch packet, don't parse the 'a'
+ as a register number. */
- /* Read the ``P'' register number. */
- LONGEST pnum = strtol ((const char *) p, &p_temp, 16);
- p1 = (unsigned char *) p_temp;
+ if (strncmp (p, "awatch", strlen("awatch")) != 0)
+ {
+ /* Read the ``P'' register number. */
+ pnum = strtol (p, &p_temp, 16);
+ p1 = (unsigned char *) p_temp;
+ }
+ else
+ p1 = p;
if (p1 == p) /* No register number present here */
{
- p1 = (unsigned char *) strchr ((const char *) p, ':');
+ p1 = (unsigned char *) strchr (p, ':');
if (p1 == NULL)
warning ("Malformed packet(a) (missing colon): %s\n\
Packet: '%s'\n",
p, buf);
- if (strncmp ((const char *) p, "thread", p1 - p) == 0)
+ if (strncmp (p, "thread", p1 - p) == 0)
{
p_temp = unpack_varlen_hex (++p1, &thread_num);
record_currthread (thread_num);
p = (unsigned char *) p_temp;
}
+ else if ((strncmp (p, "watch", p1 - p) == 0)
+ || (strncmp (p, "rwatch", p1 - p) == 0)
+ || (strncmp (p, "awatch", p1 - p) == 0))
+ {
+ remote_stopped_by_watchpoint_p = 1;
+ p = unpack_varlen_hex (++p1, &addr);
+ remote_watch_data_address = (CORE_ADDR)addr;
+ }
+ else
+ {
+ /* Silently skip unknown optional info. */
+ p_temp = strchr (p1 + 1, ';');
+ if (p_temp)
+ p = (unsigned char *) p_temp;
+ }
}
else
{
@@ -3216,11 +3164,14 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
{
struct remote_state *rs = get_remote_state ();
unsigned char *buf = alloca (rs->remote_packet_size);
- int thread_num = -1;
+ ULONGEST thread_num = -1;
+ ULONGEST addr;
status->kind = TARGET_WAITKIND_EXITED;
status->value.integer = 0;
+ remote_stopped_by_watchpoint_p = 0;
+
while (1)
{
unsigned char *p;
@@ -3263,25 +3214,54 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
unsigned char *p1;
char *p_temp;
int fieldsize;
+ long pnum = 0;
- /* Read the register number */
- long pnum = strtol ((const char *) p, &p_temp, 16);
- p1 = (unsigned char *) p_temp;
+ /* If the packet contains a register number, save it in pnum
+ and set p1 to point to the character following it.
+ Otherwise p1 points to p. */
+
+ /* If this packet is an awatch packet, don't parse the 'a'
+ as a register number. */
+
+ if (!strncmp (p, "awatch", strlen ("awatch")) != 0)
+ {
+ /* Read the register number. */
+ pnum = strtol (p, &p_temp, 16);
+ p1 = (unsigned char *) p_temp;
+ }
+ else
+ p1 = p;
if (p1 == p) /* No register number present here */
{
- p1 = (unsigned char *) strchr ((const char *) p, ':');
+ p1 = (unsigned char *) strchr (p, ':');
if (p1 == NULL)
warning ("Malformed packet(a) (missing colon): %s\n\
Packet: '%s'\n",
p, buf);
- if (strncmp ((const char *) p, "thread", p1 - p) == 0)
+ if (strncmp (p, "thread", p1 - p) == 0)
{
p_temp = unpack_varlen_hex (++p1, &thread_num);
record_currthread (thread_num);
p = (unsigned char *) p_temp;
}
+ else if ((strncmp (p, "watch", p1 - p) == 0)
+ || (strncmp (p, "rwatch", p1 - p) == 0)
+ || (strncmp (p, "awatch", p1 - p) == 0))
+ {
+ remote_stopped_by_watchpoint_p = 1;
+ p = unpack_varlen_hex (++p1, &addr);
+ remote_watch_data_address = (CORE_ADDR)addr;
+ }
+ else
+ {
+ /* Silently skip unknown optional info. */
+ p_temp = (unsigned char *) strchr (p1 + 1, ';');
+ if (p_temp)
+ p = p_temp;
+ }
}
+
else
{
struct packet_reg *reg = packet_reg_from_pnum (rs, pnum);
@@ -3948,7 +3928,9 @@ remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
putpkt (buf);
getpkt (buf, sizeof_buf, 0);
- if (buf[0] == 'E')
+ if (buf[0] == 'E'
+ && isxdigit (buf[1]) && isxdigit (buf[2])
+ && buf[3] == '\0')
{
/* There is no correspondance between what the remote protocol uses
for errors and errno codes. We would like a cleaner way of
@@ -4787,10 +4769,7 @@ watchpoint_to_Z_packet (int type)
}
}
-/* FIXME: This function should be static and a member of the remote
- target vector. */
-
-int
+static int
remote_insert_watchpoint (CORE_ADDR addr, int len, int type)
{
struct remote_state *rs = get_remote_state ();
@@ -4824,10 +4803,8 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type)
"remote_insert_watchpoint: reached end of function");
}
-/* FIXME: This function should be static and a member of the remote
- target vector. */
-int
+static int
remote_remove_watchpoint (CORE_ADDR addr, int len, int type)
{
struct remote_state *rs = get_remote_state ();
@@ -4860,16 +4837,60 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type)
"remote_remove_watchpoint: reached end of function");
}
-/* FIXME: This function should be static and a member of the remote
- target vector. */
+
+int remote_hw_watchpoint_limit = 0;
+int remote_hw_breakpoint_limit = 0;
+
+int
+remote_check_watch_resources (int type, int cnt, int ot)
+{
+ if (type == bp_hardware_breakpoint)
+ {
+ if (remote_hw_breakpoint_limit == 0)
+ return 0;
+ else if (cnt <= remote_hw_breakpoint_limit)
+ return 1;
+ }
+ else
+ {
+ if (remote_hw_watchpoint_limit == 0)
+ return 0;
+ else if (ot)
+ return -1;
+ else if (cnt <= remote_hw_watchpoint_limit)
+ return 1;
+ }
+ return -1;
+}
int
-remote_insert_hw_breakpoint (CORE_ADDR addr, int len)
+remote_stopped_by_watchpoint (void)
{
+ return remote_stopped_by_watchpoint_p;
+}
+
+CORE_ADDR
+remote_stopped_data_address (void)
+{
+ if (remote_stopped_by_watchpoint ())
+ return remote_watch_data_address;
+ return (CORE_ADDR)0;
+}
+
+
+static int
+remote_insert_hw_breakpoint (CORE_ADDR addr, char *shadow)
+{
+ int len = 0;
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
+ /* The length field should be set to the size of a breakpoint
+ instruction. */
+
+ BREAKPOINT_FROM_PC (&addr, &len);
+
if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE)
error ("Can't set hardware breakpoint without the '%s' (%s) packet\n",
remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,
@@ -4895,19 +4916,23 @@ remote_insert_hw_breakpoint (CORE_ADDR addr, int len)
return 0;
}
internal_error (__FILE__, __LINE__,
- "remote_remove_watchpoint: reached end of function");
+ "remote_insert_hw_breakpoint: reached end of function");
}
-/* FIXME: This function should be static and a member of the remote
- target vector. */
-int
-remote_remove_hw_breakpoint (CORE_ADDR addr, int len)
+static int
+remote_remove_hw_breakpoint (CORE_ADDR addr, char *shadow)
{
+ int len;
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
-
+
+ /* The length field should be set to the size of a breakpoint
+ instruction. */
+
+ BREAKPOINT_FROM_PC (&addr, &len);
+
if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE)
error ("Can't clear hardware breakpoint without the '%s' (%s) packet\n",
remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,
@@ -4933,7 +4958,7 @@ remote_remove_hw_breakpoint (CORE_ADDR addr, int len)
return 0;
}
internal_error (__FILE__, __LINE__,
- "remote_remove_watchpoint: reached end of function");
+ "remote_remove_hw_breakpoint: reached end of function");
}
/* Some targets are only capable of doing downloads, and afterwards
@@ -4953,18 +4978,6 @@ push_remote_target (char *name, int from_tty)
remote_open (name, from_tty);
}
-/* Other targets want to use the entire remote serial module but with
- certain remote_ops overridden. */
-
-void
-open_remote_target (char *name, int from_tty, struct target_ops *target,
- int extended_p)
-{
- printf_filtered ("Selecting the %sremote protocol\n",
- (extended_p ? "extended-" : ""));
- remote_open_1 (name, from_tty, target, extended_p);
-}
-
/* Table used by the crc32 function to calcuate the checksum. */
static unsigned long crc32_table[256] =
@@ -5410,6 +5423,13 @@ Specify the serial device it is connected to\n\
remote_ops.to_files_info = remote_files_info;
remote_ops.to_insert_breakpoint = remote_insert_breakpoint;
remote_ops.to_remove_breakpoint = remote_remove_breakpoint;
+ remote_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
+ remote_ops.to_stopped_data_address = remote_stopped_data_address;
+ remote_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
+ remote_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
+ remote_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;
+ remote_ops.to_insert_watchpoint = remote_insert_watchpoint;
+ remote_ops.to_remove_watchpoint = remote_remove_watchpoint;
remote_ops.to_kill = remote_kill;
remote_ops.to_load = generic_load;
remote_ops.to_mourn_inferior = remote_mourn;
@@ -5825,7 +5845,14 @@ Specify the serial device it is connected to (e.g. host:2020).";
remote_cisco_ops.to_xfer_memory = remote_xfer_memory;
remote_cisco_ops.to_files_info = remote_files_info;
remote_cisco_ops.to_insert_breakpoint = remote_insert_breakpoint;
- remote_cisco_ops.to_remove_breakpoint = remote_remove_breakpoint;
+ remote_cisco_ops.to_remove_breakpoint = remote_remove_breakpoint;
+ remote_cisco_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;
+ remote_cisco_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
+ remote_cisco_ops.to_insert_watchpoint = remote_insert_watchpoint;
+ remote_cisco_ops.to_remove_watchpoint = remote_remove_watchpoint;
+ remote_cisco_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
+ remote_cisco_ops.to_stopped_data_address = remote_stopped_data_address;
+ remote_cisco_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
remote_cisco_ops.to_kill = remote_kill;
remote_cisco_ops.to_load = generic_load;
remote_cisco_ops.to_mourn_inferior = remote_cisco_mourn;
@@ -5915,6 +5942,13 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_async_ops.to_files_info = remote_files_info;
remote_async_ops.to_insert_breakpoint = remote_insert_breakpoint;
remote_async_ops.to_remove_breakpoint = remote_remove_breakpoint;
+ remote_async_ops.to_can_use_hw_breakpoint = remote_check_watch_resources;
+ remote_async_ops.to_insert_hw_breakpoint = remote_insert_hw_breakpoint;
+ remote_async_ops.to_remove_hw_breakpoint = remote_remove_hw_breakpoint;
+ remote_async_ops.to_insert_watchpoint = remote_insert_watchpoint;
+ remote_async_ops.to_remove_watchpoint = remote_remove_watchpoint;
+ remote_async_ops.to_stopped_by_watchpoint = remote_stopped_by_watchpoint;
+ remote_async_ops.to_stopped_data_address = remote_stopped_data_address;
remote_async_ops.to_terminal_inferior = remote_async_terminal_inferior;
remote_async_ops.to_terminal_ours = remote_async_terminal_ours;
remote_async_ops.to_kill = remote_async_kill;
@@ -5968,13 +6002,14 @@ set_remote_cmd (char *args, int from_tty)
static void
show_remote_cmd (char *args, int from_tty)
{
-
- show_remote_protocol_Z_packet_cmd (args, from_tty);
- show_remote_protocol_e_packet_cmd (args, from_tty);
- show_remote_protocol_E_packet_cmd (args, from_tty);
- show_remote_protocol_P_packet_cmd (args, from_tty);
- show_remote_protocol_qSymbol_packet_cmd (args, from_tty);
- show_remote_protocol_binary_download_cmd (args, from_tty);
+ /* FIXME: cagney/2002-06-15: This function should iterate over
+ remote_show_cmdlist for a list of sub commands to show. */
+ show_remote_protocol_Z_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_e_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_E_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_P_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_qSymbol_packet_cmd (args, from_tty, NULL);
+ show_remote_protocol_binary_download_cmd (args, from_tty, NULL);
}
static void
@@ -6069,11 +6104,11 @@ response packet. GDB supplies the initial `$' character, and the\n\
terminating `#' character and checksum.",
&maintenancelist);
- add_show_from_set
- (add_set_boolean_cmd ("remotebreak", no_class, &remote_break,
- "Set whether to send break if interrupted.\n",
- &setlist),
- &showlist);
+ add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break,
+ "Set whether to send break if interrupted.\n",
+ "Show whether to send break if interrupted.\n",
+ NULL, NULL,
+ &setlist, &showlist);
/* Install commands for configuring memory read/write packets. */
@@ -6150,7 +6185,7 @@ in a memory packet.\n",
0);
/* Disable by default. The ``e'' packet has nasty interactions with
the threading code - it relies on global state. */
- remote_protocol_e.detect = CMD_AUTO_BOOLEAN_FALSE;
+ remote_protocol_e.detect = AUTO_BOOLEAN_FALSE;
update_packet_config (&remote_protocol_e);
add_packet_config_cmd (&remote_protocol_E,
@@ -6161,7 +6196,7 @@ in a memory packet.\n",
0);
/* Disable by default. The ``e'' packet has nasty interactions with
the threading code - it relies on global state. */
- remote_protocol_E.detect = CMD_AUTO_BOOLEAN_FALSE;
+ remote_protocol_E.detect = AUTO_BOOLEAN_FALSE;
update_packet_config (&remote_protocol_E);
add_packet_config_cmd (&remote_protocol_P,
@@ -6207,12 +6242,11 @@ in a memory packet.\n",
0);
/* Keep the old ``set remote Z-packet ...'' working. */
- tmpcmd = add_set_auto_boolean_cmd ("Z-packet", class_obscure,
- &remote_Z_packet_detect,
- "\
-Set use of remote protocol `Z' packets", &remote_set_cmdlist);
- set_cmd_sfunc (tmpcmd, set_remote_protocol_Z_packet_cmd);
- add_cmd ("Z-packet", class_obscure, show_remote_protocol_Z_packet_cmd,
- "Show use of remote protocol `Z' packets ",
- &remote_show_cmdlist);
+ add_setshow_auto_boolean_cmd ("Z-packet", class_obscure,
+ &remote_Z_packet_detect, "\
+Set use of remote protocol `Z' packets",
+ "Show use of remote protocol `Z' packets ",
+ set_remote_protocol_Z_packet_cmd,
+ show_remote_protocol_Z_packet_cmd,
+ &remote_set_cmdlist, &remote_show_cmdlist);
}
diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c
index ec49f5d7177..cc0586f8ed5 100644
--- a/gdb/rom68k-rom.c
+++ b/gdb/rom68k-rom.c
@@ -157,11 +157,24 @@ rom68k_supply_register (char *regname, int regnamelen, char *val, int vallen)
than does GDB, and don't necessarily support all the registers
either. So, typing "info reg sp" becomes a "r30". */
-static char *rom68k_regnames[NUM_REGS] =
+static const char *
+rom68k_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
- "SR", "PC"};
+
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
+ "SR", "PC"
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof(regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+
+}
/* Define the monitor command strings. Since these are passed directly
through to a printf style function, we may include formatting
@@ -220,7 +233,8 @@ init_rom68k_cmds (void)
rom68k_cmds.cmd_end = ".\r";
rom68k_cmds.target = &rom68k_ops;
rom68k_cmds.stopbits = SERIAL_1_STOPBITS;
- rom68k_cmds.regnames = rom68k_regnames;
+ rom68k_cmds.regnames = NULL;
+ rom68k_cmds.regname = rom68k_regname;
rom68k_cmds.magic = MONITOR_OPS_MAGIC;
} /* init_rom68k_cmds */
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 8fb2fecf91f..65256f44711 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -32,6 +32,8 @@
#include "gdb-stabs.h"
#include "regcache.h"
#include "arch-utils.h"
+#include "language.h" /* for local_hex_string(). */
+#include "ppc-tdep.h"
#include <sys/ptrace.h>
#include <sys/reg.h>
@@ -144,18 +146,43 @@ static void exec_one_dummy_insn (void);
extern void
fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta);
-/* Conversion from gdb-to-system special purpose register numbers. */
+/* Given REGNO, a gdb register number, return the corresponding
+ number suitable for use as a ptrace() parameter. Return -1 if
+ there's no suitable mapping. Also, set the int pointed to by
+ ISFLOAT to indicate whether REGNO is a floating point register. */
-static int special_regs[] =
+static int
+regmap (int regno, int *isfloat)
{
- IAR, /* PC_REGNUM */
- MSR, /* PS_REGNUM */
- CR, /* CR_REGNUM */
- LR, /* LR_REGNUM */
- CTR, /* CTR_REGNUM */
- XER, /* XER_REGNUM */
- MQ /* MQ_REGNUM */
-};
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ *isfloat = 0;
+ if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
+ return regno;
+ else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM)
+ {
+ *isfloat = 1;
+ return regno - FP0_REGNUM + FPR0;
+ }
+ else if (regno == PC_REGNUM)
+ return IAR;
+ else if (regno == tdep->ppc_ps_regnum)
+ return MSR;
+ else if (regno == tdep->ppc_cr_regnum)
+ return CR;
+ else if (regno == tdep->ppc_lr_regnum)
+ return LR;
+ else if (regno == tdep->ppc_ctr_regnum)
+ return CTR;
+ else if (regno == tdep->ppc_xer_regnum)
+ return XER;
+ else if (regno == tdep->ppc_fpscr_regnum)
+ return FPSCR;
+ else if (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum)
+ return MQ;
+ else
+ return -1;
+}
/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */
@@ -192,36 +219,31 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
static void
fetch_register (int regno)
{
- int *addr = (int *) &registers[REGISTER_BYTE (regno)];
- int nr;
+ int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int nr, isfloat;
/* Retrieved values may be -1, so infer errors from errno. */
errno = 0;
+ nr = regmap (regno, &isfloat);
+
/* Floating-point registers. */
- if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
- {
- nr = regno - FP0_REGNUM + FPR0;
- rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
- }
+ if (isfloat)
+ rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
/* Bogus register number. */
- else if (regno > LAST_UISA_SP_REGNUM)
+ else if (nr < 0)
{
if (regno >= NUM_REGS)
fprintf_unfiltered (gdb_stderr,
"gdb error: register no %d not implemented.\n",
regno);
+ return;
}
/* Fixed-point registers. */
else
{
- if (regno >= FIRST_UISA_SP_REGNUM)
- nr = special_regs[regno - FIRST_UISA_SP_REGNUM];
- else
- nr = regno;
-
if (!ARCH64 ())
*addr = rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
else
@@ -238,7 +260,7 @@ fetch_register (int regno)
}
if (!errno)
- register_valid[regno] = 1;
+ supply_register (regno, (char *) addr);
else
{
#if 0
@@ -254,21 +276,23 @@ fetch_register (int regno)
static void
store_register (int regno)
{
- int *addr = (int *) &registers[REGISTER_BYTE (regno)];
- int nr;
+ int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int nr, isfloat;
+
+ /* Fetch the register's value from the register cache. */
+ regcache_collect (regno, addr);
/* -1 can be a successful return value, so infer errors from errno. */
errno = 0;
+ nr = regmap (regno, &isfloat);
+
/* Floating-point registers. */
- if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
- {
- nr = regno - FP0_REGNUM + FPR0;
- rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
- }
+ if (isfloat)
+ rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
/* Bogus register number. */
- else if (regno > LAST_UISA_SP_REGNUM)
+ else if (nr < 0)
{
if (regno >= NUM_REGS)
fprintf_unfiltered (gdb_stderr,
@@ -287,11 +311,9 @@ store_register (int regno)
(%sp). */
exec_one_dummy_insn ();
- if (regno >= FIRST_UISA_SP_REGNUM)
- nr = special_regs[regno - FIRST_UISA_SP_REGNUM];
- else
- nr = regno;
-
+ /* The PT_WRITE_GPR operation is rather odd. For 32-bit inferiors,
+ the register's value is passed by value, but for 64-bit inferiors,
+ the address of a buffer containing the value is passed. */
if (!ARCH64 ())
rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
else
@@ -325,17 +347,30 @@ fetch_inferior_registers (int regno)
else
{
- /* read 32 general purpose registers. */
- for (regno = 0; regno < 32; regno++)
- fetch_register (regno);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- /* read general purpose floating point registers. */
+ /* Read 32 general purpose registers. */
+ for (regno = tdep->ppc_gp0_regnum;
+ regno <= tdep->ppc_gplast_regnum;
+ regno++)
+ {
+ fetch_register (regno);
+ }
+
+ /* Read general purpose floating point registers. */
for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
fetch_register (regno);
- /* read special registers. */
- for (regno = FIRST_UISA_SP_REGNUM; regno <= LAST_UISA_SP_REGNUM; regno++)
- fetch_register (regno);
+ /* Read special registers. */
+ fetch_register (PC_REGNUM);
+ fetch_register (tdep->ppc_ps_regnum);
+ fetch_register (tdep->ppc_cr_regnum);
+ fetch_register (tdep->ppc_lr_regnum);
+ fetch_register (tdep->ppc_ctr_regnum);
+ fetch_register (tdep->ppc_xer_regnum);
+ fetch_register (tdep->ppc_fpscr_regnum);
+ if (tdep->ppc_mq_regnum >= 0)
+ fetch_register (tdep->ppc_mq_regnum);
}
}
@@ -351,18 +386,30 @@ store_inferior_registers (int regno)
else
{
- /* write general purpose registers first! */
- for (regno = GPR0; regno <= GPR31; regno++)
- store_register (regno);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- /* write floating point registers now. */
+ /* Write general purpose registers first. */
+ for (regno = tdep->ppc_gp0_regnum;
+ regno <= tdep->ppc_gplast_regnum;
+ regno++)
+ {
+ store_register (regno);
+ }
+
+ /* Write floating point registers. */
for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
store_register (regno);
- /* write special registers. */
-
- for (regno = FIRST_UISA_SP_REGNUM; regno <= LAST_UISA_SP_REGNUM; regno++)
- store_register (regno);
+ /* Write special registers. */
+ store_register (PC_REGNUM);
+ store_register (tdep->ppc_ps_regnum);
+ store_register (tdep->ppc_cr_regnum);
+ store_register (tdep->ppc_lr_regnum);
+ store_register (tdep->ppc_ctr_regnum);
+ store_register (tdep->ppc_xer_regnum);
+ store_register (tdep->ppc_fpscr_regnum);
+ if (tdep->ppc_mq_regnum >= 0)
+ store_register (tdep->ppc_mq_regnum);
}
}
@@ -514,9 +561,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
CoreRegs *regs;
- double *fprs;
- int arch64, i, size;
- void *gprs, *sprs[7];
+ int regi;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (which != 0)
{
@@ -526,45 +572,43 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
return;
}
- arch64 = ARCH64 ();
regs = (CoreRegs *) core_reg_sect;
- /* Retrieve register pointers. */
+ /* Put the register values from the core file section in the regcache. */
- if (arch64)
+ if (ARCH64 ())
{
- gprs = regs->r64.gpr;
- fprs = regs->r64.fpr;
- sprs[0] = &regs->r64.iar;
- sprs[1] = &regs->r64.msr;
- sprs[2] = &regs->r64.cr;
- sprs[3] = &regs->r64.lr;
- sprs[4] = &regs->r64.ctr;
- sprs[5] = &regs->r64.xer;
+ for (regi = 0; regi < 32; regi++)
+ supply_register (regi, (char *) &regs->r64.gpr[regi]);
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (FP0_REGNUM + regi, (char *) &regs->r64.fpr[regi]);
+
+ supply_register (PC_REGNUM, (char *) &regs->r64.iar);
+ supply_register (tdep->ppc_ps_regnum, (char *) &regs->r64.msr);
+ supply_register (tdep->ppc_cr_regnum, (char *) &regs->r64.cr);
+ supply_register (tdep->ppc_lr_regnum, (char *) &regs->r64.lr);
+ supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r64.ctr);
+ supply_register (tdep->ppc_xer_regnum, (char *) &regs->r64.xer);
+ supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r64.fpscr);
}
else
{
- gprs = regs->r32.gpr;
- fprs = regs->r32.fpr;
- sprs[0] = &regs->r32.iar;
- sprs[1] = &regs->r32.msr;
- sprs[2] = &regs->r32.cr;
- sprs[3] = &regs->r32.lr;
- sprs[4] = &regs->r32.ctr;
- sprs[5] = &regs->r32.xer;
- sprs[6] = &regs->r32.mq;
- }
-
- /* Copy from pointers to registers[]. */
-
- memcpy (registers, gprs, 32 * (arch64 ? 8 : 4));
- memcpy (registers + REGISTER_BYTE (FP0_REGNUM), fprs, 32 * 8);
- for (i = FIRST_UISA_SP_REGNUM; i <= LAST_UISA_SP_REGNUM; i++)
- {
- size = REGISTER_RAW_SIZE (i);
- if (size)
- memcpy (registers + REGISTER_BYTE (i),
- sprs[i - FIRST_UISA_SP_REGNUM], size);
+ for (regi = 0; regi < 32; regi++)
+ supply_register (regi, (char *) &regs->r32.gpr[regi]);
+
+ for (regi = 0; regi < 32; regi++)
+ supply_register (FP0_REGNUM + regi, (char *) &regs->r32.fpr[regi]);
+
+ supply_register (PC_REGNUM, (char *) &regs->r32.iar);
+ supply_register (tdep->ppc_ps_regnum, (char *) &regs->r32.msr);
+ supply_register (tdep->ppc_cr_regnum, (char *) &regs->r32.cr);
+ supply_register (tdep->ppc_lr_regnum, (char *) &regs->r32.lr);
+ supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r32.ctr);
+ supply_register (tdep->ppc_xer_regnum, (char *) &regs->r32.xer);
+ supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r32.fpscr);
+ if (tdep->ppc_mq_regnum >= 0)
+ supply_register (tdep->ppc_mq_regnum, (char *) &regs->r32.mq);
}
}
@@ -832,6 +876,11 @@ vmap_ldinfo (LdInfo *ldi)
/* relocate symbol table(s). */
vmap_symtab (vp);
+ /* Announce new object files. Doing this after symbol relocation
+ makes aix-thread.c's job easier. */
+ if (target_new_objfile_hook && vp->objfile)
+ target_new_objfile_hook (vp->objfile);
+
/* There may be more, so we don't break out of the loop. */
}
@@ -1109,6 +1158,9 @@ xcoff_relocate_core (struct target_ops *target)
}
vmap_symtab (vp);
+
+ if (target_new_objfile_hook && vp != vmap && vp->objfile)
+ target_new_objfile_hook (vp->objfile);
}
while (LDI_NEXT (ldi, arch64) != 0);
vmap_exec ();
@@ -1143,7 +1195,7 @@ find_toc_address (CORE_ADDR pc)
: vp->objfile);
}
}
- error ("Unable to find TOC entry for pc 0x%x\n", pc);
+ error ("Unable to find TOC entry for pc %s\n", local_hex_string (pc));
}
/* Register that we are able to handle rs6000 core file formats. */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 2ba81ea2aba..c73f92da04d 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -67,12 +67,14 @@ struct rs6000_framedata
int saved_gpr; /* smallest # of saved gpr */
int saved_fpr; /* smallest # of saved fpr */
int saved_vr; /* smallest # of saved vr */
+ int saved_ev; /* smallest # of saved ev */
int alloca_reg; /* alloca register number (frame ptr) */
char frameless; /* true if frameless functions. */
char nosavedpc; /* true if pc not saved. */
int gpr_offset; /* offset of saved gprs from prev sp */
int fpr_offset; /* offset of saved fprs from prev sp */
int vr_offset; /* offset of saved vrs from prev sp */
+ int ev_offset; /* offset of saved evs from prev sp */
int lr_offset; /* offset of saved lr */
int cr_offset; /* offset of saved cr */
int vrsave_offset; /* offset of saved vrsave register */
@@ -86,12 +88,9 @@ struct reg
unsigned char sz32; /* size on 32-bit arch, 0 if nonextant */
unsigned char sz64; /* size on 64-bit arch, 0 if nonextant */
unsigned char fpr; /* whether register is floating-point */
+ unsigned char pseudo; /* whether register is pseudo */
};
-/* Return the current architecture's gdbarch_tdep structure. */
-
-#define TDEP gdbarch_tdep (current_gdbarch)
-
/* Breakpoint shadows for the single step instructions will be kept here. */
static struct sstep_breaks
@@ -252,7 +251,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,
- TDEP->wordsize);
+ gdbarch_tdep (current_gdbarch)->wordsize);
}
}
@@ -362,11 +361,13 @@ rs6000_software_single_step (enum target_signal signal,
- saved_gpr is the number of the first saved gpr.
- saved_fpr is the number of the first saved fpr.
- saved_vr is the number of the first saved vr.
+ - saved_ev is the number of the first saved ev.
- alloca_reg is the number of the register used for alloca() handling.
Otherwise -1.
- gpr_offset is the offset of the first saved gpr from the previous frame.
- fpr_offset is the offset of the first saved fpr from the previous frame.
- vr_offset is the offset of the first saved vr from the previous frame.
+ - ev_offset is the offset of the first saved ev from the previous frame.
- lr_offset is the offset of the saved lr
- cr_offset is the offset of the saved cr
- vrsave_offset is the offset of the saved vrsave register
@@ -444,13 +445,16 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
int lr_reg = -1;
int cr_reg = -1;
int vr_reg = -1;
+ int ev_reg = -1;
+ long ev_offset = 0;
int vrsave_reg = -1;
int reg;
int framep = 0;
int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0;
-
+ const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
+
/* Attempt to find the end of the prologue when no limit is specified.
Note that refine_prologue_limit() has been written so that it may
be used to "refine" the limits of non-zero PC values too, but this
@@ -470,6 +474,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->saved_vr = -1;
+ fdata->saved_ev = -1;
fdata->alloca_reg = -1;
fdata->frameless = 1;
fdata->nosavedpc = 1;
@@ -536,7 +541,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
}
else if ((op & 0xffff0000) == 0x60000000)
{
- /* nop */
+ /* nop */
/* Allow nops in the prologue, but do not consider them to
be part of the prologue unless followed by other prologue
instructions. */
@@ -650,7 +655,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
else if ((op & 0xfc0007fe) == 0x7c000378 && /* mr(.) Rx,Ry */
(((op >> 21) & 31) >= 3) && /* R3 >= Ry >= R10 */
(((op >> 21) & 31) <= 10) &&
- (((op >> 16) & 31) >= fdata->saved_gpr)) /* Rx: local var reg */
+ ((long) ((op >> 16) & 31) >= fdata->saved_gpr)) /* Rx: local var reg */
{
continue;
@@ -731,7 +736,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
in a pair of insns to save the vector registers on the
stack. */
/* 001110 00000 00000 iiii iiii iiii iiii */
- else if ((op & 0xffff0000) == 0x38000000) /* li r0, SIMM */
+ /* 001110 01110 00000 iiii iiii iiii iiii */
+ else if ((op & 0xffff0000) == 0x38000000 /* li r0, SIMM */
+ || (op & 0xffff0000) == 0x39c00000) /* li r14, SIMM */
{
li_found_pc = pc;
vr_saved_offset = SIGNED_SHORT (op);
@@ -757,6 +764,104 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
}
}
/* End AltiVec related instructions. */
+
+ /* Start BookE related instructions. */
+ /* Store gen register S at (r31+uimm).
+ Any register less than r13 is volatile, so we don't care. */
+ /* 000100 sssss 11111 iiiii 01100100001 */
+ else if (arch_info->mach == bfd_mach_ppc_e500
+ && (op & 0xfc1f07ff) == 0x101f0321) /* evstdd Rs,uimm(R31) */
+ {
+ if ((op & 0x03e00000) >= 0x01a00000) /* Rs >= r13 */
+ {
+ unsigned int imm;
+ ev_reg = GET_SRC_REG (op);
+ imm = (op >> 11) & 0x1f;
+ ev_offset = imm * 8;
+ /* If this is the first vector reg to be saved, or if
+ it has a lower number than others previously seen,
+ reupdate the frame info. */
+ if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg)
+ {
+ fdata->saved_ev = ev_reg;
+ fdata->ev_offset = ev_offset + offset;
+ }
+ }
+ continue;
+ }
+ /* Store gen register rS at (r1+rB). */
+ /* 000100 sssss 00001 bbbbb 01100100000 */
+ else if (arch_info->mach == bfd_mach_ppc_e500
+ && (op & 0xffe007ff) == 0x13e00320) /* evstddx RS,R1,Rb */
+ {
+ if (pc == (li_found_pc + 4))
+ {
+ ev_reg = GET_SRC_REG (op);
+ /* If this is the first vector reg to be saved, or if
+ it has a lower number than others previously seen,
+ reupdate the frame info. */
+ /* We know the contents of rB from the previous instruction. */
+ if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg)
+ {
+ fdata->saved_ev = ev_reg;
+ fdata->ev_offset = vr_saved_offset + offset;
+ }
+ vr_saved_offset = -1;
+ ev_reg = -1;
+ li_found_pc = 0;
+ }
+ continue;
+ }
+ /* Store gen register r31 at (rA+uimm). */
+ /* 000100 11111 aaaaa iiiii 01100100001 */
+ else if (arch_info->mach == bfd_mach_ppc_e500
+ && (op & 0xffe007ff) == 0x13e00321) /* evstdd R31,Ra,UIMM */
+ {
+ /* Wwe know that the source register is 31 already, but
+ it can't hurt to compute it. */
+ ev_reg = GET_SRC_REG (op);
+ ev_offset = ((op >> 11) & 0x1f) * 8;
+ /* If this is the first vector reg to be saved, or if
+ it has a lower number than others previously seen,
+ reupdate the frame info. */
+ if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg)
+ {
+ fdata->saved_ev = ev_reg;
+ fdata->ev_offset = ev_offset + offset;
+ }
+
+ continue;
+ }
+ /* Store gen register S at (r31+r0).
+ Store param on stack when offset from SP bigger than 4 bytes. */
+ /* 000100 sssss 11111 00000 01100100000 */
+ else if (arch_info->mach == bfd_mach_ppc_e500
+ && (op & 0xfc1fffff) == 0x101f0320) /* evstddx Rs,R31,R0 */
+ {
+ if (pc == (li_found_pc + 4))
+ {
+ if ((op & 0x03e00000) >= 0x01a00000)
+ {
+ ev_reg = GET_SRC_REG (op);
+ /* If this is the first vector reg to be saved, or if
+ it has a lower number than others previously seen,
+ reupdate the frame info. */
+ /* We know the contents of r0 from the previous
+ instruction. */
+ if (fdata->saved_ev == -1 || fdata->saved_ev > ev_reg)
+ {
+ fdata->saved_ev = ev_reg;
+ fdata->ev_offset = vr_saved_offset + offset;
+ }
+ ev_reg = -1;
+ }
+ vr_saved_offset = -1;
+ li_found_pc = 0;
+ continue;
+ }
+ }
+ /* End BookE related instructions. */
+
else
{
/* Not a recognized prologue instruction.
@@ -773,7 +878,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
trampolines. */
break;
if ((op & 0xf4000000) == 0x40000000) /* bxx */
- /* Never skip branches. */
+ /* Never skip branches. */
break;
if (num_skip_non_prologue_insns++ > max_skip_non_prologue_insns)
@@ -794,9 +899,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
/* If the first thing after skipping a prolog is a branch to a function,
this might be a call to an initializer in main(), introduced by gcc2.
- We'd like to skip over it as well. Fortunately, xlc does some extra
+ We'd like to skip over it as well. Fortunately, xlc does some extra
work before calling a function right after a prologue, thus we can
- single out such gcc2 behaviour. */
+ single out such gcc2 behaviour. */
if ((op & 0xfc000001) == 0x48000001)
@@ -806,8 +911,8 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
if (op == 0x4def7b82)
{ /* cror 0xf, 0xf, 0xf (nop) */
- /* check and see if we are in main. If so, skip over this initializer
- function as well. */
+ /* Check and see if we are in main. If so, skip over this
+ initializer function as well. */
tmp = find_pc_misc_function (pc);
if (tmp >= 0 && STREQ (misc_function_vector[tmp].name, main_name ()))
@@ -827,7 +932,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
*************************************************************************/
-/* Pop the innermost frame, go back to the caller. */
+/* Pop the innermost frame, go back to the caller. */
static void
rs6000_pop_frame (void)
@@ -850,14 +955,14 @@ rs6000_pop_frame (void)
/* Make sure that all registers are valid. */
read_register_bytes (0, NULL, REGISTER_BYTES);
- /* figure out previous %pc value. If the function is frameless, it is
+ /* Figure out previous %pc value. If the function is frameless, it is
still in the link register, otherwise walk the frames and retrieve the
- saved %pc value in the previous frame. */
+ saved %pc value in the previous frame. */
addr = get_pc_function_start (frame->pc);
(void) skip_prologue (addr, frame->pc, &fdata);
- wordsize = TDEP->wordsize;
+ wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
if (fdata.frameless)
prev_sp = sp;
else
@@ -870,7 +975,7 @@ rs6000_pop_frame (void)
/* reset %pc value. */
write_register (PC_REGNUM, lr);
- /* reset register values if any was saved earlier. */
+ /* reset register values if any was saved earlier. */
if (fdata.saved_gpr != -1)
{
@@ -898,7 +1003,7 @@ rs6000_pop_frame (void)
}
/* Fixup the call sequence of a dummy function, with the real function
- address. Its arguments will be passed by gdb. */
+ address. Its arguments will be passed by gdb. */
static void
rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
@@ -920,8 +1025,8 @@ rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
the first eight words of the argument list (that might be less than
eight parameters if some parameters occupy more than one word) are
passed in r3..r10 registers. float and double parameters are
- passed in fpr's, in addition to that. Rest of the parameters if any
- are passed in user stack. There might be cases in which half of the
+ passed in fpr's, in addition to that. Rest of the parameters if any
+ are passed in user stack. There might be cases in which half of the
parameter is copied into registers, the other half is pushed into
stack.
@@ -930,7 +1035,7 @@ rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
If the function is returning a structure, then the return address is passed
in r3, then the first 7 words of the parameters can be passed in registers,
- starting from r4. */
+ starting from r4. */
static CORE_ADDR
rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
@@ -942,20 +1047,20 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int argbytes; /* current argument byte */
char tmp_buffer[50];
int f_argno = 0; /* current floating point argno */
- int wordsize = TDEP->wordsize;
+ int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
struct value *arg = 0;
struct type *type;
CORE_ADDR saved_sp;
- /* The first eight words of ther arguments are passed in registers. Copy
- them appropriately.
+ /* The first eight words of ther arguments are passed in registers.
+ Copy them appropriately.
If the function is returning a `struct', then the first word (which
- will be passed in r3) is used for struct return address. In that
+ will be passed in r3) is used for struct return address. In that
case we should advance one word and start from r4 register to copy
- parameters. */
+ parameters. */
ii = struct_return ? 1 : 0;
@@ -989,9 +1094,9 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
- /* floating point arguments are passed in fpr's, as well as gpr's.
+ /* Floating point arguments are passed in fpr's, as well as gpr's.
There are 13 fpr's reserved for passing parameters. At this point
- there is no way we would run out of them. */
+ there is no way we would run out of them. */
if (len > 8)
printf_unfiltered (
@@ -1006,7 +1111,7 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
if (len > reg_size)
{
- /* Argument takes more than one register. */
+ /* Argument takes more than one register. */
while (argbytes < len)
{
memset (&registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
@@ -1023,7 +1128,8 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
--ii;
}
else
- { /* Argument can fit in one register. No problem. */
+ {
+ /* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
memset (&registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
memcpy ((char *)&registers[REGISTER_BYTE (ii + 3)] + adj,
@@ -1036,17 +1142,17 @@ ran_out_of_registers_for_arguments:
saved_sp = read_sp ();
- /* location for 8 parameters are always reserved. */
+ /* Location for 8 parameters are always reserved. */
sp -= wordsize * 8;
- /* another six words for back chain, TOC register, link register, etc. */
+ /* Another six words for back chain, TOC register, link register, etc. */
sp -= wordsize * 6;
- /* stack pointer must be quadword aligned */
+ /* Stack pointer must be quadword aligned. */
sp &= -16;
- /* if there are more arguments, allocate space for them in
- the stack, then push them starting from the ninth one. */
+ /* If there are more arguments, allocate space for them in
+ the stack, then push them starting from the ninth one. */
if ((argno < nargs) || argbytes)
{
@@ -1066,19 +1172,20 @@ ran_out_of_registers_for_arguments:
space += ((TYPE_LENGTH (VALUE_TYPE (val))) + 3) & -4;
}
- /* add location required for the rest of the parameters */
+ /* Add location required for the rest of the parameters. */
space = (space + 15) & -16;
sp -= space;
- /* This is another instance we need to be concerned about securing our
- stack space. If we write anything underneath %sp (r1), we might conflict
- with the kernel who thinks he is free to use this area. So, update %sp
- first before doing anything else. */
+ /* This is another instance we need to be concerned about
+ securing our stack space. If we write anything underneath %sp
+ (r1), we might conflict with the kernel who thinks he is free
+ to use this area. So, update %sp first before doing anything
+ else. */
write_register (SP_REGNUM, sp);
- /* if the last argument copied into the registers didn't fit there
- completely, push the rest of it into stack. */
+ /* If the last argument copied into the registers didn't fit there
+ completely, push the rest of it into stack. */
if (argbytes)
{
@@ -1089,7 +1196,7 @@ ran_out_of_registers_for_arguments:
ii += ((len - argbytes + 3) & -4) / 4;
}
- /* push the rest of the arguments into stack. */
+ /* Push the rest of the arguments into stack. */
for (; argno < nargs; ++argno)
{
@@ -1098,7 +1205,8 @@ ran_out_of_registers_for_arguments:
len = TYPE_LENGTH (type);
- /* float types should be passed in fpr's, as well as in the stack. */
+ /* Float types should be passed in fpr's, as well as in the
+ stack. */
if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
{
@@ -1117,7 +1225,7 @@ ran_out_of_registers_for_arguments:
}
}
else
- /* Secure stack areas first, before doing anything else. */
+ /* Secure stack areas first, before doing anything else. */
write_register (SP_REGNUM, sp);
/* set back chain properly */
@@ -1129,7 +1237,7 @@ ran_out_of_registers_for_arguments:
}
/* Function: ppc_push_return_address (pc, sp)
- Set up the return address for the inferior function call. */
+ Set up the return address for the inferior function call. */
static CORE_ADDR
ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
@@ -1140,7 +1248,63 @@ ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
}
/* Extract a function return value of type TYPE from raw register array
- REGBUF, and copy that return value into VALBUF in virtual format. */
+ REGBUF, and copy that return value into VALBUF in virtual format. */
+static void
+e500_extract_return_value (struct type *valtype, struct regcache *regbuf, char *valbuf)
+{
+ int offset = 0;
+ int vallen = TYPE_LENGTH (valtype);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
+ && vallen == 8
+ && TYPE_VECTOR (valtype))
+ {
+ regcache_raw_read (regbuf, tdep->ppc_ev0_regnum + 3, valbuf);
+ }
+ else
+ {
+ /* Return value is copied starting from r3. Note that r3 for us
+ is a pseudo register. */
+ int offset = 0;
+ int return_regnum = tdep->ppc_gp0_regnum + 3;
+ int reg_size = REGISTER_RAW_SIZE (return_regnum);
+ int reg_part_size;
+ char *val_buffer;
+ int copied = 0;
+ int i = 0;
+
+ /* Compute where we will start storing the value from. */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ if (vallen <= reg_size)
+ offset = reg_size - vallen;
+ else
+ offset = reg_size + (reg_size - vallen);
+ }
+
+ /* How big does the local buffer need to be? */
+ if (vallen <= reg_size)
+ val_buffer = alloca (reg_size);
+ else
+ val_buffer = alloca (vallen);
+
+ /* Read all we need into our private buffer. We copy it in
+ chunks that are as long as one register, never shorter, even
+ if the value is smaller than the register. */
+ while (copied < vallen)
+ {
+ reg_part_size = REGISTER_RAW_SIZE (return_regnum + i);
+ /* It is a pseudo/cooked register. */
+ regcache_cooked_read (regbuf, return_regnum + i,
+ val_buffer + copied);
+ copied += reg_part_size;
+ i++;
+ }
+ /* Put the stuff in the return buffer. */
+ memcpy (valbuf, val_buffer + offset, vallen);
+ }
+}
static void
rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
@@ -1155,7 +1319,7 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
float ff;
/* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes.
We need to truncate the return value into float size (4 byte) if
- necessary. */
+ necessary. */
if (TYPE_LENGTH (valtype) > 4) /* this is a double */
memcpy (valbuf,
@@ -1284,7 +1448,7 @@ rs6000_skip_trampoline_code (CORE_ADDR pc)
return 0;
}
ii = read_register (11); /* r11 holds destination addr */
- pc = read_memory_addr (ii, TDEP->wordsize); /* (r11) value */
+ pc = read_memory_addr (ii, gdbarch_tdep (current_gdbarch)->wordsize); /* (r11) value */
return pc;
}
@@ -1304,13 +1468,13 @@ rs6000_frameless_function_invocation (struct frame_info *fi)
func_start = get_pc_function_start (fi->pc);
/* If we failed to find the start of the function, it is a mistake
- to inspect the instructions. */
+ to inspect the instructions. */
if (!func_start)
{
/* A frame with a zero PC is usually created by dereferencing a NULL
function pointer, normally causing an immediate core dump of the
- inferior. Mark function as frameless, as the inferior has no chance
+ inferior. Mark function as frameless, as the inferior has no chance
of setting up a stack frame. */
if (fi->pc == 0)
return 1;
@@ -1322,14 +1486,14 @@ rs6000_frameless_function_invocation (struct frame_info *fi)
return fdata.frameless;
}
-/* Return the PC saved in a frame */
+/* Return the PC saved in a frame. */
CORE_ADDR
rs6000_frame_saved_pc (struct frame_info *fi)
{
CORE_ADDR func_start;
struct rs6000_framedata fdata;
- struct gdbarch_tdep *tdep = TDEP;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int wordsize = tdep->wordsize;
if (fi->signal_handler_caller)
@@ -1341,7 +1505,7 @@ rs6000_frame_saved_pc (struct frame_info *fi)
func_start = get_pc_function_start (fi->pc);
/* If we failed to find the start of the function, it is a mistake
- to inspect the instructions. */
+ to inspect the instructions. */
if (!func_start)
return 0;
@@ -1387,16 +1551,18 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
frame_saved_regs_zalloc (fi);
/* If there were any saved registers, figure out parent's stack
- pointer. */
+ pointer. */
/* The following is true only if the frame doesn't have a call to
- alloca(), FIXME. */
+ alloca(), FIXME. */
if (fdatap->saved_fpr == 0
&& fdatap->saved_gpr == 0
&& fdatap->saved_vr == 0
+ && fdatap->saved_ev == 0
&& fdatap->lr_offset == 0
&& fdatap->cr_offset == 0
- && fdatap->vr_offset == 0)
+ && fdatap->vr_offset == 0
+ && fdatap->ev_offset == 0)
frame_addr = 0;
else
/* NOTE: cagney/2002-04-14: The ->frame points to the inner-most
@@ -1450,6 +1616,23 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
}
}
+ /* if != -1, fdatap->saved_ev is the smallest number of saved_ev.
+ All vr's from saved_ev to ev31 are saved. ????? */
+ if (tdep->ppc_ev0_regnum != -1 && tdep->ppc_ev31_regnum != -1)
+ {
+ if (fdatap->saved_ev >= 0)
+ {
+ int i;
+ 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;
+ ev_addr += REGISTER_RAW_SIZE (tdep->ppc_ev0_regnum);
+ }
+ }
+ }
+
/* If != 0, fdatap->cr_offset is the offset from the frame that holds
the CR. */
if (fdatap->cr_offset != 0)
@@ -1467,8 +1650,8 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
}
/* Return the address of a frame. This is the inital %sp value when the frame
- was first allocated. For functions calling alloca(), it might be saved in
- an alloca register. */
+ was first allocated. For functions calling alloca(), it might be saved in
+ an alloca register. */
static CORE_ADDR
frame_initial_stack_address (struct frame_info *fi)
@@ -1477,23 +1660,24 @@ frame_initial_stack_address (struct frame_info *fi)
struct rs6000_framedata fdata;
struct frame_info *callee_fi;
- /* if the initial stack pointer (frame address) of this frame is known,
- just return it. */
+ /* 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;
- /* find out if this function is using an alloca register.. */
+ /* Find out if this function is using an alloca register. */
(void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, &fdata);
- /* if saved registers of this frame are not known yet, read and cache them. */
+ /* If saved registers of this frame are not known yet, read and
+ cache them. */
if (!fi->saved_regs)
frame_get_saved_regs (fi, &fdata);
/* If no alloca register used, then fi->frame is the value of the %sp for
- this frame, and it is good enough. */
+ this frame, and it is good enough. */
if (fdata.alloca_reg < 0)
{
@@ -1524,7 +1708,7 @@ frame_initial_stack_address (struct frame_info *fi)
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
- and produces the frame's chain-pointer. */
+ and produces the frame's chain-pointer. */
/* In the case of the RS/6000, the frame's nominal address
is the address of a 4-byte word containing the calling frame's address. */
@@ -1533,7 +1717,7 @@ CORE_ADDR
rs6000_frame_chain (struct frame_info *thisframe)
{
CORE_ADDR fp, fpp, lr;
- int wordsize = TDEP->wordsize;
+ int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame))
return thisframe->frame; /* dummy frame same as caller's frame */
@@ -1564,7 +1748,7 @@ rs6000_frame_chain (struct frame_info *thisframe)
}
/* Return the size of register REG when words are WORDSIZE bytes long. If REG
- isn't available with that word size, return 0. */
+ isn't available with that word size, return 0. */
static int
regsize (const struct reg *reg, int wordsize)
@@ -1573,12 +1757,12 @@ regsize (const struct reg *reg, int wordsize)
}
/* Return the name of register number N, or null if no such register exists
- in the current architecture. */
+ in the current architecture. */
-static char *
+static const char *
rs6000_register_name (int n)
{
- struct gdbarch_tdep *tdep = TDEP;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
const struct reg *reg = tdep->regs + n;
if (!regsize (reg, tdep->wordsize))
@@ -1592,16 +1776,16 @@ rs6000_register_name (int n)
static int
rs6000_register_byte (int n)
{
- return TDEP->regoff[n];
+ return gdbarch_tdep (current_gdbarch)->regoff[n];
}
/* Return the number of bytes of storage in the actual machine representation
- for register N if that register is available, else return 0. */
+ for register N if that register is available, else return 0. */
static int
rs6000_register_raw_size (int n)
{
- struct gdbarch_tdep *tdep = TDEP;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
const struct reg *reg = tdep->regs + n;
return regsize (reg, tdep->wordsize);
}
@@ -1612,7 +1796,7 @@ rs6000_register_raw_size (int n)
static struct type *
rs6000_register_virtual_type (int n)
{
- struct gdbarch_tdep *tdep = TDEP;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
const struct reg *reg = tdep->regs + n;
if (reg->fpr)
@@ -1623,7 +1807,10 @@ rs6000_register_virtual_type (int n)
switch (size)
{
case 8:
- return builtin_type_int64;
+ if (tdep->ppc_ev0_regnum <= n && n <= tdep->ppc_ev31_regnum)
+ return builtin_type_vec64;
+ else
+ return builtin_type_int64;
break;
case 16:
return builtin_type_vec128;
@@ -1638,7 +1825,7 @@ rs6000_register_virtual_type (int n)
/* For the PowerPC, it appears that the debug info marks float parameters as
floats regardless of whether the function is prototyped, but the actual
values are always passed in as doubles. Tell gdb to always assume that
- floats are passed as doubles and then converted in the callee. */
+ floats are passed as doubles and then converted in the callee. */
static int
rs6000_coerce_float_to_double (struct type *formal, struct type *actual)
@@ -1650,17 +1837,17 @@ rs6000_coerce_float_to_double (struct type *formal, struct type *actual)
to virtual format.
The register format for RS/6000 floating point registers is always
- double, we need a conversion if the memory format is float. */
+ double, we need a conversion if the memory format is float. */
static int
rs6000_register_convertible (int n)
{
- const struct reg *reg = TDEP->regs + n;
+ const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + n;
return reg->fpr;
}
/* Convert data from raw format for register N in buffer FROM
- to virtual format with type TYPE in buffer TO. */
+ to virtual format with type TYPE in buffer TO. */
static void
rs6000_register_convert_to_virtual (int n, struct type *type,
@@ -1676,7 +1863,7 @@ rs6000_register_convert_to_virtual (int n, struct type *type,
}
/* Convert data from virtual format with type TYPE in buffer FROM
- to raw format for register N in buffer TO. */
+ to raw format for register N in buffer TO. */
static void
rs6000_register_convert_to_raw (struct type *type, int n,
@@ -1691,185 +1878,70 @@ rs6000_register_convert_to_raw (struct type *type, int n,
memcpy (to, from, REGISTER_RAW_SIZE (n));
}
-int
-altivec_register_p (int regno)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (tdep->ppc_vr0_regnum < 0 || tdep->ppc_vrsave_regnum < 0)
- return 0;
- else
- return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum);
-}
-
static void
-rs6000_do_altivec_registers (int regnum)
+e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, void *buffer)
{
- int i;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ int base_regnum;
+ int offset = 0;
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- for (i = tdep->ppc_vr0_regnum; i <= tdep->ppc_vrsave_regnum; i++)
+ if (reg_nr >= tdep->ppc_gp0_regnum
+ && reg_nr <= tdep->ppc_gplast_regnum)
{
- /* If we want just one reg, check that this is the one we want. */
- if (regnum != -1 && i != regnum)
- continue;
-
- /* If the register name is empty, it is undefined for this
- processor, so don't display anything. */
- if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
- continue;
-
- fputs_filtered (REGISTER_NAME (i), gdb_stdout);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
-
- /* Get the data in raw format. */
- if (!frame_register_read (selected_frame, i, raw_buffer))
- {
- printf_filtered ("*value not available*\n");
- continue;
- }
-
- /* Convert raw data to virtual format if necessary. */
- if (REGISTER_CONVERTIBLE (i))
- REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
- raw_buffer, virtual_buffer);
- else
- memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i));
-
- /* Print as integer in hex only. */
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 'x', 1, 0, Val_pretty_default);
- printf_filtered ("\n");
+ base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
+
+ /* Build the value in the provided buffer. */
+ /* Read the raw register of which this one is the lower portion. */
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = 4;
+ memcpy ((char *) buffer, temp_buffer + offset, 4);
}
}
static void
-rs6000_altivec_registers_info (char *addr_exp, int from_tty)
+e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, const void *buffer)
{
- int regnum, numregs;
- register char *end;
-
- if (!target_has_registers)
- error ("The program has no registers now.");
- if (selected_frame == NULL)
- error ("No selected frame.");
-
- if (!addr_exp)
- {
- rs6000_do_altivec_registers (-1);
- return;
- }
+ int base_regnum;
+ int offset = 0;
+ char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- numregs = NUM_REGS + NUM_PSEUDO_REGS;
- do
+ if (reg_nr >= tdep->ppc_gp0_regnum
+ && reg_nr <= tdep->ppc_gplast_regnum)
{
- if (addr_exp[0] == '$')
- addr_exp++;
- end = addr_exp;
- while (*end != '\0' && *end != ' ' && *end != '\t')
- ++end;
-
- regnum = target_map_name_to_register (addr_exp, end - addr_exp);
- if (regnum < 0)
- {
- regnum = numregs;
- if (*addr_exp >= '0' && *addr_exp <= '9')
- regnum = atoi (addr_exp); /* Take a number */
- if (regnum >= numregs) /* Bad name, or bad number */
- error ("%.*s: invalid register", end - addr_exp, addr_exp);
- }
-
- rs6000_do_altivec_registers (regnum);
-
- addr_exp = end;
- while (*addr_exp == ' ' || *addr_exp == '\t')
- ++addr_exp;
+ base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
+ /* reg_nr is 32 bit here, and base_regnum is 64 bits. */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = 4;
+
+ /* Let's read the value of the base register into a temporary
+ buffer, so that overwriting the last four bytes with the new
+ value of the pseudo will leave the upper 4 bytes unchanged. */
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
+
+ /* Write as an 8 byte quantity. */
+ memcpy (temp_buffer + offset, (char *) buffer, 4);
+ regcache_raw_write (regcache, base_regnum, temp_buffer);
}
- while (*addr_exp != '\0');
}
-static void
-rs6000_do_registers_info (int regnum, int fpregs)
+/* Convert a dwarf2 register number to a gdb REGNUM. */
+static int
+e500_dwarf2_reg_to_regnum (int num)
{
- register int i;
- int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = (char*) alloca (MAX_REGISTER_VIRTUAL_SIZE);
-
- for (i = 0; i < numregs; i++)
- {
- /* Decide between printing all regs, nonfloat regs, or specific reg. */
- if (regnum == -1)
- {
- if ((TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs)
- || (altivec_register_p (i) && !fpregs))
- continue;
- }
- else
- {
- if (i != regnum)
- continue;
- }
-
- /* If the register name is empty, it is undefined for this
- processor, so don't display anything. */
- if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
- continue;
-
- fputs_filtered (REGISTER_NAME (i), gdb_stdout);
- print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
-
- /* Get the data in raw format. */
- if (!frame_register_read (selected_frame, i, raw_buffer))
- {
- printf_filtered ("*value not available*\n");
- continue;
- }
-
- /* Convert raw data to virtual format if necessary. */
- if (REGISTER_CONVERTIBLE (i))
- REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
- raw_buffer, virtual_buffer);
- else
- memcpy (virtual_buffer, raw_buffer, REGISTER_VIRTUAL_SIZE (i));
-
- /* If virtual format is floating, print it that way, and in raw hex. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
- {
- register int j;
-
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
-
- printf_filtered ("\t(raw 0x");
- for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
- {
- register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
- : REGISTER_RAW_SIZE (i) - 1 - j;
- printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
- }
- printf_filtered (")");
- }
- else
- {
- /* Print the register in hex. */
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 'x', 1, 0, Val_pretty_default);
- /* If not a vector register, print it also in decimal. */
- if (!altivec_register_p (i))
- {
- printf_filtered ("\t");
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
- }
- }
- printf_filtered ("\n");
- }
+ int regnum;
+ if (0 <= num && num <= 31)
+ return num + gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum;
+ else
+ return num;
}
/* Convert a dbx stab register number (from `r' declaration) to a gdb
- REGNUM. */
+ REGNUM. */
static int
rs6000_stab_reg_to_regnum (int num)
{
@@ -1901,7 +1973,7 @@ rs6000_stab_reg_to_regnum (int num)
In RS/6000, struct return addresses are passed as an extra parameter in r3.
In function return, callee is not responsible of returning this address
back. Since gdb needs to find it, we will store in a designated variable
- `rs6000_struct_return_address'. */
+ `rs6000_struct_return_address'. */
static void
rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
@@ -1912,6 +1984,27 @@ rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
+static void
+e500_store_return_value (struct type *type, char *valbuf)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* Everything is returned in GPR3 and up. */
+ int copied = 0;
+ int i = 0;
+ int len = TYPE_LENGTH (type);
+ while (copied < len)
+ {
+ int regnum = gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3 + i;
+ int reg_size = REGISTER_RAW_SIZE (regnum);
+ char *reg_val_buf = alloca (reg_size);
+
+ memcpy (reg_val_buf, valbuf + copied, reg_size);
+ copied += reg_size;
+ write_register_gen (regnum, reg_val_buf);
+ i++;
+ }
+}
static void
rs6000_store_return_value (struct type *type, char *valbuf)
@@ -1922,7 +2015,7 @@ rs6000_store_return_value (struct type *type, char *valbuf)
/* Floating point values are returned starting from FPR1 and up.
Say a double_double_double type could be returned in
- FPR1/FPR2/FPR3 triple. */
+ FPR1/FPR2/FPR3 triple. */
write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
TYPE_LENGTH (type));
@@ -1934,7 +2027,7 @@ rs6000_store_return_value (struct type *type, char *valbuf)
valbuf, TYPE_LENGTH (type));
}
else
- /* Everything else is returned in GPR3 and up. */
+ /* Everything else is returned in GPR3 and up. */
write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
valbuf, TYPE_LENGTH (type));
}
@@ -1952,7 +2045,7 @@ rs6000_extract_struct_value_address (char *regbuf)
/* Return whether PC is in a dummy function call.
FIXME: This just checks for the end of the stack, which is broken
- for things like stepping through gcc nested function stubs. */
+ for things like stepping through gcc nested function stubs. */
static int
rs6000_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
@@ -1960,7 +2053,7 @@ rs6000_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
return sp < pc && pc < fp;
}
-/* Hook called when a new child process is started. */
+/* Hook called when a new child process is started. */
void
rs6000_create_inferior (int pid)
@@ -1998,7 +2091,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
return addr;
/* ADDR is in the data space, so it's a special function pointer. */
- return read_memory_addr (addr, TDEP->wordsize);
+ return read_memory_addr (addr, gdbarch_tdep (current_gdbarch)->wordsize);
}
@@ -2039,41 +2132,44 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
would introduce a really large gap between fpscr and the rest of
the registers for most processors. */
-/* Convenience macros for populating register arrays. */
+/* Convenience macros for populating register arrays. */
-/* Within another macro, convert S to a string. */
+/* Within another macro, convert S to a string. */
#define STR(s) #s
/* Return a struct reg defining register NAME that's 32 bits on 32-bit systems
- and 64 bits on 64-bit systems. */
-#define R(name) { STR(name), 4, 8, 0 }
+ and 64 bits on 64-bit systems. */
+#define R(name) { STR(name), 4, 8, 0, 0 }
/* Return a struct reg defining register NAME that's 32 bits on all
- systems. */
-#define R4(name) { STR(name), 4, 4, 0 }
+ systems. */
+#define R4(name) { STR(name), 4, 4, 0, 0 }
/* Return a struct reg defining register NAME that's 64 bits on all
- systems. */
-#define R8(name) { STR(name), 8, 8, 0 }
+ systems. */
+#define R8(name) { STR(name), 8, 8, 0, 0 }
/* Return a struct reg defining register NAME that's 128 bits on all
- systems. */
-#define R16(name) { STR(name), 16, 16, 0 }
+ systems. */
+#define R16(name) { STR(name), 16, 16, 0, 0 }
-/* Return a struct reg defining floating-point register NAME. */
-#define F(name) { STR(name), 8, 8, 1 }
+/* Return a struct reg defining floating-point register NAME. */
+#define F(name) { STR(name), 8, 8, 1, 0 }
+
+/* Return a struct reg defining a pseudo register NAME. */
+#define P(name) { STR(name), 4, 8, 0, 1}
/* Return a struct reg defining register NAME that's 32 bits on 32-bit
- systems and that doesn't exist on 64-bit systems. */
-#define R32(name) { STR(name), 4, 0, 0 }
+ systems and that doesn't exist on 64-bit systems. */
+#define R32(name) { STR(name), 4, 0, 0, 0 }
/* Return a struct reg defining register NAME that's 64 bits on 64-bit
- systems and that doesn't exist on 32-bit systems. */
-#define R64(name) { STR(name), 0, 8, 0 }
+ systems and that doesn't exist on 32-bit systems. */
+#define R64(name) { STR(name), 0, 8, 0, 0 }
-/* Return a struct reg placeholder for a register that doesn't exist. */
-#define R0 { 0, 0, 0, 0 }
+/* Return a struct reg placeholder for a register that doesn't exist. */
+#define R0 { 0, 0, 0, 0, 0 }
/* UISA registers common across all architectures, including POWER. */
@@ -2103,6 +2199,10 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
#define PPC_UISA_SPRS \
/* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R4(fpscr)
+/* UISA-level SPRs for PowerPC without floating point support. */
+#define PPC_UISA_NOFP_SPRS \
+ /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R0
+
/* Segment registers, for PowerPC. */
#define PPC_SEGMENT_REGS \
/* 71 */ R32(sr0), R32(sr1), R32(sr2), R32(sr3), \
@@ -2122,7 +2222,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
/* 112 */ R(srr0), R(srr1), R(tbl), R(tbu), \
/* 116 */ R4(dec), R(dabr), R4(ear)
-/* AltiVec registers */
+/* AltiVec registers. */
#define PPC_ALTIVEC_REGS \
/*119*/R16(vr0), R16(vr1), R16(vr2), R16(vr3), R16(vr4), R16(vr5), R16(vr6), R16(vr7), \
/*127*/R16(vr8), R16(vr9), R16(vr10),R16(vr11),R16(vr12),R16(vr13),R16(vr14),R16(vr15), \
@@ -2130,8 +2230,22 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
/*143*/R16(vr24),R16(vr25),R16(vr26),R16(vr27),R16(vr28),R16(vr29),R16(vr30),R16(vr31), \
/*151*/R4(vscr), R4(vrsave)
+/* Vectors of hi-lo general purpose registers. */
+#define PPC_EV_REGS \
+ /* 0*/R8(ev0), R8(ev1), R8(ev2), R8(ev3), R8(ev4), R8(ev5), R8(ev6), R8(ev7), \
+ /* 8*/R8(ev8), R8(ev9), R8(ev10),R8(ev11),R8(ev12),R8(ev13),R8(ev14),R8(ev15), \
+ /*16*/R8(ev16),R8(ev17),R8(ev18),R8(ev19),R8(ev20),R8(ev21),R8(ev22),R8(ev23), \
+ /*24*/R8(ev24),R8(ev25),R8(ev26),R8(ev27),R8(ev28),R8(ev29),R8(ev30),R8(ev31)
+
+/* Lower half of the EV registers. */
+#define PPC_GPRS_PSEUDO_REGS \
+ /* 0 */ P(r0), P(r1), P(r2), P(r3), P(r4), P(r5), P(r6), P(r7), \
+ /* 8 */ P(r8), P(r9), P(r10),P(r11),P(r12),P(r13),P(r14),P(r15), \
+ /* 16 */ P(r16),P(r17),P(r18),P(r19),P(r20),P(r21),P(r22),P(r23), \
+ /* 24 */ P(r24),P(r25),P(r26),P(r27),P(r28),P(r29),P(r30),P(r31), \
+
/* IBM POWER (pre-PowerPC) architecture, user-level view. We only cover
- user-level SPR's. */
+ user-level SPR's. */
static const struct reg registers_power[] =
{
COMMON_UISA_REGS,
@@ -2140,7 +2254,7 @@ static const struct reg registers_power[] =
};
/* PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
- view of the PowerPC. */
+ view of the PowerPC. */
static const struct reg registers_powerpc[] =
{
COMMON_UISA_REGS,
@@ -2156,7 +2270,7 @@ static const struct reg registers_powerpc_nofp[] =
PPC_UISA_SPRS
};
-/* IBM PowerPC 403. */
+/* IBM PowerPC 403. */
static const struct reg registers_403[] =
{
COMMON_UISA_REGS,
@@ -2171,7 +2285,7 @@ static const struct reg registers_403[] =
/* 139 */ R(pbl1), R(pbu1), R(pbl2), R(pbu2)
};
-/* IBM PowerPC 403GC. */
+/* IBM PowerPC 403GC. */
static const struct reg registers_403GC[] =
{
COMMON_UISA_REGS,
@@ -2188,7 +2302,7 @@ static const struct reg registers_403GC[] =
/* 147 */ R(tbhu), R(tblu)
};
-/* Motorola PowerPC 505. */
+/* Motorola PowerPC 505. */
static const struct reg registers_505[] =
{
COMMON_UISA_REGS,
@@ -2198,7 +2312,7 @@ static const struct reg registers_505[] =
/* 119 */ R(eie), R(eid), R(nri)
};
-/* Motorola PowerPC 860 or 850. */
+/* Motorola PowerPC 860 or 850. */
static const struct reg registers_860[] =
{
COMMON_UISA_REGS,
@@ -2232,7 +2346,7 @@ static const struct reg registers_601[] =
/* 123 */ R(pir), R(mq), R(rtcu), R(rtcl)
};
-/* Motorola PowerPC 602. */
+/* Motorola PowerPC 602. */
static const struct reg registers_602[] =
{
COMMON_UISA_REGS,
@@ -2244,7 +2358,7 @@ static const struct reg registers_602[] =
/* 127 */ R(sebr), R(ser), R(sp), R(lt)
};
-/* Motorola/IBM PowerPC 603 or 603e. */
+/* Motorola/IBM PowerPC 603 or 603e. */
static const struct reg registers_603[] =
{
COMMON_UISA_REGS,
@@ -2256,7 +2370,7 @@ static const struct reg registers_603[] =
/* 127 */ R(hash2), R(imiss), R(icmp), R(rpa)
};
-/* Motorola PowerPC 604 or 604e. */
+/* Motorola PowerPC 604 or 604e. */
static const struct reg registers_604[] =
{
COMMON_UISA_REGS,
@@ -2268,7 +2382,7 @@ static const struct reg registers_604[] =
/* 127 */ R(sia), R(sda)
};
-/* Motorola/IBM PowerPC 750 or 740. */
+/* Motorola/IBM PowerPC 750 or 740. */
static const struct reg registers_750[] =
{
COMMON_UISA_REGS,
@@ -2284,7 +2398,7 @@ static const struct reg registers_750[] =
};
-/* Motorola PowerPC 7400. */
+/* Motorola PowerPC 7400. */
static const struct reg registers_7400[] =
{
/* gpr0-gpr31, fpr0-fpr31 */
@@ -2299,6 +2413,18 @@ static const struct reg registers_7400[] =
/* FIXME? Add more registers? */
};
+/* Motorola e500. */
+static const struct reg registers_e500[] =
+{
+ R(pc), R(ps),
+ /* cr, lr, ctr, xer, "" */
+ PPC_UISA_NOFP_SPRS,
+ /* 7...38 */
+ PPC_EV_REGS,
+ /* 39...70 */
+ PPC_GPRS_PSEUDO_REGS
+};
+
/* Information about a particular processor variant. */
struct variant
@@ -2309,20 +2435,53 @@ struct variant
/* English description of the variant. */
char *description;
- /* bfd_arch_info.arch corresponding to variant. */
+ /* bfd_arch_info.arch corresponding to variant. */
enum bfd_architecture arch;
- /* bfd_arch_info.mach corresponding to variant. */
+ /* bfd_arch_info.mach corresponding to variant. */
unsigned long mach;
+ /* Number of real registers. */
+ int nregs;
+
+ /* Number of pseudo registers. */
+ int npregs;
+
+ /* Number of total registers (the sum of nregs and npregs). */
+ int num_tot_regs;
+
/* Table of register names; registers[R] is the name of the register
number R. */
- int nregs;
const struct reg *regs;
};
-#define num_registers(list) (sizeof (list) / sizeof((list)[0]))
+#define tot_num_registers(list) (sizeof (list) / sizeof((list)[0]))
+static int
+num_registers (const struct reg *reg_list, int num_tot_regs)
+{
+ int i;
+ int nregs = 0;
+
+ for (i = 0; i < num_tot_regs; i++)
+ if (!reg_list[i].pseudo)
+ nregs++;
+
+ return nregs;
+}
+
+static int
+num_pseudo_registers (const struct reg *reg_list, int num_tot_regs)
+{
+ int i;
+ int npregs = 0;
+
+ for (i = 0; i < num_tot_regs; i++)
+ if (reg_list[i].pseudo)
+ npregs ++;
+
+ return npregs;
+}
/* Information in this table comes from the following web sites:
IBM: http://www.chips.ibm.com:80/products/embedded/
@@ -2334,62 +2493,101 @@ struct variant
If you add entries to this table, please be sure to allow the new
value as an argument to the --with-cpu flag, in configure.in. */
-static const struct variant variants[] =
+static struct variant variants[] =
{
+
{"powerpc", "PowerPC user-level", bfd_arch_powerpc,
- bfd_mach_ppc, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"power", "POWER user-level", bfd_arch_rs6000,
- bfd_mach_rs6k, num_registers (registers_power), registers_power},
+ bfd_mach_rs6k, -1, -1, tot_num_registers (registers_power),
+ registers_power},
{"403", "IBM PowerPC 403", bfd_arch_powerpc,
- bfd_mach_ppc_403, num_registers (registers_403), registers_403},
+ bfd_mach_ppc_403, -1, -1, tot_num_registers (registers_403),
+ registers_403},
{"601", "Motorola PowerPC 601", bfd_arch_powerpc,
- bfd_mach_ppc_601, num_registers (registers_601), registers_601},
+ bfd_mach_ppc_601, -1, -1, tot_num_registers (registers_601),
+ registers_601},
{"602", "Motorola PowerPC 602", bfd_arch_powerpc,
- bfd_mach_ppc_602, num_registers (registers_602), registers_602},
+ bfd_mach_ppc_602, -1, -1, tot_num_registers (registers_602),
+ registers_602},
{"603", "Motorola/IBM PowerPC 603 or 603e", bfd_arch_powerpc,
- bfd_mach_ppc_603, num_registers (registers_603), registers_603},
+ bfd_mach_ppc_603, -1, -1, tot_num_registers (registers_603),
+ registers_603},
{"604", "Motorola PowerPC 604 or 604e", bfd_arch_powerpc,
- 604, num_registers (registers_604), registers_604},
+ 604, -1, -1, tot_num_registers (registers_604),
+ registers_604},
{"403GC", "IBM PowerPC 403GC", bfd_arch_powerpc,
- bfd_mach_ppc_403gc, num_registers (registers_403GC), registers_403GC},
+ bfd_mach_ppc_403gc, -1, -1, tot_num_registers (registers_403GC),
+ registers_403GC},
{"505", "Motorola PowerPC 505", bfd_arch_powerpc,
- bfd_mach_ppc_505, num_registers (registers_505), registers_505},
+ bfd_mach_ppc_505, -1, -1, tot_num_registers (registers_505),
+ registers_505},
{"860", "Motorola PowerPC 860 or 850", bfd_arch_powerpc,
- bfd_mach_ppc_860, num_registers (registers_860), registers_860},
+ bfd_mach_ppc_860, -1, -1, tot_num_registers (registers_860),
+ registers_860},
{"750", "Motorola/IBM PowerPC 750 or 740", bfd_arch_powerpc,
- bfd_mach_ppc_750, num_registers (registers_750), registers_750},
+ bfd_mach_ppc_750, -1, -1, tot_num_registers (registers_750),
+ registers_750},
{"7400", "Motorola/IBM PowerPC 7400 (G4)", bfd_arch_powerpc,
- bfd_mach_ppc_7400, num_registers (registers_7400), registers_7400},
+ bfd_mach_ppc_7400, -1, -1, tot_num_registers (registers_7400),
+ registers_7400},
+ {"e500", "Motorola PowerPC e500", bfd_arch_powerpc,
+ bfd_mach_ppc_e500, -1, -1, tot_num_registers (registers_e500),
+ registers_e500},
/* 64-bit */
{"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc,
- bfd_mach_ppc64, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc64, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"620", "Motorola PowerPC 620", bfd_arch_powerpc,
- bfd_mach_ppc_620, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc_620, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"630", "Motorola PowerPC 630", bfd_arch_powerpc,
- bfd_mach_ppc_630, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc_630, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"a35", "PowerPC A35", bfd_arch_powerpc,
- bfd_mach_ppc_a35, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc_a35, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"rs64ii", "PowerPC rs64ii", bfd_arch_powerpc,
- bfd_mach_ppc_rs64ii, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc_rs64ii, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
{"rs64iii", "PowerPC rs64iii", bfd_arch_powerpc,
- bfd_mach_ppc_rs64iii, num_registers (registers_powerpc), registers_powerpc},
+ bfd_mach_ppc_rs64iii, -1, -1, tot_num_registers (registers_powerpc),
+ registers_powerpc},
- /* FIXME: I haven't checked the register sets of the following. */
+ /* FIXME: I haven't checked the register sets of the following. */
{"rs1", "IBM POWER RS1", bfd_arch_rs6000,
- bfd_mach_rs6k_rs1, num_registers (registers_power), registers_power},
+ bfd_mach_rs6k_rs1, -1, -1, tot_num_registers (registers_power),
+ registers_power},
{"rsc", "IBM POWER RSC", bfd_arch_rs6000,
- bfd_mach_rs6k_rsc, num_registers (registers_power), registers_power},
+ bfd_mach_rs6k_rsc, -1, -1, tot_num_registers (registers_power),
+ registers_power},
{"rs2", "IBM POWER RS2", bfd_arch_rs6000,
- bfd_mach_rs6k_rs2, num_registers (registers_power), registers_power},
+ bfd_mach_rs6k_rs2, -1, -1, tot_num_registers (registers_power),
+ registers_power},
- {0, 0, 0, 0}
+ {0, 0, 0, 0, 0, 0, 0, 0}
};
-#undef num_registers
+/* Initialize the number of registers and pseudo registers in each variant. */
+
+static void
+init_variants (void)
+{
+ struct variant *v;
+
+ for (v = variants; v->name; v++)
+ {
+ if (v->nregs == -1)
+ v->nregs = num_registers (v->regs, v->num_tot_regs);
+ if (v->npregs == -1)
+ v->npregs = num_pseudo_registers (v->regs, v->num_tot_regs);
+ }
+}
/* Return the variant corresponding to architecture ARCH and machine number
- MACH. If no such variant exists, return null. */
+ MACH. If no such variant exists, return null. */
static const struct variant *
find_variant_by_arch (enum bfd_architecture arch, unsigned long mach)
@@ -2403,93 +2601,21 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach)
return NULL;
}
-
-
-
-static void
-process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
-{
- int *os_ident_ptr = obj;
- const char *name;
- unsigned int sectsize;
-
- name = bfd_get_section_name (abfd, sect);
- sectsize = bfd_section_size (abfd, sect);
- if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
- {
- unsigned int name_length, data_length, note_type;
- char *note = alloca (sectsize);
-
- bfd_get_section_contents (abfd, sect, note,
- (file_ptr) 0, (bfd_size_type) sectsize);
-
- name_length = bfd_h_get_32 (abfd, note);
- data_length = bfd_h_get_32 (abfd, note + 4);
- note_type = bfd_h_get_32 (abfd, note + 8);
-
- if (name_length == 4 && data_length == 16 && note_type == 1
- && strcmp (note + 12, "GNU") == 0)
- {
- int os_number = bfd_h_get_32 (abfd, note + 16);
-
- /* The case numbers are from abi-tags in glibc */
- switch (os_number)
- {
- case 0 :
- *os_ident_ptr = ELFOSABI_LINUX;
- break;
- case 1 :
- *os_ident_ptr = ELFOSABI_HURD;
- break;
- case 2 :
- *os_ident_ptr = ELFOSABI_SOLARIS;
- break;
- default :
- internal_error (__FILE__, __LINE__,
- "process_note_abi_sections: unknown OS number %d",
- os_number);
- break;
- }
- }
- }
-}
-
-/* Return one of the ELFOSABI_ constants for BFDs representing ELF
- executables. If it's not an ELF executable or if the OS/ABI couldn't
- be determined, simply return -1. */
-
static int
-get_elfosabi (bfd *abfd)
+gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info)
{
- int elfosabi = -1;
-
- if (abfd != NULL && bfd_get_flavour (abfd) == bfd_target_elf_flavour)
- {
- elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
-
- /* When elfosabi is 0 (ELFOSABI_NONE), this is supposed to indicate
- that we're on a SYSV system. However, GNU/Linux uses a note section
- to record OS/ABI info, but leaves e_ident[EI_OSABI] zero. So we
- have to check the note sections too. */
- if (elfosabi == 0)
- {
- bfd_map_over_sections (abfd,
- process_note_abi_tag_sections,
- &elfosabi);
- }
- }
-
- return elfosabi;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ return print_insn_big_powerpc (memaddr, info);
+ else
+ return print_insn_little_powerpc (memaddr, info);
}
-
-
/* Initialize the current architecture based on INFO. If possible, re-use an
architecture from ARCHES, which is a list of architectures already created
during this debugging session.
Called e.g. at program startup, when reading a core file, and when reading
- a binary file. */
+ a binary file. */
static struct gdbarch *
rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
@@ -2502,8 +2628,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
enum bfd_architecture arch;
unsigned long mach;
bfd abfd;
- int osabi, sysv_abi;
- gdbarch_print_insn_ftype *print_insn;
+ int sysv_abi;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
+ asection *sect;
from_xcoff_exec = info.abfd && info.abfd->format == bfd_object &&
bfd_get_flavour (info.abfd) == bfd_target_xcoff_flavour;
@@ -2513,10 +2640,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
sysv_abi = info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour;
- osabi = get_elfosabi (info.abfd);
+ if (info.abfd)
+ osabi = gdbarch_lookup_osabi (info.abfd);
/* Check word size. If INFO is from a binary file, infer it from
- that, else choose a likely default. */
+ that, else choose a likely default. */
if (from_xcoff_exec)
{
if (bfd_xcoff_is_xcoff64 (info.abfd))
@@ -2540,14 +2668,14 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
wordsize = 4;
}
- /* Find a candidate among extant architectures. */
+ /* 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))
{
/* Word size in the various PowerPC bfd_arch_info structs isn't
meaningful, because 64-bit CPUs can run in 32-bit mode. So, perform
- separate word size check. */
+ separate word size check. */
tdep = gdbarch_tdep (arches->gdbarch);
if (tdep && tdep->wordsize == wordsize && tdep->osabi == osabi)
return arches->gdbarch;
@@ -2576,10 +2704,34 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = xmalloc (sizeof (struct gdbarch_tdep));
tdep->wordsize = wordsize;
tdep->osabi = osabi;
+
+ /* For e500 executables, the apuinfo section is of help here. Such
+ section contains the identifier and revision number of each
+ Application-specific Processing Unit that is present on the
+ chip. The content of the section is determined by the assembler
+ which looks at each instruction and determines which unit (and
+ which version of it) can execute it. In our case we just look for
+ the existance of the section. */
+
+ if (info.abfd)
+ {
+ sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo");
+ if (sect)
+ {
+ arch = info.bfd_arch_info->arch;
+ mach = bfd_mach_ppc_e500;
+ bfd_default_set_arch_mach (&abfd, arch, mach);
+ info.bfd_arch_info = bfd_get_arch_info (&abfd);
+ }
+ }
+
gdbarch = gdbarch_alloc (&info, tdep);
power = arch == bfd_arch_rs6000;
- /* Choose variant. */
+ /* Initialize the number of real and pseudo registers in each variant. */
+ init_variants ();
+
+ /* Choose variant. */
v = find_variant_by_arch (arch, mach);
if (!v)
return NULL;
@@ -2602,20 +2754,53 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->ppc_mq_regnum = -1;
tdep->ppc_fpscr_regnum = power ? 71 : 70;
+ set_gdbarch_pc_regnum (gdbarch, 64);
+ set_gdbarch_sp_regnum (gdbarch, 1);
+ set_gdbarch_fp_regnum (gdbarch, 1);
+ set_gdbarch_deprecated_extract_return_value (gdbarch,
+ rs6000_extract_return_value);
+ set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
+
if (v->arch == bfd_arch_powerpc)
switch (v->mach)
{
case bfd_mach_ppc:
tdep->ppc_vr0_regnum = 71;
tdep->ppc_vrsave_regnum = 104;
+ tdep->ppc_ev0_regnum = -1;
+ tdep->ppc_ev31_regnum = -1;
break;
case bfd_mach_ppc_7400:
tdep->ppc_vr0_regnum = 119;
tdep->ppc_vrsave_regnum = 153;
+ tdep->ppc_ev0_regnum = -1;
+ tdep->ppc_ev31_regnum = -1;
+ break;
+ case bfd_mach_ppc_e500:
+ tdep->ppc_gp0_regnum = 39;
+ tdep->ppc_gplast_regnum = 70;
+ tdep->ppc_toc_regnum = -1;
+ tdep->ppc_ps_regnum = 1;
+ tdep->ppc_cr_regnum = 2;
+ tdep->ppc_lr_regnum = 3;
+ tdep->ppc_ctr_regnum = 4;
+ tdep->ppc_xer_regnum = 5;
+ tdep->ppc_ev0_regnum = 7;
+ tdep->ppc_ev31_regnum = 38;
+ set_gdbarch_pc_regnum (gdbarch, 0);
+ set_gdbarch_sp_regnum (gdbarch, 40);
+ set_gdbarch_fp_regnum (gdbarch, 40);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum);
+ set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write);
+ set_gdbarch_extract_return_value (gdbarch, e500_extract_return_value);
+ set_gdbarch_store_return_value (gdbarch, e500_store_return_value);
break;
default:
tdep->ppc_vr0_regnum = -1;
tdep->ppc_vrsave_regnum = -1;
+ tdep->ppc_ev0_regnum = -1;
+ tdep->ppc_ev31_regnum = -1;
break;
}
@@ -2628,8 +2813,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->lr_frame_offset = 8;
/* Calculate byte offsets in raw register array. */
- tdep->regoff = xmalloc (v->nregs * sizeof (int));
- for (i = off = 0; i < v->nregs; i++)
+ tdep->regoff = xmalloc (v->num_tot_regs * sizeof (int));
+ for (i = off = 0; i < v->num_tot_regs; i++)
{
tdep->regoff[i] = off;
off += regsize (v->regs + i, wordsize);
@@ -2637,12 +2822,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Select instruction printer. */
if (arch == power)
- print_insn = print_insn_rs6000;
- else if (info.byte_order == BFD_ENDIAN_BIG)
- print_insn = print_insn_big_powerpc;
+ set_gdbarch_print_insn (gdbarch, print_insn_rs6000);
else
- print_insn = print_insn_little_powerpc;
- set_gdbarch_print_insn (gdbarch, print_insn);
+ set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc);
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
@@ -2651,9 +2833,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
set_gdbarch_num_regs (gdbarch, v->nregs);
- set_gdbarch_sp_regnum (gdbarch, 1);
- set_gdbarch_fp_regnum (gdbarch, 1);
- set_gdbarch_pc_regnum (gdbarch, 64);
+ set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
set_gdbarch_register_name (gdbarch, rs6000_register_name);
set_gdbarch_register_size (gdbarch, wordsize);
set_gdbarch_register_bytes (gdbarch, off);
@@ -2663,7 +2843,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
set_gdbarch_max_register_virtual_size (gdbarch, 16);
set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type);
- set_gdbarch_do_registers_info (gdbarch, rs6000_do_registers_info);
set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT);
set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
@@ -2685,7 +2864,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
@@ -2697,9 +2876,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual);
set_gdbarch_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw);
set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum);
-
- set_gdbarch_extract_return_value (gdbarch, rs6000_extract_return_value);
-
/* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments()
is correct for the SysV ABI when the wordsize is 8, but I'm also
fairly certain that ppc_sysv_abi_push_arguments() will give even
@@ -2712,9 +2888,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
else
set_gdbarch_push_arguments (gdbarch, rs6000_push_arguments);
- set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, rs6000_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
@@ -2726,57 +2901,23 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Not sure on this. FIXMEmgo */
set_gdbarch_frame_args_skip (gdbarch, 8);
- /* Until November 2001, gcc was not complying to the SYSV ABI for
- returning structures less than or equal to 8 bytes in size. It was
- returning everything in memory. When this was corrected, it wasn't
- fixed for native platforms. */
if (sysv_abi)
- {
- if (osabi == ELFOSABI_LINUX
- || osabi == ELFOSABI_NETBSD
- || osabi == ELFOSABI_FREEBSD)
- set_gdbarch_use_struct_convention (gdbarch,
- ppc_sysv_abi_broken_use_struct_convention);
- else
- set_gdbarch_use_struct_convention (gdbarch,
- ppc_sysv_abi_use_struct_convention);
- }
+ set_gdbarch_use_struct_convention (gdbarch,
+ ppc_sysv_abi_use_struct_convention);
else
- {
- set_gdbarch_use_struct_convention (gdbarch,
- generic_use_struct_convention);
- }
+ set_gdbarch_use_struct_convention (gdbarch,
+ generic_use_struct_convention);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
- /* Note: kevinb/2002-04-12: See note above regarding *_push_arguments().
- The same remarks hold for the methods below. */
- if (osabi == ELFOSABI_LINUX && wordsize == 4)
- {
- set_gdbarch_frameless_function_invocation (gdbarch,
- ppc_linux_frameless_function_invocation);
- set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain);
- set_gdbarch_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
-
- set_gdbarch_frame_init_saved_regs (gdbarch,
- ppc_linux_frame_init_saved_regs);
- set_gdbarch_init_extra_frame_info (gdbarch,
- ppc_linux_init_extra_frame_info);
-
- set_gdbarch_memory_remove_breakpoint (gdbarch,
- ppc_linux_memory_remove_breakpoint);
- set_solib_svr4_fetch_link_map_offsets
- (gdbarch, ppc_linux_svr4_fetch_link_map_offsets);
- }
- else
- {
- set_gdbarch_frameless_function_invocation (gdbarch,
- rs6000_frameless_function_invocation);
- set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain);
- set_gdbarch_frame_saved_pc (gdbarch, rs6000_frame_saved_pc);
- set_gdbarch_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs);
- set_gdbarch_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info);
- }
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ rs6000_frameless_function_invocation);
+ set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain);
+ set_gdbarch_frame_saved_pc (gdbarch, rs6000_frame_saved_pc);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs);
+ set_gdbarch_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info);
+
if (!sysv_abi)
{
/* Handle RS/6000 function pointers (which are really function
@@ -2792,9 +2933,24 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
now that the C compiler delays popping them. */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch, osabi);
+
return gdbarch;
}
+static void
+rs6000_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep == NULL)
+ return;
+
+ fprintf_unfiltered (file, "rs6000_dump_tdep: OS ABI = %s\n",
+ gdbarch_osabi_name (tdep->osabi));
+}
+
static struct cmd_list_element *info_powerpc_cmdlist = NULL;
static void
@@ -2808,16 +2964,11 @@ rs6000_info_powerpc_command (char *args, int from_tty)
void
_initialize_rs6000_tdep (void)
{
- register_gdbarch_init (bfd_arch_rs6000, rs6000_gdbarch_init);
- register_gdbarch_init (bfd_arch_powerpc, rs6000_gdbarch_init);
+ gdbarch_register (bfd_arch_rs6000, rs6000_gdbarch_init, rs6000_dump_tdep);
+ gdbarch_register (bfd_arch_powerpc, rs6000_gdbarch_init, rs6000_dump_tdep);
/* Add root prefix command for "info powerpc" commands */
add_prefix_cmd ("powerpc", class_info, rs6000_info_powerpc_command,
"Various POWERPC info specific commands.",
&info_powerpc_cmdlist, "info powerpc ", 0, &infolist);
-
- add_cmd ("altivec", class_info, rs6000_altivec_registers_info,
- "Display the contents of the AltiVec registers.",
- &info_powerpc_cmdlist);
-
}
diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c
index 19e89238374..b7f59188850 100644
--- a/gdb/s390-nat.c
+++ b/gdb/s390-nat.c
@@ -273,14 +273,22 @@ supply_fpregset (fpregset_t * fpregsetp)
void
fill_gregset (gregset_t * gregsetp, int regno)
{
+ int regi;
greg_t *gregp = (greg_t *) gregsetp;
- if (regno >= S390_FIRST_CR && regno <= S390_LAST_CR)
- supply_register (regno, NULL);
- else if (regno != -1)
- supply_register (regno, (char *) &gregp[regno]);
- else
- supply_gregset (gregsetp);
+ if (regno < 0)
+ {
+ regcache_collect (S390_PSWM_REGNUM, &gregp[S390_PSWM_REGNUM]);
+ regcache_collect (S390_PC_REGNUM, &gregp[S390_PC_REGNUM]);
+ for (regi = 0; regi < S390_NUM_GPRS; regi++)
+ regcache_collect (S390_GP0_REGNUM + regi,
+ &gregp[S390_GP0_REGNUM + regi]);
+ for (regi = 0; regi < S390_NUM_ACRS; regi++)
+ regcache_collect (S390_FIRST_ACR + regi,
+ &gregp[S390_FIRST_ACR + regi]);
+ }
+ else if (regno >= S390_PSWM_REGNUM && regno <= S390_LAST_ACR)
+ regcache_collect (regno, &gregp[regno]);
}
/* Given a pointer to a floating point register set in /proc format
@@ -291,12 +299,18 @@ fill_gregset (gregset_t * gregsetp, int regno)
void
fill_fpregset (fpregset_t * fpregsetp, int regno)
{
- if (regno == -1)
- supply_fpregset (fpregsetp);
- else
- supply_register (regno,
- &((char *) fpregsetp)[REGISTER_BYTE (regno) -
- REGISTER_BYTE (S390_FPC_REGNUM)]);
+ int regi;
+
+ if (regno < 0)
+ {
+ regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+ for (regi = 0; regi < S390_NUM_FPRS; regi++)
+ regcache_collect (S390_FP0_REGNUM + regi, &fpregsetp->fprs[regi]);
+ }
+ else if (regno == S390_FPC_REGNUM)
+ regcache_collect (S390_FPC_REGNUM, &fpregsetp->fpc);
+ else if (regno >= S390_FP0_REGNUM && regno <= S390_FPLAST_REGNUM)
+ regcache_collect (regno, &fpregsetp->fprs[regno - S390_FP0_REGNUM]);
}
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index c69aca69fa3..49a15a2f46a 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -150,7 +150,7 @@ s390_memset_extra_info (struct frame_extra_info *fextra_info)
-char *
+const char *
s390_register_name (int reg_nr)
{
static char *register_names[] = {
@@ -955,7 +955,7 @@ s390_frame_saved_pc_nofix (struct frame_info *fi)
if (fi->extra_info && fi->extra_info->saved_pc_valid)
return fi->extra_info->saved_pc;
- if (generic_find_dummy_frame (fi->pc, fi->frame))
+ if (deprecated_generic_find_dummy_frame (fi->pc, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, S390_PC_REGNUM);
s390_frame_init_saved_regs (fi);
@@ -1009,7 +1009,7 @@ s390_frame_chain (struct frame_info *thisframe)
{
CORE_ADDR prev_fp = 0;
- if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
+ if (deprecated_generic_find_dummy_frame (thisframe->pc, thisframe->frame))
return generic_read_register_dummy (thisframe->pc, thisframe->frame,
S390_SP_REGNUM);
else
@@ -1189,7 +1189,7 @@ gdb_print_insn_s390 (bfd_vma memaddr, disassemble_info * info)
/* Not the most efficent code in the world */
int
-s390_fp_regnum ()
+s390_fp_regnum (void)
{
int regno = S390_SP_REGNUM;
struct frame_extra_info fextra_info;
@@ -1204,7 +1204,7 @@ s390_fp_regnum ()
}
CORE_ADDR
-s390_read_fp ()
+s390_read_fp (void)
{
return read_register (s390_fp_regnum ());
}
@@ -1246,7 +1246,7 @@ s390_pop_frame_regular (struct frame_info *frame)
Used in the contexts of the "return" command, and of
target function calls from the debugger. */
void
-s390_pop_frame ()
+s390_pop_frame (void)
{
/* This function checks for and handles generic dummy frames, and
calls back to our function for ordinary frames. */
@@ -1773,8 +1773,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* We can't do this */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_store_struct_return (gdbarch, s390_store_struct_return);
- set_gdbarch_extract_return_value (gdbarch, s390_extract_return_value);
- set_gdbarch_store_return_value (gdbarch, s390_store_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, s390_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, s390_store_return_value);
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT
but not always. */
@@ -1811,14 +1811,14 @@ 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_get_saved_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);
set_gdbarch_stab_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_stab_reg_to_regnum);
- set_gdbarch_extract_struct_value_address
+ set_gdbarch_deprecated_extract_struct_value_address
(gdbarch, generic_cannot_extract_struct_value_address);
/* Parameters for inferior function calls. */
@@ -1874,7 +1874,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
void
-_initialize_s390_tdep ()
+_initialize_s390_tdep (void)
{
/* Hook us into the gdbarch mechanism. */
diff --git a/gdb/ser-e7kpc.c b/gdb/ser-e7kpc.c
index 49b2c89c324..063cca13d63 100644
--- a/gdb/ser-e7kpc.c
+++ b/gdb/ser-e7kpc.c
@@ -423,16 +423,12 @@ static struct serial_ops e7000pc_ops =
e7000pc_noop, /* wait for output to drain */
};
-void
-_initialize_ser_e7000pc (void)
-{
- serial_add_interface (&e7000pc_ops);
-}
-#else
+#endif /*_WIN32 or __GO32__*/
void
_initialize_ser_e7000pc (void)
{
-
+#if defined __GO32__ || defined _WIN32
+ serial_add_interface (&e7000pc_ops);
+#endif
}
-#endif
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 924b675a276..b133b035f6b 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -26,7 +26,6 @@
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "symfile.h"
#include "gdbtypes.h"
@@ -68,7 +67,7 @@ struct frame_extra_info
int f_offset;
};
-static char *
+static const char *
sh_generic_register_name (int reg_nr)
{
static char *register_names[] =
@@ -90,7 +89,7 @@ sh_generic_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh_register_name (int reg_nr)
{
static char *register_names[] =
@@ -112,7 +111,7 @@ sh_sh_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3_register_name (int reg_nr)
{
static char *register_names[] =
@@ -134,7 +133,7 @@ sh_sh3_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3e_register_name (int reg_nr)
{
static char *register_names[] =
@@ -156,7 +155,7 @@ sh_sh3e_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh_dsp_register_name (int reg_nr)
{
static char *register_names[] =
@@ -178,7 +177,7 @@ sh_sh_dsp_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh3_dsp_register_name (int reg_nr)
{
static char *register_names[] =
@@ -201,7 +200,7 @@ sh_sh3_dsp_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh4_register_name (int reg_nr)
{
static char *register_names[] =
@@ -236,7 +235,7 @@ sh_sh4_register_name (int reg_nr)
return register_names[reg_nr];
}
-static char *
+static const char *
sh_sh64_register_name (int reg_nr)
{
static char *register_names[] =
@@ -1046,7 +1045,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
if (fi->saved_regs == NULL)
frame_saved_regs_zalloc (fi);
@@ -1385,7 +1384,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
int insn_size;
int gdb_register_number;
int register_number;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
@@ -1586,7 +1585,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
@@ -1814,8 +1813,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
- generic_find_dummy_frame (frame->pc, frame->frame) +
- REGISTER_BYTE (regnum),
+ (deprecated_generic_find_dummy_frame (frame->pc, frame->frame)
+ + REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
return;
}
@@ -2251,11 +2250,12 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
}
#endif
/* Note: must use write_register_gen here instead
- of regcache_write, because regcache_write works
- only for real registers, not pseudo.
- write_register_gen will call the gdbarch
- function to do register writes, and that will
- properly know how to deal with pseudoregs. */
+ of regcache_raw_write, because
+ regcache_raw_write works only for real
+ registers, not pseudo. write_register_gen will
+ call the gdbarch function to do register
+ writes, and that will properly know how to deal
+ with pseudoregs. */
write_register_gen (regnum, val);
fp_args[double_arg_index] = 1;
fp_args[double_arg_index + 1] = 1;
@@ -3331,7 +3331,7 @@ sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
static void
sh_sh4_register_convert_to_raw (struct type *type, int regnum,
- char *from, char *to)
+ const void *from, void *to)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
@@ -3347,7 +3347,7 @@ sh_sh4_register_convert_to_raw (struct type *type, int regnum,
void
sh_sh64_register_convert_to_raw (struct type *type, int regnum,
- char *from, char *to)
+ const void *from, void *to)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
@@ -3371,11 +3371,12 @@ sh_sh64_register_convert_to_raw (struct type *type, int regnum,
}
void
-sh_pseudo_register_read (int reg_nr, char *buffer)
+sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, void *buffer)
{
int base_regnum, portion;
char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
&& reg_nr <= tdep->DR_LAST_REGNUM)
@@ -3385,9 +3386,9 @@ sh_pseudo_register_read (int reg_nr, char *buffer)
/* Build the value in the provided buffer. */
/* Read the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
- regcache_read (base_regnum + portion,
- temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
/* We must pay attention to the endiannes. */
sh_sh4_register_convert_to_virtual (reg_nr,
REGISTER_VIRTUAL_TYPE (reg_nr),
@@ -3400,30 +3401,21 @@ sh_pseudo_register_read (int reg_nr, char *buffer)
/* Read the real regs for which this one is an alias. */
for (portion = 0; portion < 4; portion++)
- regcache_read (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
}
static void
-sh4_register_read (struct gdbarch *gdbarch, int reg_nr, char *buffer)
-{
- if (reg_nr >= 0 && reg_nr < gdbarch_tdep (current_gdbarch)->DR0_REGNUM)
- /* It is a regular register. */
- regcache_read (reg_nr, buffer);
- else
- /* It is a pseudo register and we need to construct its value */
- sh_pseudo_register_read (reg_nr, buffer);
-}
-
-static void
-sh64_pseudo_register_read (int reg_nr, char *buffer)
+sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, void *buffer)
{
int base_regnum;
int portion;
int offset = 0;
char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
&& reg_nr <= tdep->DR_LAST_REGNUM)
@@ -3434,9 +3426,9 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* DR regs are double precision registers obtained by
concatenating 2 single precision floating point registers. */
for (portion = 0; portion < 2; portion++)
- regcache_read (base_regnum + portion,
- temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
/* We must pay attention to the endiannes. */
sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
@@ -3453,8 +3445,9 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* FPP regs are pairs of single precision registers obtained by
concatenating 2 single precision floating point registers. */
for (portion = 0; portion < 2; portion++)
- regcache_read (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
else if (reg_nr >= tdep->FV0_REGNUM
@@ -3466,8 +3459,9 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* FV regs are vectors of single precision registers obtained by
concatenating 4 single precision floating point registers. */
for (portion = 0; portion < 4; portion++)
- regcache_read (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
/* sh compact pseudo registers. 1-to-1 with a shmedia register */
@@ -3477,7 +3471,7 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
base_regnum = sh64_compact_reg_base_num (reg_nr);
/* Build the value in the provided buffer. */
- regcache_read (base_regnum, temp_buffer);
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = 4;
memcpy (buffer, temp_buffer + offset, 4); /* get LOWER 32 bits only????*/
@@ -3491,7 +3485,7 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* Build the value in the provided buffer. */
/* Floating point registers map 1-1 to the media fp regs,
they have the same size and endienness. */
- regcache_read (base_regnum, buffer);
+ regcache_raw_read (regcache, base_regnum, buffer);
}
else if (reg_nr >= tdep->DR0_C_REGNUM
@@ -3502,9 +3496,9 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* DR_C regs are double precision registers obtained by
concatenating 2 single precision floating point registers. */
for (portion = 0; portion < 2; portion++)
- regcache_read (base_regnum + portion,
- temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
/* We must pay attention to the endiannes. */
sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
@@ -3520,8 +3514,9 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* FV_C regs are vectors of single precision registers obtained by
concatenating 4 single precision floating point registers. */
for (portion = 0; portion < 4; portion++)
- regcache_read (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
else if (reg_nr == tdep->FPSCR_C_REGNUM)
@@ -3552,11 +3547,11 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
*/
/* *INDENT-ON* */
/* Get FPSCR into a local buffer */
- regcache_read (fpscr_base_regnum, temp_buffer);
+ regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
/* Get value as an int. */
fpscr_value = extract_unsigned_integer (temp_buffer, 4);
/* Get SR into a local buffer */
- regcache_read (sr_base_regnum, temp_buffer);
+ regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
/* Get value as an int. */
sr_value = extract_unsigned_integer (temp_buffer, 4);
/* Build the new value. */
@@ -3574,28 +3569,17 @@ sh64_pseudo_register_read (int reg_nr, char *buffer)
/* FPUL_C register is floating point register 32,
same size, same endianness. */
- regcache_read (base_regnum, buffer);
+ regcache_raw_read (regcache, base_regnum, buffer);
}
}
-static void
-sh64_register_read (struct gdbarch *gdbarch, int reg_nr, char *buffer)
-{
-
- if (reg_nr >= 0 && reg_nr < gdbarch_tdep (current_gdbarch)->DR0_REGNUM)
- /* It is a regular register. */
- regcache_read (reg_nr, buffer);
- else
- /* It is a pseudo register and we need to construct its value */
- sh64_pseudo_register_read (reg_nr, buffer);
-}
-
void
-sh_pseudo_register_write (int reg_nr, char *buffer)
+sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, const void *buffer)
{
int base_regnum, portion;
char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
&& reg_nr <= tdep->DR_LAST_REGNUM)
@@ -3608,8 +3592,9 @@ sh_pseudo_register_write (int reg_nr, char *buffer)
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
- regcache_write (base_regnum + portion,
- temp_buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
else if (reg_nr >= tdep->FV0_REGNUM
&& reg_nr <= tdep->FV_LAST_REGNUM)
@@ -3618,29 +3603,20 @@ sh_pseudo_register_write (int reg_nr, char *buffer)
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 4; portion++)
- regcache_write (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
}
-static void
-sh4_register_write (struct gdbarch *gdbarch, int reg_nr, char *buffer)
-{
- if (reg_nr >= 0 && reg_nr < gdbarch_tdep (current_gdbarch)->DR0_REGNUM)
- /* It is a regular register. */
- regcache_write (reg_nr, buffer);
- else
- /* It is a pseudo register and we need to construct its value */
- sh_pseudo_register_write (reg_nr, buffer);
-}
-
void
-sh64_pseudo_register_write (int reg_nr, char *buffer)
+sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, const void *buffer)
{
int base_regnum, portion;
int offset;
char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
&& reg_nr <= tdep->DR_LAST_REGNUM)
@@ -3653,8 +3629,9 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
- regcache_write (base_regnum + portion,
- temp_buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
else if (reg_nr >= tdep->FPP0_REGNUM
@@ -3664,8 +3641,9 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
- regcache_write (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
else if (reg_nr >= tdep->FV0_REGNUM
@@ -3675,8 +3653,9 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 4; portion++)
- regcache_write (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
/* sh compact general pseudo registers. 1-to-1 with a shmedia
@@ -3693,10 +3672,10 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
/* Let's read the value of the base register into a temporary
buffer, so that overwriting the last four bytes with the new
value of the pseudo will leave the upper 4 bytes unchanged. */
- regcache_read (base_regnum, temp_buffer);
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
/* Write as an 8 byte quantity */
memcpy (temp_buffer + offset, buffer, 4);
- regcache_write (base_regnum, temp_buffer);
+ regcache_raw_write (regcache, base_regnum, temp_buffer);
}
/* sh floating point compact pseudo registers. 1-to-1 with a shmedia
@@ -3705,7 +3684,7 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
&& reg_nr <= tdep->FP_LAST_C_REGNUM)
{
base_regnum = sh64_compact_reg_base_num (reg_nr);
- regcache_write (base_regnum, buffer);
+ regcache_raw_write (regcache, base_regnum, buffer);
}
else if (reg_nr >= tdep->DR0_C_REGNUM
@@ -3718,8 +3697,9 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
buffer, temp_buffer);
- regcache_write (base_regnum + portion,
- temp_buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
}
@@ -3730,8 +3710,9 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
for (portion = 0; portion < 4; portion++)
{
- regcache_write (base_regnum + portion,
- buffer + REGISTER_RAW_SIZE (base_regnum) * portion);
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
}
}
@@ -3773,39 +3754,28 @@ sh64_pseudo_register_write (int reg_nr, char *buffer)
fpscr_value = fpscr_c_value & fpscr_mask;
sr_value = (fpscr_value & sr_mask) >> 6;
- regcache_read (fpscr_base_regnum, temp_buffer);
+ regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
old_fpscr_value = extract_unsigned_integer (temp_buffer, 4);
old_fpscr_value &= 0xfffc0002;
fpscr_value |= old_fpscr_value;
store_unsigned_integer (temp_buffer, 4, fpscr_value);
- regcache_write (fpscr_base_regnum, temp_buffer);
+ regcache_raw_write (regcache, fpscr_base_regnum, temp_buffer);
- regcache_read (sr_base_regnum, temp_buffer);
+ regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
old_sr_value = extract_unsigned_integer (temp_buffer, 4);
old_sr_value &= 0xffff8fff;
sr_value |= old_sr_value;
store_unsigned_integer (temp_buffer, 4, sr_value);
- regcache_write (sr_base_regnum, temp_buffer);
+ regcache_raw_write (regcache, sr_base_regnum, temp_buffer);
}
else if (reg_nr == tdep->FPUL_C_REGNUM)
{
base_regnum = sh64_compact_reg_base_num (reg_nr);
- regcache_write (base_regnum, buffer);
+ regcache_raw_write (regcache, base_regnum, buffer);
}
}
-static void
-sh64_register_write (struct gdbarch *gdbarch, int reg_nr, char *buffer)
-{
- if (reg_nr >= 0 && reg_nr < gdbarch_tdep (current_gdbarch)->DR0_REGNUM)
- /* It is a regular register. */
- regcache_write (reg_nr, buffer);
- else
- /* It is a pseudo register and we need to construct its value */
- sh64_pseudo_register_write (reg_nr, buffer);
-}
-
/* Floating point vector of 4 float registers. */
static void
do_fv_register_info (int fv_regnum)
@@ -4179,6 +4149,47 @@ sh_linux_svr4_fetch_link_map_offsets (void)
#endif /* SVR4_SHARED_LIBS */
+enum
+{
+ DSP_DSR_REGNUM = 24,
+ DSP_A0G_REGNUM,
+ DSP_A0_REGNUM,
+ DSP_A1G_REGNUM,
+ DSP_A1_REGNUM,
+ DSP_M0_REGNUM,
+ DSP_M1_REGNUM,
+ DSP_X0_REGNUM,
+ DSP_X1_REGNUM,
+ DSP_Y0_REGNUM,
+ DSP_Y1_REGNUM,
+
+ DSP_MOD_REGNUM = 40,
+
+ DSP_RS_REGNUM = 43,
+ DSP_RE_REGNUM,
+
+ DSP_R0_BANK_REGNUM = 51,
+ DSP_R7_BANK_REGNUM = DSP_R0_BANK_REGNUM + 7
+};
+
+static int
+sh_dsp_register_sim_regno (int nr)
+{
+ if (legacy_register_sim_regno (nr) < 0)
+ return legacy_register_sim_regno (nr);
+ if (nr >= DSP_DSR_REGNUM && nr < DSP_Y1_REGNUM)
+ return nr - DSP_DSR_REGNUM + SIM_SH_DSR_REGNUM;
+ if (nr == DSP_MOD_REGNUM)
+ return SIM_SH_MOD_REGNUM;
+ if (nr == DSP_RS_REGNUM)
+ return SIM_SH_RS_REGNUM;
+ if (nr == DSP_RE_REGNUM)
+ return SIM_SH_RE_REGNUM;
+ if (nr >= DSP_R0_BANK_REGNUM && nr <= DSP_R7_BANK_REGNUM)
+ return nr - DSP_R0_BANK_REGNUM + SIM_SH_R0_BANK_REGNUM;
+ return nr;
+}
+
static gdbarch_init_ftype sh_gdbarch_init;
static struct gdbarch *
@@ -4188,7 +4199,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
gdbarch_register_name_ftype *sh_register_name;
- gdbarch_store_return_value_ftype *sh_store_return_value;
+ gdbarch_deprecated_store_return_value_ftype *sh_store_return_value;
gdbarch_register_virtual_type_ftype *sh_register_virtual_type;
enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
@@ -4270,13 +4281,14 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_chain (gdbarch, sh_frame_chain);
set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
set_gdbarch_init_extra_frame_info (gdbarch, sh_init_extra_frame_info);
- set_gdbarch_extract_return_value (gdbarch, sh_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value);
set_gdbarch_push_arguments (gdbarch, sh_push_arguments);
set_gdbarch_store_struct_return (gdbarch, sh_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention);
- set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
set_gdbarch_pop_frame (gdbarch, sh_pop_frame);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh);
+ set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
skip_prologue_hard_way = sh_skip_prologue_hard_way;
do_pseudo_register = sh_do_pseudo_register;
@@ -4311,6 +4323,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size);
set_gdbarch_register_byte (gdbarch, sh_default_register_byte);
+ set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno);
tdep->DSR_REGNUM = 24;
tdep->A0G_REGNUM = 25;
tdep->A0_REGNUM = 26;
@@ -4347,7 +4360,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size);
set_gdbarch_register_byte (gdbarch, sh_default_register_byte);
- set_gdbarch_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
set_gdbarch_fp0_regnum (gdbarch, 25);
tdep->FPUL_REGNUM = 23;
tdep->FPSCR_REGNUM = 24;
@@ -4387,7 +4400,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
sh_store_return_value = sh3e_sh4_store_return_value;
sh_register_virtual_type = sh_sh4_register_virtual_type;
set_gdbarch_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs);
- set_gdbarch_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
set_gdbarch_fp0_regnum (gdbarch, 25);
set_gdbarch_register_raw_size (gdbarch, sh_sh4_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, sh_sh4_register_raw_size);
@@ -4395,8 +4408,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_pseudo_regs (gdbarch, 12);
set_gdbarch_max_register_raw_size (gdbarch, 4 * 4);
set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4);
- set_gdbarch_register_read (gdbarch, sh4_register_read);
- set_gdbarch_register_write (gdbarch, sh4_register_write);
+ set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
tdep->FPUL_REGNUM = 23;
tdep->FPSCR_REGNUM = 24;
tdep->FP_LAST_REGNUM = 40;
@@ -4487,8 +4500,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Or should that go in the virtual_size? */
/*set_gdbarch_max_register_virtual_size (gdbarch, 8);*/
set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4);
- set_gdbarch_register_read (gdbarch, sh64_register_read);
- set_gdbarch_register_write (gdbarch, sh64_register_write);
+ set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
set_gdbarch_do_registers_info (gdbarch, sh64_do_registers_info);
set_gdbarch_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs);
@@ -4496,10 +4509,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
set_gdbarch_frame_chain (gdbarch, sh64_frame_chain);
set_gdbarch_get_saved_register (gdbarch, sh64_get_saved_register);
- set_gdbarch_extract_return_value (gdbarch, sh64_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value);
set_gdbarch_push_arguments (gdbarch, sh64_push_arguments);
/*set_gdbarch_store_struct_return (gdbarch, sh64_store_struct_return);*/
- set_gdbarch_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
set_gdbarch_pop_frame (gdbarch, sh64_pop_frame);
set_gdbarch_elf_make_msymbol_special (gdbarch,
@@ -4552,7 +4565,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_push_return_address (gdbarch, sh_push_return_address);
- set_gdbarch_store_return_value (gdbarch, sh_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sh_store_return_value);
set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
diff --git a/gdb/signals/signals.c b/gdb/signals/signals.c
index 643e450fbbe..0057e60e377 100644
--- a/gdb/signals/signals.c
+++ b/gdb/signals/signals.c
@@ -498,8 +498,11 @@ target_signal_from_host (int hostsig)
if (33 <= hostsig && hostsig <= 63)
return (enum target_signal)
(hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
- else if (hostsig == 64)
- return TARGET_SIGNAL_REALTIME_64;
+ else if (hostsig == 32)
+ return TARGET_SIGNAL_REALTIME_32;
+ else if (64 <= hostsig && hostsig <= 127)
+ return (enum target_signal)
+ (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
else
error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
}
@@ -784,8 +787,21 @@ do_target_signal_to_host (enum target_signal oursig,
if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
return retsig;
}
- else if (oursig == TARGET_SIGNAL_REALTIME_64)
- return 64;
+ else if (oursig == TARGET_SIGNAL_REALTIME_32)
+ {
+ /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
+ TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */
+ return 32;
+ }
+ else if (oursig >= TARGET_SIGNAL_REALTIME_64
+ && oursig <= TARGET_SIGNAL_REALTIME_127)
+ {
+ /* This block of signals is continuous, and
+ TARGET_SIGNAL_REALTIME_64 is 64 by definition. */
+ int retsig =
+ (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
+ return retsig;
+ }
#endif
*oursig_ok = 0;
return 0;
diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c
new file mode 100644
index 00000000000..1cfa452b06d
--- /dev/null
+++ b/gdb/solib-irix.c
@@ -0,0 +1,725 @@
+/* Shared library support for IRIX.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
+
+ This file was created using portions of irix5-nat.c originally
+ contributed to GDB by Ian Lance Taylor.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "symtab.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "inferior.h"
+
+#include "solist.h"
+
+/* Link map info to include in an allocate so_list entry. Unlike some
+ of the other solib backends, this (Irix) backend chooses to decode
+ the link map info obtained from the target and store it as (mostly)
+ CORE_ADDRs which need no further decoding. This is more convenient
+ because there are three different link map formats to worry about.
+ We use a single routine (fetch_lm_info) to read (and decode) the target
+ specific link map data. */
+
+struct lm_info
+{
+ CORE_ADDR addr; /* address of obj_info or obj_list
+ struct on target (from which the
+ following information is obtained). */
+ CORE_ADDR next; /* address of next item in list. */
+ CORE_ADDR reloc_offset; /* amount to relocate by */
+ CORE_ADDR pathname_addr; /* address of pathname */
+ int pathname_len; /* length of pathname */
+};
+
+/* It's not desirable to use the system header files to obtain the
+ structure of the obj_list or obj_info structs. Therefore, we use a
+ platform neutral representation which has been derived from the IRIX
+ header files. */
+
+typedef struct
+{
+ char b[4];
+}
+gdb_int32_bytes;
+typedef struct
+{
+ char b[8];
+}
+gdb_int64_bytes;
+
+/* The "old" obj_list struct. This is used with old (o32) binaries.
+ The ``data'' member points at a much larger and more complicated
+ struct which we will only refer to by offsets. See
+ fetch_lm_info(). */
+
+struct irix_obj_list
+{
+ gdb_int32_bytes data;
+ gdb_int32_bytes next;
+ gdb_int32_bytes prev;
+};
+
+/* The ELF32 and ELF64 versions of the above struct. The oi_magic value
+ corresponds to the ``data'' value in the "old" struct. When this value
+ is 0xffffffff, the data will be in one of the following formats. The
+ ``oi_size'' field is used to decide which one we actually have. */
+
+struct irix_elf32_obj_info
+{
+ gdb_int32_bytes oi_magic;
+ gdb_int32_bytes oi_size;
+ gdb_int32_bytes oi_next;
+ gdb_int32_bytes oi_prev;
+ gdb_int32_bytes oi_ehdr;
+ gdb_int32_bytes oi_orig_ehdr;
+ gdb_int32_bytes oi_pathname;
+ gdb_int32_bytes oi_pathname_len;
+};
+
+struct irix_elf64_obj_info
+{
+ gdb_int32_bytes oi_magic;
+ gdb_int32_bytes oi_size;
+ gdb_int64_bytes oi_next;
+ gdb_int64_bytes oi_prev;
+ gdb_int64_bytes oi_ehdr;
+ gdb_int64_bytes oi_orig_ehdr;
+ gdb_int64_bytes oi_pathname;
+ gdb_int32_bytes oi_pathname_len;
+ gdb_int32_bytes padding;
+};
+
+/* Union of all of the above (plus a split out magic field). */
+
+union irix_obj_info
+{
+ gdb_int32_bytes magic;
+ struct irix_obj_list ol32;
+ struct irix_elf32_obj_info oi32;
+ struct irix_elf64_obj_info oi64;
+};
+
+/* MIPS sign extends its 32 bit addresses. We could conceivably use
+ extract_typed_address here, but to do so, we'd have to construct an
+ appropriate type. Calling extract_signed_integer or
+ extract_address seems simpler. */
+
+static CORE_ADDR
+extract_mips_address (void *addr, int len)
+{
+ if (len <= 32)
+ return extract_signed_integer (addr, len);
+ else
+ return extract_address (addr, len);
+}
+
+/* Fetch and return the link map data associated with ADDR. Note that
+ this routine automatically determines which (of three) link map
+ formats is in use by the target. */
+
+struct lm_info
+fetch_lm_info (CORE_ADDR addr)
+{
+ struct lm_info li;
+ union irix_obj_info buf;
+
+ li.addr = addr;
+
+ /* The smallest region that we'll need is for buf.ol32. We'll read
+ that first. We'll read more of the buffer later if we have to deal
+ with one of the other cases. (We don't want to incur a memory error
+ if we were to read a larger region that generates an error due to
+ being at the end of a page or the like.) */
+ read_memory (addr, (char *) &buf, sizeof (buf.ol32));
+
+ if (extract_unsigned_integer (&buf.magic, sizeof (buf.magic)) != 0xffffffff)
+ {
+ /* Use buf.ol32... */
+ char obj_buf[432];
+ CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
+ sizeof (buf.ol32.data));
+ li.next = extract_mips_address (&buf.ol32.next, sizeof (buf.ol32.next));
+
+ read_memory (obj_addr, obj_buf, sizeof (obj_buf));
+
+ li.pathname_addr = extract_mips_address (&obj_buf[236], 4);
+ li.pathname_len = 0; /* unknown */
+ li.reloc_offset = extract_mips_address (&obj_buf[196], 4)
+ - extract_mips_address (&obj_buf[248], 4);
+
+ }
+ else if (extract_unsigned_integer (&buf.oi32.oi_size,
+ sizeof (buf.oi32.oi_size))
+ == sizeof (buf.oi32))
+ {
+ /* Use buf.oi32... */
+
+ /* Read rest of buffer. */
+ read_memory (addr + sizeof (buf.ol32),
+ ((char *) &buf) + sizeof (buf.ol32),
+ sizeof (buf.oi32) - sizeof (buf.ol32));
+
+ /* Fill in fields using buffer contents. */
+ li.next = extract_mips_address (&buf.oi32.oi_next,
+ sizeof (buf.oi32.oi_next));
+ li.reloc_offset = extract_mips_address (&buf.oi32.oi_ehdr,
+ sizeof (buf.oi32.oi_ehdr))
+ - extract_mips_address (&buf.oi32.oi_orig_ehdr,
+ sizeof (buf.oi32.oi_orig_ehdr));
+ li.pathname_addr = extract_mips_address (&buf.oi32.oi_pathname,
+ sizeof (buf.oi32.oi_pathname));
+ li.pathname_len = extract_unsigned_integer (&buf.oi32.oi_pathname_len,
+ sizeof (buf.oi32.
+ oi_pathname_len));
+ }
+ else if (extract_unsigned_integer (&buf.oi64.oi_size,
+ sizeof (buf.oi64.oi_size))
+ == sizeof (buf.oi64))
+ {
+ /* Use buf.oi64... */
+
+ /* Read rest of buffer. */
+ read_memory (addr + sizeof (buf.ol32),
+ ((char *) &buf) + sizeof (buf.ol32),
+ sizeof (buf.oi64) - sizeof (buf.ol32));
+
+ /* Fill in fields using buffer contents. */
+ li.next = extract_mips_address (&buf.oi64.oi_next,
+ sizeof (buf.oi64.oi_next));
+ li.reloc_offset = extract_mips_address (&buf.oi64.oi_ehdr,
+ sizeof (buf.oi64.oi_ehdr))
+ - extract_mips_address (&buf.oi64.oi_orig_ehdr,
+ sizeof (buf.oi64.oi_orig_ehdr));
+ li.pathname_addr = extract_mips_address (&buf.oi64.oi_pathname,
+ sizeof (buf.oi64.oi_pathname));
+ li.pathname_len = extract_unsigned_integer (&buf.oi64.oi_pathname_len,
+ sizeof (buf.oi64.
+ oi_pathname_len));
+ }
+ else
+ {
+ error ("Unable to fetch shared library obj_info or obj_list info.");
+ }
+
+ return li;
+}
+
+/* The symbol which starts off the list of shared libraries. */
+#define DEBUG_BASE "__rld_obj_head"
+
+char shadow_contents[BREAKPOINT_MAX]; /* Stash old bkpt addr contents */
+
+static CORE_ADDR debug_base; /* Base of dynamic linker structures */
+static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
+
+/*
+
+ LOCAL FUNCTION
+
+ locate_base -- locate the base address of dynamic linker structs
+
+ SYNOPSIS
+
+ CORE_ADDR locate_base (void)
+
+ DESCRIPTION
+
+ For both the SunOS and SVR4 shared library implementations, if the
+ inferior executable has been linked dynamically, there is a single
+ address somewhere in the inferior's data space which is the key to
+ locating all of the dynamic linker's runtime structures. This
+ address is the value of the symbol defined by the macro DEBUG_BASE.
+ The job of this function is to find and return that address, or to
+ return 0 if there is no such address (the executable is statically
+ linked for example).
+
+ For SunOS, the job is almost trivial, since the dynamic linker and
+ all of it's structures are statically linked to the executable at
+ link time. Thus the symbol for the address we are looking for has
+ already been added to the minimal symbol table for the executable's
+ objfile at the time the symbol file's symbols were read, and all we
+ have to do is look it up there. Note that we explicitly do NOT want
+ to find the copies in the shared library.
+
+ The SVR4 version is much more complicated because the dynamic linker
+ and it's structures are located in the shared C library, which gets
+ run as the executable's "interpreter" by the kernel. We have to go
+ to a lot more work to discover the address of DEBUG_BASE. Because
+ of this complexity, we cache the value we find and return that value
+ on subsequent invocations. Note there is no copy in the executable
+ symbol tables.
+
+ Irix 5 is basically like SunOS.
+
+ Note that we can assume nothing about the process state at the time
+ we need to find this address. We may be stopped on the first instruc-
+ tion of the interpreter (C shared library), the first instruction of
+ the executable itself, or somewhere else entirely (if we attached
+ to the process for example).
+
+ */
+
+static CORE_ADDR
+locate_base (void)
+{
+ struct minimal_symbol *msymbol;
+ CORE_ADDR address = 0;
+
+ msymbol = lookup_minimal_symbol (DEBUG_BASE, NULL, symfile_objfile);
+ if ((msymbol != NULL) && (SYMBOL_VALUE_ADDRESS (msymbol) != 0))
+ {
+ address = SYMBOL_VALUE_ADDRESS (msymbol);
+ }
+ return (address);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ disable_break -- remove the "mapping changed" breakpoint
+
+ SYNOPSIS
+
+ static int disable_break ()
+
+ DESCRIPTION
+
+ Removes the breakpoint that gets hit when the dynamic linker
+ completes a mapping change.
+
+ */
+
+static int
+disable_break (void)
+{
+ int status = 1;
+
+
+ /* Note that breakpoint address and original contents are in our address
+ space, so we just need to write the original contents back. */
+
+ if (memory_remove_breakpoint (breakpoint_addr, shadow_contents) != 0)
+ {
+ status = 0;
+ }
+
+ /* For the SVR4 version, we always know the breakpoint address. For the
+ SunOS version we don't know it until the above code is executed.
+ Grumble if we are stopped anywhere besides the breakpoint address. */
+
+ if (stop_pc != breakpoint_addr)
+ {
+ warning
+ ("stopped at unknown breakpoint while handling shared libraries");
+ }
+
+ return (status);
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ enable_break -- arrange for dynamic linker to hit breakpoint
+
+ SYNOPSIS
+
+ int enable_break (void)
+
+ DESCRIPTION
+
+ This functions inserts a breakpoint at the entry point of the
+ main executable, where all shared libraries are mapped in.
+ */
+
+static int
+enable_break (void)
+{
+ if (symfile_objfile != NULL
+ && target_insert_breakpoint (symfile_objfile->ei.entry_point,
+ shadow_contents) == 0)
+ {
+ breakpoint_addr = symfile_objfile->ei.entry_point;
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ irix_solib_create_inferior_hook -- shared library startup support
+
+ SYNOPSIS
+
+ void solib_create_inferior_hook()
+
+ DESCRIPTION
+
+ When gdb starts up the inferior, it nurses it along (through the
+ shell) until it is ready to execute it's first instruction. At this
+ point, this function gets called via expansion of the macro
+ SOLIB_CREATE_INFERIOR_HOOK.
+
+ For SunOS executables, this first instruction is typically the
+ one at "_start", or a similar text label, regardless of whether
+ the executable is statically or dynamically linked. The runtime
+ startup code takes care of dynamically linking in any shared
+ libraries, once gdb allows the inferior to continue.
+
+ For SVR4 executables, this first instruction is either the first
+ instruction in the dynamic linker (for dynamically linked
+ executables) or the instruction at "start" for statically linked
+ executables. For dynamically linked executables, the system
+ first exec's /lib/libc.so.N, which contains the dynamic linker,
+ and starts it running. The dynamic linker maps in any needed
+ shared libraries, maps in the actual user executable, and then
+ jumps to "start" in the user executable.
+
+ For both SunOS shared libraries, and SVR4 shared libraries, we
+ can arrange to cooperate with the dynamic linker to discover the
+ names of shared libraries that are dynamically linked, and the
+ base addresses to which they are linked.
+
+ This function is responsible for discovering those names and
+ addresses, and saving sufficient information about them to allow
+ their symbols to be read at a later time.
+
+ FIXME
+
+ Between enable_break() and disable_break(), this code does not
+ properly handle hitting breakpoints which the user might have
+ set in the startup code or in the dynamic linker itself. Proper
+ handling will probably have to wait until the implementation is
+ changed to use the "breakpoint handler function" method.
+
+ Also, what if child has exit()ed? Must exit loop somehow.
+ */
+
+static void
+irix_solib_create_inferior_hook (void)
+{
+ if (!enable_break ())
+ {
+ warning ("shared library handler failed to enable breakpoint");
+ return;
+ }
+
+ /* Now run the target. It will eventually hit the breakpoint, at
+ which point all of the libraries will have been mapped in and we
+ can go groveling around in the dynamic linker structures to find
+ out what we need to know about them. */
+
+ clear_proceed_status ();
+ stop_soon_quietly = 1;
+ stop_signal = TARGET_SIGNAL_0;
+ do
+ {
+ target_resume (pid_to_ptid (-1), 0, stop_signal);
+ wait_for_inferior ();
+ }
+ while (stop_signal != TARGET_SIGNAL_TRAP);
+
+ /* We are now either at the "mapping complete" breakpoint (or somewhere
+ else, a condition we aren't prepared to deal with anyway), so adjust
+ the PC as necessary after a breakpoint, disable the breakpoint, and
+ add any shared libraries that were mapped in. */
+
+ if (!disable_break ())
+ {
+ warning ("shared library handler failed to disable breakpoint");
+ }
+
+ /* solib_add will call reinit_frame_cache.
+ But we are stopped in the startup code and we might not have symbols
+ for the startup code, so heuristic_proc_start could be called
+ and will put out an annoying warning.
+ Delaying the resetting of stop_soon_quietly until after symbol loading
+ suppresses the warning. */
+ solib_add ((char *) 0, 0, (struct target_ops *) 0, auto_solib_add);
+ stop_soon_quietly = 0;
+ re_enable_breakpoints_in_shlibs ();
+}
+
+/* LOCAL FUNCTION
+
+ current_sos -- build a list of currently loaded shared objects
+
+ SYNOPSIS
+
+ struct so_list *current_sos ()
+
+ DESCRIPTION
+
+ Build a list of `struct so_list' objects describing the shared
+ objects currently loaded in the inferior. This list does not
+ include an entry for the main executable file.
+
+ Note that we only gather information directly available from the
+ inferior --- we don't examine any of the shared library files
+ themselves. The declaration of `struct so_list' says which fields
+ we provide values for. */
+
+static struct so_list *
+irix_current_sos (void)
+{
+ CORE_ADDR lma;
+ char addr_buf[8];
+ struct so_list *head = 0;
+ struct so_list **link_ptr = &head;
+ int is_first = 1;
+ struct lm_info lm;
+
+ /* Make sure we've looked up the inferior's dynamic linker's base
+ structure. */
+ if (!debug_base)
+ {
+ debug_base = locate_base ();
+
+ /* If we can't find the dynamic linker's base structure, this
+ must not be a dynamically linked executable. Hmm. */
+ if (!debug_base)
+ return 0;
+ }
+
+ read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+
+ while (lma)
+ {
+ lm = fetch_lm_info (lma);
+ if (!is_first)
+ {
+ int errcode;
+ char *name_buf;
+ int name_size;
+ struct so_list *new
+ = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct cleanup *old_chain = make_cleanup (xfree, new);
+
+ memset (new, 0, sizeof (*new));
+
+ new->lm_info = xmalloc (sizeof (struct lm_info));
+ make_cleanup (xfree, new->lm_info);
+
+ *new->lm_info = lm;
+
+ /* Extract this shared object's name. */
+ name_size = lm.pathname_len;
+ if (name_size == 0)
+ name_size = SO_NAME_MAX_PATH_SIZE - 1;
+
+ if (name_size >= SO_NAME_MAX_PATH_SIZE)
+ {
+ name_size = SO_NAME_MAX_PATH_SIZE - 1;
+ warning
+ ("current_sos: truncating name of %d characters to only %d characters",
+ lm.pathname_len, name_size);
+ }
+
+ target_read_string (lm.pathname_addr, &name_buf,
+ name_size, &errcode);
+ if (errcode != 0)
+ {
+ warning ("current_sos: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ }
+ else
+ {
+ strncpy (new->so_name, name_buf, name_size);
+ new->so_name[name_size] = '\0';
+ xfree (name_buf);
+ strcpy (new->so_original_name, new->so_name);
+ }
+
+ new->next = 0;
+ *link_ptr = new;
+ link_ptr = &new->next;
+
+ discard_cleanups (old_chain);
+ }
+ is_first = 0;
+ lma = lm.next;
+ }
+
+ return head;
+}
+
+/*
+
+ LOCAL FUNCTION
+
+ irix_open_symbol_file_object
+
+ SYNOPSIS
+
+ void irix_open_symbol_file_object (void *from_tty)
+
+ DESCRIPTION
+
+ If no open symbol file, attempt to locate and open the main symbol
+ file. On IRIX, this is the first link map entry. If its name is
+ here, we can open it. Useful when attaching to a process without
+ first loading its symbol file.
+
+ If FROM_TTYP dereferences to a non-zero integer, allow messages to
+ be printed. This parameter is a pointer rather than an int because
+ open_symbol_file_object() is called via catch_errors() and
+ catch_errors() requires a pointer argument. */
+
+static int
+irix_open_symbol_file_object (void *from_ttyp)
+{
+ CORE_ADDR lma;
+ char addr_buf[8];
+ struct lm_info lm;
+ struct cleanup *cleanups;
+ int errcode;
+ int from_tty = *(int *) from_ttyp;
+ char *filename;
+
+ if (symfile_objfile)
+ if (!query ("Attempt to reload symbols from process? "))
+ return 0;
+
+ if ((debug_base = locate_base ()) == 0)
+ return 0; /* failed somehow... */
+
+ /* First link map member should be the executable. */
+ read_memory (debug_base, addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ lma = extract_mips_address (addr_buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+ if (lma == 0)
+ return 0; /* failed somehow... */
+
+ lm = fetch_lm_info (lma);
+
+ if (lm.pathname_addr == 0)
+ return 0; /* No filename. */
+
+ /* Now fetch the filename from target memory. */
+ target_read_string (lm.pathname_addr, &filename, SO_NAME_MAX_PATH_SIZE - 1,
+ &errcode);
+
+ if (errcode)
+ {
+ warning ("failed to read exec filename from attached file: %s",
+ safe_strerror (errcode));
+ return 0;
+ }
+
+ cleanups = make_cleanup (xfree, filename);
+ /* Have a pathname: read the symbol file. */
+ symbol_file_add_main (filename, from_tty);
+
+ do_cleanups (cleanups);
+
+ return 1;
+}
+
+
+/*
+
+ LOCAL FUNCTION
+
+ irix_special_symbol_handling -- additional shared library symbol handling
+
+ SYNOPSIS
+
+ void irix_special_symbol_handling ()
+
+ DESCRIPTION
+
+ Once the symbols from a shared object have been loaded in the usual
+ way, we are called to do any system specific symbol handling that
+ is needed.
+
+ For SunOS4, this consisted of grunging around in the dynamic
+ linkers structures to find symbol definitions for "common" symbols
+ and adding them to the minimal symbol table for the runtime common
+ objfile.
+
+ However, for IRIX, there's nothing to do.
+
+ */
+
+static void
+irix_special_symbol_handling (void)
+{
+}
+
+/* Using the solist entry SO, relocate the addresses in SEC. */
+
+static void
+irix_relocate_section_addresses (struct so_list *so,
+ struct section_table *sec)
+{
+ sec->addr += so->lm_info->reloc_offset;
+ sec->endaddr += so->lm_info->reloc_offset;
+}
+
+/* Free the lm_info struct. */
+
+static void
+irix_free_so (struct so_list *so)
+{
+ xfree (so->lm_info);
+}
+
+/* Clear backend specific state. */
+
+static void
+irix_clear_solib (void)
+{
+ debug_base = 0;
+}
+
+/* Return 1 if PC lies in the dynamic symbol resolution code of the
+ run time loader. */
+static int
+irix_in_dynsym_resolve_code (CORE_ADDR pc)
+{
+ return 0;
+}
+
+static struct target_so_ops irix_so_ops;
+
+void
+_initialize_irix_solib (void)
+{
+ irix_so_ops.relocate_section_addresses = irix_relocate_section_addresses;
+ irix_so_ops.free_so = irix_free_so;
+ irix_so_ops.clear_solib = irix_clear_solib;
+ irix_so_ops.solib_create_inferior_hook = irix_solib_create_inferior_hook;
+ irix_so_ops.special_symbol_handling = irix_special_symbol_handling;
+ irix_so_ops.current_sos = irix_current_sos;
+ irix_so_ops.open_symbol_file_object = irix_open_symbol_file_object;
+ irix_so_ops.in_dynsym_resolve_code = irix_in_dynsym_resolve_code;
+
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ current_target_so_ops = &irix_so_ops;
+}
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index a00e488ee04..6f43a8f0e49 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -359,7 +359,14 @@ static int
open_map (struct read_map_ctxt *ctxt)
{
#ifdef USE_LDR_ROUTINES
- ctxt->proc = ldr_my_process ();
+ /* Note: As originally written, ldr_my_process() was used to obtain
+ the value for ctxt->proc. This is incorrect, however, since
+ ldr_my_process() retrieves the "unique identifier" associated
+ with the current process (i.e. GDB) and not the one being
+ debugged. Presumably, the pid of the process being debugged is
+ compatible with the "unique identifier" used by the ldr_
+ routines, so we use that. */
+ ctxt->proc = ptid_get_pid (inferior_ptid);
if (ldr_xattach (ctxt->proc) != 0)
return 0;
ctxt->next = LDR_NULL_MODULE;
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 2d71097c091..3f98a1eb433 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1318,24 +1318,20 @@ set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch,
set_gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data, flmo);
}
-/* Initialize the architecture specific link_map_offsets fetcher.
- This is called after <arch>_gdbarch_init() has set up its struct
- gdbarch for the new architecture, so care must be taken to use the
- value set by set_solib_svr4_fetch_link_map_offsets(), above. We
- do, however, attempt to provide a reasonable alternative (for
- native targets anyway) if the <arch>_gdbarch_init() fails to call
+/* Initialize the architecture-specific link_map_offsets fetcher.
+ This is called after <arch>_gdbarch_init() has set up its `struct
+ gdbarch' for the new architecture, and is only called if the
+ link_map_offsets fetcher isn't already initialized (which is
+ usually done by calling set_solib_svr4_fetch_link_map_offsets()
+ above in <arch>_gdbarch_init()). Therefore we attempt to provide a
+ reasonable alternative (for native targets anyway) if the
+ <arch>_gdbarch_init() fails to call
set_solib_svr4_fetch_link_map_offsets(). */
static void *
init_fetch_link_map_offsets (struct gdbarch *gdbarch)
{
- struct link_map_offsets *(*flmo) =
- gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data);
-
- if (flmo == NULL)
- return legacy_fetch_link_map_offsets;
- else
- return flmo;
+ return legacy_fetch_link_map_offsets;
}
static struct target_so_ops svr4_so_ops;
diff --git a/gdb/somsolib.c b/gdb/somsolib.c
index d623e4b76db..2eb1ff5685c 100644
--- a/gdb/somsolib.c
+++ b/gdb/somsolib.c
@@ -1,6 +1,7 @@
/* Handle HP SOM shared libraries for GDB, the GNU Debugger.
- Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -38,7 +39,6 @@
#include "gdb-stabs.h"
#include "gdb_stat.h"
#include "gdbcmd.h"
-#include "assert.h"
#include "language.h"
#include "regcache.h"
@@ -319,7 +319,7 @@ som_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
sizeof (obj_private_data_t));
obj_private->unwind_info = NULL;
obj_private->so_info = NULL;
- so->objfile->obj_private = (PTR) obj_private;
+ so->objfile->obj_private = obj_private;
}
obj_private = (obj_private_data_t *) so->objfile->obj_private;
diff --git a/gdb/source.c b/gdb/source.c
index ac743724058..c7c1ce2f5d2 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -500,6 +500,8 @@ source_info (char *ignore, int from_tty)
printf_filtered ("Source language is %s.\n", language_str (s->language));
printf_filtered ("Compiled with %s debugging format.\n", s->debugformat);
+ printf_filtered ("%s preprocessor macro info.\n",
+ s->macro_table ? "Includes" : "Does not include");
}
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 6461ca088f6..033cc8170bf 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -27,12 +27,12 @@
#include "arch-utils.h"
#include "frame.h"
#include "inferior.h"
-#include "obstack.h"
#include "target.h"
#include "value.h"
#include "bfd.h"
#include "gdb_string.h"
#include "regcache.h"
+#include "osabi.h"
#ifdef USE_PROC_FS
#include <sys/procfs.h>
@@ -111,6 +111,8 @@ struct gdbarch_tdep
int reg_save_offset;
int call_dummy_call_offset;
int print_insn_mach;
+
+ enum gdb_osabi osabi;
};
/* Now make GDB_TARGET_IS_SPARC64 a runtime test. */
@@ -2272,12 +2274,13 @@ sparc_target_architecture_hook (const bfd_arch_info_type *ap)
static struct gdbarch * sparc_gdbarch_init (struct gdbarch_info info,
struct gdbarch_list *arches);
+static void sparc_dump_tdep (struct gdbarch *, struct ui_file *);
void
_initialize_sparc_tdep (void)
{
/* Hook us into the gdbarch mechanism. */
- register_gdbarch_init (bfd_arch_sparc, sparc_gdbarch_init);
+ gdbarch_register (bfd_arch_sparc, sparc_gdbarch_init, sparc_dump_tdep);
tm_print_insn = gdb_print_insn_sparc;
tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
@@ -2547,7 +2550,7 @@ sparc_print_extra_frame_info (struct frame_info *fi)
/* MULTI_ARCH support */
-static char *
+static const char *
sparc32_register_name (int regno)
{
static char *register_names[] =
@@ -2571,7 +2574,7 @@ sparc32_register_name (int regno)
return register_names[regno];
}
-static char *
+static const char *
sparc64_register_name (int regno)
{
static char *register_names[] =
@@ -2603,7 +2606,7 @@ sparc64_register_name (int regno)
return register_names[regno];
}
-static char *
+static const char *
sparclite_register_name (int regno)
{
static char *register_names[] =
@@ -2628,7 +2631,7 @@ sparclite_register_name (int regno)
return register_names[regno];
}
-static char *
+static const char *
sparclet_register_name (int regno)
{
static char *register_names[] =
@@ -2930,6 +2933,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
static LONGEST call_dummy_32[] =
{ 0xbc100001, 0x9de38000, 0xbc100002, 0xbe100003,
@@ -2953,10 +2957,29 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
};
static LONGEST call_dummy_nil[] = {0};
+ /* Try to determine the OS 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 an ELF file, assume it's Solaris. */
+ if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
+ osabi = GDB_OSABI_SOLARIS;
+ }
+ }
+
/* First see if there is already a gdbarch that can satisfy the request. */
- arches = gdbarch_list_lookup_by_info (arches, &info);
- if (arches != NULL)
- return arches->gdbarch;
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ /* Make sure the ABI selection matches. */
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep && tdep->osabi == osabi)
+ return arches->gdbarch;
+ }
/* None found: is the request for a sparc architecture? */
if (info.bfd_arch_info->arch != bfd_arch_sparc)
@@ -2966,6 +2989,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
+ tdep->osabi = osabi;
+
/* First set settings that are common for all sparc architectures. */
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_breakpoint_from_pc (gdbarch, memory_breakpoint_from_pc);
@@ -2976,8 +3001,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 1);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_extract_struct_value_address (gdbarch,
- sparc_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);
set_gdbarch_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_fp_regnum (gdbarch, SPARC_FP_REGNUM);
@@ -3191,96 +3215,109 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
switch (info.bfd_arch_info->mach)
{
case bfd_mach_sparc:
- set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 32 * 4;
tdep->print_insn_mach = bfd_mach_sparc;
break;
case bfd_mach_sparc_sparclet:
- set_gdbarch_extract_return_value (gdbarch,
- sparclet_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparclet_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 32 + 32 + 8 + 8 + 8);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclet_register_name);
- set_gdbarch_store_return_value (gdbarch, sparclet_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparclet_store_return_value);
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 0;
tdep->print_insn_mach = bfd_mach_sparc_sparclet;
break;
case bfd_mach_sparc_sparclite:
- set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 80);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclite_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 0;
tdep->print_insn_mach = bfd_mach_sparc_sparclite;
break;
case bfd_mach_sparc_v8plus:
- set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->print_insn_mach = bfd_mach_sparc;
tdep->fp_register_bytes = 32 * 4;
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
break;
case bfd_mach_sparc_v8plusa:
- set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 72);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparc32_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 32 * 4;
tdep->print_insn_mach = bfd_mach_sparc;
break;
case bfd_mach_sparc_sparclite_le:
- set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 80);
set_gdbarch_register_bytes (gdbarch, 32*4 + 32*4 + 8*4 + 8*4);
set_gdbarch_register_name (gdbarch, sparclite_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 0; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 0;
tdep->print_insn_mach = bfd_mach_sparc_sparclite;
break;
case bfd_mach_sparc_v9:
- set_gdbarch_extract_return_value (gdbarch, sparc64_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 125);
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 64 * 4;
tdep->print_insn_mach = bfd_mach_sparc_v9a;
break;
case bfd_mach_sparc_v9a:
- set_gdbarch_extract_return_value (gdbarch, sparc64_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sparc64_extract_return_value);
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
set_gdbarch_num_regs (gdbarch, 125);
set_gdbarch_register_bytes (gdbarch, 32*8 + 32*8 + 45*8);
set_gdbarch_register_name (gdbarch, sparc64_register_name);
- set_gdbarch_store_return_value (gdbarch, sparc_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
tdep->has_fpu = 1; /* (all but sparclet and sparclite) */
tdep->fp_register_bytes = 64 * 4;
tdep->print_insn_mach = bfd_mach_sparc_v9a;
break;
}
+ /* Hook in OS ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch, osabi);
+
return gdbarch;
}
+static void
+sparc_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep == NULL)
+ return;
+
+ fprintf_unfiltered (file, "sparc_dump_tdep: OS ABI = %s\n",
+ gdbarch_osabi_name (tdep->osabi));
+}
diff --git a/gdb/sparcl-tdep.c b/gdb/sparcl-tdep.c
index 87351f11c13..aa06747e97b 100644
--- a/gdb/sparcl-tdep.c
+++ b/gdb/sparcl-tdep.c
@@ -27,7 +27,7 @@
#include "regcache.h"
#include <sys/types.h>
-#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
+#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN__)
#define HAVE_SOCKETS
#include <sys/time.h>
#include <sys/socket.h>
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 56b78495938..6011769cf6a 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -29,7 +29,7 @@
#include "defs.h"
#include "gdb_string.h"
#include "bfd.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
@@ -142,7 +142,7 @@ static struct type *read_struct_type (char **, struct type *,
static struct type *read_array_type (char **, struct type *,
struct objfile *);
-static struct type **read_args (char **, int, struct objfile *);
+static struct field *read_args (char **, int, struct objfile *, int *, int *);
static int
read_cpp_abbrev (struct field_info *, char **, struct type *,
@@ -256,34 +256,36 @@ static struct symbol *current_symbol = NULL;
*(pp) = next_symbol_text (objfile); \
} while (0)
-/* FIXME: These probably should be our own types (like rs6000_builtin_type
- has its own types) rather than builtin_type_*. */
-static struct type **os9k_type_vector[] =
-{
- 0,
- &builtin_type_int,
- &builtin_type_char,
- &builtin_type_long,
- &builtin_type_short,
- &builtin_type_unsigned_char,
- &builtin_type_unsigned_short,
- &builtin_type_unsigned_long,
- &builtin_type_unsigned_int,
- &builtin_type_float,
- &builtin_type_double,
- &builtin_type_void,
- &builtin_type_long_double
-};
-
-static void os9k_init_type_vector (struct type **);
-
-static void
-os9k_init_type_vector (struct type **tv)
-{
- unsigned int i;
- for (i = 0; i < sizeof (os9k_type_vector) / sizeof (struct type **); i++)
- tv[i] = (os9k_type_vector[i] == 0 ? 0 : *(os9k_type_vector[i]));
-}
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE /* FIXME: These probably should be our own types (like rs6000_builtin_type
+// OBSOLETE has its own types) rather than builtin_type_*. */
+// OBSOLETE static struct type **os9k_type_vector[] =
+// OBSOLETE {
+// OBSOLETE 0,
+// OBSOLETE &builtin_type_int,
+// OBSOLETE &builtin_type_char,
+// OBSOLETE &builtin_type_long,
+// OBSOLETE &builtin_type_short,
+// OBSOLETE &builtin_type_unsigned_char,
+// OBSOLETE &builtin_type_unsigned_short,
+// OBSOLETE &builtin_type_unsigned_long,
+// OBSOLETE &builtin_type_unsigned_int,
+// OBSOLETE &builtin_type_float,
+// OBSOLETE &builtin_type_double,
+// OBSOLETE &builtin_type_void,
+// OBSOLETE &builtin_type_long_double
+// OBSOLETE };
+// OBSOLETE
+// OBSOLETE static void os9k_init_type_vector (struct type **);
+// OBSOLETE
+// OBSOLETE static void
+// OBSOLETE os9k_init_type_vector (struct type **tv)
+// OBSOLETE {
+// OBSOLETE unsigned int i;
+// OBSOLETE for (i = 0; i < sizeof (os9k_type_vector) / sizeof (struct type **); i++)
+// OBSOLETE tv[i] = (os9k_type_vector[i] == 0 ? 0 : *(os9k_type_vector[i]));
+// OBSOLETE }
+#endif /* OBSOLETE OS9K */
/* Look up a dbx type-number pair. Return the address of the slot
where the type for that number-pair is stored.
@@ -351,9 +353,11 @@ Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
memset (&type_vector[old_len], 0,
(type_vector_length - old_len) * sizeof (struct type *));
- if (os9k_stabs)
- /* Deal with OS9000 fundamental types. */
- os9k_init_type_vector (type_vector);
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE /* Deal with OS9000 fundamental types. */
+// OBSOLETE os9k_init_type_vector (type_vector);
+#endif /* OBSOLETE OS9K */
}
return (&type_vector[index]);
}
@@ -2052,9 +2056,11 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
}
#endif
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
- if (os9k_stabs)
- add_symbol_to_list (sym, &global_symbols);
- else
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE add_symbol_to_list (sym, &global_symbols);
+// OBSOLETE else
+#endif /* OBSOLETE OS9K */
add_symbol_to_list (sym, &local_symbols);
break;
@@ -2589,21 +2595,24 @@ again:
break;
case 'f': /* Function returning another type */
- if (os9k_stabs && **pp == '(')
- {
- /* Function prototype; parse it.
- We must conditionalize this on os9k_stabs because otherwise
- it could be confused with a Sun-style (1,3) typenumber
- (I think). */
- struct type *t;
- ++*pp;
- while (**pp != ')')
- {
- t = read_type (pp, objfile);
- if (**pp == ',')
- ++ * pp;
- }
- }
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs && **pp == '(')
+// OBSOLETE {
+// OBSOLETE /* Function prototype; parse it.
+// OBSOLETE We must conditionalize this on os9k_stabs because otherwise
+// OBSOLETE it could be confused with a Sun-style (1,3) typenumber
+// OBSOLETE (I think). */
+// OBSOLETE struct type *t;
+// OBSOLETE ++*pp;
+// OBSOLETE while (**pp != ')')
+// OBSOLETE {
+// OBSOLETE t = read_type (pp, objfile);
+// OBSOLETE if (**pp == ',')
+// OBSOLETE ++ * pp;
+// OBSOLETE }
+// OBSOLETE }
+#endif /* OBSOLETE OS9K */
+
type1 = read_type (pp, objfile);
type = make_function_type (type1, dbx_lookup_type (typenums));
break;
@@ -2684,22 +2693,36 @@ again:
}
case 'k': /* Const qualifier on some type (Sun) */
- case 'c': /* Const qualifier on some type (OS9000) */
- /* Because 'c' means other things to AIX and 'k' is perfectly good,
- only accept 'c' in the os9k_stabs case. */
- if (type_descriptor == 'c' && !os9k_stabs)
- return error_type (pp, objfile);
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE /* ezannoni 2002-07-16: This can be safely deleted, because 'c'
+// OBSOLETE means complex type in AIX stabs, while it means const qualifier
+// OBSOLETE in os9k stabs. Obviously we were supporting only the os9k meaning.
+// OBSOLETE We were erroring out if we were reading AIX stabs. Right now the
+// OBSOLETE erroring out will happen in the default clause of the switch. */
+// OBSOLETE case 'c': /* Const qualifier on some type (OS9000) */
+// OBSOLETE /* Because 'c' means other things to AIX and 'k' is perfectly good,
+// OBSOLETE only accept 'c' in the os9k_stabs case. */
+// OBSOLETE if (type_descriptor == 'c' && !os9k_stabs)
+// OBSOLETE return error_type (pp, objfile);
+#endif /* OBSOLETE OS9K */
type = read_type (pp, objfile);
type = make_cv_type (1, TYPE_VOLATILE (type), type,
dbx_lookup_type (typenums));
break;
case 'B': /* Volatile qual on some type (Sun) */
- case 'i': /* Volatile qual on some type (OS9000) */
- /* Because 'i' means other things to AIX and 'B' is perfectly good,
- only accept 'i' in the os9k_stabs case. */
- if (type_descriptor == 'i' && !os9k_stabs)
- return error_type (pp, objfile);
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE /* ezannoni 2002-07-16: This can be safely deleted, because 'i'
+// OBSOLETE means imported type in AIX stabs, while it means volatile qualifier
+// OBSOLETE in os9k stabs. Obviously we were supporting only the os9k meaning.
+// OBSOLETE We were erroring out if we were reading AIX stabs. Right now the
+// OBSOLETE erroring out will happen in the default clause of the switch. */
+// OBSOLETE case 'i': /* Volatile qual on some type (OS9000) */
+// OBSOLETE /* Because 'i' means other things to AIX and 'B' is perfectly good,
+// OBSOLETE only accept 'i' in the os9k_stabs case. */
+// OBSOLETE if (type_descriptor == 'i' && !os9k_stabs)
+// OBSOLETE return error_type (pp, objfile);
+#endif /* OBSOLETE OS9K */
type = read_type (pp, objfile);
type = make_cv_type (TYPE_CONST (type), 1, type,
dbx_lookup_type (typenums));
@@ -2780,7 +2803,8 @@ again:
{
struct type *domain = read_type (pp, objfile);
struct type *return_type;
- struct type **args;
+ struct field *args;
+ int nargs, varargs;
if (**pp != ',')
/* Invalid member type data format. */
@@ -2789,9 +2813,10 @@ again:
++(*pp);
return_type = read_type (pp, objfile);
- args = read_args (pp, ';', objfile);
+ args = read_args (pp, ';', objfile, &nargs, &varargs);
type = dbx_alloc_type (typenums, objfile);
- smash_to_method_type (type, domain, return_type, args);
+ smash_to_method_type (type, domain, return_type, args,
+ nargs, varargs);
}
break;
@@ -2802,10 +2827,12 @@ again:
break;
case 'b':
- if (os9k_stabs)
- /* Const and volatile qualified type. */
- type = read_type (pp, objfile);
- else
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE /* Const and volatile qualified type. */
+// OBSOLETE type = read_type (pp, objfile);
+// OBSOLETE else
+#endif /* OBSOLETE OS9K */
{
/* Sun ACC builtin int type */
type = read_sun_builtin_type (pp, typenums, objfile);
@@ -3664,8 +3691,10 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
while (**pp != ';' && **pp != '\0')
{
- if (os9k_stabs && **pp == ',')
- break;
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs && **pp == ',')
+// OBSOLETE break;
+#endif /* OBSOLETE OS9K */
STABS_CONTINUE (pp, objfile);
/* Get space to record the next field's data. */
new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
@@ -3710,8 +3739,9 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
}
if (p[0] == ':' && p[1] == ':')
{
- /* chill the list of fields: the last entry (at the head) is a
- partially constructed entry which we now scrub. */
+ /* (OBSOLETE) chill (OBSOLETE) the list of fields: the last
+ entry (at the head) is a partially constructed entry which we
+ now scrub. */
fip->list = fip->list->next;
}
return 1;
@@ -4327,9 +4357,11 @@ read_array_type (register char **pp, register struct type *type,
Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
for these, produce a type like float[][]. */
- if (os9k_stabs)
- index_type = builtin_type_int;
- else
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE index_type = builtin_type_int;
+// OBSOLETE else
+#endif /* OBSOLETE OS9K */
{
index_type = read_type (pp, objfile);
if (**pp != ';')
@@ -4343,7 +4375,12 @@ read_array_type (register char **pp, register struct type *type,
(*pp)++;
adjustable = 1;
}
- lower = read_huge_number (pp, os9k_stabs ? ',' : ';', &nbits);
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE lower = read_huge_number (pp, os9k_stabs ? ',' : ';', &nbits);
+#else /* OBSOLETE OS9K */
+ lower = read_huge_number (pp, ';', &nbits);
+#endif /* OBSOLETE OS9K */
+
if (nbits != 0)
return error_type (pp, objfile);
@@ -4403,15 +4440,17 @@ read_enum_type (register char **pp, register struct type *type,
osyms = *symlist;
o_nsyms = osyms ? osyms->nsyms : 0;
- if (os9k_stabs)
- {
- /* Size. Perhaps this does not have to be conditionalized on
- os9k_stabs (assuming the name of an enum constant can't start
- with a digit). */
- read_huge_number (pp, 0, &nbits);
- if (nbits != 0)
- return error_type (pp, objfile);
- }
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE {
+// OBSOLETE /* Size. Perhaps this does not have to be conditionalized on
+// OBSOLETE os9k_stabs (assuming the name of an enum constant can't start
+// OBSOLETE with a digit). */
+// OBSOLETE read_huge_number (pp, 0, &nbits);
+// OBSOLETE if (nbits != 0)
+// OBSOLETE return error_type (pp, objfile);
+// OBSOLETE }
+#endif /* OBSOLETE OS9K */
/* The aix4 compiler emits an extra field before the enum members;
my guess is it's a type of some sort. Just ignore it. */
@@ -4650,9 +4689,11 @@ read_huge_number (char **pp, int end, int *bits)
p++;
}
- if (os9k_stabs)
- upper_limit = ULONG_MAX / radix;
- else
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE if (os9k_stabs)
+// OBSOLETE upper_limit = ULONG_MAX / radix;
+// OBSOLETE else
+#endif /* OBSOLETE OS9K */
upper_limit = LONG_MAX / radix;
while ((c = *p++) >= '0' && c < ('0' + radix))
@@ -4849,9 +4890,11 @@ read_range_type (char **pp, int typenums[2], struct objfile *objfile)
else if (self_subrange && n2 == 0 && n3 == 127)
return init_type (TYPE_CODE_INT, 1, 0, NULL, objfile);
- else if (current_symbol && SYMBOL_LANGUAGE (current_symbol) == language_chill
- && !self_subrange)
- goto handle_true_range;
+#if 0
+ /* OBSOLETE else if (current_symbol && SYMBOL_LANGUAGE (current_symbol) == language_chill */
+ /* OBSOLETE && !self_subrange) */
+ /* OBSOLETE goto handle_true_range; */
+#endif
/* We used to do this only for subrange of self or subrange of int. */
else if (n2 == 0)
@@ -4929,38 +4972,39 @@ handle_true_range:
and terminated with END. Return the list of types read in, or (struct type
**)-1 if there is an error. */
-static struct type **
-read_args (char **pp, int end, struct objfile *objfile)
+static struct field *
+read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
+ int *varargsp)
{
/* FIXME! Remove this arbitrary limit! */
- struct type *types[1024], **rval; /* allow for fns of 1023 parameters */
- int n = 0;
+ struct type *types[1024]; /* allow for fns of 1023 parameters */
+ int n = 0, i;
+ struct field *rval;
while (**pp != end)
{
if (**pp != ',')
/* Invalid argument list: no ','. */
- return (struct type **) -1;
+ return (struct field *) -1;
(*pp)++;
STABS_CONTINUE (pp, objfile);
types[n++] = read_type (pp, objfile);
}
(*pp)++; /* get past `end' (the ':' character) */
- if (n == 1)
- {
- rval = (struct type **) xmalloc (2 * sizeof (struct type *));
- }
- else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
- {
- rval = (struct type **) xmalloc ((n + 1) * sizeof (struct type *));
- memset (rval + n, 0, sizeof (struct type *));
- }
+ if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
+ *varargsp = 1;
else
{
- rval = (struct type **) xmalloc (n * sizeof (struct type *));
+ n--;
+ *varargsp = 0;
}
- memcpy (rval, types, n * sizeof (struct type *));
+
+ rval = (struct field *) xmalloc (n * sizeof (struct field));
+ memset (rval, 0, n * sizeof (struct field));
+ for (i = 0; i < n; i++)
+ rval[i].type = types[i];
+ *nargsp = n;
return rval;
}
@@ -5363,7 +5407,9 @@ start_stabs (void)
/* FIXME: If common_block_name is not already NULL, we should complain(). */
common_block_name = NULL;
- os9k_stabs = 0;
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE os9k_stabs = 0;
+#endif /* OBSOLETE OS9K */
}
/* Call after end_symtab() */
diff --git a/gdb/stabsread.h b/gdb/stabsread.h
index 59504da552b..d470d477a82 100644
--- a/gdb/stabsread.h
+++ b/gdb/stabsread.h
@@ -154,8 +154,9 @@ extern void end_stabs (void);
extern void finish_global_stabs (struct objfile *objfile);
-
-EXTERN int os9k_stabs;
+#if 0 /* OBSOLETE OS9K */
+// OBSOLETE EXTERN int os9k_stabs;
+#endif /* OBSOLETE OS9K */
/* COFF files can have multiple .stab sections, if they are linked
using --split-by-reloc. This linked list is used to pass the
@@ -182,15 +183,14 @@ extern struct partial_symtab *end_psymtab (struct partial_symtab *pst,
int number_dependencies,
int textlow_not_set);
-extern void
-process_one_symbol (int, int, CORE_ADDR, char *,
- struct section_offsets *, struct objfile *);
+extern void process_one_symbol (int, int, CORE_ADDR, char *,
+ struct section_offsets *, struct objfile *);
-extern void elfstab_build_psymtabs
- (struct objfile *objfile,
- int mainline,
- file_ptr staboff, unsigned int stabsize,
- file_ptr stabstroffset, unsigned int stabstrsize);
+extern void elfstab_build_psymtabs (struct objfile *objfile,
+ int mainline,
+ file_ptr staboff, unsigned int stabsize,
+ file_ptr stabstroffset,
+ unsigned int stabstrsize);
extern void coffstab_build_psymtabs
(struct objfile *objfile,
diff --git a/gdb/stack.c b/gdb/stack.c
index 2dab0deb016..fa5896395d6 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -461,7 +461,7 @@ print_frame (struct frame_info *fi,
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
- func = find_pc_function (fi->pc);
+ func = find_pc_function (frame_address_in_block (fi));
if (func)
{
/* In certain pathological cases, the symtabs give the wrong
@@ -480,7 +480,7 @@ print_frame (struct frame_info *fi,
ever changed many parts of GDB will need to be changed (and we'll
create a find_pc_minimal_function or some such). */
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
+ struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (frame_address_in_block (fi));
if (msymbol != NULL
&& (SYMBOL_VALUE_ADDRESS (msymbol)
> BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
@@ -528,7 +528,7 @@ print_frame (struct frame_info *fi,
}
else
{
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
+ struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (frame_address_in_block (fi));
if (msymbol != NULL)
{
funname = SYMBOL_NAME (msymbol);
@@ -929,39 +929,84 @@ frame_info (char *addr_exp, int from_tty)
}
}
- FRAME_INIT_SAVED_REGS (fi);
- if (fi->saved_regs != NULL)
- {
- /* The sp is special; what's returned isn't the save address, but
- actually the value of the previous frame's sp. */
- printf_filtered (" Previous frame's sp is ");
- print_address_numeric (fi->saved_regs[SP_REGNUM], 1, gdb_stdout);
- printf_filtered ("\n");
- count = 0;
- numregs = NUM_REGS + NUM_PSEUDO_REGS;
- for (i = 0; i < numregs; i++)
- if (fi->saved_regs[i] && i != SP_REGNUM)
+ if (fi->saved_regs == NULL)
+ FRAME_INIT_SAVED_REGS (fi);
+ /* Print as much information as possible on the location of all the
+ registers. */
+ {
+ enum lval_type lval;
+ int optimized;
+ CORE_ADDR addr;
+ int realnum;
+ int count;
+ int i;
+ int need_nl = 1;
+
+ /* The sp is special; what's displayed isn't the save address, but
+ the value of the previous frame's sp. This is a legacy thing,
+ at one stage the frame cached the previous frame's SP instead
+ of its address, hence it was easiest to just display the cached
+ value. */
+ if (SP_REGNUM >= 0)
+ {
+ /* Find out the location of the saved stack pointer with out
+ actually evaluating it. */
+ frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
+ &realnum, NULL);
+ if (!optimized && lval == not_lval)
{
- if (count == 0)
- puts_filtered (" Saved registers:\n ");
- else
- puts_filtered (",");
- wrap_here (" ");
- printf_filtered (" %s at ", REGISTER_NAME (i));
- print_address_numeric (fi->saved_regs[i], 1, gdb_stdout);
- count++;
+ void *value = alloca (MAX_REGISTER_RAW_SIZE);
+ CORE_ADDR sp;
+ frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
+ &realnum, value);
+ sp = extract_address (value, REGISTER_RAW_SIZE (SP_REGNUM));
+ printf_filtered (" Previous frame's sp is ");
+ print_address_numeric (sp, 1, gdb_stdout);
+ printf_filtered ("\n");
+ need_nl = 0;
}
- if (count)
- puts_filtered ("\n");
- }
- else
- {
- /* We could get some information about saved registers by
- calling get_saved_register on each register. Which info goes
- with which frame is necessarily lost, however, and I suspect
- that the users don't care whether they get the info. */
+ else if (!optimized && lval == lval_memory)
+ {
+ printf_filtered (" Previous frame's sp at ");
+ print_address_numeric (addr, 1, gdb_stdout);
+ printf_filtered ("\n");
+ need_nl = 0;
+ }
+ else if (!optimized && lval == lval_register)
+ {
+ printf_filtered (" Previous frame's sp in %s\n",
+ REGISTER_NAME (realnum));
+ need_nl = 0;
+ }
+ /* else keep quiet. */
+ }
+
+ count = 0;
+ numregs = NUM_REGS + NUM_PSEUDO_REGS;
+ for (i = 0; i < numregs; i++)
+ if (i != SP_REGNUM)
+ {
+ /* Find out the location of the saved register without
+ fetching the corresponding value. */
+ frame_register_unwind (fi, i, &optimized, &lval, &addr, &realnum,
+ NULL);
+ /* For moment, only display registers that were saved on the
+ stack. */
+ if (!optimized && lval == lval_memory)
+ {
+ if (count == 0)
+ puts_filtered (" Saved registers:\n ");
+ else
+ puts_filtered (",");
+ wrap_here (" ");
+ printf_filtered (" %s at ", REGISTER_NAME (i));
+ print_address_numeric (addr, 1, gdb_stdout);
+ count++;
+ }
+ }
+ if (count || need_nl)
puts_filtered ("\n");
- }
+ }
}
#if 0
@@ -1066,7 +1111,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
fi = get_prev_frame (fi))
{
QUIT;
- ps = find_pc_psymtab (fi->pc);
+ ps = find_pc_psymtab (frame_address_in_block (fi));
if (ps)
PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in */
}
@@ -1500,17 +1545,6 @@ select_and_print_frame (struct frame_info *fi)
}
}
-
-/* Store the selected frame and its level into *FRAMEP and *LEVELP.
- If there is no selected frame, *FRAMEP is set to NULL. */
-
-void
-record_selected_frame (CORE_ADDR *frameaddrp, int *levelp)
-{
- *frameaddrp = selected_frame ? selected_frame->frame : 0;
- *levelp = frame_relative_level (selected_frame);
-}
-
/* Return the symbol-block in which the selected frame is executing.
Can return zero under various legitimate circumstances.
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index b96c9018783..8177fc281cb 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -26,6 +26,7 @@
#include "frame.h"
#include "gdbtypes.h"
#include "value.h"
+#include "gdb_string.h"
/* Types that describe the various builtin registers. */
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d087b1fe4c7..8d63484af11 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -38,8 +38,9 @@
#include "demangle.h"
#include "inferior.h" /* for write_pc */
#include "gdb-stabs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "completer.h"
+#include "bcache.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -1740,8 +1741,10 @@ reread_symbols (void)
sizeof (objfile->static_psymbols));
/* Free the obstacks for non-reusable objfiles */
- free_bcache (&objfile->psymbol_cache);
- free_bcache (&objfile->macro_cache);
+ bcache_xfree (objfile->psymbol_cache);
+ objfile->psymbol_cache = bcache_xmalloc ();
+ bcache_xfree (objfile->macro_cache);
+ objfile->macro_cache = bcache_xmalloc ();
obstack_free (&objfile->psymbol_obstack, 0);
obstack_free (&objfile->symbol_obstack, 0);
obstack_free (&objfile->type_obstack, 0);
@@ -1765,10 +1768,8 @@ reread_symbols (void)
objfile->md = NULL;
/* obstack_specify_allocation also initializes the obstack so
it is empty. */
- obstack_specify_allocation (&objfile->psymbol_cache.cache, 0, 0,
- xmalloc, xfree);
- obstack_specify_allocation (&objfile->macro_cache.cache, 0, 0,
- xmalloc, xfree);
+ objfile->psymbol_cache = bcache_xmalloc ();
+ objfile->macro_cache = bcache_xmalloc ();
obstack_specify_allocation (&objfile->psymbol_obstack, 0, 0,
xmalloc, xfree);
obstack_specify_allocation (&objfile->symbol_obstack, 0, 0,
@@ -1962,9 +1963,9 @@ init_filename_language_table (void)
add_filename_language (".c++", language_cplus);
add_filename_language (".java", language_java);
add_filename_language (".class", language_java);
- add_filename_language (".ch", language_chill);
- add_filename_language (".c186", language_chill);
- add_filename_language (".c286", language_chill);
+ /* OBSOLETE add_filename_language (".ch", language_chill); */
+ /* OBSOLETE add_filename_language (".c186", language_chill); */
+ /* OBSOLETE add_filename_language (".c286", language_chill); */
add_filename_language (".f", language_fortran);
add_filename_language (".F", language_fortran);
add_filename_language (".s", language_asm);
@@ -2377,7 +2378,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
/* Create local copy of the partial symbol */
memcpy (buf, name, namelength);
buf[namelength] = '\0';
- SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache);
+ SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache);
/* val and coreaddr are mutually exclusive, one of them *will* be zero */
if (val != 0)
{
@@ -2394,7 +2395,7 @@ add_psymbol_to_list (char *name, int namelength, namespace_enum namespace,
SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
/* Stash the partial symbol away in the cache */
- psym = bcache (&psymbol, sizeof (struct partial_symbol), &objfile->psymbol_cache);
+ psym = bcache (&psymbol, sizeof (struct partial_symbol), objfile->psymbol_cache);
/* Save pointer to partial symbol in psymtab, growing symtab if needed. */
if (list->next >= list->list + list->size)
@@ -2429,7 +2430,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
memcpy (buf, name, namelength);
buf[namelength] = '\0';
- SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, &objfile->psymbol_cache);
+ SYMBOL_NAME (&psymbol) = bcache (buf, namelength + 1, objfile->psymbol_cache);
buf = alloca (dem_namelength + 1);
memcpy (buf, dem_name, dem_namelength);
@@ -2440,11 +2441,11 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
case language_c:
case language_cplus:
SYMBOL_CPLUS_DEMANGLED_NAME (&psymbol) =
- bcache (buf, dem_namelength + 1, &objfile->psymbol_cache);
+ bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
break;
- case language_chill:
- SYMBOL_CHILL_DEMANGLED_NAME (&psymbol) =
- bcache (buf, dem_namelength + 1, &objfile->psymbol_cache);
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE SYMBOL_CHILL_DEMANGLED_NAME (&psymbol) = */
+ /* OBSOLETE bcache (buf, dem_namelength + 1, objfile->psymbol_cache); */
/* FIXME What should be done for the default case? Ignoring for now. */
}
@@ -2465,7 +2466,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language);
/* Stash the partial symbol away in the cache */
- psym = bcache (&psymbol, sizeof (struct partial_symbol), &objfile->psymbol_cache);
+ psym = bcache (&psymbol, sizeof (struct partial_symbol), objfile->psymbol_cache);
/* Save pointer to partial symbol in psymtab, growing symtab if needed. */
if (list->next >= list->list + list->size)
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 39b10a6a02c..198b2d632ec 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -1,6 +1,8 @@
/* Do various things to symbol tables (other than lookup), for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation,
+ Inc.
This file is part of GDB.
@@ -27,7 +29,7 @@
#include "objfiles.h"
#include "breakpoint.h"
#include "command.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "language.h"
#include "bcache.h"
@@ -86,11 +88,17 @@ static void
free_symtab_block (struct objfile *objfile, struct block *b)
{
register int i, n;
- n = BLOCK_NSYMS (b);
+ struct symbol *sym, *next_sym;
+
+ n = BLOCK_BUCKETS (b);
for (i = 0; i < n; i++)
{
- xmfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
- xmfree (objfile->md, (PTR) BLOCK_SYM (b, i));
+ for (sym = BLOCK_BUCKET (b, i); sym; sym = next_sym)
+ {
+ next_sym = sym->hash_next;
+ xmfree (objfile->md, SYMBOL_NAME (sym));
+ xmfree (objfile->md, (PTR) sym);
+ }
}
xmfree (objfile->md, (PTR) b);
}
@@ -161,7 +169,7 @@ print_symbol_bcache_statistics (void)
ALL_OBJFILES (objfile)
{
printf_filtered ("Byte cache statistics for '%s':\n", objfile->name);
- print_bcache_statistics (&objfile->psymbol_cache, "partial symbol cache");
+ print_bcache_statistics (objfile->psymbol_cache, "partial symbol cache");
}
immediate_quit--;
}
@@ -196,9 +204,9 @@ print_objfile_statistics (void)
printf_filtered (" Total memory used for psymbol obstack: %d\n",
obstack_memory_used (&objfile->psymbol_obstack));
printf_filtered (" Total memory used for psymbol cache: %d\n",
- obstack_memory_used (&objfile->psymbol_cache.cache));
+ bcache_memory_used (objfile->psymbol_cache));
printf_filtered (" Total memory used for macro cache: %d\n",
- obstack_memory_used (&objfile->macro_cache.cache));
+ bcache_memory_used (objfile->macro_cache));
printf_filtered (" Total memory used for symbol obstack: %d\n",
obstack_memory_used (&objfile->symbol_obstack));
printf_filtered (" Total memory used for type obstack: %d\n",
@@ -457,8 +465,14 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab,
fprintf_filtered (outfile, " under ");
gdb_print_host_address (BLOCK_SUPERBLOCK (b), outfile);
}
- blen = BLOCK_NSYMS (b);
- fprintf_filtered (outfile, ", %d syms in ", blen);
+ /* drow/2002-07-10: We could save the total symbols count
+ even if we're using a hashtable, but nothing else but this message
+ wants it. */
+ blen = BLOCK_BUCKETS (b);
+ if (BLOCK_HASHTABLE (b))
+ fprintf_filtered (outfile, ", %d buckets in ", blen);
+ else
+ fprintf_filtered (outfile, ", %d syms in ", blen);
print_address_numeric (BLOCK_START (b), 1, outfile);
fprintf_filtered (outfile, "..");
print_address_numeric (BLOCK_END (b), 1, outfile);
@@ -474,8 +488,8 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab,
if (BLOCK_GCC_COMPILED (b))
fprintf_filtered (outfile, ", compiled with gcc%d", BLOCK_GCC_COMPILED (b));
fprintf_filtered (outfile, "\n");
- /* Now print each symbol in this block. */
- /* FIXMED: Sort? */
+ /* Now print each symbol in this block (in no particular order, if
+ we're using a hashtable). */
ALL_BLOCK_SYMBOLS (b, j, sym)
{
struct print_symbol_args s;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3d687be09d1..d39962ec033 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -40,7 +40,7 @@
#include "linespec.h"
#include "filenames.h" /* for FILENAME_CMP */
-#include "obstack.h"
+#include "gdb_obstack.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -438,24 +438,26 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol,
gsymbol->language_specific.cplus_specific.demangled_name = NULL;
}
}
- if (demangled == NULL
- && (gsymbol->language == language_chill
- || gsymbol->language == language_auto))
- {
- demangled =
- chill_demangle (gsymbol->name);
- if (demangled != NULL)
- {
- gsymbol->language = language_chill;
- gsymbol->language_specific.chill_specific.demangled_name =
- obsavestring (demangled, strlen (demangled), obstack);
- xfree (demangled);
- }
- else
- {
- gsymbol->language_specific.chill_specific.demangled_name = NULL;
- }
- }
+#if 0
+ /* OBSOLETE if (demangled == NULL */
+ /* OBSOLETE && (gsymbol->language == language_chill */
+ /* OBSOLETE || gsymbol->language == language_auto)) */
+ /* OBSOLETE { */
+ /* OBSOLETE demangled = */
+ /* OBSOLETE chill_demangle (gsymbol->name); */
+ /* OBSOLETE if (demangled != NULL) */
+ /* OBSOLETE { */
+ /* OBSOLETE gsymbol->language = language_chill; */
+ /* OBSOLETE gsymbol->language_specific.chill_specific.demangled_name = */
+ /* OBSOLETE obsavestring (demangled, strlen (demangled), obstack); */
+ /* OBSOLETE xfree (demangled); */
+ /* OBSOLETE } */
+ /* OBSOLETE else */
+ /* OBSOLETE { */
+ /* OBSOLETE gsymbol->language_specific.chill_specific.demangled_name = NULL; */
+ /* OBSOLETE } */
+ /* OBSOLETE } */
+#endif
}
@@ -679,12 +681,27 @@ lookup_symbol (const char *name, const struct block *block,
const namespace_enum namespace, int *is_a_field_of_this,
struct symtab **symtab)
{
- char *modified_name = NULL;
- char *modified_name2 = NULL;
+ char *demangled_name = NULL;
+ const char *modified_name = NULL;
const char *mangled_name = NULL;
int needtofreename = 0;
struct symbol *returnval;
+ modified_name = name;
+
+ /* If we are using C++ language, demangle the name before doing a lookup, so
+ we can always binary search. */
+ if (current_language->la_language == language_cplus)
+ {
+ demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
+ if (demangled_name)
+ {
+ mangled_name = name;
+ modified_name = demangled_name;
+ needtofreename = 1;
+ }
+ }
+
if (case_sensitivity == case_sensitive_off)
{
char *copy;
@@ -697,26 +714,11 @@ lookup_symbol (const char *name, const struct block *block,
copy[len] = 0;
modified_name = copy;
}
- else
- modified_name = (char *) name;
-
- /* If we are using C++ language, demangle the name before doing a lookup, so
- we can always binary search. */
- if (current_language->la_language == language_cplus)
- {
- modified_name2 = cplus_demangle (modified_name, DMGL_ANSI | DMGL_PARAMS);
- if (modified_name2)
- {
- mangled_name = name;
- modified_name = modified_name2;
- needtofreename = 1;
- }
- }
returnval = lookup_symbol_aux (modified_name, mangled_name, block,
namespace, is_a_field_of_this, symtab);
if (needtofreename)
- xfree (modified_name2);
+ xfree (demangled_name);
return returnval;
}
@@ -1328,6 +1330,22 @@ lookup_block_symbol (register const struct block *block, const char *name,
register struct symbol *sym_found = NULL;
register int do_linear_search = 1;
+ if (BLOCK_HASHTABLE (block))
+ {
+ unsigned int hash_index;
+ hash_index = msymbol_hash_iw (name);
+ hash_index = hash_index % BLOCK_BUCKETS (block);
+ for (sym = BLOCK_BUCKET (block, hash_index); sym; sym = sym->hash_next)
+ {
+ if (SYMBOL_NAMESPACE (sym) == namespace
+ && (mangled_name
+ ? strcmp (SYMBOL_NAME (sym), mangled_name) == 0
+ : SYMBOL_MATCHES_NAME (sym, name)))
+ return sym;
+ }
+ return NULL;
+ }
+
/* If the blocks's symbols were sorted, start with a binary search. */
if (BLOCK_SHOULD_SORT (block))
@@ -1582,14 +1600,15 @@ find_pc_sect_symtab (CORE_ADDR pc, asection *section)
if (section != 0)
{
int i;
+ struct symbol *sym = NULL;
- for (i = 0; i < b->nsyms; i++)
+ ALL_BLOCK_SYMBOLS (b, i, sym)
{
- fixup_symbol_section (b->sym[i], objfile);
- if (section == SYMBOL_BFD_SECTION (b->sym[i]))
+ fixup_symbol_section (sym, objfile);
+ if (section == SYMBOL_BFD_SECTION (sym))
break;
}
- if (i >= b->nsyms)
+ if ((i >= BLOCK_BUCKETS (b)) && (sym == NULL))
continue; /* no symbol in this symtab matches section */
}
distance = BLOCK_END (b) - BLOCK_START (b);
@@ -1661,10 +1680,8 @@ find_addr_symbol (CORE_ADDR addr, struct symtab **symtabp, CORE_ADDR *symaddrp)
{
QUIT;
block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), blocknum);
- top = BLOCK_NSYMS (block);
- for (bot = 0; bot < top; bot++)
+ ALL_BLOCK_SYMBOLS (block, bot, sym)
{
- sym = BLOCK_SYM (block, bot);
switch (SYMBOL_CLASS (sym))
{
case LOC_STATIC:
@@ -2795,10 +2812,9 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
struct symbol_search *prevtail = tail;
int nfound = 0;
b = BLOCKVECTOR_BLOCK (bv, i);
- for (j = 0; j < BLOCK_NSYMS (b); j++)
+ ALL_BLOCK_SYMBOLS (b, j, sym)
{
QUIT;
- sym = BLOCK_SYM (b, j);
if (file_matches (s->filename, files, nfiles)
&& ((regexp == NULL || SYMBOL_MATCHES_REGEXP (sym))
&& ((kind == VARIABLES_NAMESPACE && SYMBOL_CLASS (sym) != LOC_TYPEDEF
@@ -3719,6 +3735,49 @@ in_prologue (CORE_ADDR pc, CORE_ADDR func_start)
/* Begin overload resolution functions */
+
+static char *
+remove_params (const char *demangled_name)
+{
+ const char *argp;
+ char *new_name;
+ int depth;
+
+ if (demangled_name == NULL)
+ return NULL;
+
+ /* First find the end of the arg list. */
+ argp = strrchr (demangled_name, ')');
+ if (argp == NULL)
+ return NULL;
+
+ /* Back up to the beginning. */
+ depth = 1;
+
+ while (argp-- > demangled_name)
+ {
+ if (*argp == ')')
+ depth ++;
+ else if (*argp == '(')
+ {
+ depth --;
+
+ if (depth == 0)
+ break;
+ }
+ }
+ if (depth != 0)
+ internal_error (__FILE__, __LINE__,
+ "bad demangled name %s\n", demangled_name);
+ while (argp[-1] == ' ' && argp > demangled_name)
+ argp --;
+
+ new_name = xmalloc (argp - demangled_name + 1);
+ memcpy (new_name, demangled_name, argp - demangled_name);
+ new_name[argp - demangled_name] = '\0';
+ return new_name;
+}
+
/* Helper routine for make_symbol_completion_list. */
static int sym_return_val_size;
@@ -3734,14 +3793,21 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
{
int newsize;
int i;
+ char *sym_name;
+
+ /* If there is no type information, we can't do anything, so skip */
+ if (SYMBOL_TYPE (sym) == NULL)
+ return;
+
+ /* skip any symbols that we've already considered. */
+ for (i = 0; i < sym_return_val_index; ++i)
+ if (!strcmp (SYMBOL_NAME (sym), SYMBOL_NAME (sym_return_val[i])))
+ return;
/* Get the demangled name without parameters */
- char *sym_name = cplus_demangle (SYMBOL_NAME (sym), DMGL_ARM | DMGL_ANSI);
+ sym_name = remove_params (SYMBOL_DEMANGLED_NAME (sym));
if (!sym_name)
- {
- sym_name = (char *) xmalloc (strlen (SYMBOL_NAME (sym)) + 1);
- strcpy (sym_name, SYMBOL_NAME (sym));
- }
+ return;
/* skip symbols that cannot match */
if (strcmp (sym_name, oload_name) != 0)
@@ -3750,14 +3816,7 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
return;
}
- /* If there is no type information, we can't do anything, so skip */
- if (SYMBOL_TYPE (sym) == NULL)
- return;
-
- /* skip any symbols that we've already considered. */
- for (i = 0; i < sym_return_val_index; ++i)
- if (!strcmp (SYMBOL_NAME (sym), SYMBOL_NAME (sym_return_val[i])))
- return;
+ xfree (sym_name);
/* We have a match for an overload instance, so add SYM to the current list
* of overload instances */
@@ -3768,8 +3827,6 @@ overload_list_add_symbol (struct symbol *sym, char *oload_name)
}
sym_return_val[sym_return_val_index++] = sym;
sym_return_val[sym_return_val_index] = NULL;
-
- xfree (sym_name);
}
/* Return a null-terminated list of pointers to function symbols that
@@ -3792,14 +3849,17 @@ make_symbol_overload_list (struct symbol *fsym)
/* Length of name. */
int oload_name_len = 0;
- /* Look for the symbol we are supposed to complete on.
- * FIXME: This should be language-specific. */
+ /* Look for the symbol we are supposed to complete on. */
- oload_name = cplus_demangle (SYMBOL_NAME (fsym), DMGL_ARM | DMGL_ANSI);
+ oload_name = remove_params (SYMBOL_DEMANGLED_NAME (fsym));
if (!oload_name)
{
- oload_name = (char *) xmalloc (strlen (SYMBOL_NAME (fsym)) + 1);
- strcpy (oload_name, SYMBOL_NAME (fsym));
+ sym_return_val_size = 1;
+ sym_return_val = (struct symbol **) xmalloc (2 * sizeof (struct symbol *));
+ sym_return_val[0] = fsym;
+ sym_return_val[1] = NULL;
+
+ return sym_return_val;
}
oload_name_len = strlen (oload_name);
diff --git a/gdb/symtab.h b/gdb/symtab.h
index bb22d0d4eaa..7f511f070cd 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -23,12 +23,8 @@
#if !defined (SYMTAB_H)
#define SYMTAB_H 1
-/* Some definitions and declarations to go with use of obstacks. */
-
-#include "obstack.h"
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free xfree
-#include "bcache.h"
+/* Opaque declarations. */
+struct obstack;
/* Don't do this; it means that if some .o's are compiled with GNU C
and some are not (easy to do accidentally the way we configure
@@ -93,11 +89,13 @@ struct general_symbol_info
char *demangled_name;
}
cplus_specific;
- struct chill_specific /* For Chill */
- {
- char *demangled_name;
- }
- chill_specific;
+#if 0
+ /* OBSOLETE struct chill_specific *//* For Chill */
+ /* OBSOLETE { */
+ /* OBSOLETE char *demangled_name; */
+ /* OBSOLETE } */
+ /* OBSOLETE chill_specific; */
+#endif
}
language_specific;
@@ -148,10 +146,10 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
{ \
SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
} \
- else if (SYMBOL_LANGUAGE (symbol) == language_chill) \
- { \
- SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; \
- } \
+ /* OBSOLETE else if (SYMBOL_LANGUAGE (symbol) == language_chill) */ \
+ /* OBSOLETE { */ \
+ /* OBSOLETE SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; */ \
+ /* OBSOLETE } */ \
else \
{ \
memset (&(symbol)->ginfo.language_specific, 0, \
@@ -172,12 +170,12 @@ extern void symbol_init_demangled_name (struct general_symbol_info *symbol,
(SYMBOL_LANGUAGE (symbol) == language_cplus \
|| SYMBOL_LANGUAGE (symbol) == language_java \
? SYMBOL_CPLUS_DEMANGLED_NAME (symbol) \
- : (SYMBOL_LANGUAGE (symbol) == language_chill \
- ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) \
- : NULL))
+ : /* OBSOLETE (SYMBOL_LANGUAGE (symbol) == language_chill */ \
+ /* OBSOLETE ? SYMBOL_CHILL_DEMANGLED_NAME (symbol) */ \
+ NULL)
-#define SYMBOL_CHILL_DEMANGLED_NAME(symbol) \
- (symbol)->ginfo.language_specific.chill_specific.demangled_name
+/* OBSOLETE #define SYMBOL_CHILL_DEMANGLED_NAME(symbol) */
+/* OBSOLETE (symbol)->ginfo.language_specific.chill_specific.demangled_name */
/* Macro that returns the "natural source name" of a symbol. In C++ this is
the "demangled" form of the name if demangle is on and the "mangled" form
@@ -387,6 +385,25 @@ struct block
unsigned char gcc_compile_flag;
+ /* The symbols for this block are either in a simple linear list or
+ in a simple hashtable. Blocks which correspond to a function
+ (which have a list of symbols corresponding to arguments) use
+ a linear list, as do some older symbol readers (currently only
+ mdebugread and dstread). Other blocks are hashed.
+
+ The hashtable uses the same hash function as the minsym hashtables,
+ found in minsyms.c:minsym_hash_iw. Symbols are hashed based on
+ their demangled name if appropriate, and on their name otherwise.
+ The hash function ignores space, and stops at the beginning of the
+ argument list if any.
+
+ The table is laid out in NSYMS/5 buckets and symbols are chained via
+ their hash_next field. */
+
+ /* If this is really a hashtable of the symbols, this flag is 1. */
+
+ unsigned char hashtable;
+
/* Number of local symbols. */
int nsyms;
@@ -399,30 +416,38 @@ struct block
#define BLOCK_START(bl) (bl)->startaddr
#define BLOCK_END(bl) (bl)->endaddr
-#define BLOCK_NSYMS(bl) (bl)->nsyms
-#define BLOCK_SYM(bl, n) (bl)->sym[n]
#define BLOCK_FUNCTION(bl) (bl)->function
#define BLOCK_SUPERBLOCK(bl) (bl)->superblock
#define BLOCK_GCC_COMPILED(bl) (bl)->gcc_compile_flag
+#define BLOCK_HASHTABLE(bl) (bl)->hashtable
+
+/* For blocks without a hashtable (BLOCK_HASHTABLE (bl) == 0) only. */
+#define BLOCK_NSYMS(bl) (bl)->nsyms
+#define BLOCK_SYM(bl, n) (bl)->sym[n]
-/* Macro to loop through all symbols in a block BL.
- i counts which symbol we are looking at, and sym points to the current
- symbol.
- The contortion at the end is to avoid reading past the last valid
- BLOCK_SYM. */
-#define ALL_BLOCK_SYMBOLS(bl, i, sym) \
- for ((i) = 0, (sym) = BLOCK_SYM ((bl), (i)); \
- (i) < BLOCK_NSYMS ((bl)); \
- ++(i), (sym) = ((i) < BLOCK_NSYMS ((bl))) \
- ? BLOCK_SYM ((bl), (i)) \
- : NULL)
+/* For blocks with a hashtable, but these are valid for non-hashed blocks as
+ well - each symbol will appear to be one bucket by itself. */
+#define BLOCK_BUCKETS(bl) (bl)->nsyms
+#define BLOCK_BUCKET(bl, n) (bl)->sym[n]
+
+/* Macro used to set the size of a hashtable for N symbols. */
+#define BLOCK_HASHTABLE_SIZE(n) ((n)/5 + 1)
+
+/* Macro to loop through all symbols in a block BL, in no particular order.
+ i counts which bucket we are in, and sym points to the current symbol. */
+
+#define ALL_BLOCK_SYMBOLS(bl, i, sym) \
+ for ((i) = 0; (i) < BLOCK_BUCKETS ((bl)); (i)++) \
+ for ((sym) = BLOCK_BUCKET ((bl), (i)); (sym); \
+ (sym) = (sym)->hash_next)
/* Nonzero if symbols of block BL should be sorted alphabetically.
Don't sort a block which corresponds to a function. If we did the
sorting would have to preserve the order of the symbols for the
- arguments. */
+ arguments. Also don't sort any block that we chose to hash. */
-#define BLOCK_SHOULD_SORT(bl) ((bl)->nsyms >= 40 && BLOCK_FUNCTION (bl) == NULL)
+#define BLOCK_SHOULD_SORT(bl) (! BLOCK_HASHTABLE (bl) \
+ && BLOCK_FUNCTION (bl) == NULL)
/* Represent one symbol name; a variable, constant, function or typedef. */
@@ -672,6 +697,8 @@ struct symbol
/* List of ranges where this symbol is active. This is only
used by alias symbols at the current time. */
struct range_list *ranges;
+
+ struct symbol *hash_next;
};
@@ -1077,9 +1104,8 @@ find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, CORE_ADDR *);
extern void clear_pc_function_cache (void);
-extern int
-find_pc_sect_partial_function (CORE_ADDR, asection *,
- char **, CORE_ADDR *, CORE_ADDR *);
+extern int find_pc_sect_partial_function (CORE_ADDR, asection *,
+ char **, CORE_ADDR *, CORE_ADDR *);
/* from symtab.c: */
diff --git a/gdb/target.c b/gdb/target.c
index 2cd492809f4..ec1979b4f90 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -52,6 +52,8 @@ static void kill_or_be_killed (int);
static void default_terminal_info (char *, int);
+static int default_region_size_ok_for_hw_watchpoint (int);
+
static int nosymbol (char *, CORE_ADDR *);
static void tcomplain (void);
@@ -62,6 +64,8 @@ static int return_zero (void);
static int return_one (void);
+static int return_minus_one (void);
+
void target_ignore (void);
static void target_command (char *, int);
@@ -103,9 +107,8 @@ static void debug_to_store_registers (int);
static void debug_to_prepare_to_store (void);
-static int
-debug_to_xfer_memory (CORE_ADDR, char *, int, int, struct mem_attrib *,
- struct target_ops *);
+static int debug_to_xfer_memory (CORE_ADDR, char *, int, int,
+ struct mem_attrib *, struct target_ops *);
static void debug_to_files_info (struct target_ops *);
@@ -113,6 +116,22 @@ static int debug_to_insert_breakpoint (CORE_ADDR, char *);
static int debug_to_remove_breakpoint (CORE_ADDR, char *);
+static int debug_to_can_use_hw_breakpoint (int, int, int);
+
+static int debug_to_insert_hw_breakpoint (CORE_ADDR, char *);
+
+static int debug_to_remove_hw_breakpoint (CORE_ADDR, char *);
+
+static int debug_to_insert_watchpoint (CORE_ADDR, int, int);
+
+static int debug_to_remove_watchpoint (CORE_ADDR, int, int);
+
+static int debug_to_stopped_by_watchpoint (void);
+
+static CORE_ADDR debug_to_stopped_data_address (void);
+
+static int debug_to_region_size_ok_for_hw_watchpoint (int);
+
static void debug_to_terminal_init (void);
static void debug_to_terminal_inferior (void);
@@ -391,6 +410,29 @@ cleanup_target (struct target_ops *t)
memory_insert_breakpoint);
de_fault (to_remove_breakpoint,
memory_remove_breakpoint);
+ de_fault (to_can_use_hw_breakpoint,
+ (int (*) (int, int, int))
+ return_zero);
+ de_fault (to_insert_hw_breakpoint,
+ (int (*) (CORE_ADDR, char *))
+ return_minus_one);
+ de_fault (to_remove_hw_breakpoint,
+ (int (*) (CORE_ADDR, char *))
+ return_minus_one);
+ de_fault (to_insert_watchpoint,
+ (int (*) (CORE_ADDR, int, int))
+ return_minus_one);
+ de_fault (to_remove_watchpoint,
+ (int (*) (CORE_ADDR, int, int))
+ return_minus_one);
+ de_fault (to_stopped_by_watchpoint,
+ (int (*) (void))
+ return_zero);
+ de_fault (to_stopped_data_address,
+ (CORE_ADDR (*) (void))
+ return_zero);
+ de_fault (to_region_size_ok_for_hw_watchpoint,
+ default_region_size_ok_for_hw_watchpoint);
de_fault (to_terminal_init,
(void (*) (void))
target_ignore);
@@ -554,6 +596,14 @@ update_current_target (void)
INHERIT (to_files_info, t);
INHERIT (to_insert_breakpoint, t);
INHERIT (to_remove_breakpoint, t);
+ INHERIT (to_can_use_hw_breakpoint, t);
+ INHERIT (to_insert_hw_breakpoint, t);
+ INHERIT (to_remove_hw_breakpoint, t);
+ INHERIT (to_insert_watchpoint, t);
+ INHERIT (to_remove_watchpoint, t);
+ INHERIT (to_stopped_data_address, t);
+ INHERIT (to_stopped_by_watchpoint, t);
+ INHERIT (to_region_size_ok_for_hw_watchpoint, t);
INHERIT (to_terminal_init, t);
INHERIT (to_terminal_inferior, t);
INHERIT (to_terminal_ours_for_output, t);
@@ -1228,6 +1278,12 @@ find_default_clone_and_follow_inferior (int child_pid, int *followed_child)
}
static int
+default_region_size_ok_for_hw_watchpoint (int byte_count)
+{
+ return (byte_count <= REGISTER_SIZE);
+}
+
+static int
return_zero (void)
{
return 0;
@@ -1239,6 +1295,12 @@ return_one (void)
return 1;
}
+static int
+return_minus_one (void)
+{
+ return -1;
+}
+
/*
* Resize the to_sections pointer. Also make sure that anyone that
* was holding on to an old value of it gets updated.
@@ -1775,6 +1837,116 @@ debug_to_remove_breakpoint (CORE_ADDR addr, char *save)
return retval;
}
+static int
+debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty)
+{
+ int retval;
+
+ retval = debug_target.to_can_use_hw_breakpoint (type, cnt, from_tty);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_can_use_hw_breakpoint (%ld, %ld, %ld) = %ld\n",
+ (unsigned long) type,
+ (unsigned long) cnt,
+ (unsigned long) from_tty,
+ (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_region_size_ok_for_hw_watchpoint (int byte_count)
+{
+ CORE_ADDR retval;
+
+ retval = debug_target.to_region_size_ok_for_hw_watchpoint (byte_count);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT (%ld) = 0x%lx\n",
+ (unsigned long) byte_count,
+ (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_stopped_by_watchpoint (void)
+{
+ int retval;
+
+ retval = debug_target.to_stopped_by_watchpoint ();
+
+ fprintf_unfiltered (gdb_stdlog,
+ "STOPPED_BY_WATCHPOINT () = %ld\n",
+ (unsigned long) retval);
+ return retval;
+}
+
+static CORE_ADDR
+debug_to_stopped_data_address (void)
+{
+ CORE_ADDR retval;
+
+ retval = debug_target.to_stopped_data_address ();
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_stopped_data_address () = 0x%lx\n",
+ (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_insert_hw_breakpoint (CORE_ADDR addr, char *save)
+{
+ int retval;
+
+ retval = debug_target.to_insert_hw_breakpoint (addr, save);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_insert_hw_breakpoint (0x%lx, xxx) = %ld\n",
+ (unsigned long) addr,
+ (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_remove_hw_breakpoint (CORE_ADDR addr, char *save)
+{
+ int retval;
+
+ retval = debug_target.to_remove_hw_breakpoint (addr, save);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_remove_hw_breakpoint (0x%lx, xxx) = %ld\n",
+ (unsigned long) addr,
+ (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ int retval;
+
+ retval = debug_target.to_insert_watchpoint (addr, len, type);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_insert_watchpoint (0x%lx, %d, %d) = %ld\n",
+ (unsigned long) addr, len, type, (unsigned long) retval);
+ return retval;
+}
+
+static int
+debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type)
+{
+ int retval;
+
+ retval = debug_target.to_insert_watchpoint (addr, len, type);
+
+ fprintf_unfiltered (gdb_stdlog,
+ "target_insert_watchpoint (0x%lx, %d, %d) = %ld\n",
+ (unsigned long) addr, len, type, (unsigned long) retval);
+ return retval;
+}
+
static void
debug_to_terminal_init (void)
{
@@ -2221,6 +2393,14 @@ setup_target_debug (void)
current_target.to_files_info = debug_to_files_info;
current_target.to_insert_breakpoint = debug_to_insert_breakpoint;
current_target.to_remove_breakpoint = debug_to_remove_breakpoint;
+ current_target.to_can_use_hw_breakpoint = debug_to_can_use_hw_breakpoint;
+ current_target.to_insert_hw_breakpoint = debug_to_insert_hw_breakpoint;
+ current_target.to_remove_hw_breakpoint = debug_to_remove_hw_breakpoint;
+ current_target.to_insert_watchpoint = debug_to_insert_watchpoint;
+ current_target.to_remove_watchpoint = debug_to_remove_watchpoint;
+ current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint;
+ current_target.to_stopped_data_address = debug_to_stopped_data_address;
+ current_target.to_region_size_ok_for_hw_watchpoint = debug_to_region_size_ok_for_hw_watchpoint;
current_target.to_terminal_init = debug_to_terminal_init;
current_target.to_terminal_inferior = debug_to_terminal_inferior;
current_target.to_terminal_ours_for_output = debug_to_terminal_ours_for_output;
@@ -2299,16 +2479,15 @@ initialize_targets (void)
When non-zero, target debugging is enabled.", &setdebuglist),
&showdebuglist);
- add_show_from_set
- (add_set_boolean_cmd
- ("trust-readonly-sections", class_support,
- &trust_readonly,
- "Set mode for reading from readonly sections.\n\
+ add_setshow_boolean_cmd ("trust-readonly-sections", class_support,
+ &trust_readonly, "\
+Set mode for reading from readonly sections.\n\
When this mode is on, memory reads from readonly sections (such as .text)\n\
will be read from the object file instead of from the target. This will\n\
-result in significant performance improvement for remote targets.",
- &setlist),
- &showlist);
+result in significant performance improvement for remote targets.", "\
+Show mode for reading from readonly sections.\n",
+ NULL, NULL,
+ &setlist, &showlist);
add_com ("monitor", class_obscure, do_monitor_command,
"Send a command to the remote monitor (remote targets only).");
diff --git a/gdb/target.h b/gdb/target.h
index 1797fc1d3e3..c165801bfcc 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -252,6 +252,14 @@ struct target_ops
void (*to_files_info) (struct target_ops *);
int (*to_insert_breakpoint) (CORE_ADDR, char *);
int (*to_remove_breakpoint) (CORE_ADDR, char *);
+ int (*to_can_use_hw_breakpoint) (int, int, int);
+ int (*to_insert_hw_breakpoint) (CORE_ADDR, char *);
+ int (*to_remove_hw_breakpoint) (CORE_ADDR, char *);
+ int (*to_remove_watchpoint) (CORE_ADDR, int, int);
+ int (*to_insert_watchpoint) (CORE_ADDR, int, int);
+ int (*to_stopped_by_watchpoint) (void);
+ CORE_ADDR (*to_stopped_data_address) (void);
+ int (*to_region_size_ok_for_hw_watchpoint) (int);
void (*to_terminal_init) (void);
void (*to_terminal_inferior) (void);
void (*to_terminal_ours_for_output) (void);
@@ -1041,7 +1049,8 @@ extern void (*target_new_objfile_hook) (struct objfile *);
write). */
#ifndef STOPPED_BY_WATCHPOINT
-#define STOPPED_BY_WATCHPOINT(w) 0
+#define STOPPED_BY_WATCHPOINT(w) \
+ (*current_target.to_stopped_by_watchpoint) ()
#endif
/* HP-UX supplies these operations, which respectively disable and enable
@@ -1056,20 +1065,24 @@ extern void (*target_new_objfile_hook) (struct objfile *);
#define TARGET_ENABLE_HW_WATCHPOINTS(pid)
#endif
-/* Provide defaults for systems that don't support hardware watchpoints. */
+/* Provide defaults for hardware watchpoint functions. */
-#ifndef TARGET_HAS_HARDWARE_WATCHPOINTS
+/* If the *_hw_beakpoint functions have not been defined
+ elsewhere use the definitions in the target vector. */
/* Returns non-zero if we can set a hardware watchpoint of type TYPE. TYPE is
one of bp_hardware_watchpoint, bp_read_watchpoint, bp_write_watchpoint, or
bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
(including this one?). OTHERTYPE is who knows what... */
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) 0
+#ifndef TARGET_CAN_USE_HARDWARE_WATCHPOINT
+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) \
+ (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
+#endif
#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \
- ((LONGEST)(byte_count) <= REGISTER_SIZE)
+ (*current_target.to_region_size_ok_for_hw_watchpoint) (byte_count)
#endif
@@ -1077,18 +1090,25 @@ extern void (*target_new_objfile_hook) (struct objfile *);
for write, 1 for read, and 2 for read/write accesses. Returns 0 for
success, non-zero for failure. */
-#define target_remove_watchpoint(ADDR,LEN,TYPE) -1
-#define target_insert_watchpoint(ADDR,LEN,TYPE) -1
+#ifndef target_insert_watchpoint
+#define target_insert_watchpoint(addr, len, type) \
+ (*current_target.to_insert_watchpoint) (addr, len, type)
-#endif /* TARGET_HAS_HARDWARE_WATCHPOINTS */
+#define target_remove_watchpoint(addr, len, type) \
+ (*current_target.to_remove_watchpoint) (addr, len, type)
+#endif
#ifndef target_insert_hw_breakpoint
-#define target_remove_hw_breakpoint(ADDR,SHADOW) -1
-#define target_insert_hw_breakpoint(ADDR,SHADOW) -1
+#define target_insert_hw_breakpoint(addr, save) \
+ (*current_target.to_insert_hw_breakpoint) (addr, save)
+
+#define target_remove_hw_breakpoint(addr, save) \
+ (*current_target.to_remove_hw_breakpoint) (addr, save)
#endif
#ifndef target_stopped_data_address
-#define target_stopped_data_address() 0
+#define target_stopped_data_address() \
+ (*current_target.to_stopped_data_address) ()
#endif
/* If defined, then we need to decr pc by this much after a hardware break-
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c033fa374fe..e47afec868b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,12 +1,145 @@
+2002-08-23 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/print-threads.c: New file.
+ * gdb.threads/print-threads.exp: New file.
+ * gdb.threads/schedlock.c: New file.
+ * gdb.threads/schedlock.exp: New file.
+
+2002-08-22 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.arch/altivec-abi.exp: The source C file is altivec-abi.c,
+ not altivec.c.
+
+2002-08-17 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/return.exp: Remove i*86-*-* from list of xfail'ed
+ targets. The problem should be fixed now.
+
+2002-08-15 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.java/jv-print.exp: Fix p '' and p ''' tests to deal with
+ 2002-07-24 change that removes final dots from error messages.
+
+2002-08-13 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/readline.exp: New file.
+
+2002-08-01 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/gdb.exp (gdb_expect_list): Only print one pass, fail, or
+ supress message.
+
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (TARGET_FLAGS_TO_PASS): Remove CHILLFLAGS, CHILL,
+ CHILL_FOR_TARGET and CHILL_LIB.
+ * configure.in (configdirs): Remove gdb.chill.
+ * configure: Regenerate.
+ * lib/gdb.exp: Obsolete references to chill.
+ * gdb.fortran/types.exp: Ditto.
+ * gdb.fortran/exprs.exp: Ditto.
+
+2002-07-30 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/shlib-call.exp (additional_flags): Conditionally
+ set Irix-specific compile and link flags.
+
+2002-07-29 Kevin Buettner <kevinb@redhat.com>
+
+ * lib/gdb.exp (mips*-*-irix*): Use alternate method for preprocessing
+ source files. The ``-o'' option doesn't work with the ``-E'' option
+ when using the Irix compiler.
+
+2002-07-19 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/gdbserver.exp (gdb_load): Don't use TCL varargs.
+ Improve support for reusing an exec file. Copy exec file
+ to target, and run gdbserver on the target instead of on the host.
+
+2002-07-18 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/ending-run.exp: Don't expect to see the program end in
+ some orderly fashion when we're running on a real stand-alone
+ board.
+
+ * gdb.base/interrupt.exp: Correct logic for skipping tests on
+ targets that don't support interrupts.
+
+2002-07-10 Paul N. Hilfinger <hilfingr@otisco.mckusick.com>
+
+ * gdb.base/attach.exp: Add patterns to match output from /proc-based
+ systems.
+ Move comments in expect statements to inside the actions, so that they
+ don't get matched against.
+
+2002-07-10 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/interrupt.exp: Setup xfail for all i386 BSD's on "call
+ function when asleep" test.
+
+2002-07-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/page.exp: Rewrite to handle problems with very long
+ `info set' output. Update copyright.
+
+2002-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.hp/configure.in (AC_CONFIG_SUBDIRS): Do not try to configure
+ gdb.threads-hp.
+ * gdb.hp/configure: Regenerate.
+ * gdb.hp/gdb.threads-hp/configure.in: Delete file.
+ * gdb.hp/gdb.threads-hp/configure: Delete file.
+ * gdb.hp/gdb.threads-hp/Makefile.in: Delete file.
+
+2002-06-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/selftest.exp (do_stes_and_next): Skip calls to
+ setlocale, bindtextdomain and textdomain.
+
+2002-06-11 Jim Blandy <jimb@redhat.com>
+
+ * lib/gdb.exp (get_debug_format): Tolerate message saying whether
+ preprocessor macro information is present.
+
+ * macscp.exp, macscp1.c, macscp2.h, macscp3.h, macscp4.h: New
+ tests.
+
+2002-06-06 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/overlays.exp: Record addresses of overlay
+ functions in TCL variables rather than in GDB variables,
+ to avoid having GDB convert them to pointers (with loss
+ of information).
+
+ * gdb.base/d10v.ld: Merge in several years worth of
+ default linker script changes.
+ * gdb.base/long_long.exp: Add check for sizeof (long double).
+
+2002-06-06 Michal Ludvig <mludvig@suse.cz>
+
+ * gdb.asm/asm-source.exp: Add x86-64 target.
+ * gdb.asm/x86_64.inc: New.
+
+2002-05-30 Michael Chastain <mec@shout.net>
+
+ From Benjamin Kosnik <bkoz@redhat.com>:
+ * gdb.c++/m-static.cc: New file.
+ * gdb.c++/m-static.exp: New file.
+
+2002-05-28 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/call-ar-st.exp: Allow for reduced floating point
+ precision.
+
2002-05-27 Michael Chastain <mec@shout.net>
-From Benjamin Kosnik <bkoz@redhat.com>
+ From Benjamin Kosnik <bkoz@redhat.com>:
* gdb.c++/m-data.cc: New file.
* gdb.c++/m-data.exp: New file.
2002-05-27 Michael Chastain <mec@shout.net>
-From Benjamin Kosnik <bkoz@redhat.com>
+ From Benjamin Kosnik <bkoz@redhat.com>:
* gdb.c++/try_catch.cc: New file.
* gdb.c++/try_catch.exp: New file.
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index b936e39fdb9..f7f610ae1f5 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -67,10 +67,6 @@ TARGET_FLAGS_TO_PASS = \
'CC=$$(CC_FOR_TARGET)' \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(TESTSUITE_CFLAGS)" \
- "CHILLFLAGS=$(CHILLFLAGS)" \
- 'CHILL=$$(CHILL_FOR_TARGET)' \
- "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
- "CHILL_LIB=$(CHILL_LIB)" \
'CXX=$$(CXX_FOR_TARGET)' \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
"CXXFLAGS=$(CXXFLAGS)" \
diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp
index 2c63729d72e..475acd42073 100644
--- a/gdb/testsuite/config/gdbserver.exp
+++ b/gdb/testsuite/config/gdbserver.exp
@@ -2,7 +2,7 @@
# ie. a debug agent running as a native process on the same or
# a different host.
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 2002 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
@@ -89,7 +89,8 @@ global server_exec;
global portnum;
set portnum "2345";
-proc gdb_load { args } {
+proc gdb_load { arg } {
+ global host_exec;
global server_exec;
global portnum;
global verbose;
@@ -133,49 +134,62 @@ proc gdb_load { args } {
# Export the host:port pair.
set gdbport $debughost$portnum;
- if { $args == "" || $args == "{}" } {
- if [info exists server_exec] {
- set args $server_exec;
- } else {
+ # Remember new exec file.
+ if { $arg == "" } {
+ if { ! [info exists host_exec] } {
send_gdb "info files\n";
gdb_expect 30 {
-re "Symbols from \"(\[^\"\]+)\"" {
- set args $expect_out(1,string);
+ set host_exec $expect_out(1,string);
exp_continue;
}
-re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
- set args $expect_out(1,string);
+ set host_exec $expect_out(1,string);
exp_continue;
}
-re "$gdb_prompt $" { }
}
}
+ } else {
+ set host_exec $arg
+ if [info exists server_exec] { unset server_exec }
}
- # remember new exec file
- set server_exec $args;
+ if { ! [info exists server_exec] } {
+ if [is_remote target] {
+ set server_exec [remote_download target $host_exec]
+ } else {
+ set server_exec $host_exec
+ }
+ }
# Fire off the debug agent
if [target_info exists gdb_server_args] {
# This flavour of gdbserver takes as arguments those specified
# in the board configuration file
set custom_args [target_info gdb_server_args];
- remote_spawn host \
- "$gdbserver $custom_args >& /dev/null < /dev/null &" \
- writeonly
+ set server_spawn_id [remote_spawn target \
+ "$gdbserver $custom_args"]
} else {
# This flavour of gdbserver takes as arguments the port information
# and the name of the executable file to be debugged.
- remote_spawn host \
- "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
- writeonly
+ set server_spawn_id [remote_spawn target \
+ "$gdbserver $sockethost$portnum $server_exec"]
}
+
+ # We can't call close, because if gdbserver is local then that means
+ # that it will get a SIGHUP.
+ ## close -i $server_spawn_id
+ wait -nowait -i $server_spawn_id
+
# Give it a little time to establish
- sleep 2
+ sleep 1
# tell gdb what file we are debugging
- if [gdb_file_cmd $args] {
- return -1;
+ if { $arg != "" } {
+ if [gdb_file_cmd $arg] {
+ return -1;
+ }
}
# attach to the "serial port"
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index bdfc4cd443e..26d555e029a 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -32,7 +32,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -147,7 +146,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -318,11 +316,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -488,16 +481,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- 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
+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
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -586,7 +575,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:590: checking host system type" >&5
+echo "configure:579: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -607,7 +596,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:611: checking target system type" >&5
+echo "configure:600: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -625,7 +614,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:629: checking build system type" >&5
+echo "configure:618: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -655,7 +644,6 @@ configdirs="gdb.arch \
gdb.c++ \
gdb.java \
gdb.disasm \
- gdb.chill \
gdb.mi \
gdb.threads \
gdb.trace"
@@ -750,12 +738,12 @@ fi
# End stuff to support --enable-shared
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:754: checking for Cygwin environment" >&5
+echo "configure:742: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 759 "configure"
+#line 747 "configure"
#include "confdefs.h"
int main() {
@@ -766,7 +754,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -783,19 +771,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:787: checking for mingw32 environment" >&5
+echo "configure:775: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 792 "configure"
+#line 780 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -814,7 +802,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:818: checking for executable suffix" >&5
+echo "configure:806: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -824,10 +812,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index 48e50d873f4..ab37e6de4ed 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -19,7 +19,6 @@ configdirs="gdb.arch \
gdb.c++ \
gdb.java \
gdb.disasm \
- gdb.chill \
gdb.mi \
gdb.threads \
gdb.trace"
diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp
index 8a9f29dd813..2e4504a1a30 100644
--- a/gdb/testsuite/gdb.arch/altivec-abi.exp
+++ b/gdb/testsuite/gdb.arch/altivec-abi.exp
@@ -26,7 +26,7 @@ if $tracelevel then {
}
#
-# This file uses altivec.c for input.
+# This file uses altivec-abi.c for input.
#
set prms_id 0
@@ -37,7 +37,7 @@ if ![istarget "powerpc-*altivec"] then {
return
}
-set testfile "altivec"
+set testfile "altivec-abi"
set binfile ${objdir}/${subdir}/${testfile}
set src1 ${srcdir}/${subdir}/${testfile}.c
@@ -58,16 +58,16 @@ if ![runto_main] then {
gdb_suppress_tests
}
-gdb_test "b marker" "Breakpoint 2 at.*file.*altivec.c, line \[0-9\]+." "break marker"
-gdb_test "continue" "Breakpoint 2.*marker.*altivec.c.*" "continue to marker"
-gdb_test "finish" "Run till exit from .0.*in marker.*at.*altivec.c.*main \\(\\) at.*altivec.c.*result = vec_func \\(vshort,.*goes in v2.*" "back to main (1)"
+gdb_test "b marker" "Breakpoint 2 at.*file.*altivec-abi.c, line \[0-9\]+." "break marker"
+gdb_test "continue" "Breakpoint 2.*marker.*altivec-abi.c.*" "continue to marker"
+gdb_test "finish" "Run till exit from .0.*in marker.*at.*altivec-abi.c.*main \\(\\) at.*altivec-abi.c.*result = vec_func \\(vshort,.*goes in v2.*" "back to main (1)"
# now all the arguments of vec_fun are initialized
set pattern "vec_func .vshort_f=.111, 222, 333, 444, 555, 666, 777, 888., vushort_f=.100, 200, 300, 400, 500, 600, 700, 800., vint_f=.-10, -20, -30, -40., vuint_f=.1111, 2222, 3333, 4444., vchar_f=.abcdefghilmnopqr., vuchar_f=.ABCDEFGHILMNOPQR., vfloat_f=.1.25, 3.75, 5.5, 1.25., x_f=.1, 2, 3, 4, 5, 6, 7, 8., y_f=.12, 22, 32, 42., a_f=.vector of chars.., b_f=.5.5, 4.5, 3.75, 2.25., c_f=.1.25, 3.5, 5.5, 7.75., intv_on_stack_f=.12, 34, 56, 78.."
set pattern1 $pattern
-append pattern1 " at.*altivec.c.*vint_res = vec_add.*vint_f, intv_on_stack_f.;"
+append pattern1 " at.*altivec-abi.c.*vint_res = vec_add.*vint_f, intv_on_stack_f.;"
# Now let's call the function. This function has > 12 args,
# the last one will go on the stack.
@@ -85,7 +85,7 @@ gdb_test "step" \
"step into vec_fun"
set pattern2 $pattern
-append pattern2 " at.*altivec.c.*in main.*result = vec_func .vshort,.*goes in v2.*Value returned is.*= .2, 2, 2, 2."
+append pattern2 " at.*altivec-abi.c.*in main.*result = vec_func .vshort,.*goes in v2.*Value returned is.*= .2, 2, 2, 2."
# Let's see if the result is returned correctly.
gdb_test "finish" \
@@ -95,14 +95,14 @@ gdb_test "finish" \
# can we print the args correctly for this function?
gdb_test "break struct_of_vector_func" "" ""
-set pattern "struct_of_vector_func .vector_struct=.vshort1 = .1, 2, 3, 4, 5, 6, 7, 8., vshort2 = .11, 12, 13, 14, 15, 16, 17, 18., vshort3 = .21, 22, 23, 24, 25, 26, 27, 28., vshort4 = .31, 32, 33, 34, 35, 36, 37, 38... at.*altivec.c.*"
+set pattern "struct_of_vector_func .vector_struct=.vshort1 = .1, 2, 3, 4, 5, 6, 7, 8., vshort2 = .11, 12, 13, 14, 15, 16, 17, 18., vshort3 = .21, 22, 23, 24, 25, 26, 27, 28., vshort4 = .31, 32, 33, 34, 35, 36, 37, 38... at.*altivec-abi.c.*"
gdb_test "continue" \
"Breakpoint 3, $pattern.*vector_struct.vshort1 = vec_add .vector_struct.vshort1, vector_struct.vshort2.;" \
"continue to struct_of_vector_func"
gdb_test "finish" \
- "Run till exit from .0 $pattern\[ \r\n\]+main.*altivec.c.*array_of_vector_func.*" \
+ "Run till exit from .0 $pattern\[ \r\n\]+main.*altivec-abi.c.*array_of_vector_func.*" \
"back to main (2)"
gdb_test "step" "" "step into array_of_vector_func"
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index f6ce1c73b2b..f10f4ae2a62 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -47,6 +47,10 @@ if [istarget "d10v-*-*"] then {
if [istarget "s390-*-*"] then {
set asm-arch s390
}
+if [istarget "x86_64-*-*"] then {
+ set asm-arch x86_64
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
if [istarget "i\[3456\]86-*-*"] then {
set asm-arch i386
}
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 2b341af009f..9c6bb971431 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -113,6 +113,11 @@ proc do_attach_tests {} {
gdb_expect {
-re ".*Illegal process-id: abc.*$gdb_prompt $"\
{pass "attach to nonsense is prohibited"}
+ -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
+ {
+ # Response expected from /proc-based systems.
+ pass "attach to nonsense is prohibited"
+ }
-re "Attaching to.*$gdb_prompt $"\
{fail "attach to nonsense is prohibited (bogus pid allowed)"}
-re "$gdb_prompt $" {fail "attach to nonsense is prohibited"}
@@ -125,14 +130,23 @@ proc do_attach_tests {} {
#
send_gdb "attach 0\n"
gdb_expect {
- # This reponse is expected on HP-UX 10.20 (i.e., ptrace-based).
-re "Attaching to.*, process 0.*No such process.*$gdb_prompt $"\
- {pass "attach to nonexistent process is prohibited"}
- # This response is expected on HP-UX 11.0 (i.e., ttrace-based).
+ {
+ # Response expected on HP-UX 10.20 (i.e., ptrace-based).
+ pass "attach to nonexistent process is prohibited"
+ }
-re "Attaching to.*, process 0 failed.*Hint.*$gdb_prompt $"\
- {pass "attach to nonexistent process is prohibited"}
+ {
+ # Response expected on HP-UX 11.0 (i.e., ttrace-based).
+ pass "attach to nonexistent process is prohibited"
+ }
-re "Attaching to.*, process 0.*denied.*$gdb_prompt $"\
{pass "attach to nonexistent process is prohibited"}
+ -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
+ {
+ # Response expected from /proc-based systems.
+ pass "attach to nonexistent process is prohibited"
+ }
-re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"}
timeout {fail "(timeout) attach to nonexistent process is prohibited"}
}
@@ -164,7 +178,7 @@ proc do_attach_tests {} {
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to program.*$binfile, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
+ -re "Attaching to program.*`?$binfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
{pass "attach1, after setting file"}
-re "$gdb_prompt $" {fail "attach1, after setting file"}
timeout {fail "(timeout) attach1, after setting file"}
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index d9bb350f8d1..a7ea5cf56aa 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -125,7 +125,7 @@ if {![gdb_skip_float_test "print print_double_array(double_array)"] && \
"\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000"
- "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+23.456\[0-9\]* 46.913\[0-9\]* 70.370\[0-9\]* 93.826\[0-9\]* 117.283\[0-9\]* 140.740\[0-9\]* 164.196\[0-9\]* 187.653\[0-9\]"
"\[ \t\r\n\]+"
}
}
@@ -194,7 +194,7 @@ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
"\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000"
- "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+23.456\[0-9\]* 46.913\[0-9\]* 70.370\[0-9\]* 93.826\[0-9\]* 117.283\[0-9\]* 140.740\[0-9\]* 164.196\[0-9\]* 187.653\[0-9\]*"
"\[ \t\r\n\]+"
".*array_f :"
".*student id :\[\t \]+.*YELLOW"
@@ -240,7 +240,7 @@ if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
"array_d :"
"\[ \t\r\n\]+========="
"\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
- "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+23.456\[0-9\]* 46.913\[0-9\]* 70.370\[0-9\]* 93.826\[0-9\]* 117.283\[0-9\]* 140.740\[0-9\]* 164.196\[0-9\]* 187.653\[0-9\]*"
"\[ \t\r\n\]+"
}
}
@@ -259,7 +259,7 @@ if {![gdb_skip_float_test "continuing to 1236"] && \
"\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000"
- "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+23.456\[0-9\]* 46.913\[0-9\]* 70.370\[0-9\]* 93.826\[0-9\]* 117.283\[0-9\]* 140.740\[0-9\]* 164.196\[0-9\]* 187.653\[0-9\]*"
"\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
}
} else {
@@ -433,11 +433,11 @@ if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \
![gdb_skip_stdio_test "print print_ten_doubles(...)"]} {
send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
gdb_expect_list "print print_ten_doubles" ".*$gdb_prompt $" {
- "\[\t\r\n \]+Two Doubles : 123.456000.*123.456000"
- "\[\t\r\n \]+Two Doubles : -0.120000.*-1.230000"
- "\[\t\r\n \]+Two Doubles : 343434.800000.*89.098000"
- "\[\t\r\n \]+Two Doubles : 3.140000.*-5678.123450"
- "\[\t\r\n \]+Two Doubles : -0.111111.*216.970650"
+ "\[\t\r\n \]+Two Doubles : 123.45\[0-9\]*.*123.45\[0-9\]*"
+ "\[\t\r\n \]+Two Doubles : -0.1200\[0-9\]*.*-1.2300\[0-9\]*"
+ "\[\t\r\n \]+Two Doubles : 343434.\[0-9\]*.*89.09\[0-9\]*"
+ "\[\t\r\n \]+Two Doubles : 3.1400\[0-9\]*.*-5678.123\[0-9\]*"
+ "\[\t\r\n \]+Two Doubles : -0.1111\[0-9\]*.*216.97\[0-9\]*"
}
}
diff --git a/gdb/testsuite/gdb.base/d10v.ld b/gdb/testsuite/gdb.base/d10v.ld
index 3c4c38a3c9c..41f085b1ed7 100644
--- a/gdb/testsuite/gdb.base/d10v.ld
+++ b/gdb/testsuite/gdb.base/d10v.ld
@@ -2,54 +2,57 @@ OUTPUT_FORMAT("elf32-d10v", "elf32-d10v",
"elf32-d10v")
OUTPUT_ARCH(d10v)
ENTRY(_start)
- SEARCH_DIR(/usr/cygnus/d10v-961230/H-sparc-sun-sunos4.1//lib);
/* Do we need any of these for elf?
__DYNAMIC = 0; */
+
+MEMORY
+{
+ UNIFIED : org = 0, len = 0x1000000
+ INSN : org = 0x1014000, len = 0x40000
+ DATA : org = 0x2000004, len = 0x7FFC
+ STACK : org = 0x200BFFE, len = 4
+}
+
SECTIONS
{
/* Overlay sections: */
- .ovly0 0x01010000 : AT (0x12010000) { foo.o(.text) }
- .ovly1 0x01010000 : AT (0x12011000) { bar.o(.text) }
- .ovly2 0x01011000 : AT (0x12012000) { baz.o(.text) }
- .ovly3 0x01011000 : AT (0x12013000) { grbx.o(.text) }
- .data00 0x00001000 : AT (0x12014000) { foo.o(.data) }
- .data01 0x00001000 : AT (0x12015000) { bar.o(.data) }
- .data02 0x00002000 : AT (0x12016000) { baz.o(.data) }
- .data03 0x00002000 : AT (0x12017000) { grbx.o(.data) }
- /* Read-only sections, merged into data segment: */
- . = 0x00000004;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .rel.text : { *(.rel.text) }
- .rela.text : { *(.rela.text) }
- .rel.data : { *(.rel.data) }
- .rela.data : { *(.rela.data) }
- .rel.rodata : { *(.rel.rodata) }
- .rela.rodata : { *(.rela.rodata) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
- .rela.ctors : { *(.rela.ctors) }
- .rel.dtors : { *(.rel.dtors) }
- .rela.dtors : { *(.rela.dtors) }
- .rel.init : { *(.rel.init) }
- .rela.init : { *(.rela.init) }
- .rel.fini : { *(.rel.fini) }
- .rela.fini : { *(.rela.fini) }
- .rel.bss : { *(.rel.bss) }
- .rela.bss : { *(.rela.bss) }
- .rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
- .plt : { *(.plt) }
- .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 : { *(.rodata1) }
- /* Adjust the address for the data segment. */
- . = ALIGN(4);
+ .ovly0 0x1001000 : AT (0x8000) { foo.o(.text) }
+ .ovly1 0x1001000 : AT (0x9000) { bar.o(.text) }
+ .ovly2 0x1002000 : AT (0xa000) { baz.o(.text) }
+ .ovly3 0x1002000 : AT (0xb000) { grbx.o(.text) }
+ .data00 0x2001000 : AT (0xc000) { foo.o(.data) }
+ .data01 0x2001000 : AT (0xd000) { bar.o(.data) }
+ .data02 0x2002000 : AT (0xe000) { baz.o(.data) }
+ .data03 0x2002000 : AT (0xf000) { grbx.o(.data) }
+
+ .text :
+ {
+ KEEP (*(.init))
+ KEEP (*(.init.*))
+ KEEP (*(.fini))
+ KEEP (*(.fini.*))
+ *(.text)
+ *(.text.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ _etext = .;
+ PROVIDE (etext = .);
+ } >INSN =0
+ .rodata : {
+ *(.rodata)
+ *(.gnu.linkonce.r*)
+ *(.rodata.*)
+ } >DATA
+ .rodata1 : {
+ *(.rodata1)
+ *(.rodata1.*)
+ } >DATA
+
.data :
{
*(.data)
+ *(.data.*)
*(.gnu.linkonce.d*)
_ovly_table = .;
LONG(ABSOLUTE(ADDR(.ovly0)));
@@ -87,34 +90,66 @@ SECTIONS
_novlys = .;
LONG((_novlys - _ovly_table) / 16);
CONSTRUCTORS
- }
- .data1 : { *(.data1) }
+ } >DATA
+ .data1 : {
+ *(.data1)
+ *(.data1.*)
+ } >DATA
.ctors :
{
- *(.ctors)
- }
+ /* gcc uses crtbegin.o to find the start of
+ the constructors, so we make sure it is
+ first. Because this is a wildcard, it
+ doesn't matter if the user does not
+ actually link against crtbegin.o; the
+ linker won't look for a file to match a
+ wildcard. The wildcard also means that it
+ doesn't matter which directory crtbegin.o
+ is in. */
+
+ KEEP (*crtbegin.o(.ctors))
+
+ /* We don't want to include the .ctor section from
+ from the crtend.o file until after the sorted ctors.
+ The .ctor section from the crtend file contains the
+ end of ctors marker and it must be last */
+
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ } >DATA
.dtors :
{
- *(.dtors)
- }
- .got : { *(.got.plt) *(.got) }
- .dynamic : { *(.dynamic) }
+ KEEP (*crtbegin.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ } >DATA
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
- .sdata : { *(.sdata) }
+ .sdata : {
+ *(.sdata)
+ *(.sdata.*)
+ } >DATA
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
- .sbss : { *(.sbss) *(.scommon) }
+ .sbss : { *(.sbss) *(.scommon) } >DATA
.bss :
{
*(.dynbss)
+ *(.dynbss.*)
*(.bss)
+ *(.bss.*)
*(COMMON)
- }
+ } >DATA
+
_end = . ;
PROVIDE (end = .);
+
+ .stack : { _stack = .; *(.stack) } >STACK
+
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
@@ -122,34 +157,37 @@ SECTIONS
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
+
.comment 0 : { *(.comment) }
+
/* DWARF debug sections.
- Symbols in the .debug DWARF section are relative to the beginning of the
- section so we begin .debug at 0. It's not clear yet what needs to happen
- for the others. */
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+
+ /* DWARF 1 */
.debug 0 : { *(.debug) }
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
+ .line 0 : { *(.line) }
+
+ /* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+
+ /* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- .line 0 : { *(.line) }
- /* These must appear regardless of . */
- /* Hmmm, there's got to be a better way. This sets the stack to the
- top of the simulator memory (i.e. top of 64K data space). */
- .stack 0x00007FFE : { _stack = .; *(.stack) }
- .text 0x1000000 :
- {
- *(.init)
- *(.fini)
- *(.text)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.gnu.linkonce.t*)
- } =0
- _etext = .;
- PROVIDE (etext = .);
+
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
}
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 656601efc98..69f2b26917c 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -229,7 +229,12 @@ gdb_expect {
timeout { fail "step out of main (hang or timeout on step at end 1)" }
}
-if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
+# When we're talking to a program running on a real stand-alone board,
+# every BSP's exit function behaves differently, so there's no single
+# way to tell whether we've exited gracefully or not. So don't run
+# these tests when use_gdb_stub is set, or when we're running under Cygmon.
+if {! [target_info exists use_gdb_stub]
+ && (! [target_info exists use_cygmon] || ! [target_info use_cygmon])} {
global program_exited;
if {[eval expr $program_exited == 0]} {
send_gdb "n\n"
diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp
index b370b53a52d..6d5401d71aa 100644
--- a/gdb/testsuite/gdb.base/interrupt.exp
+++ b/gdb/testsuite/gdb.base/interrupt.exp
@@ -18,11 +18,9 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
-if [host_info exists name] {
- if [board_info host exists gdb,nointerrupts] {
- verbose "Skipping interrupt.exp because of nointerrupts."
- continue
- }
+if [target_info exists gdb,nointerrupts] {
+ verbose "Skipping interrupt.exp because of nointerrupts."
+ continue
}
if [target_info exists gdb,noinferiorio] {
@@ -122,7 +120,7 @@ if ![file exists $binfile] then {
setup_xfail "sparc*-*-solaris2*"
setup_xfail "mips-*-ultrix*"
- setup_xfail "i386*-*-bsd*"
+ setup_xfail "i*86-*-*bsd*"
setup_xfail "i*86-*-solaris2*"
setup_xfail "*-*-sysv4*"
setup_xfail "vax-*-*"
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 7084a8deee1..55086d76755 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -114,6 +114,14 @@ gdb_expect {
default { }
}
+set sizeof_long_double 8
+send_gdb "print sizeof(long double)\n"
+gdb_expect {
+ -re ".* = 4.*$gdb_prompt $" { set sizeof_long_double 4 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
gdb_test "n 4" ".*38.*" "get to known place"
# Check the hack for long long prints.
@@ -146,11 +154,10 @@ if { $sizeof_ptr == 2 } {
}
gdb_test "p/c oct" ".*'w'.*"
-if { $sizeof_double == 8 } {
-
-# ARM floating point numbers are not strictly little endian or big endian,
-# but a hybrid. They are in little endian format with the two words
-# swapped in big endian format.
+if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
+ # ARM floating point numbers are not strictly little endian or big endian,
+ # but a hybrid. They are in little endian format with the two words
+ # swapped in big endian format.
if { [istarget "arm*-*-*"] || \
[istarget "xscale*-*-*"] || \
@@ -239,7 +246,7 @@ if { $target_bigendian_p } {
gdb_test "x/c &oct" ".*-89 .*"
# FIXME GDB's output is correct, but this longer match fails.
# gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
- if { $sizeof_double == 8 } {
+ if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
} else {
gdb_test "x/f &oct" ".*-2.42716126e-15.*"
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index 9188b278014..c31da4e5ad4 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 2002 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
@@ -86,22 +86,42 @@ if ![runto_main] then {
}
# couple of convenience variables
-set fptrcast [string_to_regexp "(int (*)(int))"]
+set fptrcast [string_to_regexp "{int (int)}"]
set iptrcast [string_to_regexp "(int *)"]
+set hexx "0x\[0-9abcdefABCDEF\]+"
gdb_test "overlay manual" ""
gdb_test "overlay list" "No sections are mapped." "List with none mapped"
# capture the LMA addresses of [foo bar baz grbx foox barx bazx grbxx]
-gdb_test "print \$foo_lma = &foo" \
- ".* $fptrcast 0x.* <\\*foo\\*>" "foo load addr"
-gdb_test "print \$bar_lma = &bar" \
- ".* $fptrcast 0x.* <\\*bar\\*>" "bar load addr"
-gdb_test "print \$baz_lma = &baz" \
- ".* $fptrcast 0x.* <\\*baz\\*>" "baz load addr"
-gdb_test "print \$grbx_lma = &grbx" \
- ".* $fptrcast 0x.* <\\*grbx\\*>" "grbx load addr"
+proc get_func_address { func func_sym msg } {
+ global gdb_prompt
+ global fptrcast
+ global hexx
+
+ set func_addr 0
+ send_gdb "print $func\n"
+ gdb_expect {
+ -re "\\$\[0-9\]+ = $fptrcast (${hexx}) <$func_sym>.*$gdb_prompt $" {
+ set func_addr $expect_out(1,string)
+ pass "get $msg"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "get $msg"
+ }
+ default {
+ fail "get $msg (timeout)"
+ }
+ }
+ return $func_addr
+}
+
+set foo_lma [get_func_address "foo" "\\*foo\\*" "foo load address"]
+set bar_lma [get_func_address "bar" "\\*bar\\*" "bar load address"]
+set baz_lma [get_func_address "baz" "\\*baz\\*" "baz load address"]
+set grbx_lma [get_func_address "grbx" "\\*grbx\\*" "grbx load address"]
+
gdb_test "print \$foox_lma = &foox" \
".* $iptrcast 0x.*" "foox load addr"
gdb_test "print \$barx_lma = &barx" \
@@ -116,23 +136,19 @@ gdb_test "print \$grbxx_lma = &grbxx" \
gdb_test "overlay map .ovly0" ""
gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "List ovly0"
-gdb_test "print \$foo_vma = &foo" \
- ".* $fptrcast 0x.* <foo>" "foo runtime addr"
+set foo_vma [get_func_address "foo" "foo" "foo runtime address"]
gdb_test "overlay map .ovly1" ""
gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "List ovly1"
-gdb_test "print \$bar_vma = &bar" \
- ".* $fptrcast 0x.* <bar>" "bar runtime addr"
+set bar_vma [get_func_address "bar" "bar" "bar runtime address"]
gdb_test "overlay map .ovly2" ""
gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "List ovly2"
-gdb_test "print \$baz_vma = &baz" \
- ".* $fptrcast 0x.* <baz>" "baz runtime addr"
+set baz_vma [get_func_address "baz" "baz" "baz runtime address"]
gdb_test "overlay map .ovly3" ""
gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "List ovly3"
-gdb_test "print \$grbx_vma = &grbx" \
- ".* $fptrcast 0x.* <grbx>" "grbx runtime addr"
+set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"]
gdb_test "overlay map .data00" ""
gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "List data00"
@@ -156,10 +172,10 @@ gdb_test "print \$grbxx_vma = &grbxx" \
# Verify that LMA != VMA
-gdb_test "print \$foo_lma != \$foo_vma" ".* = 1" "foo's LMA != VMA"
-gdb_test "print \$bar_lma != \$bar_vma" ".* = 1" "bar's LMA != VMA"
-gdb_test "print \$baz_lma != \$baz_vma" ".* = 1" "baz's LMA != VMA"
-gdb_test "print \$grbx_lma != \$grbx_vma" ".* = 1" "grbx's LMA != VMA"
+gdb_test "print $foo_lma != $foo_vma" ".* = 1" "foo's LMA != VMA"
+gdb_test "print $bar_lma != $bar_vma" ".* = 1" "bar's LMA != VMA"
+gdb_test "print $baz_lma != $baz_vma" ".* = 1" "baz's LMA != VMA"
+gdb_test "print $grbx_lma != $grbx_vma" ".* = 1" "grbx's LMA != VMA"
gdb_test "print \$foox_lma != \$foox_vma" ".* = 1" "foox's LMA != VMA"
gdb_test "print \$barx_lma != \$barx_vma" ".* = 1" "barx's LMA != VMA"
gdb_test "print \$bazx_lma != \$bazx_vma" ".* = 1" "bazx's LMA != VMA"
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp
index 9791a607599..c757ca2b563 100644
--- a/gdb/testsuite/gdb.base/page.exp
+++ b/gdb/testsuite/gdb.base/page.exp
@@ -1,4 +1,5 @@
-# Copyright 1992, 1994, 1995, 1999 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1999, 2002 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
@@ -30,10 +31,50 @@ set timeout 200
gdb_exit
gdb_start
+
gdb_test "set pagination off" ""
-gdb_test "info set" ".*pagination: State of pagination is off.*"
+gdb_test "show pagination" "State of pagination is off.*" "pagination is off"
+send_gdb "help\n"
+gdb_expect_list "unpaged help" ".*$gdb_prompt $" {
+ "List of classes of commands:"
+ ""
+ "aliases -- Aliases of other commands"
+ "breakpoints -- Making program stop at certain points"
+ "data -- Examining data"
+ "files -- Specifying and examining files"
+ "internals -- Maintenance commands"
+ "obscure -- Obscure features"
+ "running -- Running the program"
+ "stack -- Examining the stack"
+ "status -- Status inquiries"
+ "support -- Support facilities"
+ "tracepoints -- Tracing of program execution without stopping the program"
+ "user-defined -- User-defined commands"
+ ""
+ "Type .help. followed by a class name for a list of commands in that class."
+ "Type .help. followed by command name for full documentation."
+ "Command name abbreviations are allowed if unambiguous."
+}
+
+
gdb_test "set pagination on" ""
-gdb_test "info set" ".*pagination: State of pagination is on.*"
+gdb_test "show pagination" "State of pagination is on.*" "pagination is on"
+gdb_test "set height 10" ""
+send_gdb "help\n"
+gdb_expect_list "paged help" \
+ ".*---Type <return> to continue, or q <return> to quit---" {
+ "List of classes of commands:"
+ ""
+ "aliases -- Aliases of other commands"
+ "breakpoints -- Making program stop at certain points"
+ "data -- Examining data"
+ "files -- Specifying and examining files"
+ "internals -- Maintenance commands"
+ "obscure -- Obscure features"
+ "running -- Running the program"
+}
+gdb_test "q"
+
gdb_exit
return 0
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
new file mode 100644
index 00000000000..8edd1333db4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -0,0 +1,190 @@
+# Copyright 2002 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
+
+# This file was written by Tom Tromey <tromey@redhat.com>
+
+# This file is part of the gdb testsuite.
+
+#
+# Tests for readline operations.
+#
+
+# This function is used to test operate-and-get-next.
+# NAME is the name of the test.
+# ARGS is a list of alternating commands and expected results.
+proc operate_and_get_next {name args} {
+ global gdb_prompt
+
+ set my_gdb_prompt "($gdb_prompt| >)"
+
+ set reverse {}
+ foreach {item result} $args {
+ verbose "sending $item"
+ sleep 1
+
+ # We can't use gdb_test here because we might see a " >" prompt.
+ set status 0
+ send_gdb "$item\n"
+ gdb_expect {
+ -re "$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+
+ if {! $status} {
+ gdb_expect {
+ -re "$result" {
+ # Ok.
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {$status} {
+ fail "$name - send $item"
+ return 0
+ }
+ pass "$name - send $item"
+
+ set reverse [linsert $reverse 0 $item $result]
+ }
+
+ # Now use C-p to go back to the start.
+ foreach {item result} $reverse {
+ # Actually send C-p followed by C-l. This lets us recognize the
+ # command when gdb prints it again.
+ send_gdb "\x10\x0c"
+ set status 0
+ gdb_expect {
+ -re "$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ if {$status} {
+ fail "$name - C-p to $item"
+ return 0
+ }
+ pass "$name - C-p to $item"
+ }
+
+ # Now C-o through the list. Don't send the command, since it is
+ # already there. Strip off the first command from the list so we
+ # can see the next command inside the loop.
+ set count 0
+ foreach {item result} $args {
+ set status 0
+
+ # If this isn't the first item, make sure we see the command at
+ # the prompt.
+ if {$count > 0} {
+ gdb_expect {
+ -re ".*$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {! $status} {
+ # For the last item, send a simple \n instead of C-o.
+ if {$count == [llength $args] - 2} {
+ send_gdb "\n"
+ } else {
+ # 15 is C-o.
+ send_gdb [format %c 15]
+ }
+ set status 0
+ gdb_expect {
+ -re "$result" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {$status} {
+ fail "$name - C-o for $item"
+ return 0
+ }
+ pass "$name - C-o for $item"
+
+ set count [expr {$count + 2}]
+ }
+
+ return 1
+}
+
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
+# the test results. Even if /dev/null doesn't exist on the particular
+# platform, the readline library will use the default setting just by
+# failing to open the file. OTOH, opening /dev/null successfully will
+# also result in the default settings being used since nothing will be
+# read from this file.
+global env
+if [info exists env(INPUTRC)] {
+ set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set oldtimeout1 $timeout
+set timeout 30
+
+
+# A simple test of operate-and-get-next.
+operate_and_get_next "Simple operate-and-get-next" \
+ "p 1" ".* = 1" \
+ "p 2" ".* = 2"\
+ "p 3" ".* = 3"
+
+# Test operate-and-get-next with a secondary prompt.
+operate_and_get_next "operate-and-get-next with secondary prompt" \
+ "if 1 > 0" "" \
+ "p 5" "" \
+ "end" ".* = 5"
+
+
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+ set env(INPUTRC) $old_inputrc
+} else {
+ unset env(INPUTRC)
+}
+set timeout $oldtimeout1
+
+return 0
diff --git a/gdb/testsuite/gdb.base/return.exp b/gdb/testsuite/gdb.base/return.exp
index e7a536bdac6..2f8946d3020 100644
--- a/gdb/testsuite/gdb.base/return.exp
+++ b/gdb/testsuite/gdb.base/return.exp
@@ -91,19 +91,6 @@ proc return_tests { } {
setup_xfail "m6811-*-*"
gdb_test "next" "printf.*" "next over call to func3"
- # This test is going to fail on all i*86 systems using an i*87.
- # When returning a floating point value from a function, all known
- # compilers do this via a `fldl' instruction, which pushes the floating
- # value on the i387 stack. This causes two problems:
- # a) Most i*86 targets do not store (or cannot store, see comment in
- # in i386v-nat.c:i386_register_u_addr) the floating point registers
- # to the target.
- # b) gdb would have to figure out if the `fldl' instruction (or variants
- # of it) has already been executed. If not, it would have to simulate
- # a push instruction, as it is not enough to write the register,
- # the floating point `stack pointer' has to be updated too.
- # Do not expect this to get fixed anytime soon.
-
# This test also fails for sparc Solaris 2.3 & 2.4, but passes under 2.5
# At the time the `next' is issued, the floating point unit for the
# process is not yet initialized, and the storing of the floating
@@ -113,8 +100,8 @@ proc return_tests { } {
# process start, making this test pass, it will be for a version that
# is not xfailed.
- setup_xfail "i*86-*-*" "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*"
- gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with i*86 and sparc solaris"
+ setup_xfail "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*"
+ gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with sparc solaris)"
}
diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp
index 83ceb620e8e..85e9fa79af6 100644
--- a/gdb/testsuite/gdb.base/selftest.exp
+++ b/gdb/testsuite/gdb.base/selftest.exp
@@ -52,7 +52,7 @@ proc do_steps_and_nexts {} {
gdb_reinitialize_dir $srcdir/..
- for {set count 0} {$count < 22} {incr count} {
+ for {set count 0} {$count < 26} {incr count} {
send_gdb "list\n"
gdb_expect {
-re ".*context = data.*$gdb_prompt $" {
@@ -142,6 +142,22 @@ proc do_steps_and_nexts {} {
-re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
return
}
+ -re ".*setlocale .LC_MESSAGES,.*$gdb_prompt $" {
+ set description "next over setlocale LC_MESSAGES"
+ set command "next"
+ }
+ -re ".*setlocale .LC_CTYPE,.*$gdb_prompt $" {
+ set description "next over setlocale LC_CTYPE"
+ set command "next"
+ }
+ -re ".*bindtextdomain .PACKAGE, LOCALEDIR.;.*$gdb_prompt $" {
+ set description "next over bindtextdomain"
+ set command "next"
+ }
+ -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" {
+ set description "next over textdomain PACKAGE"
+ set command "next"
+ }
-re "\[ \t\]+\{\r\n$gdb_prompt $" {
setup_xfail "mips-*-irix5*"
fail "$description ended up at odd location"
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 47919be4c03..dd88274d1be 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -65,6 +65,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug
if {$gcc_compiled == 0} {
if [istarget "hppa*-hp-hpux*"] then {
set additional_flags "additional_flags=+z"
+ } elseif { [istarget "mips-sgi-irix*"] } {
+ # Disable SGI compiler's implicit -Dsgi
+ set additional_flags "additional_flags=-Usgi"
} else {
# don't know what the compiler is...
set additional_flags ""
@@ -103,6 +106,8 @@ if { ($gcc_compiled
&& ([istarget "powerpc*-*-aix*"]
|| [istarget "rs6000*-*-aix*"] )) } {
set additional_flags "additional_flags=-L${objdir}/${subdir}"
+} elseif { [istarget "mips-sgi-irix*"] } {
+ set additional_flags "additional_flags=-rpath ${objdir}/${subdir}"
} else {
set additional_flags ""
}
diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog
index 51a24df26a8..f4f49b188a5 100644
--- a/gdb/testsuite/gdb.chill/ChangeLog
+++ b/gdb/testsuite/gdb.chill/ChangeLog
@@ -1,3 +1,17 @@
+2002-08-01 Andrew Cagney <cagney@redhat.com>
+
+ * 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 <kevinb@redhat.com>
* builtins.exp, callch.exp, chexp.exp, chillvars.exp,
diff --git a/gdb/testsuite/gdb.chill/builtins.exp b/gdb/testsuite/gdb.chill/builtins.exp
index 87fe3af1f94..482a69500e1 100644
--- a/gdb/testsuite/gdb.chill/builtins.exp
+++ b/gdb/testsuite/gdb.chill/builtins.exp
@@ -1,441 +1,441 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file tests various Chill values, expressions, and types.
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "builtins"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break xx_\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-#
-# Args are:
-#
-# First one is string to send_gdb to gdb
-# Second one is string to match gdb result to
-# Third one is an optional message to be printed
-
-proc test_print_accept { args } {
- global gdb_prompt
- global passcount
- global verbose
-
- if [llength $args]==3 then {
- set message [lindex $args 2]
- } else {
- set message [lindex $args 0]
- }
- set sendthis [lindex $args 0]
- set expectthis [lindex $args 1]
- set result [gdb_test $sendthis ".* = ${expectthis}" $message]
- if $result==0 {incr passcount}
- return $result
-}
-
-proc test_lower {} {
- global passcount
-
- verbose "testing builtin LOWER"
- set passcount 0
-
- # discrete mode names
- test_print_accept "print lower(bool)" "FALSE"
- test_print_accept "print lower(char)" {'\^[(]0[)]'}
- test_print_accept "print lower(byte)" "-128"
- test_print_accept "print lower(ubyte)" "0"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print lower(int)" "-2147483648"
- } else {
- test_print_accept "print lower(int)" "-32768"
- }
- test_print_accept "print lower(uint)" "0"
- setup_xfail "alpha-*-*"
- test_print_accept "print lower(long)" "-2147483648"
- test_print_accept "print lower(ulong)" "0"
- test_print_accept "print lower(m_set)" "e1"
- test_print_accept "print lower(m_set_range)" "e2"
- test_print_accept "print lower(m_numbered_set)" "n2"
- test_print_accept "print lower(m_char_range)" "'A'"
- test_print_accept "print lower(m_bool_range)" "FALSE"
- test_print_accept "print lower(m_long_range)" "255"
- test_print_accept "print lower(m_range)" "12"
-
- # discrete locations
- test_print_accept "print lower(v_bool)" "FALSE"
- test_print_accept "print lower(v_char)" {'\^[(]0[)]'}
- test_print_accept "print lower(v_byte)" "-128"
- test_print_accept "print lower(v_ubyte)" "0"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print lower(v_int)" "-2147483648"
- } else {
- test_print_accept "print lower(v_int)" "-32768"
- }
- test_print_accept "print lower(v_uint)" "0"
- setup_xfail "alpha-*-*"
- test_print_accept "print lower(v_long)" "-2147483648"
- test_print_accept "print lower(v_ulong)" "0"
- test_print_accept "print lower(v_set)" "e1"
- test_print_accept "print lower(v_set_range)" "e2"
- test_print_accept "print lower(v_numbered_set)" "n2"
- test_print_accept "print lower(v_char_range)" "'A'"
- test_print_accept "print lower(v_bool_range)" "FALSE"
- test_print_accept "print lower(v_long_range)" "255"
- test_print_accept "print lower(v_range)" "12"
-
- # string mode names
- test_print_accept "print lower(m_chars)" "0"
- test_print_accept "print lower(m_chars_v)" "0"
- test_print_accept "print lower(m_bits)" "0"
-
- # string locations
- test_print_accept "print lower(v_chars)" "0"
- test_print_accept "print lower(v_chars_v)" "0"
- test_print_accept "print lower(v_bits)" "0"
-
- # string expressions
- test_print_accept "print lower(\"abcd\")" "0"
- test_print_accept "print lower(B'010101')" "0"
-
- # array mode name
- test_print_accept "print lower(m_arr)" "1";
- test_print_accept "print lower(m_char_arr)" {'\^[(]0[)]'}
- test_print_accept "print lower(m_bool_arr)" "FALSE"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print lower(m_int_arr)" "-2147483648"
- } else {
- test_print_accept "print lower(m_int_arr)" "-32768"
- }
- test_print_accept "print lower(m_set_arr)" "e1"
- test_print_accept "print lower(m_set_range_arr)" "e2"
- test_print_accept "print lower(m_numbered_set_arr)" "n2"
- test_print_accept "print lower(m_char_range_arr)" "'A'"
- test_print_accept "print lower(m_bool_range_arr)" "FALSE"
- test_print_accept "print lower(m_long_range_arr)" "255"
- test_print_accept "print lower(m_range_arr)" "12"
-
- # array locations
- test_print_accept "print lower(v_arr)" "1";
- test_print_accept "print lower(v_char_arr)" {'\^[(]0[)]'}
- test_print_accept "print lower(v_bool_arr)" "FALSE"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print lower(v_int_arr)" "-2147483648"
- } else {
- test_print_accept "print lower(v_int_arr)" "-32768"
- }
- test_print_accept "print lower(v_set_arr)" "e1"
- test_print_accept "print lower(v_set_range_arr)" "e2"
- test_print_accept "print lower(v_numbered_set_arr)" "n2"
- test_print_accept "print lower(v_char_range_arr)" "'A'"
- test_print_accept "print lower(v_bool_range_arr)" "FALSE"
- test_print_accept "print lower(v_long_range_arr)" "255"
- test_print_accept "print lower(v_range_arr)" "12"
-}
-
-proc test_upper {} {
- global passcount
-
- verbose "testing builtin UPPER"
- set passcount 0
-
- # discrete mode names
- test_print_accept "print upper(bool)" "TRUE"
- test_print_accept "print upper(char)" {'\^[(]255[)]'}
- test_print_accept "print upper(byte)" "127"
- test_print_accept "print upper(ubyte)" "255"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print upper(int)" "2147483647"
- test_print_accept "print upper(uint)" "4294967295"
- setup_xfail "alpha-*-*"
- test_print_accept "print upper(long)" "4294967295"
- test_print_accept "print upper(ulong)" "18446744073709551615"
- } else {
- test_print_accept "print upper(int)" "32767"
- test_print_accept "print upper(uint)" "65535"
- test_print_accept "print upper(long)" "2147483647"
- test_print_accept "print upper(ulong)" "4294967295"
- }
- test_print_accept "print upper(m_set)" "e6"
- test_print_accept "print upper(m_set_range)" "e5"
- test_print_accept "print upper(m_numbered_set)" "n5"
- test_print_accept "print upper(m_char_range)" "'Z'"
- test_print_accept "print upper(m_bool_range)" "FALSE"
- test_print_accept "print upper(m_long_range)" "3211"
- test_print_accept "print upper(m_range)" "28"
-
- # discrete locations
- test_print_accept "print upper(v_bool)" "TRUE"
- test_print_accept "print upper(v_char)" {'\^[(]255[)]'}
- test_print_accept "print upper(v_byte)" "127"
- test_print_accept "print upper(v_ubyte)" "255"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print upper(v_int)" "2147483647"
- test_print_accept "print upper(v_uint)" "4294967295"
- setup_xfail "alpha-*-*"
- test_print_accept "print upper(v_long)" "4294967295"
- test_print_accept "print upper(v_ulong)" "18446744073709551615"
- } else {
- test_print_accept "print upper(v_int)" "32767"
- test_print_accept "print upper(v_uint)" "65535"
- test_print_accept "print upper(v_long)" "2147483647"
- test_print_accept "print upper(v_ulong)" "4294967295"
- }
- test_print_accept "print upper(v_set)" "e6"
- test_print_accept "print upper(v_set_range)" "e5"
- test_print_accept "print upper(v_numbered_set)" "n5"
- test_print_accept "print upper(v_char_range)" "'Z'"
- test_print_accept "print upper(v_bool_range)" "FALSE"
- test_print_accept "print upper(v_long_range)" "3211"
- test_print_accept "print upper(v_range)" "28"
-
- # string mode names
- test_print_accept "print upper(m_chars)" "19"
- test_print_accept "print upper(m_chars_v)" "19"
- test_print_accept "print upper(m_bits)" "9"
-
- # string locations
- test_print_accept "print upper(v_chars)" "19"
- test_print_accept "print upper(v_chars_v)" "19"
- test_print_accept "print upper(v_bits)" "9"
-
- # string expressions
- test_print_accept "print upper(\"abcd\")" "3"
- test_print_accept "print upper(B'010101')" "5"
-
- # array mode name
- test_print_accept "print upper(m_arr)" "10";
- test_print_accept "print upper(m_char_arr)" {'\^[(]255[)]'}
- test_print_accept "print upper(m_bool_arr)" "TRUE"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print upper(m_int_arr)" "2147483647"
- } else {
- test_print_accept "print upper(m_int_arr)" "32767"
- }
- test_print_accept "print upper(m_set_arr)" "e6"
- test_print_accept "print upper(m_set_range_arr)" "e5"
- test_print_accept "print upper(m_numbered_set_arr)" "n5"
- test_print_accept "print upper(m_char_range_arr)" "'Z'"
- test_print_accept "print upper(m_bool_range_arr)" "FALSE"
- test_print_accept "print upper(m_long_range_arr)" "3211"
- test_print_accept "print upper(m_range_arr)" "28"
-
- # array locations
- test_print_accept "print upper(v_arr)" "10";
- test_print_accept "print upper(v_char_arr)" {'\^[(]255[)]'}
- test_print_accept "print upper(v_bool_arr)" "TRUE"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print upper(v_int_arr)" "2147483647"
- } else {
- test_print_accept "print upper(v_int_arr)" "32767"
- }
- test_print_accept "print upper(v_set_arr)" "e6"
- test_print_accept "print upper(v_set_range_arr)" "e5"
- test_print_accept "print upper(v_numbered_set_arr)" "n5"
- test_print_accept "print upper(v_char_range_arr)" "'Z'"
- test_print_accept "print upper(v_bool_range_arr)" "FALSE"
- test_print_accept "print upper(v_long_range_arr)" "3211"
- test_print_accept "print upper(v_range_arr)" "28"
-}
-
-proc test_length {} {
- global passcount
-
- verbose "testing builtin LENGTH"
- set passcount 0
-
- # string locations
- test_print_accept "print length(v_chars)" "20"
- test_print_accept "print length(v_chars_v)" "7";
- test_print_accept "print length(v_bits)" "10";
-
- # string expressions
- test_print_accept "print length(\"the quick brown fox ...\")" "23"
- test_print_accept "print length(B'010101010101')" "12"
- test_print_accept "print length(\"foo \" // \"bar\")" "7"
-
- # check some failures
- setup_xfail "*-*-*"
- test_print_accept "print length(m_chars)" "typename in invalid context"
- setup_xfail "*-*-*"
- test_print_accept "print length(v_byte)" "bad argument to LENGTH builtin"
- setup_xfail "*-*-*"
- test_print_accept "print length(b'000000' // b'111111')" "12"
-}
-
-proc test_size {} {
- global passcount
-
- verbose "testing builtin SIZE"
- set passcount 0
-
- # modes
- test_print_accept "print size(bool)" "1"
- test_print_accept "print size(char)" "1"
- test_print_accept "print size(byte)" "1"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print size(int)" "4"
- test_print_accept "print size(ulong)" "8"
- test_print_accept "print size(ptr)" "8"
- test_print_accept "print size(m_chars_v)" "24"
- test_print_accept "print size(m_struct)" "40"
- } else {
- test_print_accept "print size(int)" "2"
- test_print_accept "print size(ulong)" "4"
- test_print_accept "print size(ptr)" "4"
- test_print_accept "print size(m_chars_v)" "22"
- test_print_accept "print size(m_struct)" "36"
- }
- test_print_accept "print size(m_set)" "1"
- test_print_accept "print size(m_numbered_set)" "1"
- test_print_accept "print size(m_char_range)" "1"
- test_print_accept "print size(m_range_arr)" "17"
- test_print_accept "print size(m_chars)" "20"
- test_print_accept "print size(m_bits)" "2"
-
- # locations
- test_print_accept "print size(v_bool)" "1"
- test_print_accept "print size(v_char)" "1"
- test_print_accept "print size(v_byte)" "1"
- if [istarget "alpha-*-*"] then {
- test_print_accept "print size(v_int)" "4"
- test_print_accept "print size(v_ulong)" "8"
- test_print_accept "print size(v_ptr)" "8"
- test_print_accept "print size(v_chars_v)" "24"
- test_print_accept "print size(v_struct)" "40"
- } else {
- test_print_accept "print size(v_int)" "2"
- test_print_accept "print size(v_ulong)" "4"
- test_print_accept "print size(v_ptr)" "4"
- test_print_accept "print size(v_chars_v)" "22"
- test_print_accept "print size(v_struct)" "36"
- }
- test_print_accept "print size(v_set)" "1"
- test_print_accept "print size(v_numbered_set)" "1"
- test_print_accept "print size(v_char_range)" "1"
- test_print_accept "print size(v_range_arr)" "17"
- test_print_accept "print size(v_chars)" "20"
- test_print_accept "print size(v_bits)" "2"
-}
-
-proc test_num {} {
- global passcount
-
- verbose "testing builtin NUM"
- set passcount 0
-
- # constants
- test_print_accept "print num(false)" "0"
- test_print_accept "print num(true)" "1"
- test_print_accept "print num(10)" "10"
- test_print_accept "print num(33-34)" "-1"
- test_print_accept "print num('X')" "88"
- test_print_accept "print num(e5)" "4"
-
- # locations
- test_print_accept "print num(v_bool)" "0"
- test_print_accept "print num(v_char)" "88"
- test_print_accept "print num(v_byte)" "-30"
- test_print_accept "print num(v_ubyte)" "30"
- test_print_accept "print num(v_int)" "-333"
- test_print_accept "print num(v_uint)" "333"
- test_print_accept "print num(v_long)" "-4444"
- test_print_accept "print num(v_ulong)" "4444"
- test_print_accept "print num(v_set)" "2"
- test_print_accept "print num(v_set_range)" "2"
- test_print_accept "print num(v_numbered_set)" "35"
- test_print_accept "print num(v_char_range)" "71"
- test_print_accept "print num(v_long_range)" "1000"
- test_print_accept "print num(v_range)" "23"
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if [set_lang_chill] then {
- # test builtins as described in chapter 6.20.3 Z.200
- test_num
- test_size
- test_lower
- test_upper
- test_length
-} else {
- warning "$test_name tests suppressed."
-}
+# 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.exp b/gdb/testsuite/gdb.chill/callch.exp
index 78cf0b7e088..f81d42f6831 100644
--- a/gdb/testsuite/gdb.chill/callch.exp
+++ b/gdb/testsuite/gdb.chill/callch.exp
@@ -1,69 +1,69 @@
-# Copyright 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
-
-# This file tests that gdb can call functions in a Chill inferior.
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "callch"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- send_gdb "set language chill\n" ;
-
- gdb_test "break callch.ch:48" ""
- send_gdb "run\n"; gdb_expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $"
- gdb_test {set fred(10, i)} {a is '10'; b is '12'.}
- gdb_test_exact "call klaus()" {here's klaus calling.}
- gdb_test_exact "call fred()" {too few arguments in function call}
- # Too many arguments are allowed
- gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.}
- gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\
- "print a before king"
- # Current gdb prints 255 for the results that are expected to be -1.
- setup_xfail "mips*-sgi-irix*"
- 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.*"
- gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\
- "print a after king"
- gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.}
- 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.*"
-}
-
-do_tests
+# 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/chillvars.exp b/gdb/testsuite/gdb.chill/chillvars.exp
index 386bf432bd1..1827c3f143c 100644
--- a/gdb/testsuite/gdb.chill/chillvars.exp
+++ b/gdb/testsuite/gdb.chill/chillvars.exp
@@ -1,316 +1,316 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Fred Fish. (fnf@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "chillvars"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- # This is needed (at least on SunOS4) to make sure the
- # the symbol table is read.
- gdb_test "break chillvars.ch:3" ""
- gdb_test "delete 1" ""
-
- gdb_test "set width 0" ""
- gdb_test "set print sevenbit-strings" ""
- gdb_test "set print address off" ""
-
- test_BOOL
- test_CHAR
- test_BYTE
- test_UBYTE
- test_INT
- test_UINT
- test_LONG
- test_ULONG
- test_REAL
- test_LONG_REAL
- test_POWERSET
- test_arrays
- test_strings
- test_structs
-
- test_ptr
-}
-
-proc test_BOOL {} {
-
- gdb_test "ptype bool_true" "type = (BOOL|bool)"
- gdb_test "ptype bool_false" "type = (BOOL|bool)"
- gdb_test "whatis bool_true" "type = (BOOL|bool)"
- gdb_test "whatis bool_false" "type = (BOOL|bool)"
- gdb_test "print bool_false" " = FALSE"
- gdb_test "print bool_true" " = TRUE"
-
-}
-
-proc test_CHAR {} {
- gdb_test "ptype control_char" "type = (CHAR|char)"
- gdb_test "whatis control_char" "type = (CHAR|char)"
- gdb_test "print control_char" { = '\^[(]7[)]'}
- gdb_test "ptype printable_char" "type = (CHAR|char)"
- gdb_test "whatis printable_char" "type = (CHAR|char)"
- gdb_test "print printable_char" " = 'a'"
-
- gdb_test "print lower(char)" { = '\^[(]0[)]'}
- gdb_test "print upper(char)" { = '\^[(]255[)]'}
-}
-
-proc test_BYTE {} {
- gdb_test "ptype byte_low" "type = (BYTE|byte)"
- gdb_test "whatis byte_low" "type = (BYTE|byte)"
- gdb_test "print byte_low" " = -128"
- gdb_test "ptype byte_high" "type = (BYTE|byte)"
- gdb_test "whatis byte_high" "type = (BYTE|byte)"
- gdb_test "print byte_high" " = 127"
-
- gdb_test "print lower(byte)" " = -128"
- gdb_test "print upper(byte)" " = 127"
- gdb_test "print lower(byte_high)" " = -128"
- gdb_test "print upper(byte_high)" " = 127"
-}
-
-proc test_UBYTE {} {
- gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)"
- gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)"
- gdb_test "print ubyte_low" " = 0"
- gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)"
- gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)"
- gdb_test "print ubyte_high" " = 255"
-}
-
-proc test_INT {} {
- gdb_test "ptype int_low" "type = (INT|int)"
- gdb_test "whatis int_low" "type = (INT|int)"
- gdb_test "print int_low" " = -32768"
- gdb_test "ptype int_high" "type = (INT|int)"
- gdb_test "whatis int_high" "type = (INT|int)"
- gdb_test "print int_high" " = 32767"
-}
-
-proc test_UINT {} {
- gdb_test "ptype uint_low" "type = (UINT|uint)"
- gdb_test "whatis uint_low" "type = (UINT|uint)"
- gdb_test "print uint_low" " = 0"
- gdb_test "ptype uint_high" "type = (UINT|uint)"
- gdb_test "whatis uint_high" "type = (UINT|uint)"
- gdb_test "print uint_high" " = 65535"
-}
-
-proc test_LONG {} {
- gdb_test "ptype long_low" "type = (LONG|long)"
- gdb_test "whatis long_low" "type = (LONG|long)"
- gdb_test "print long_low" " = -2147483648"
- gdb_test "ptype long_high" "type = (LONG|long)"
- gdb_test "whatis long_high" "type = (LONG|long)"
- gdb_test "print long_high" " = 2147483647"
-}
-
-proc test_ULONG {} {
- gdb_test "ptype ulong_low" "type = (ULONG|ulong)"
- gdb_test "whatis ulong_low" "type = (ULONG|ulong)"
- gdb_test "print ulong_low" " = 0"
- gdb_test "ptype ulong_high" "type = (ULONG|ulong)"
- gdb_test "whatis ulong_high" "type = (ULONG|ulong)"
- gdb_test "print ulong_high" " = 4294967295"
-}
-
-proc test_REAL {} {
- gdb_test "ptype real1" "type = (FLOAT|float)"
- gdb_test "whatis real1" "type = (FLOAT|float)"
- gdb_test "print real1" " = 3.14159274"
-}
-
-proc test_LONG_REAL {} {
- gdb_test "ptype long_real1" "type = (DOUBLE|double)"
- gdb_test "whatis long_real1" "type = (DOUBLE|double)"
- gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300"
-}
-
-proc test_POWERSET {} {
-}
-
-proc test_arrays {} {
- gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)"
- gdb_test_exact "print booltable1" \
- { = [(0): TRUE, (1:2): FALSE, (3): TRUE]}
-
- gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)"
- gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]}
-
- gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)"
- gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']}
-
- gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)"
- gdb_test_exact "print chartable2" \
- {= [(3): '^(0)', (4): '^(1)', (5): '^(2)']}
-
- gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)"
- gdb_test_exact "print bytetable1" \
- {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
-
- gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)"
- gdb_test_exact "print bytetable2" \
- {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
-
- gdb_test "ptype bytetable3" \
- "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
- gdb_test_exact "print bytetable3" \
- {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
- gdb_test "ptype bytetable4" \
- "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
- gdb_test_exact "print bytetable4" \
- {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
-
- gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)"
- gdb_test_exact "print ubytetable1" \
- {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
-
- gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)"
- gdb_test_exact "print ubytetable2" \
- {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
-
- gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)"
- gdb_test_exact "print inttable1" \
- {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
-
- gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)"
- gdb_test_exact "print inttable2" \
- {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
-
- gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)"
- gdb_test_exact "print uinttable1" \
- {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
-
- gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)"
- gdb_test_exact "print uinttable2" \
- {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
-
- gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)"
- gdb_test_exact "print longtable1" \
- {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
-
- gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)"
- gdb_test_exact "print longtable2" \
- {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
-
- gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)"
- gdb_test_exact "print ulongtable1" \
- {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
-
- gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)"
- gdb_test_exact "print ulongtable2" \
- {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
-
- gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)"
- gdb_test_exact "print realtable1" \
- {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
-
- gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)"
- gdb_test_exact "print realtable2" \
- {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
-
- gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)"
- gdb_test_exact "print longrealtable1" \
- {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
-
- gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
- gdb_test_exact "print longrealtable2" \
- {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
-
- gdb_test "print length(longrealtable2)" {= 5}
- gdb_test "print lower(longrealtable2)" {= 5}
- gdb_test "print upper(longrealtable2)" {= 9}
-}
-
-proc test_strings {} {
-
- gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+"
- gdb_test "print string1" " = \"abcd\""
-
- gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+"
- gdb_test "print string2" { = \"ef\^\(0\)gh\"}
-
- gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+"
- gdb_test "print string3" " = \"efghij\""
-
- gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+"
- gdb_test "print string4" { = \"zzzzzz\^\(0\)\"}
-
- # These tests require a running process, so run to one of the procs
- # and then do the tests.
-
- if [runto scalar_arithmetic] then {
- gdb_test "ptype string1//string2" "type = CHARS \\(9\\)"
- gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"}
- gdb_test_exact {ptype "a chill string"} {type = CHARS (14)}
- gdb_test "print 'a chill string'" " = \"a chill string\""
- gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"}
- gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\""
- gdb_test "print (6) 'z'" " = \"zzzzzz\""
- gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+"
- gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\""
- gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+"
- }
-
-}
-
-proc test_structs {} {
- gdb_test "ptype struct1" \
- "type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+"
- gdb_test "print struct1" \
- ".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]"
- gdb_test "ptype struct2" \
- "type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+"
- gdb_test "print struct2" \
- ".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]"
-}
-
-proc test_ptr {} {
- # This is to test Cygnus PR 6932
- gdb_test "print xptr->int" ".* = 32767"
-}
-
-do_tests
+# 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/enum.exp b/gdb/testsuite/gdb.chill/enum.exp
index 78152722bcf..a4e2930ccf0 100644
--- a/gdb/testsuite/gdb.chill/enum.exp
+++ b/gdb/testsuite/gdb.chill/enum.exp
@@ -1,85 +1,85 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Wilfried Moser (moser@aut.alcatel.at
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "enum"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto hugo_
-
- send_gdb "set var \$i := d\n"
- gdb_expect -re ".*$gdb_prompt $"
- gdb_test "print \$i" { = d}
- gdb_test "print size (\$i)" { = 1}
- gdb_test "print b+c" { = 3}
- gdb_test "print c*d" { = 6}
- gdb_test "print a<b" { = TRUE}
- gdb_test "print a=b" { = FALSE}
- gdb_test "print a=a" { = TRUE}
- gdb_test "print a/=\$i" { = TRUE}
-
-# This is PR 8870
- gdb_test "break malloc" ".*"
- gdb_test {set var $j := m_set[b]} ".*invalid.*tuple.*"
-}
+# 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<b" { = TRUE}
+# OBSOLETE gdb_test "print a=b" { = FALSE}
+# OBSOLETE gdb_test "print a=a" { = TRUE}
+# OBSOLETE gdb_test "print a/=\$i" { = TRUE}
+# OBSOLETE
+# OBSOLETE # This is PR 8870
+# OBSOLETE gdb_test "break malloc" ".*"
+# OBSOLETE gdb_test {set var $j := m_set[b]} ".*invalid.*tuple.*"
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/gch1041.exp b/gdb/testsuite/gdb.chill/gch1041.exp
index ec80ddf4629..fe13dc91bfa 100644
--- a/gdb/testsuite/gdb.chill/gch1041.exp
+++ b/gdb/testsuite/gdb.chill/gch1041.exp
@@ -1,76 +1,76 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Fred Fish. (fnf@cygnus.com)
-# Martin Pottendorfer (pottendo@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "gch1041"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto arr_
- # check if array slices print correct index
- gdb_test {print a1(10:30)} { = \[\(10:30\): 33\]}
- gdb_test {print a2(3:5)} { = \[\(3:5\): \[.l: 22, .c: "mowi", .b: TRUE\]\]}
- gdb_test {print a3('a':'c')} { = \[\('a':'c'\): 'X'\]}
- gdb_test {print a4(e2:e5)} { = \[\(e2:e5\): TRUE\]}
-}
+# 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 "gch1041"
+# 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 arr_
+# OBSOLETE # check if array slices print correct index
+# OBSOLETE gdb_test {print a1(10:30)} { = \[\(10:30\): 33\]}
+# OBSOLETE gdb_test {print a2(3:5)} { = \[\(3:5\): \[.l: 22, .c: "mowi", .b: TRUE\]\]}
+# OBSOLETE gdb_test {print a3('a':'c')} { = \[\('a':'c'\): 'X'\]}
+# OBSOLETE gdb_test {print a4(e2:e5)} { = \[\(e2:e5\): TRUE\]}
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/gch1272.exp b/gdb/testsuite/gdb.chill/gch1272.exp
index 544a5ecb6bf..2d2ce9e3e56 100644
--- a/gdb/testsuite/gdb.chill/gch1272.exp
+++ b/gdb/testsuite/gdb.chill/gch1272.exp
@@ -1,86 +1,86 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Wilfried Moser (moser@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "gch1272"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto brrr
-
- # check foo
- gdb_test {print foo} { = \[\(0:99\): 222\]}
- gdb_test "set var foo := m_array\[\(\*\):44\]" ".*"
- gdb_test {print foo} { = \[\(0:99\): 44\]}
-
- # check bar
- gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
- gdb_test "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]" ".*"
- gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
-
- # some failues
- gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
- gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
- gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
- gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
-}
+# 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 "gch1272"
+# 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 brrr
+# OBSOLETE
+# OBSOLETE # check foo
+# OBSOLETE gdb_test {print foo} { = \[\(0:99\): 222\]}
+# OBSOLETE gdb_test "set var foo := m_array\[\(\*\):44\]" ".*"
+# OBSOLETE gdb_test {print foo} { = \[\(0:99\): 44\]}
+# OBSOLETE
+# OBSOLETE # check bar
+# OBSOLETE gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
+# OBSOLETE gdb_test "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]" ".*"
+# OBSOLETE gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
+# OBSOLETE
+# OBSOLETE # some failues
+# OBSOLETE gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
+# OBSOLETE gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
+# OBSOLETE gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
+# OBSOLETE gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/gch1280.exp b/gdb/testsuite/gdb.chill/gch1280.exp
index c05f84547ea..70638425465 100644
--- a/gdb/testsuite/gdb.chill/gch1280.exp
+++ b/gdb/testsuite/gdb.chill/gch1280.exp
@@ -1,76 +1,76 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Wilfried Moser (moser@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "gch1280"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto doit
- gdb_test "next" ""
- # check too many array elements
- gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
- gdb_test {set var $i := m_x[(3): 22, 25]} {Too many array elements}
- gdb_test "set var \$i := m_x\[\(2\): 22, 25\]" ""
- gdb_test {print $i} { = \[\(1\): 0, \(2\): 22, \(3\): 25\]}
-}
+# 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 "gch1280"
+# 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 doit
+# OBSOLETE gdb_test "next" ""
+# OBSOLETE # check too many array elements
+# OBSOLETE gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
+# OBSOLETE gdb_test {set var $i := m_x[(3): 22, 25]} {Too many array elements}
+# OBSOLETE gdb_test "set var \$i := m_x\[\(2\): 22, 25\]" ""
+# OBSOLETE gdb_test {print $i} { = \[\(1\): 0, \(2\): 22, \(3\): 25\]}
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/gch922.exp b/gdb/testsuite/gdb.chill/gch922.exp
index 104b6224338..cdfdd35ec50 100644
--- a/gdb/testsuite/gdb.chill/gch922.exp
+++ b/gdb/testsuite/gdb.chill/gch922.exp
@@ -1,183 +1,183 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file tests various Chill values, expressions, and types.
-
-# This file was written by Wilfried Moser (moser@aut.alcatel.at)
-# Kurt Fuchs (fuchs_k@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "gch922"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break xx_\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-#
-# Args are:
-#
-# First one is string to send_gdb to gdb
-# Second one is string to match gdb result to
-# Third one is an optional message to be printed
-
-proc test_print_accept { args } {
- global gdb_prompt
- global passcount
- global verbose
-
- if [llength $args]==3 then {
- set message [lindex $args 2]
- } else {
- set message [lindex $args 0]
- }
- set sendthis [lindex $args 0]
- set expectthis [lindex $args 1]
- set result [gdb_test $sendthis ".* = ${expectthis}" $message]
- if $result==0 {incr passcount}
- return $result
-}
-
-
-proc test_chars {} {
- global passcount gdb_prompt
-
- verbose "Testing Chars"
- set passcount 0
-
- test_print_accept "print a" {'\^\(0\)'<repeats 70 times>//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'<repeats 70 times>}
- test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
- test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
- test_print_accept "print d" {'\^\(11\)'}
-
- gdb_test "set var a := (100)'\^(0,255)'" ""
- 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\)"}
-
- send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
- send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"}
- send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print c" {'b'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
- gdb_test "set var d := '\^(199)'" ""
- test_print_accept "print d" {'\^\(199\)'}
-
- 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"}
- test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
-
- send_gdb "set var a := \"\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {""}
- send_gdb "set var a := \"\"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {""""}
- send_gdb "set var a := \" \"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {" """}
- send_gdb "set var a := \"\^\^\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {"\^\^"}
- send_gdb "set var a := \"'\" \n" ; gdb_expect -re "$gdb_prompt $"
- test_print_accept "print a" {"'"}
-}
-
-
-proc test_code {} {
- global passcount gdb_prompt
-
- verbose "Testing Chars"
- set passcount 0
-
- runto bulk
- 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\)"}
- test_print_accept "print b" {"\^\(200\)"}
-# test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
- test_print_accept "print d" {'a'}
-}
-
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-
-if [set_lang_chill] then {
- # test builtins as described in chapter 6.20.3 Z.200
-
- test_chars
-# test_code
-} else {
- warning "$test_name tests suppressed."
-}
+# 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 "gch922"
+# 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
+# OBSOLETE proc test_chars {} {
+# OBSOLETE global passcount gdb_prompt
+# OBSOLETE
+# OBSOLETE verbose "Testing Chars"
+# OBSOLETE set passcount 0
+# OBSOLETE
+# OBSOLETE test_print_accept "print a" {'\^\(0\)'<repeats 70 times>//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'<repeats 70 times>}
+# OBSOLETE test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
+# OBSOLETE test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
+# 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'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
+# 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'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
+# 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.exp b/gdb/testsuite/gdb.chill/gch981.exp
index 5651bb0a56d..9b684f07a03 100644
--- a/gdb/testsuite/gdb.chill/gch981.exp
+++ b/gdb/testsuite/gdb.chill/gch981.exp
@@ -1,249 +1,249 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file tests various Chill values, expressions, and types.
-
-# This file was written by Wilfried Moser (moser@aut.alcatel.at)
-# Kurt Fuchs (fuchs_k@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "gch981"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break xx_\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-#
-# Args are:
-#
-# First one is string to send_gdb to gdb
-# Second one is string to match gdb result to
-# Third one is an optional message to be printed
-
-proc test_print_accept { args } {
- global gdb_prompt
- global passcount
- global verbose
-
- if [llength $args]==3 then {
- set message [lindex $args 2]
- } else {
- set message [lindex $args 0]
- }
- set sendthis [lindex $args 0]
- set expectthis [lindex $args 1]
- set result [gdb_test $sendthis ".* = ${expectthis}" $message]
- if $result==0 {incr passcount}
- return $result
-}
-
-proc test_power {} {
- global passcount gdb_prompt
-
- verbose "Testing some POWERSET Stuff"
- set passcount 0
-
- test_print_accept "print v1_power1" {\[e1:e5\]}
- test_print_accept "print v2_power1" {\[\]}
- test_print_accept "print SIZE(v1_power1)" "1"
-
- gdb_test "set v1_power1 := \[b1\]" ""
-# if GDB has rejected the improper values, we have to gdb_expect the same!
- test_print_accept "print v1_power1" {\[e1:e5\]}
-
- gdb_test "set v1_power1 := \[a1,a2\]" ""
- test_print_accept "print v1_power1" {\[e1:e5\]}
- gdb_test "set v1_power1 := \[b1,b2,b3,e4\]" ""
- test_print_accept "print v1_power1" {\[e1:e5\]}
- gdb_test "set v1_power1 := \[e4:e5\]" ""
- test_print_accept "print v1_power1" {\[e4:e5\]}
- gdb_test "set v1_power1 := \[e1, e2:e3, e5\]" ""
- test_print_accept "print v1_power1" {\[e1:e3, e5\]}
- gdb_test "set v1_power1 := \[e1, e2:e4, e4:e5\]" ""
- test_print_accept "print v1_power1" {\[e1:e5\]}
- gdb_test "set v1_power1 := \[e1, e1:e3, e1:e2, e2:e3\]" ""
- test_print_accept "print v1_power1" {\[e1:e3\]}
-
- gdb_test "set v_power2 := \[e2\]" ""
- test_print_accept "print v_power2" {\[\]}
- gdb_test "set v_power2 := \[1,2,3\]" ""
- test_print_accept "print v_power2" {\[\]}
- gdb_test "set v_power2 := \[e2, b2, b1\]" ""
- test_print_accept "print v_power2" {\[\]}
-
-# Note, that this is a numbered SET, so a1:a3 contains all elements (exept a6)
- gdb_test "set v_power2 := \[a1:a3, a6:a4, a7:a9\]" ""
- test_print_accept "print v_power2" {\[a6:a3\]}
- gdb_test "set v_power2 := \[a1, a4:a6, a9\]" ""
- test_print_accept "print v_power2" {\[a1, a9\]}
- gdb_test "set v_power2 := \[a1:a2, a6, a9\]" ""
- test_print_accept "print v_power2" {\[a6:a2, a9\]}
- gdb_test "set v_power2 := \[a1, a4, a7:a8, a9:a3\]" ""
- test_print_accept "print v_power2" {\[a1, a4, a9:a8\]}
- gdb_test "set v_power2 := \[a1, a4:a8\]" ""
- test_print_accept "print v_power2" {\[a1, a4:a8\]}
- gdb_test "set v_power2 := \[a8,a3,a7,a9,a5,a6\]" ""
- test_print_accept "print v_power2" {\[a6, a5, a9, a7, a3, a8\]}
-
- gdb_test "set v_power3 := \[b1:b2,e1\]" ""
- test_print_accept "print v_power3" {\[b1:b2\]}
- gdb_test "set v_power3 := \[b1, b3, b6:b7\]" ""
- test_print_accept "print v_power3" {\[b1, b3, b6:b7\]}
- gdb_test "set v_power3 := \[b1, b3:b4, b7\]" ""
- test_print_accept "print v_power3" {\[b1, b3:b4, b7\]}
- gdb_test "set v_power3 := \[b1, b4:b6, b7\]" ""
- test_print_accept "print v_power3" {\[b1, b4:b7\]}
- gdb_test "set v_power3 := \[b1:b7\]" ""
- test_print_accept "print v_power3" {\[b1:b7\]}
- gdb_test "set v_power3 := \[b5:b7, b1\]" ""
- test_print_accept "print v_power3" {\[b1, b5:b7\]}
-
- gdb_test "set v_power4 := \[\"b\"\]" ""
- test_print_accept "print v_power4" {\['b':'x'\]}
- gdb_test "set v_power4 := \[5\]" ""
- test_print_accept "print v_power4" {\['b':'x'\]}
- gdb_test "set v_power4 := \['c':'f','g':'h','o':'t'\]" ""
- test_print_accept "print v_power4" {\['c':'h', 'o':'t'\]}
- gdb_test "set v_power4 := \['a','b','c','d','e','f'\]" ""
- test_print_accept "print v_power4" {\['a':'f'\]}
- gdb_test "set v_power4 := \['\^(0)':'\^(200)'\]" ""
- test_print_accept "print v_power4" {\['\^\(0\)':'\^\(200\)'\]}
-
- gdb_test "set v_power5 := \[a8\]" ""
- test_print_accept "print v_power5" {\[2:100\]}
- gdb_test "set v_power5 := \[4\]" ""
- test_print_accept "print v_power5" {\[4\]}
- gdb_test "set v_power5 := \[3:95,9:100,10:107,200:250\]" ""
- test_print_accept "print v_power5" {\[3:107, 200:250\]}
- gdb_test "set v_power5 := \[2, 100:120, 350:400\]" ""
- test_print_accept "print v_power5" {\[2, 100:120, 350:400\]}
- gdb_test "set v_power5 := \[2:64,65:127,128:256,256:399,400\]" ""
- test_print_accept "print v_power5" {\[2:400\]}
- gdb_test "set v_power5 := \[3:95, 99:100, 101:107, 200:250\]" ""
- test_print_accept "print v_power5" {\[3:95, 99:107, 200:250\]}
-
- gdb_test "set v_power6 := \[a8\]" ""
- test_print_accept "print v_power6" {\[\]}
- gdb_test "set v_power6 := \[4\]" ""
- test_print_accept "print v_power6" {\[4\]}
- gdb_test "set v_power6 := \[3:95, 99:100, 101:107, 200:250\]" ""
- test_print_accept "print v_power6" {\[3:95, 99:107, 200:250\]}
- gdb_test "set v_power6 := \[-111:0, 1:112, 11111:22222\]" ""
- test_print_accept "print v_power6" {\[-111:112, 11111:22222\]}
- gdb_test "set v_power6 := \[0, 200:4000, 6666:9999\]" ""
- test_print_accept "print v_power6" {\[0, 200:4000, 6666:9999\]}
-
-# gdb_test "set v_power7 := \[a8\]" ""
-# test_print_accept "print v_power7" {\[2:100\]}
-# gdb_test "set v_power7 := \[4\]" ""
-# test_print_accept "print v_power7" {\[4\]}
-# gdb_test "set v_power7 := \[3:95, 99:100, 101:107, 200:250\]" ""
-# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
-# gdb_test "set v_power7 := \[0, 1000, 1000000, 10000000000\]" ""
-# test_print_accept "print v_power7" {\[0, 1000, 1000000, 1000000000\]}
-# gdb_test "set v_power7 := \[-20000:100000, 111111:2222222\]" ""
-# test_print_accept "print v_power7" {\[-20000:100000, 111111:2222222\]}
-# gdb_test "set v_power7 := \[\]" ""
-# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
-# gdb_test "set v_power7 := \[2:-500, -501:1, 20:370, -888:-920, 1000:2000, 1800:2500\]\ " ""
-# test_print_accept "print v_power7" {\[-920:-888, -501:2, 20:370, 1000:2500\]}
-# test_print_accept "print SIZE(v_power7)" ""
-
-
- runto 58
- test_print_accept "print v_set1 IN v1_power1" "TRUE"
- test_print_accept "print v_set1 IN v2_power1" "FALSE"
-
-}
-
-
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-
-if [set_lang_chill] then {
- # test builtins as described in chapter 6.20.3 Z.200
-
- test_power
-} else {
- warning "$test_name tests suppressed."
-}
+# 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.exp b/gdb/testsuite/gdb.chill/misc.exp
index e58ba798103..1cdeb7c9d3a 100644
--- a/gdb/testsuite/gdb.chill/misc.exp
+++ b/gdb/testsuite/gdb.chill/misc.exp
@@ -1,100 +1,100 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Fred Fish. (fnf@cygnus.com)
-# Martin Pottendorfer (pottendo@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "misc"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto dummyfunc
- # check upper/lower case
- gdb_test "ptype BOOL" " = (bool|BOOL)"
- gdb_test "ptype bool" " = (bool|BOOL)"
- gdb_test "print otto" " = 42"
- gdb_test "print OTTO" " = 42"
- gdb_test "print otTO" " = 42"
- gdb_test "print OTto" " = 42"
- gdb_test "print NULL" " = NULL" "print emptiness literal"
-
- # This tests PR 8496.
- gdb_test {printf "%d %d.", 3+4,2} "7 2." "printf with 2 arguments"
-
- # This tests GCH/924
- gdb_test {print (h'23)} { = 35} "print parantised integer literal"
-
- # Linux thinks this is at line 6, but is otherwise ok.
- setup_xfail "i*86-pc-linux*-gnu"
- gdb_test "info line" \
- {Line 7 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\
- "info about current line"
-
- # check array () type (expr)
- setup_xfail "m68*-*-hpux*"
- gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]}
-
- send_gdb "set var \$i := foo\n"
- gdb_expect -re ".*$gdb_prompt $"
- setup_xfail "m68*-*-hpux*"
- gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'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.exp b/gdb/testsuite/gdb.chill/powerset.exp
index c41276c0c13..6d19248e854 100644
--- a/gdb/testsuite/gdb.chill/powerset.exp
+++ b/gdb/testsuite/gdb.chill/powerset.exp
@@ -1,187 +1,187 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file tests various Chill values, expressions, and types.
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "powerset"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break xx_\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-#
-# Args are:
-#
-# First one is string to send_gdb to gdb
-# Second one is string to match gdb result to
-# Third one is an optional message to be printed
-
-proc test_print_accept { args } {
- global gdb_prompt
- global passcount
- global verbose
-
- if [llength $args]==3 then {
- set message [lindex $args 2]
- } else {
- set message [lindex $args 0]
- }
- set sendthis [lindex $args 0]
- set expectthis [lindex $args 1]
- set result [gdb_test $sendthis ".* = ${expectthis}" $message]
- if $result==0 {incr passcount}
- return $result
-}
-
-proc test_card {} {
- global passcount
-
- verbose "testing builtin CARD"
- set passcount 0
-
- # discrete mode names
- test_print_accept "print card(v_ps1)" "4"
- test_print_accept "print card(v_ps2)" "15"
- test_print_accept "print card(v_ps3)" "4"
- test_print_accept "print card(v_ps4)" "11"
- test_print_accept "print card(v_ps5)" "1"
- test_print_accept "print card(v_ps51)" "0"
- test_print_accept "print card(v_ps6)" "101"
-
- # a failure
- setup_xfail "*-*-*"
- test_print_accept "print card(m_ps1)" "typename in invalid context"
-}
-
-proc test_min {} {
- global passcount
-
- verbose "testing builtin MIN"
- set passcount 0
-
- # discrete mode names
- test_print_accept "print min(v_ps1)" "1"
- test_print_accept "print min(v_ps2)" "-100"
- test_print_accept "print min(v_ps3)" "bb"
- test_print_accept "print min(v_ps4)" "','"
- test_print_accept "print min(v_ps5)" "FALSE"
- test_print_accept "print min(v_ps6)" "-50"
-
- # a failure
- setup_xfail "*-*-*"
- test_print_accept "print min(v_ps51)" "MIN for empty powerset"
- setup_xfail "*-*-*"
- test_print_accept "print min(m_ps1)" "typename in invalid context"
-}
-
-proc test_max {} {
- global passcount
-
- verbose "testing builtin MIN"
- set passcount 0
-
- # discrete mode names
- test_print_accept "print max(v_ps1)" "7"
- test_print_accept "print max(v_ps2)" "100"
- test_print_accept "print max(v_ps3)" "ii"
- test_print_accept "print max(v_ps4)" "'z'"
- test_print_accept "print max(v_ps5)" "FALSE"
- test_print_accept "print max(v_ps6)" "50"
-
- # test an IN
- test_print_accept "print 0 in v_ps6" "TRUE"
-
- # a failure
- setup_xfail "*-*-*"
- test_print_accept "print max(v_ps51)" "MAX for empty powerset"
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if [set_lang_chill] then {
- # test builtins as described in chapter 6.20.3 Z.200
- test_card
- test_min
- test_max
-} else {
- warning "$test_name tests suppressed."
-}
+# 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.exp b/gdb/testsuite/gdb.chill/pr-4975.exp
index cef9ef528bd..366c5369da7 100644
--- a/gdb/testsuite/gdb.chill/pr-4975.exp
+++ b/gdb/testsuite/gdb.chill/pr-4975.exp
@@ -1,67 +1,67 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "pr-4975-grt"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-4975"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- # This is needed (at least on SunOS4) to make sure the
- # the symbol table is read.
- runto "x"
- # "You loose"? Why, thank you. (But I suspect "You lose" might have
- # been what was intended).
- gdb_test "finish" "You loose.*" "Runs and reads symbols OK"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-5016.exp
index 760b514ae9c..f01c1bf44e1 100644
--- a/gdb/testsuite/gdb.chill/pr-5016.exp
+++ b/gdb/testsuite/gdb.chill/pr-5016.exp
@@ -1,62 +1,63 @@
-# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+# 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
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-5016"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto dump
- # Linux thinks type is "_cint" (and so does sparc-sun-sunos4, alpha-dec-osf2.0)
- #setup_xfail "i*86-pc-linux*-gnu" "sparc-sun-sunos4*" "alpha-dec-osf2*"
- gdb_test "whatis i" "type = m_index" "whatis int-range"
- gdb_test_exact "ptype m_index" "type = RANGE (1:10)" "ptype m_index"
- gdb_test_exact "whatis a" "type = /*LOC*/ vector"
- gdb_test "ptype a" "type = /\\*LOC\\*/ ARRAY \\(1:10\\) (INT|int)"
- gdb_test "step" ""
- gdb_test_exact "whatis i" "type = long" "whatis loop counter i"
-}
-
-do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5020.exp b/gdb/testsuite/gdb.chill/pr-5020.exp
index 993d373ee59..aad219d2c95 100644
--- a/gdb/testsuite/gdb.chill/pr-5020.exp
+++ b/gdb/testsuite/gdb.chill/pr-5020.exp
@@ -1,85 +1,85 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-5020"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- # This is needed (at least on SunOS4) to make sure the
- # the symbol table is read.
- gdb_test "break chillvars.ch:3" ""
- gdb_test "delete 1" ""
-
- gdb_test "set width 0" ""
- gdb_test "set print sevenbit-strings" ""
- gdb_test "set print address off" ""
-
- test_pr_5020
-}
-
-proc test_pr_5020 {} {
- global gdb_prompt
- runto dummy_pr_5020
- gdb_test_exact "print y" \
- {= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}
- gdb_test_exact "print boolarr" \
- {= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]}
- gdb_test_exact "print intarr" \
- {= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]}
- gdb_test_exact "print setarr" \
- {= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]}
- gdb_test "set print pretty" ""
- gdb_test_exact "print y" \
-{= [('a'): [
- .l: 10,
- .b: TRUE
- ], ('b'): [
- .l: 111,
- .b: FALSE
- ]]} "print y pretty"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-5022.exp
index 43e2dc27710..306095095f0 100644
--- a/gdb/testsuite/gdb.chill/pr-5022.exp
+++ b/gdb/testsuite/gdb.chill/pr-5022.exp
@@ -1,70 +1,70 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-5022"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- # This is needed (at least on SunOS4) to make sure the
- # the symbol table is read.
- gdb_test "break gdbme.ch:3" ""
- gdb_test "delete 1" ""
-
- gdb_test "set width 0" ""
- gdb_test "set print sevenbit-strings" ""
-
- test_pr_5022
-}
-
-proc test_pr_5022 {} {
- global gdb_prompt
- runto dummy_pr_5022
- gdb_test "p p" " = NULL" "print NULL pointer"
- gdb_test "continue" ""
- gdb_test "p p" {= PTR\(H'[0-9a-fA-F]+\)} "print non-NULL pointer"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-5646.exp
index 3a8aad3830b..dc093b9b4ee 100644
--- a/gdb/testsuite/gdb.chill/pr-5646.exp
+++ b/gdb/testsuite/gdb.chill/pr-5646.exp
@@ -1,64 +1,64 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "pr-5646-grt"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-5646"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto p
- gdb_test "next" ""
- gdb_test_exact "print xx" {= [a:b]}
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-5984.exp
index cd45aa36a51..826ec57b3db 100644
--- a/gdb/testsuite/gdb.chill/pr-5984.exp
+++ b/gdb/testsuite/gdb.chill/pr-5984.exp
@@ -1,57 +1,57 @@
-# Copyright 1992, 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-5984"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- send_gdb "set language chill\n" ;
-
- gdb_test "break pr-5984.ch:6" ""
- send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-5984.ch:6"
- gdb_expect -re "$gdb_prompt $"
- gdb_test "next" "Jason Dark.*" "next over Jason Dark"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-6292.exp
index d57f4819046..4daf3826709 100644
--- a/gdb/testsuite/gdb.chill/pr-6292.exp
+++ b/gdb/testsuite/gdb.chill/pr-6292.exp
@@ -1,58 +1,58 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-6292"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- send_gdb "set language chill\n" ;
-
- gdb_test "break pr-6292.ch:15" ""
- send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $"
- gdb_test_exact "call klaus()" {here's klaus calling.}
- gdb_test {set fred(10, i)} {a was '10'; b was '12'.}
- gdb_test "print i" { = 13} "print i after call"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-6632.exp
index 1bec3c7041c..9f7d6235446 100644
--- a/gdb/testsuite/gdb.chill/pr-6632.exp
+++ b/gdb/testsuite/gdb.chill/pr-6632.exp
@@ -1,66 +1,66 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "pr-6632-grt"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-6632"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto p
- gdb_test "whatis x" {type = m_dummy_range}
- gdb_test_exact "ptype x" {type = m_dummy (dummy_6:dummy_22)}
- gdb_test "print x" { = dummy_10}
-}
-
-do_tests
+# 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
index 0e81ca770e4..d98c0d873d5 100644
--- a/gdb/testsuite/gdb.chill/pr-8134.exp
+++ b/gdb/testsuite/gdb.chill/pr-8134.exp
@@ -1,65 +1,65 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-# Note we use pr-8136.ch for pr-8134.exp as well as pr-8136.exp.
-set testfile2 "func1"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-8134"
-set srcfile ${srcdir}/$subdir/pr-8136.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto p1
- gdb_test "print first" "= 1"
- gdb_test "print last" "= 10"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-8136.exp
index 3fee7ec3c79..2dd5281a754 100644
--- a/gdb/testsuite/gdb.chill/pr-8136.exp
+++ b/gdb/testsuite/gdb.chill/pr-8136.exp
@@ -1,63 +1,63 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "func1"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-8136"
-set srcfile ${srcdir}/$subdir/pr-8136.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto p1
- gdb_test "print ps" {= \[e3, e7:e9\]}
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-8405.exp
index 826ac6b6e4b..31aa6d5cee5 100644
--- a/gdb/testsuite/gdb.chill/pr-8405.exp
+++ b/gdb/testsuite/gdb.chill/pr-8405.exp
@@ -1,61 +1,61 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_load $binfile
-
- gdb_test "set language chill" ""
- gdb_test "set var \$i:=xx" ""
- gdb_test "print \$i" {= \[.c: "", .b: B'00000000', .boo: FALSE\]}
-}
-
-if [skip_chill_tests] then { continue }
-
-# Check to see if we have an executable to test. If not, then either we
-# haven't tried to compile one, or the compilation failed for some reason.
-# In either case, just notify the user and skip the tests in this file.
-
-set testfile "pr-8405"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-if ![file exists $binfile] then {
- warning "$binfile does not exist; tests suppressed." 0
-} else {
- do_tests
-}
+# 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.exp b/gdb/testsuite/gdb.chill/pr-8742.exp
index 7fc05be4bdd..a7b10d0dfd5 100644
--- a/gdb/testsuite/gdb.chill/pr-8742.exp
+++ b/gdb/testsuite/gdb.chill/pr-8742.exp
@@ -1,64 +1,64 @@
-# Copyright 1992, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-8742"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto dummy
-
- # Haven't investigated why these fail on mips-sgi-irix*
- setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
- gdb_test {call x(p [1, 3, 5])} "1 3 5 " "pass int powerset tuple"
- setup_xfail "mips*-sgi-irix*"
- gdb_test {call y(s_ps [sc])} "sc " "pass set powerset tuple"
- setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
- gdb_test {call x([1, 3, 5])} "1 3 5 " "pass modeless int powerset tuple"
- setup_xfail "mips*-sgi-irix*"
- gdb_test {call y([sc])} "sc " "pass modeless set powerset tuple"
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-8894.exp
index 777570aa255..1ef444896e6 100644
--- a/gdb/testsuite/gdb.chill/pr-8894.exp
+++ b/gdb/testsuite/gdb.chill/pr-8894.exp
@@ -1,61 +1,61 @@
-# Copyright 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
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "pr-8894-grt"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "pr-8894"
-set srcfile ${srcdir}/$subdir/$testfile.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- gdb_test "print size(m_byte)" { = 2}
- gdb_test "print size(m_struct)" { = 6}
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/pr-9095.exp
index d5c72b62686..44bb2c305ac 100644
--- a/gdb/testsuite/gdb.chill/pr-9095.exp
+++ b/gdb/testsuite/gdb.chill/pr-9095.exp
@@ -1,62 +1,62 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_load $binfile
-
- gdb_test "set language chill" ""
- runto pr-9095.ch:12
- gdb_test {p v_arr2(5)->.p(5)} "reference value used as function" \
- "bad call using pointer"
-}
-
-if [skip_chill_tests] then { continue }
-
-# Check to see if we have an executable to test. If not, then either we
-# haven't tried to compile one, or the compilation failed for some reason.
-# In either case, just notify the user and skip the tests in this file.
-
-set testfile "pr-9095"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-if ![file exists $binfile] then {
- warning "$binfile does not exist; tests suppressed." 0
-} else {
- do_tests
-}
+# 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.exp b/gdb/testsuite/gdb.chill/pr-9946.exp
index 7e8b7184a92..f0c48aa73c6 100644
--- a/gdb/testsuite/gdb.chill/pr-9946.exp
+++ b/gdb/testsuite/gdb.chill/pr-9946.exp
@@ -1,79 +1,79 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file was written by Fred Fish. (fnf@cygnus.com)
-# Martin Pottendorfer (pottendo@aut.alcatel.at)
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "pr-9946"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- return [gdb_test "show language" ".* source language is \"chill\".*" \
- "set language to \"chill\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_chill] then {
- runto x_
- gdb_test "next" ""
- # check comparison of SET's
- gdb_test {print xyz=moving} { = TRUE}
- gdb_test {print xyz/=moving} { = FALSE}
- gdb_test {print xyz<moving} { = FALSE}
- gdb_test {print xyz<=moving} { = TRUE}
- gdb_test {print xyz>moving} { = FALSE}
- gdb_test {print xyz>=moving} { = TRUE}
-}
+# 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 xyz<moving} { = FALSE}
+# OBSOLETE gdb_test {print xyz<=moving} { = TRUE}
+# OBSOLETE gdb_test {print xyz>moving} { = FALSE}
+# OBSOLETE gdb_test {print xyz>=moving} { = TRUE}
+# OBSOLETE }
diff --git a/gdb/testsuite/gdb.chill/result.exp b/gdb/testsuite/gdb.chill/result.exp
index e9dce152b8d..8c9a897ceb3 100644
--- a/gdb/testsuite/gdb.chill/result.exp
+++ b/gdb/testsuite/gdb.chill/result.exp
@@ -1,77 +1,77 @@
-# Copyright 1994, 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "result"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- gdb_test "set width 0" ""
- gdb_test "set print sevenbit-strings" ""
- gdb_test "set print address off" ""
-
- # simple function
- runto simple_func
- gdb_test "step 2" ""
- gdb_test "print j" "= 5"
- gdb_test "p RESULT" "= 10"
- gdb_test "continue" ""
- gdb_test "print i" "= 7"
- gdb_test "step 4" ""
- gdb_test "set RESULT := 50" ""
- gdb_test "finish" ""
- gdb_test "step" ""
- gdb_test "print i" "= 50"
-
- # returning a structure
- runto ret_struct
- gdb_test "step 2" ""
- gdb_test "p result" {\[.l: 33, .b: FALSE\]}
- gdb_test "set var result := \[383, TRUE\]" ""
- gdb_test "finish" ""
- gdb_test "p v_struct" {\[.l: 383, .b: TRUE\]}
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/string.exp
index acaea8ff181..41b21047931 100644
--- a/gdb/testsuite/gdb.chill/string.exp
+++ b/gdb/testsuite/gdb.chill/string.exp
@@ -1,73 +1,73 @@
-# Copyright 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
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "string"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- # These tests based on Cygnus PR chill/5696.
- runto string.ch:22
- gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring"
- gdb_test "p s20(1)" { = 'o'} "print vstring element"
- gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)"
- gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)"
- gdb_test "p s10" { = "1234567890"} "print simple string"
- gdb_test "p s10(1)" { = '2'} "print string element"
- gdb_test "p s10(1:3)" { = "234"} "print string slice (:)"
- gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)"
-
- gdb_test "p length(s10)" { = 10} "print string length"
- gdb_test "p length(s20)" { = 14} "print varying string length"
- gdb_test "p lower(s10)" { = 0} "print string lower"
- gdb_test "p upper(s10)" { = 9} "print string upper"
- gdb_test "p lower(s20)" { = 0} "print varying string lower"
- gdb_test "p upper(s20)" { = 19} "print varying string upper"
-
- # These tests are based on Cygnus PR chill/9078.
- gdb_test "print foo // bar" { = "Moser Wilfried"}
- gdb_test "print foo // bar1" { = "Moser abcde"}
- gdb_test "print foo1 // bar1" { = "12345abcde"}
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/tests1.exp
index 7aa882507f3..d3c647d34f6 100644
--- a/gdb/testsuite/gdb.chill/tests1.exp
+++ b/gdb/testsuite/gdb.chill/tests1.exp
@@ -1,822 +1,822 @@
-# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You 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
-
-# This file tests various Chill values, expressions, and types.
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "tests1"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- verbose "loading file '$binfile'"
- gdb_load $binfile
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break dummyfunc\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-#
-# Args are:
-#
-# First one is string to send_gdb to gdb
-# Second one is string to match gdb result to
-# Third one is an optional message to be printed
-
-proc test_print_accept { args } {
- global gdb_prompt
- global passcount
- global verbose
-
- if [llength $args]==3 then {
- set message [lindex $args 2]
- } else {
- set message [lindex $args 0]
- }
- set sendthis [lindex $args 0]
- set expectthis [lindex $args 1]
- set result [gdb_test $sendthis ".* = ${expectthis}" $message]
- if $result==0 {incr passcount}
- return $result
-}
-
-# Testing printing of a specific value. Increment passcount for
-# success or issue fail message for failure. In both cases, return
-# a 1 to indicate that more tests can proceed. However a timeout
-# is a serious error, generates a special fail message, and causes
-# a 0 to be returned to indicate that more tests are likely to fail
-# as well.
-
-# various tests if modes are treated correctly
-# using ptype
-proc test_modes {} {
- global passcount
-
- verbose "testing chill modes"
- set passcount 0
-
- # discrete modes
- test_print_accept "ptype BYTE" "byte"
- test_print_accept "ptype UBYTE" "ubyte"
- test_print_accept "ptype INT" "int"
- test_print_accept "ptype UINT" "uint"
- test_print_accept "ptype LONG" "long"
- test_print_accept "ptype ULONG" "ulong"
- test_print_accept "ptype BOOL" "bool"
- test_print_accept "ptype CHAR" "char"
-
- test_print_accept "ptype set1" "SET \[(\]aaa, bbb, ccc\[)\]" \
- "print unnumbered set mode"
- test_print_accept "ptype nset1" "SET \[(\]na = 1, nb = 34, nc = 20\[)\]" \
- "print numbered set mode"
-
- # mp:
- # display maybe in hex values ?
- #
- test_print_accept "ptype r11" "ubyte \\(0:255\\)" \
- "print ubyte range mode"
- test_print_accept "ptype r12" "uint \\(0:65535\\)" \
- "print uint range mode"
-# test_print_accept "ptype r13" "ulong \\(0:4294967295\\)" \
-# "print ulong range mode"
- test_print_accept "ptype r14" "byte \\(-128:127\\)" \
- "print byte range mode"
- test_print_accept "ptype r15" "int \\(-32768:32767\\)" \
- "print int range mode"
- test_print_accept "ptype r16" "long \\(-2147483648:2147483647\\)" \
- "print long range mode"
-
- test_print_accept "ptype r2" "set1 \\(bbb:ccc\\)" \
- "print unnumbered set range mode"
- test_print_accept "ptype r3" "nset1 \\(na:na\\)" \
- "print numbered set range mode"
- # really this order ?
- # I'm not sure what should happen for the next two tests.
- setup_xfail "*-*-*"
- test_print_accept "ptype r4" "nset1 \\(nb = 34:nc = 20\\)" \
- "print numbered set range mode"
- setup_xfail "*-*-*"
- test_print_accept "ptype r5" "nset1 \\(na = 1, nb = 34, nc = 20\\)" \
- "print numbered set range mode"
-
- # powerset modes
- test_print_accept "ptype pm1" \
- "POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
- "print powerset mode 1"
- test_print_accept "ptype pm2" "POWERSET byte \\(1:8\\)" \
- "print powerset mode 2"
- test_print_accept "ptype pm3" "POWERSET int \\(-32768:32767\\)" \
- "print powerset mode 3"
- test_print_accept "ptype pm4" "POWERSET long \\(-32768:32768\\)" \
- "print powerset mode 4"
- test_print_accept "ptype pm5" \
- "POWERSET long \\(-2147483648:2147483647\\)" \
- "print powerset mode 5"
-
- # reference modes
- test_print_accept "ptype ref1" "REF pm1" \
- "print reference to powerset mode"
- test_print_accept "ptype ref2" "REF byte" \
- "print reference to byte"
- test_print_accept "ptype ref3" "PTR" \
- "print free reference type"
-
- # procedure modes
- # FIXME: we have to talk about this ...
- test_print_accept "ptype prm1" \
- "REF PROC \[(\]\[)\]" \
- "print procedure mode 1"
- setup_xfail "*-*-*"
- test_print_accept "ptype prm2" \
- "REF PROC \[(\]bool in, int out long inout\[)\] RETURNS \[(\]char\[)\]" \
- "print procedure mode 2"
- setup_xfail "*-*-*"
- test_print_accept "ptype prm3" \
- "REF PROC \[(\]pm1, ref loc\[)\] RETURNS \[(\]ref3\[)\]" \
- "print procedure mode 3"
- setup_xfail "*-*-*"
- test_print_accept "ptype prm4" \
- "\[(\] \[)\] EXCEPTIONS \[(\]ex1, ex2, ex3\[)\]" \
- "print procedure mode 4"
- setup_xfail "*-*-*"
- test_print_accept "ptype prm5" \
- "REF PROC \[(\]r11, r16 inout, r5 out\[)\] RETURNS \[(\]r2\[)\] EXCEPTIONS \[(\]ex1\[)\]" \
- "print procedure mode 5"
-
- # synchronization modes
- # FIXME: since gdb doesn't process events & buffers so far, this has be
- # filled later...
- xfail "synchronization mode handling"
-
- # timing modes
- test_print_accept "ptype DURATION" "duration"
- test_print_accept "ptype TIME" "time"
-
- # string modes
- # some tests are done in chillvars.exp
- test_print_accept "ptype strm1" "CHARS \\(5\\)" "print char string mode"
- test_print_accept "ptype strm2" "CHARS \[(\]7\[)\] VARYING" \
- "print varying char string mode"
- test_print_accept "ptype bstr1" "BOOLS \\(20\\)" "print bit string mode"
-
- test_print_accept "ptype B'000'" "BOOLS \\(3\\)" "bit string literal"
- test_print_accept "ptype B'11110000'" "BOOLS \\(8\\)" "bit string literal"
- # FIXME: adjust error message
- gdb_test "ptype B'00110211'" {.*Too-large digit.*[.]} \
- "reject invalid bitstring"
-
- # array modes
- # some tests are done in chillvars.exp
- test_print_accept "ptype arr1m" "ARRAY \\(1:100\\) set1" \
- "print array mode 1"
- test_print_accept "ptype arr2m" "ARRAY \\(1:100\\) ARRAY \\(1:100\\) set1"\
- "print array mode 2"
- test_print_accept "ptype arr3m" "ARRAY \\(0:255\\) ARRAY \\(0:65535\\) ARRAY \\(-128:127\\) set1" \
- "print array mode 3"
- setup_xfail "*-*-*"
- 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\[)\]" \
- "print array mode 4"
-
- # structure modes
- # some checks are in chillvars.exp
- # setup_xfail "*-*-*"
- test_print_accept "ptype stru1m" "STRUCT \\(.*a long,.*b long,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\).*ELSE.*ch3 CHARS \\(1\\).*ESAC.*\\)" \
- "print structure mode 1"
- #setup_xfail "*-*-*"
- test_print_accept "ptype stru2m" "STRUCT \\(.*f set1,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\) VARYING.*ELSE.*ch3 CHARS \\(0\\) VARYING.*ESAC.*\\)" \
- "print structure mode 2"
- #setup_xfail "*-*-*"
- test_print_accept "ptype stru3m" "STRUCT \\(.*f r3,.*CASE OF.*:.*ch1 CHARS \\(20\\).*ESAC.*\\)" \
- "print structure mode 3"
- # setup_xfail "*-*-*"
- 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.*\\)" \
- "print structure mode 4"
-
-
- if $passcount then {
- pass "$passcount correct modes printed"
- }
-}
-
-# various tests if locations are treated correctly
-# read access using ptype, print, whatis
-proc test_locations {} {
- global passcount
-
- set passcount 0
- verbose "testing read access to locations"
- # various location tests can be found in chillvars.exp
-
- # set locations
- test_print_accept "ptype s1l" "SET \\(aaa, bbb, ccc\\)" \
- "print mode of set location"
- test_print_accept "whatis s1l" "set1" \
- "print modename of set location"
- test_print_accept "print s1l" "ccc" "print set location"
- test_print_accept "ptype s2l" "SET \\(na = 1, nb = 34, nc = 20\\)" \
- "print mode of numbered set location"
- test_print_accept "whatis s2l" "nset1" \
- "print mode name of numbered set location"
- test_print_accept "print s2l" "nb" "print numberes set location"
-
- # range modes
- test_print_accept "ptype rl1" "ubyte \\(0:255\\)" \
- "print mode of range location"
- test_print_accept "whatis rl1" "r11" \
- "print mode name of range location"
- test_print_accept "print rl1" "3" \
- "print range location"
-
- test_print_accept "ptype rl2" "ubyte \\(0:255\\)" \
- "print mode of range location"
- test_print_accept "whatis rl2" "r11" \
- "print mode name of range location"
- test_print_accept "print rl2" "0" \
- "print range location"
-
- test_print_accept "ptype rl3" "ubyte \\(0:255\\)" \
- "print mode of range location"
- test_print_accept "whatis rl3" "r11" \
- "print mode name of range location"
- test_print_accept "print rl3" "255" \
- "print range location"
-
- test_print_accept "ptype rl5" "uint \\(0:65535\\)" \
- "print mode of range location"
- test_print_accept "whatis rl5" "r12" \
- "print mode name of range location"
- test_print_accept "print rl5" "65530" \
- "print range location"
-
- test_print_accept "ptype rl6" "uint \\(0:65535\\)" \
- "print mode of range location"
- test_print_accept "whatis rl6" "r12" \
- "print mode name of range location"
- test_print_accept "print rl6" "0" \
- "print range location"
-
- test_print_accept "ptype rl7" "uint \\(0:65535\\)" \
- "print mode of range location"
- test_print_accept "whatis rl7" "r12" \
- "print mode name of range location"
- test_print_accept "print rl7" "65535" \
- "print range location"
-
-# test_print_accept "ptype rl9" "ulong \\(0:4294967295\\)" \
-# "print mode of range location"
-# test_print_accept "whatis rl9" "r13" \
-# "print mode name of range location"
-# test_print_accept "print rl9" "128" \
-# "print range location"
-
-# test_print_accept "ptype rl10" "ulong \\(0:4294967295\\)" \
-# "print mode of range location"
-# test_print_accept "whatis rl10" "r13" \
-# "print mode name of range location"
-# test_print_accept "print rl10" "0" \
-# "print range location"
-
-# test_print_accept "ptype rl11" "ulong \\(0:4294967295\\)" \
-# "print mode of range location"
-# test_print_accept "whatis rl11" "r13" \
-# "print mode name of range location"
-# test_print_accept "print rl11" "4294967295" \
-# "print range location"
-
- test_print_accept "ptype rl13" "byte \\(-128:127\\)" \
- "print mode of range location"
- test_print_accept "whatis rl13" "r14" \
- "print mode name of range location"
- test_print_accept "print rl13" "-121" \
- "print range location"
-
- test_print_accept "ptype rl14" "byte \\(-128:127\\)" \
- "print mode of range location"
- test_print_accept "whatis rl14" "r14" \
- "print mode name of range location"
- test_print_accept "print rl14" "-128" \
- "print range location"
-
- test_print_accept "ptype rl15" "byte \\(-128:127\\)" \
- "print mode of range location"
- test_print_accept "whatis rl15" "r14" \
- "print mode name of range location"
- test_print_accept "print rl15" "127" \
- "print range location"
-
- test_print_accept "ptype rl17" "int \\(-32768:32767\\)" \
- "print mode of range location"
- test_print_accept "whatis rl17" "r15" \
- "print mode name of range location"
- test_print_accept "print rl17" "-32720" \
- "print range location"
-
- test_print_accept "ptype rl18" "int \\(-32768:32767\\)" \
- "print mode of range location"
- test_print_accept "whatis rl18" "r15" \
- "print mode name of range location"
- test_print_accept "print rl18" "-32768" \
- "print range location"
-
- test_print_accept "ptype rl19" "int \\(-32768:32767\\)" \
- "print mode of range location"
- test_print_accept "whatis rl19" "r15" \
- "print mode name of range location"
- test_print_accept "print rl19" "32767" \
- "print range location"
-
- test_print_accept "ptype rl21" "long \\(-2147483648:2147483647\\)" \
- "print mode of range location"
- test_print_accept "whatis rl21" "r16" \
- "print mode name of range location"
- test_print_accept "print rl21" "2147483643" \
- "print range location"
-
- test_print_accept "ptype rl22" "long \\(-2147483648:2147483647\\)" \
- "print mode of range location"
- test_print_accept "whatis rl22" "r16" \
- "print mode name of range location"
- test_print_accept "print rl22" "-2147483648" \
- "print range location"
-
- test_print_accept "ptype rl23" "long \\(-2147483648:2147483647\\)" \
- "print mode of range location"
- test_print_accept "whatis rl23" "r16" \
- "print mode name of range location"
- test_print_accept "print rl23" "2147483647" \
- "print range location"
-
- # powerset locations
- test_print_accept "ptype pl1" \
- "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \
- "print mode of powerset location 1"
- test_print_accept "whatis pl1" "pm1" \
- "print mode mode name of powerset location"
- test_print_accept "print pl1" \
- "\[\[\]p1:p10\[\]\]" \
- "print powerset location 1"
- test_print_accept "print pl2" {\[\]} \
- "print powerset location 2"
- test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \
- "print powerset location 3"
- test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \
- "print powerset location 4"
- test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \
- "print powerset location 5"
- test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \
- "print powerset location 6"
-
- test_print_accept "ptype pl7" \
- "POWERSET byte \\(1:8\\)" \
- "print mode of byte powerset location"
- test_print_accept "whatis pl7" "pm2" \
- "print modename of byte powerset location"
- test_print_accept "print pl7" {\[1:8\]} \
- "print powerset location 7"
-
- test_print_accept "ptype pl8" \
- "POWERSET int \\(-32768:32767\\)" \
- "print mode of int powerset location"
- test_print_accept "whatis pl8" "pm3" \
- "print modename of int powerset location"
- test_print_accept "print pl8" {\[-32768:32767\]} \
- "print powerset location 8"
-
-# test_print_accept "ptype pl9" \
-# "POWERSET long \\(-2147483648:2147483647\\)" \
-# "print mode of long powerset location"
-# test_print_accept "whatis pl9" "pm5" \
-# "print modename of long powerset location"
-# test_print_accept "print pl9" {\[-2147483648:2147483647\]} \
-# "print powerset location 9"
-
- # reference modes
- test_print_accept "ptype ref3l" "PTR" "print mode of reference location"
- # setup_xfail "*-*-*"
- test_print_accept "whatis ref3l" "ref3" \
- "print modename of reference location"
- # setup_xfail "*-*-*"
- test_print_accept "print ref3l" "ref3\\(H'.*\\)" \
- "print reference location"
- test_print_accept "ptype ref4l" "PTR" "print mode of reference location"
- # setup_xfail "*-*-*"
- test_print_accept "whatis ref4l" "ref4" \
- "print modename of reference location"
- # setup_xfail "*-*-*"
- test_print_accept "print ref4l" "ref4\\(H'.*\\)" \
- "print reference location"
- test_print_accept "ptype ref5l" "PTR" "print mode of reference location"
- test_print_accept "whatis ref5l" "PTR" \
- "print modename of reference location"
- test_print_accept "print ref5l" "PTR\\(H'.*\\)" \
- "print reference location"
-
- # dereference a little bit..
- test_print_accept "print ref6l->syn_int" "42" \
- "dereference reference to synmode location"
- test_print_accept "print ref7l->int" "-42" \
- "dereference reference to predefined mode location"
- test_print_accept "print ref8l->pm1" \
- "\[\[\]p1:p10\[\]\]" \
- "dereference reference to newmode location"
-
- # synchronization mode locations
- # FIXME: synchronization modes are not supported so far...
- xfail "no synchronization mode location support, not implemented yet"
-
- # timing mode locations
- # FIXME: callbacks to abstime, inttime not implemented
- xfail "timing modes not implemented properly yet"
-
- # char string locations
- # some tests are don in chillvars.exp
- test_print_accept "ptype strl1" \
- "CHARS \\(7\\) VARYING" \
- "print varying string location"
- test_print_accept "whatis strl1" "strm2" \
- "print string locationa mode name"
- test_print_accept "print strl1" \
- {\"hansi\^\(0\)\"} \
- "print string location"
- # string elements
- test_print_accept "print strl1(0)" "\'h\'" \
- "print string element 1"
- test_print_accept "print strl1(5)" {'\^[(]0[)]'} \
- "print string element 2"
- test_print_accept "print strl1(3)" "\'s\'" \
- "print string element 3"
- test_print_accept "ptype strl1(0)" "char" \
- "print mode of string element"
- # slices
- test_print_accept "print strl1(3:4)" "\"si\"" \
- "print string slice 1"
- test_print_accept "print strl1(0:5)" \
- {\"hansi\^\(0\)\"} \
- "print string slice 2"
- test_print_accept "print strl1(0:0)" "\"h\"" \
- "print string slice 3"
- test_print_accept "print strl1(0 up 6)" \
- {\"hansi\^\(0\)\"} \
- "print string slice 4"
- # FIXME: adjust error message, when implented
- gdb_test "print strl1(6 up 1)" \
- ".*slice.*out of range.*" \
- "print invalid string slice length"
- gdb_test "print strl1(-1 up 5)" \
- ".*slice.*out of range.*" \
- "print invalid string slice length"
- gdb_test "print strl1(-1:5)" \
- ".*slice.*out of range.*" \
- "print invalid string slice"
- gdb_test "print strl1(-1:7)" \
- ".*slice.*out of range.*" \
- "print invalid string slice"
- gdb_test "print strl1(0 up -1)" \
- ".*slice.*out of range.*" \
- "print invalid string slice length"
- gdb_test "print strl1(0 up 0)" {""}
-
- # bitstring locations
- test_print_accept "ptype bstr1" \
- "BOOLS \\(20\\)" \
- "print mode of bitstring location"
- test_print_accept "whatis bstrl1" "bstr1" \
- "print mode name of bitstring location"
- test_print_accept "print bstrl1" \
- "B'10101010101010101010'" \
- "print bitstring location"
-
- test_print_accept "ptype bstrl1(0)" "bool|BOOL" \
- "print mode of bitstring element"
- test_print_accept "print bstrl1(0)" "TRUE" \
- "print bitstring element 1"
- test_print_accept "print bstrl1(19)" "FALSE" \
- "print bitstring element 2"
- test_print_accept "print bstrl1(10)" "TRUE" \
- "print bitstring element 3"
-
- test_print_accept "print bstrl1(0:19)" \
- "B'10101010101010101010'" \
- "print bitstring location slice 1"
- test_print_accept "print bstrl1(0:0)" \
- "B'1'" \
- "print bitstring location slice 2"
- test_print_accept "print bstrl1(3:9)" \
- "B'0101010'" \
- "print bitstring location slice 3"
- test_print_accept "print bstrl1(0 up 20)" \
- "B'10101010101010101010'" \
- "print bitstring location slice 4"
- test_print_accept "print bstrl1(19 up 1)" \
- "B'0'" \
- "print bitstring location slice 5"
- gdb_test "print bstrl1(20 up 1)" \
- ".*slice out of range.*" \
- "print invalid bitstring slice (20 up 1)"
- gdb_test "print bstrl1(-4:5)" \
- ".*slice out of range.*" \
- "print invalid bitstring slice (-4:5)"
- gdb_test "print bstrl1(-1:up 1)" \
- ".*invalid expression syntax.*" \
- "print invalid bitstring slice (-1:ip 1)"
- gdb_test "print bstrl1(-1:20)" \
- ".*slice out of range.*" \
- "print invalid bitstring slice (-1:20)"
- gdb_test "print bstrl1(0 up -1)" \
- ".*slice out of range.*" \
- "print invalid bitstring slice (0 up -1)"
- test_print_accept "print bstrl1(4 up 0)" "B''"
-
- # array mode locations
- gdb_test_exact "ptype arrl1" \
- "ARRAY (1:100) set1" \
- "print mode of array location"
- gdb_test "whatis arrl1" "arr1m" \
- "print mode name of array location"
- gdb_test_exact "print arrl1" {[(1:100): aaa]} \
- "print array location"
- test_print_accept "ptype arrl1(1)" \
- "SET \\(aaa, bbb, ccc\\)" \
- "print mode of array element"
- gdb_test_exact "print arrl3" \
- {[(1:5): [(1:3): [(1:2): -2147483648]]]} \
- "print array location 2"
- gdb_test_exact "print arrl3(1)" \
- {[(1:3): [(1:2): -2147483648]]} \
- "print array location 3"
- gdb_test_exact "ptype arrl3(1)" \
- {ARRAY (1:3) ARRAY (1:2) long} \
- "print mode of array element"
- test_print_accept "print arrl3(5)" \
- {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \
- "print array location 4"
- test_print_accept "print arrl3(1,1)" \
- {\[\(1:2\): -2147483648\]} \
- "print array location 5"
- test_print_accept "ptype arrl3(1,1)" \
- {ARRAY \(1:2\) long} \
- "print mode of array element"
- test_print_accept "print arrl3(5,3)" \
- {\[\(1:2\): -2147483648\]} \
- "print array location 6"
- test_print_accept "print arrl3(1,1,1)" \
- "-2147483648" \
- "print array location 7"
- test_print_accept "print arrl3(5,3,2)" \
- "-2147483648" \
- "print array location 8"
- test_print_accept "print arrl3(1)(3)(2)" \
- "-2147483648" \
- "print array location 9"
-
- # reject the following range fails
- # FIXME: adjust error messages
- gdb_test "print arrl3(-1)" \
- ".*out of range.*" \
- "check invalid array indices 1"
- gdb_test "print arrl3(6)" \
- ".*out of range.*" \
- "check invalid array indices 2"
- gdb_test "print arrl3(0,0)" \
- ".*out of range.*" \
- "check invalid array indices 3"
- gdb_test "print arrl3(1,0)" \
- ".*out of range.*" \
- "check invalid array indices 4"
- gdb_test "print arrl3(1,4)" \
- ".*out of range.*" \
- "check invalid array indices 5"
- gdb_test "print arrl3(6,4)" \
- ".*out of range.*" \
- "check invalid array indices 6"
- gdb_test "print arrl3(1,1,0)" \
- ".*out of range.*" \
- "check invalid array indices 7"
- gdb_test "print arrl3(6,4,0)" \
- ".*out of range.*" \
- "check invalid array indices 8"
- gdb_test "print arrl3(1,1,3)" \
- ".*out of range.*" \
- "check invalid array indices 9"
-
- gdb_test "print arrl3(0)(0)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 10"
- gdb_test "print arrl3(1)(0)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 11"
- gdb_test "print arrl3(1)(4)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 12"
- gdb_test "print arrl3(6)(4)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 13"
- gdb_test "print arrl3(1)(1)(0)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 14"
- gdb_test "print arrl3(6)(4)(0)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 15"
- gdb_test "print arrl3(1)(1)(3)" \
- ".* array or string index out of range.*" \
- "check invalid array indices 16"
-
- # slices
- test_print_accept "print arrl4(1:3)" \
- {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \
- "print array slice 1"
- test_print_accept "ptype arrl4(1:3)" \
- {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \
- "print mode of array slice"
-# The next one is bogus:
-# test_print_accept "print arrl4(5, 2:3, 1)" \
-# # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \
-# {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \
-# "print array slice 2"
- test_print_accept "print arrl4(1 up 4)" \
- {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \
- "print array slice 3"
-# The next two are bogus:
-# test_print_accept "print arrl4(3, 2 up 1)" \
-# {\[\(2:3\): \[\(1:2\): 100\]\]} \
-# "print array slice 4"
-# test_print_accept "print arrl4(1:2, 1 up 1, 2)" \
-# {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \
-# "print array slice 4"
- # reject invalid slices
- # FIXME: adjust error messages
- gdb_test "print arrl4(5:6)" \
- ".*slice out of range.*" \
- "check invalid range 1"
- gdb_test "print arrl4(0:1)" \
- ".*slice out of range.*" \
- "check invalid range 2"
- gdb_test "print arrl4(0:6)" \
- ".*slice out of range.*" \
- "check invalid range 3"
- gdb_test "print arrl4(3:2)" \
- ".*slice out of range.*" \
- "check invalid range 4"
- gdb_test "print arrl4(1,3:4)" \
- ".*syntax error.*" \
- "check invalid range 5"
- gdb_test "print arrl4(1,0:1)" \
- ".*syntax error.*" \
- "check invalid range 6"
- gdb_test "print arrl4(1,0:4)" \
- ".*syntax error.*" \
- "check invalid range 7"
- gdb_test "print arrl4(1,3:2)" \
- ".*syntax error.*" \
- "check invalid range 8"
- gdb_test "print arrl4(5 up 2)" \
- ".*slice out of range.*" \
- "check invalid range 9"
- gdb_test "print arrl4(-1 up 1)" \
- ".*slice out of range.*" \
- "check invalid range 10"
- gdb_test "print arrl4(-1 up 7)" \
- ".*slice out of range.*" \
- "check invalid range 11"
- gdb_test "print arrl4(1 up 0)" \
- ".*slice out of range.*" \
- "check invalid range 12"
- gdb_test "print arrl4(1,3 up 1)" \
- ".*syntax error.*" \
- "check invalid range 13"
- gdb_test "print arrl4(1,-1 up 1)" \
- ".*syntax error.*" \
- "check invalid range 14"
- gdb_test "print arrl4(1,-1 up 5)" \
- ".*syntax error.*" \
- "check invalid range 15"
- gdb_test "print arrl4(1,2 up 0)" \
- ".*syntax error.*" \
- "check invalid range 16"
-
- # structure modes
- # some tests are in chillvars.exp
- # FIXME: no tag processing implemented do maybe adjust these tests
- setup_xfail "*-*-*"
- test_print_accept "ptype stru1m" \
- "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \
- "print mode of structure location 1"
- test_print_accept "whatis strul1" "stru1m" \
- "print mode name of structure location 1"
- setup_xfail "*-*-*"
- test_print_accept "print strul1" \
- {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \
- "print structure location 1"
- test_print_accept "print strul1.a" \
- "-2147483648" \
- "print field of structure location 1"
- test_print_accept "print strul1.b" "42" \
- "print field of structure location 1"
- test_print_accept "print strul1.ch1" \
- "\"12345678900987654321\"" \
- "print field of structure location 1"
- # setup_xfail "*-*-*"
- test_print_accept "print strul1.ch2" \
- "\"1234567890\"" \
- "print field of structure location 1"
- # setup_xfail "*-*-*"
- test_print_accept "print strul1.ch3" \
- "\"1\"" \
- "print field of structure location 1"
-
- if $passcount then {
- pass "$passcount correct locations printed"
- }
-}
-
-# This is chill/9434
-
-proc test_9434 {} {
- global passcount
-
- verbose "testing pr-9434"
-
- test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)"
-}
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if [set_lang_chill] then {
- test_modes
- test_locations
- test_9434
-} else {
- warning "$test_name tests suppressed."
-}
+# 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.exp b/gdb/testsuite/gdb.chill/tests2.exp
index 1e47e811ca9..a8df589cc1d 100644
--- a/gdb/testsuite/gdb.chill/tests2.exp
+++ b/gdb/testsuite/gdb.chill/tests2.exp
@@ -1,271 +1,271 @@
-# Copyright 1992, 1995, 1996, 1997, 1999 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
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set prms_id 0
-set bug_id 0
-
-# Set the current language to chill. This counts as a test. If it
-# fails, then we skip the other tests.
-
-set testfile "tests2"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-global infinity
-if [istarget "i*86-*-sysv4*"] then {
- set infinity "inf"
-} else {
- set infinity "Infinity"
-}
-
-proc set_lang_chill {} {
- global gdb_prompt
- global binfile objdir subdir
-
- if ![file exists $objdir/$subdir/$binfile] then {
- return 0
- }
- verbose "loading file '$objdir/$subdir/$binfile'"
- gdb_load $objdir/$subdir/$binfile
-
- send_gdb "set language chill\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {}
- timeout { fail "set language chill (timeout)" ; return 0 }
- }
-
- send_gdb "show language\n"
- gdb_expect {
- -re ".* source language is \"chill\".*$gdb_prompt $" {
- pass "set language to \"chill\""
- send_gdb "break dummyfunc\n"
- gdb_expect {
- -re ".*$gdb_prompt $" {
- send_gdb "run\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- return 1
- }
- timeout {
- fail "can't set breakpoint (timeout)"
- return 0
- }
- }
- }
- -re ".*$gdb_prompt $" {
- fail "setting language to \"chill\""
- return 0
- }
- timeout {
- fail "can't show language (timeout)"
- return 0
- }
- }
-}
-
-# checks if structure was accessed correctly
-proc test_write { args } {
- global gdb_prompt
-
- if [llength $args]==5 then {
- set message [lindex $args 4]
- set extended [lindex $args 3]
- set matchval [lindex $args 2]
- } elseif [llength $args]==4 then {
- set message [lindex $args 3]
- set matchval [lindex $args 2]
- set extended ""
- } elseif [llength $args]==3 then {
- set message [lindex $args 2]
- set extended ""
- } else {
- warning "test ($args) write called with wrong number of arguments"
- return
- }
-
- set location [lindex $args 0]
- set value [lindex $args 1]
- if ![info exists matchval] then {
- set matchval $value
- }
- verbose "loc: $location, val: $value, msg: $message, ext: $extended, match: $matchval"
-
- verbose "setting var $value..."
- send_gdb "set var $location.m$extended := $value\n"
- gdb_expect -re ".*$gdb_prompt $" {}
- gdb_test "print $location" \
- ".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\
- "$message"
-}
-
-# test write access from gdb (setvar x:=y) from gdb
-proc write_access { } {
- global infinity
-
- verbose "testing write access to locations"
-
- # discrete modes
- test_write b1 127 "byte write 1"
- test_write b1 -128 "byte write 2"
- test_write b1 0 "byte write 3"
- test_write ub1 255 "ubyte write 1"
- test_write ub1 0 "ubyte write 2"
- test_write ub1 42 "ubyte write 3"
- test_write i1 32767 "int write 1"
- test_write i1 -32768 "int write 2"
- test_write i1 0 "int write 3"
- test_write ui1 65535 "uint write 1"
- test_write ui1 0 "uint write 2"
- test_write ui1 123 "uint write 3"
- test_write l1 2147483647 "long write 1"
- test_write l1 -2147483648 "long write 2"
- test_write l1 0 "long write 3"
- test_write ul1 4294967295 "ulong write 1"
- test_write ul1 0 "ulong write 2"
- test_write ul1 1000000 "ulong write 3"
- test_write bo1 FALSE "bool write 1"
- test_write bo1 TRUE "bool write 2"
- test_write c1 \"1234\" "char write 1"
- test_write c2 \"1234567\" "char write 2"
- test_write c3 \"654321\" "char write 3"
- test_write c4 C'65' 'e' "char write 4"
- test_write bi1 B'10100101' "bitstring write 1"
- test_write bi2 B'0101001010' "bitstring write 2"
- test_write se1 a "set write 1"
- test_write se1 h "set write 2"
- # The following two use numbered sets with too-large values.
- setup_xfail "*-*-*"
- test_write nse1 nb "numbered set write 1"
- setup_xfail "*-*-*"
- test_write nse1 nc "numbered set write 2"
- test_write r1 127 "range write 1"
- test_write r2 32767 "range write 2"
- test_write r3 2147483647 "range write 3"
-
- # powerset modes
- test_write p1 {[pa:ph]} {\[pa:ph\]} "powerset write 1"
- test_write p1 {[pa, pc:pf, ph]} {\[pa, pc:pf, ph\]} "powerset write 2"
- test_write p1 {[pa, pc, pe, pg]} {\[pa, pc, pe, pg\]} "powerset write 3"
- test_write p1 {[]} {\[\]} "powerset write 4"
- test_write p2 {[1:32]} {\[1:32\]} "powerset write 5"
- test_write p2 {[1, 3:30, 32]} {\[1, 3:30, 32\]} "powerset write 6"
- 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\]} \
- "powerset write 7"
- test_write p2 {[]} {\[\]} "powerset write 8"
-
-# Fixme: this should be rejected by gnuchill
-# test_write p3 {[-2147483648:2147483647]} {\[-2147483648:2147483647\]} \
-# "powerset write 9"
-# test_write p3 {[-2147483648, -1000000:1000000, 2147483647]} \
-# {\[-2147483648, -1000000:1000000, 2147483647\]} \
-# "powerset write 10"
-# test_write p3 {[-99, -97, -95, 1001, 1003, 1005]} \
-# {\[-99, -97, -95, 1001, 1003, 1005\]} "powerset write 11"
-# test_write p3 {[]} {\[\]} "powerset write 12"
-
- # reference modes
- test_write ref1 ->ref1 {H'[0-9a-fA-F]+} "reference write 1"
- test_write ref2 ->b1 {H'[0-9a-fA-F]+} "reference write 2"
- test_write ref1 NULL "reference write 3"
- test_write ref2 NULL "reference write 4"
-
- # procedure modes
- test_write pr1 NULL "procefure write 1"
- # FIXME: remove when NULL is understood
- test_write pr1 0 NULL "procefure write 2"
- test_write pr1 dummyfunc {H'[0-9a-fA-F]+ <dummyfunc>} "procedure write 3"
-
- # timing modes, FIXME when callbacks to timefunctions are implemented
- #test_write ti1 abstime(1970, 3, 12, 10, 43, 0) {} "time write 1"
- #test_write ti2 <set somehow a duration>
- xfail "timing modes not implemented yet"
-
- # real modes
- # This ones
- test_write re1 42.03 {42.0[0-9]*} "real write 1"
- test_write re1 0 "real write 2"
- test_write re1 "1e+38" {1e\+38|1\.0[0-9]*e\+38|9\.9[0-9]*e\+37} \
- "real write 3"
- setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
- test_write re1 "1e+39" $infinity "real write 4"
- test_write re2 42.03 {42.0[0-9]*} "real write 5"
- test_write re2 0 "real write 6"
- test_write re2 "1e+308" {1e\+308} "real write 7"
- setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
- test_write re2 "1e+309" $infinity "real write 8"
- # array modes
- test_write arrl1 {[(1:3): [(1:2): -128]]} {\[\(1:3\): \[\(1:2\): -128\]\]}\
- "array write 1"
- test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
- "array write 2"
- 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\]\]}\
- "array write 3"
- test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
- "array write 4"
- setup_xfail "*-*-*"
- # Bogus test case - type mismatch?
- test_write arrl1 {[(1): 127, (2): -128]} "array write 5"
- test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
- "array write 6"
-
- # structure modes
- test_write strul1 {[.a: -32768, .b: 32767, .ch: "ZZZZ"]} \
- {\[\.a: -32768, \.b: 32767, \.ch: \"ZZZZ\"\]} \
- "structure write 1"
- test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
- {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
- "structure write 2"
- test_write strul1 -32768 {\[\.a: -32768, \.b: 0, \.ch: \"0000\"\]} \
- {.a} "structure write 3"
- test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
- {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
- "structure write 4"
- test_write strul1 -32768 {\[\.a: 0, \.b: -32768, \.ch: \"0000\"\]} \
- {.b} "structure write 5"
- test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
- {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
- "structure write 6"
- test_write strul1 \"HUGO\" {\[\.a: 0, \.b: 0, \.ch: \"HUGO\"\]} \
- {.ch} "structure write 7"
-}
-
-# Start with a fresh gdb.
-
-set binfile "tests2.exe"
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if [set_lang_chill] then {
- write_access
-} else {
- warning "$test_name tests suppressed."
-}
+# 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]+ <dummyfunc>} "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 <set somehow a duration>
+# 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.exp b/gdb/testsuite/gdb.chill/tuples.exp
index 0efea79eaa9..ba085392297 100644
--- a/gdb/testsuite/gdb.chill/tuples.exp
+++ b/gdb/testsuite/gdb.chill/tuples.exp
@@ -1,161 +1,161 @@
-# Copyright 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile "tuples"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- runto tuples.ch:40
-
- gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]}
- gdb_test_exact "set v_arri := \[ 33, 44, 55, 66, 77 \]" {}
- gdb_test_exact "print v_arri" {= [(1): 33, (2): 44, (3): 55, (4): 66, (5): 77]} "after assignment 1 to v_arri"
- gdb_test_exact "set v_arri := \[-33, -44, -55, -66, -77\]" {}
- gdb_test_exact "print v_arri" {= [(1): -33, (2): -44, (3): -55, (4): -66, (5): -77]} {after assignment 2 to v_arri}
-
- gdb_test_exact "print v_arrui" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
- gdb_test_exact "set v_arrui := \[ 11, 11, 11, 11, 11 \]" {}
- gdb_test_exact "print v_arrui" {= [(1:5): 11]} "after assignment to v_arrui"
-
- gdb_test_exact "print v_arrb" {= [(1): -3, (2): -4, (3): -5, (4): -6, (5): -7]}
-
- gdb_test_exact "set v_arrb := \[ -9, -8, -7, -6, -5 \]" {}
- gdb_test_exact "print v_arrb" {= [(1): -9, (2): -8, (3): -7, (4): -6, (5): -5]} "after assignment to v_arrb"
-
- gdb_test_exact "print v_arrub" {= [(1): 3, (2): 4, (3): 5, (4): 6, (5): 7]}
- gdb_test_exact "set v_arrub := \[ 77, 77, 77, 77, 77 \]" {}
- gdb_test_exact "print v_arrub" {= [(1:5): 77]} "v_arrub after assignment"
-
- gdb_test_exact "print j" {= 4}
- gdb_test_exact "print j := 3+4" {= 7}
- gdb_test_exact "print j := r1(3)" {= 3}
-
- gdb_test_exact "print v_arrc" {= [(1): '1', (2): '2', (3): '3', (4): '4', (5): '5']}
- gdb_test_exact "set v_arrc := \[ 'a', 'b', 'c', 'd', 'e' \]" {}
- gdb_test_exact "print v_arrc" {= [(1): 'a', (2): 'b', (3): 'c', (4): 'd', (5): 'e']} "v_arrc after assignment"
-
- gdb_test_exact "print v_ps" {= [1, 3, 5]}
- gdb_test_exact "set v_ps := \[ 2, 4 \]" {}
- gdb_test_exact "print v_ps" {= [2, 4]} {v_ps after assignment}
- gdb_test_exact "print v_ps := \[\]" {= []} {assign [] to v_ps}
-
- gdb_test_exact "print m_arri\[1, 2, 3, 4, 5\]" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
- gdb_test_exact "print m_arrub\[45, 46, 47, 48, 49\]" {= [(1): 45, (2): 46, (3): 47, (4): 48, (5): 49]}
-
- gdb_test_exact "print v_cv" {= "foo"}
- gdb_test_exact "set v_cv := \"foo-bar\"" {}
- gdb_test_exact "print v_cv" {= "foo-bar"} "v_cv after assignment"
- gdb_test_exact "set v_cv(3) := ' '" {}
- gdb_test_exact "print v_cv" {= "foo bar"} "v_cv after element assignment"
-
- gdb_test_exact "print v_arrbool" {= [(1): TRUE, (2): FALSE, (3): TRUE, (4): FALSE, (5): TRUE]}
- gdb_test_exact "set v_arrbool := \[ false, false, false, false, false \]" {}
- gdb_test_exact "print v_arrbool" {= [(1:5): FALSE]} "v_arrbool after assignment 1"
- gdb_test_exact "set v_arrbool := \[true, true, true, true, true\]" {}
- gdb_test_exact "print v_arrbool" {= [(1:5): TRUE]} "v_arrbool after assignment 2"
- gdb_test_exact "set v_arrbool(3) := false" {}
- gdb_test_exact "print v_arrbool" {= [(1:2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after element assignment"
-
- gdb_test_exact "set v_arrbool(1 up 2) := \[ false, true \]" {}
- gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after slice assignment 1"
- gdb_test_exact "set v_arrbool(3 : 5) := \[ true, true, false \]" {}
- gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
-
- gdb_test_exact "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]" {}
- gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment"
- gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment"
-
-# These tests are from Cygnus PR chill/5024:
- gdb_test "break printdow" ""
- gdb_test "continue" ""
- gdb_test_exact "set var w:= dow\[monday\]" {}
- gdb_test "print w" " = \\\[monday\\\]" \
- "print bitstring after assignment"
- gdb_test_exact "set var w:=\[\]" {}
- gdb_test "print w" " = \\\[\\\]" \
- "print bitstring after assignment of \[\]"
-
-# These tests are from Cygnus PR chill/8643:
- runto tuples.ch:40
- gdb_test_exact "set var vs1 := \[ \"foo\", 41, \[ b \] \]" {}
- gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \
- "print vs1 after tuple assign 1"
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]" {}
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \
- "print vs1 after tuple assign 2"
-
- gdb_test_exact "set var \$i := m_s1\[\"foo\", 42, \[a \]\]" {}
- gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \
- "print \$i after tuple assign 1"
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]" {}
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \
- "print \$i after tuple assign 2"
-
- gdb_test_exact "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]" {}
- gdb_test_exact "print vs2" \
- { = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
- "print vs2 after tuple assign 1"
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]" {}
- setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
- gdb_test_exact "print vs2" \
- { = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
- "print vs2 after tuple assign 2"
-
- gdb_test_exact "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]" {}
- gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \
- "print vs3 after tuple assign"
- gdb_test_exact "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]" {}
- gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \
- "print \$k after tuple assign"
-
-}
-
-do_tests
+# 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.exp b/gdb/testsuite/gdb.chill/xstruct.exp
index e64fcea3005..f70e6c83d72 100644
--- a/gdb/testsuite/gdb.chill/xstruct.exp
+++ b/gdb/testsuite/gdb.chill/xstruct.exp
@@ -1,66 +1,66 @@
-# Copyright 1992, 1994, 1997, 1999 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
-
-# This file was written by Per Bothner. (bothner@cygnus.com)
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-if [skip_chill_tests] then { continue }
-
-set testfile2 "xstruct-grt"
-set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
-set objfile2 ${objdir}/$subdir/${testfile2}.o
-if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
- perror "Couldn't compile ${srcfile2}"
- return -1
-}
-
-set testfile "xstruct"
-set srcfile ${srcdir}/$subdir/${testfile}.ch
-set binfile ${objdir}/${subdir}/${testfile}.exe
-if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
- perror "Couldn't compile ${srcfile}"
- return -1
-}
-
-proc do_tests {} {
- global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
-
- set prms_id 0
- set bug_id 0
-
- # Start with a fresh gdb.
-
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load $binfile
-
- gdb_test "set language chill" ""
-
- gdb_test "set var \$i := m_x\[\]" ""
- gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]}
-
- gdb_test "set var \$j := m_y\[\]" ""
- gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]}
-}
-
-do_tests
+# 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 cccc82a3f5d..6c9be34cf5a 100644
--- a/gdb/testsuite/gdb.fortran/exprs.exp
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -17,7 +17,7 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
-# This file was adapted from Chill tests by Stan Shebs (shebs@cygnus.com).
+# This file was adapted from (OBSOLETE) 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 13bec5d3be7..175549ce11f 100644
--- a/gdb/testsuite/gdb.fortran/types.exp
+++ b/gdb/testsuite/gdb.fortran/types.exp
@@ -17,7 +17,7 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
-# This file was adapted from Chill tests by Stan Shebs (shebs@cygnus.com).
+# This file was adapted from (OBSOLETE) Chill tests by Stan Shebs (shebs@cygnus.com).
if $tracelevel then {
strace $tracelevel
diff --git a/gdb/testsuite/gdb.hp/configure b/gdb/testsuite/gdb.hp/configure
index e01b9625989..cb6e184afda 100755
--- a/gdb/testsuite/gdb.hp/configure
+++ b/gdb/testsuite/gdb.hp/configure
@@ -28,6 +28,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -142,6 +143,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -312,6 +314,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -477,12 +484,16 @@ 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"
+if test -z "$sitefile"; then
+ 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
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -571,7 +582,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:575: checking host system type" >&5
+echo "configure:586: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -592,7 +603,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:596: checking target system type" >&5
+echo "configure:607: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -610,7 +621,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:614: checking build system type" >&5
+echo "configure:625: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -633,16 +644,7 @@ test "$host_alias" != "$target_alias" &&
program_prefix=${target_alias}-
-# Directories to use in all configurations.
-configdirs="gdb.aCC \
- gdb.base-hp \
- gdb.compat \
- gdb.defects \
- gdb.objdbg \
- gdb.threads-hp"
-
-# configure the subdirectories too
-subdirs="$configdirs"
+subdirs="gdb.aCC gdb.base-hp gdb.compat gdb.defects gdb.objdbg"
trap '' 1 2 15
@@ -938,7 +940,7 @@ if test "$no_recursion" != yes; then
esac
done
- for ac_config_dir in $configdirs; do
+ for ac_config_dir in gdb.aCC gdb.base-hp gdb.compat gdb.defects gdb.objdbg; do
# Do not complain, so a configure script can configure whichever
# parts of a large source tree are present.
diff --git a/gdb/testsuite/gdb.hp/configure.in b/gdb/testsuite/gdb.hp/configure.in
index dd84c343bab..3993d1c4c41 100644
--- a/gdb/testsuite/gdb.hp/configure.in
+++ b/gdb/testsuite/gdb.hp/configure.in
@@ -12,6 +12,6 @@ AC_SUBST(CC)
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
AC_CANONICAL_SYSTEM
-AC_CONFIG_SUBDIRS(gdb.aCC gdb.base-hp gdb.compat gdb.defects gdb.objdbg gdb.threads-hp)
+AC_CONFIG_SUBDIRS(gdb.aCC gdb.base-hp gdb.compat gdb.defects gdb.objdbg)
AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in b/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in
deleted file mode 100644
index 240b627a2d2..00000000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in
+++ /dev/null
@@ -1,27 +0,0 @@
-VPATH = @srcdir@
-srcdir = @srcdir@
-
-EXECUTABLES = usrthbasic usrthcore usrthfork
-
-all:
- @echo "Nothing to be done for all..."
-
-info:
-install-info:
-dvi:
-install:
-uninstall: force
-installcheck:
-check:
-
-clean mostlyclean:
- -rm -f *~ *.o *.ci
- -rm -f core $(EXECUTABLES)
-
-distclean maintainer-clean realclean: clean
- -rm -f Makefile config.status config.log
- -rm -f *-init.exp
- -rm -fr *.log summary detail *.plog *.sum *.psum site.*
-
-Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
- $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/configure b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure
deleted file mode 100755
index 90fa7554234..00000000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/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=usrthbasic.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 <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/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 <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > 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 <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $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 <<EOF
-
-EOF
-cat >> $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.hp/gdb.threads-hp/configure.in b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in
deleted file mode 100644
index 87fd81b51c8..00000000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory. For more information, check
-dnl any existing configure script.
-
-AC_PREREQ(2.5)
-AC_INIT(usrthbasic.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.java/jv-print.exp b/gdb/testsuite/gdb.java/jv-print.exp
index fb5dad73a28..00da1f33ad4 100644
--- a/gdb/testsuite/gdb.java/jv-print.exp
+++ b/gdb/testsuite/gdb.java/jv-print.exp
@@ -89,8 +89,8 @@ proc test_integer_literals_rejected {} {
global gdb_prompt
test_print_reject "p 0x"
- gdb_test "p ''" "Empty character constant\\."
- gdb_test "p '''" "Empty character constant\\."
+ gdb_test "p ''" "Empty character constant"
+ gdb_test "p '''" "Empty character constant"
test_print_reject "p '\\'"
# Note that this turns into "p '\\\'" at gdb's input.
diff --git a/gdb/testsuite/gdb.threads/print-threads.c b/gdb/testsuite/gdb.threads/print-threads.c
new file mode 100644
index 00000000000..341ee0aa35a
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/print-threads.c
@@ -0,0 +1,58 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+void *thread_function(void *arg); /* Pointer to function executed by each thread */
+
+int slow = 0;
+
+#define NUM 5
+
+int main() {
+ int res;
+ pthread_t threads[NUM];
+ void *thread_result;
+ int args[NUM];
+ int i;
+
+ for (i = 0; i < NUM; i++)
+ {
+ args[i] = i;
+ res = pthread_create(&threads[i], NULL, thread_function, (void *)&args[i]);
+ }
+
+ for (i = 0; i < NUM; i++)
+ res = pthread_join(threads[i], &thread_result);
+
+ printf ("Done\n");
+
+ if (slow)
+ sleep (4);
+
+ exit(EXIT_SUCCESS);
+}
+
+void *thread_function(void *arg) {
+ int my_number = *(int *)arg;
+ int rand_num;
+
+ printf ("Print 1, thread %d\n", my_number);
+ sleep (1);
+
+ if (slow)
+ {
+ printf ("Print 2, thread %d\n", my_number);
+ sleep (1);
+ printf ("Print 3, thread %d\n", my_number);
+ sleep (1);
+ printf ("Print 4, thread %d\n", my_number);
+ sleep (1);
+ printf ("Print 5, thread %d\n", my_number);
+ sleep (1);
+ }
+
+ printf("Bye from %d\n", my_number);
+ pthread_exit(NULL);
+}
+
diff --git a/gdb/testsuite/gdb.threads/print-threads.exp b/gdb/testsuite/gdb.threads/print-threads.exp
new file mode 100644
index 00000000000..09c3f8ada80
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/print-threads.exp
@@ -0,0 +1,156 @@
+# Copyright (C) 1996, 1997, 2002 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
+
+# This file was written by Daniel Jacobowitz <drow@mvista.com>
+# (parts based on pthreads.exp by Fred Fish (fnf@cygnus.com).
+#
+# It tests miscellaneous actions with multiple threads, including
+# handling for thread exit.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "print-threads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# regexp for "horizontal" text (i.e. doesn't include newline or
+# carriage return)
+set horiz "\[^\n\r\]*"
+
+set built_binfile 0
+
+# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
+if [istarget "*-*-linux*"] then {
+ set possible_libs "-lpthread -lpthreads -lthread"
+} else {
+ set possible_libs "-lpthreads -lpthread -lthread"
+}
+
+set why_msg "unrecognized error"
+foreach lib $possible_libs {
+ set options "debug"
+ lappend options "incdir=${objdir}/${subdir}"
+ lappend options "libs=$lib"
+ set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
+}
+if {$built_binfile == "0"} {
+ unsupported "Couldn't compile ${srcfile}, ${why_msg}"
+ return -1
+}
+
+# Now we can proceed with the real testing.
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+#gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+# We'll need this when we send_gdb a ^C to GDB. Need to do it before we
+# run the program and gdb starts saving and restoring tty states.
+# On Ultrix, we don't need it and it is really slow (because shell_escape
+# doesn't use vfork).
+if ![istarget "*-*-ultrix*"] then {
+ gdb_test "shell stty intr '^C'" ""
+}
+
+proc test_all_threads { name kill } {
+ global gdb_prompt
+
+ set i 0
+ set j 0
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint \[0-9\]+, thread_function \\(arg=.*\\) at .*print-threads.c:\[0-9\]+.*$gdb_prompt" {
+ set i [expr $i + 1]
+ pass "Hit thread_function breakpoint, $i ($name)"
+ send_gdb "continue\n"
+ exp_continue
+ }
+ -re "Breakpoint \[0-9\]+, .* kill \\(.*\\) .*$gdb_prompt" {
+ set j [expr $j + 1]
+ if { $kill == 1 } {
+ pass "Hit kill breakpoint, $j ($name)"
+ } else {
+ fail "Hit kill breakpoint, $j ($name) (unexpected)"
+ }
+ send_gdb "continue\n"
+ exp_continue
+ }
+ -re "Program exited normally\\.\[\r\n\]+$gdb_prompt" {
+ pass "program exited normally"
+ if {$i == 5} {
+ pass "all threads ran once ($name)"
+ } else {
+ fail "all threads ran once ($name) (total $i threads ran)"
+ }
+ }
+ -re "$gdb_prompt" {
+ fail "Running threads ($name) (unknown output)"
+ }
+ timeout {
+ fail "Running threads ($name) (timeout)"
+ }
+ }
+}
+
+runto_main
+gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\."
+gdb_test "set var slow = 0" ""
+test_all_threads "fast" 0
+
+runto_main
+gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (2)"
+gdb_test "set var slow = 1" ""
+test_all_threads "slow" 0
+
+runto_main
+gdb_test "break thread_function" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*print-threads.c, line \[0-9\]*\\." "break thread_function (3)"
+gdb_test "set var slow = 1" "" "set var slow = 1 (2)"
+gdb_test "break kill" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+"
+test_all_threads "slow with kill breakpoint" 1
+
+return 0
diff --git a/gdb/testsuite/gdb.threads/schedlock.c b/gdb/testsuite/gdb.threads/schedlock.c
new file mode 100644
index 00000000000..df361d0e0a7
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/schedlock.c
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+void *thread_function(void *arg); /* Pointer to function executed by each thread */
+
+#define NUM 5
+
+int args[NUM+1];
+
+int main() {
+ int res;
+ pthread_t threads[NUM];
+ void *thread_result;
+ int i;
+
+ for (i = 0; i < NUM; i++)
+ {
+ args[i] = 1;
+ res = pthread_create(&threads[i], NULL, thread_function, (void *)i);
+ }
+
+ /* schedlock.exp: last thread start. */
+ args[i] = 1;
+ thread_function ((void *) i);
+
+ exit(EXIT_SUCCESS);
+}
+
+void *thread_function(void *arg) {
+ int my_number = (int) arg;
+ int *myp = &args[my_number];
+
+ /* Don't run forever. Run just short of it :) */
+ while (*myp > 0)
+ {
+ /* schedlock.exp: main loop. */
+ (*myp) ++;
+ }
+
+ pthread_exit(NULL);
+}
+
diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp
new file mode 100644
index 00000000000..ea2d8d3fdc6
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/schedlock.exp
@@ -0,0 +1,353 @@
+# Copyright (C) 1996, 1997, 2002 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
+
+# This file was written by Daniel Jacobowitz <drow@mvista.com>
+# (parts based on pthreads.exp by Fred Fish (fnf@cygnus.com).
+#
+# This test covers the various forms of "set scheduler-locking".
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "schedlock"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+set built_binfile 0
+
+# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
+if [istarget "*-*-linux*"] then {
+ set possible_libs "-lpthread -lpthreads -lthread"
+} else {
+ set possible_libs "-lpthreads -lpthread -lthread"
+}
+
+set why_msg "unrecognized error"
+foreach lib $possible_libs {
+ set options "debug"
+ lappend options "incdir=${objdir}/${subdir}"
+ lappend options "libs=$lib"
+ set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
+}
+if {$built_binfile == "0"} {
+ unsupported "Couldn't compile ${srcfile}, ${why_msg}"
+ return -1
+}
+
+# Now we can proceed with the real testing.
+
+proc get_args { } {
+ global list_count
+ global gdb_prompt
+
+ send_gdb "print args\n"
+ gdb_expect {
+ -re "\\\$\[0-9\]+ = {(\[0-9\]+), (\[0-9\]+), (\[0-9\]+), (\[0-9\]+), (\[0-9\]+), (\[0-9\]+)}.*$gdb_prompt"
+ {
+ set list_count [expr $list_count + 1]
+ pass "listed args ($list_count)"
+ return [list $expect_out(1,string) $expect_out(2,string) $expect_out(3,string) $expect_out(4,string) $expect_out(5,string) $expect_out(6,string)]
+ }
+ -re "$gdb_prompt"
+ {
+ fail "listed args ($list_count) (unknown output)"
+ }
+ timeout
+ {
+ fail "listed args ($list_count) (timeout)"
+ }
+ }
+}
+
+proc stop_process { description } {
+ global gdb_prompt
+
+ # For this to work we must be sure to consume the "Continuing."
+ # message first, or GDB's signal handler may not be in place.
+ after 1000 {send_gdb "\003"}
+ gdb_expect {
+ -re "Program received signal SIGINT.*$gdb_prompt $"
+ {
+ pass $description
+ }
+ timeout
+ {
+ fail "$description (timeout)"
+ }
+ }
+}
+
+proc get_current_thread { description } {
+ global gdb_prompt
+
+ send_gdb "bt\n"
+ gdb_expect {
+ -re "thread_function \\(arg=0x(\[0-9\])\\).*$gdb_prompt $"
+ {
+ pass $description
+ return $expect_out(1,string)
+ }
+ -re "$gdb_prompt $"
+ {
+ fail "$description (unknown output)"
+ }
+ timeout
+ {
+ fail "$description (timeout)"
+ }
+ }
+}
+
+proc my_continue { msg } {
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing"
+ { pass "continue ($msg)" }
+ timeout
+ { fail "continue ($msg) (timeout)" }
+ }
+
+ stop_process "stop all threads ($msg)"
+
+ # Make sure we're in one of the looping threads.
+ gdb_breakpoint [gdb_get_line_number "schedlock.exp: main loop"]
+ gdb_continue_to_breakpoint "return to loop ($msg)"
+ delete_breakpoints
+}
+
+proc step_ten_loops { msg } {
+ global gdb_prompt
+
+ for {set i 0} {[expr $i < 10]} {set i [expr $i + 1]} {
+ send_gdb "step\n"
+ set other_step 0
+ gdb_expect {
+ -re ".*myp\\) \\+\\+;\[\r\n\]+$gdb_prompt $" {
+ pass "step to increment ($msg $i)"
+ }
+ -re "$gdb_prompt $" {
+ if {$other_step == 0} {
+ set other_step 1
+ send_gdb "step\n"
+ exp_continue
+ } else {
+ fail "step to increment ($msg $i)"
+ # FIXME cascade?
+ }
+ }
+ timeout {
+ fail "step to increment ($msg $i) (timeout)"
+ }
+ }
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We'll need this when we send_gdb a ^C to GDB. Need to do it before we
+# run the program and gdb starts saving and restoring tty states.
+# On Ultrix, we don't need it and it is really slow (because shell_escape
+# doesn't use vfork).
+if ![istarget "*-*-ultrix*"] then {
+ gdb_test "shell stty intr '^C'" ""
+}
+
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set width 0" ""
+
+runto_main
+
+# See if scheduler locking is available on this target.
+send_gdb "set scheduler-locking off\n"
+global gdb_prompt
+gdb_expect {
+ -re "Target .* cannot support this command"
+ {
+ unsupported "target does not support scheduler locking"
+ return
+ }
+ -re "$gdb_prompt $"
+ {
+ pass "scheduler locking set to none"
+ }
+ timeout
+ {
+ unsupported "target does not support scheduler locking (timeout)"
+ return
+ }
+}
+
+gdb_breakpoint [gdb_get_line_number "schedlock.exp: last thread start"]
+gdb_continue_to_breakpoint "all threads started"
+
+global list_count
+set list_count 0
+
+set start_args [get_args]
+
+# First make sure that all threads are alive.
+my_continue "initial"
+
+set cont_args [get_args]
+
+for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
+ if {[lindex $start_args $i] == [lindex $cont_args $i]} {
+ fail "thread $i ran (didn't run)"
+ } else {
+ pass "thread $i ran"
+ }
+}
+
+# We can't change threads, unfortunately, in current GDB. Use
+# whichever we stopped in.
+set curthread [get_current_thread "find current thread (1)"]
+
+
+
+
+# Test stepping without scheduler locking.
+gdb_test "set scheduler-locking off" ""
+
+step_ten_loops "unlocked"
+
+# Make sure we're still in the same thread.
+set newthread [get_current_thread "find current thread (2)"]
+if {$curthread == $newthread} {
+ pass "step without lock does not change thread"
+} else {
+ fail "step without lock does not change thread (switched to thread $newthread)"
+}
+
+set start_args $cont_args
+set cont_args [get_args]
+
+for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
+ if {[lindex $start_args $i] == [lindex $cont_args $i]} {
+ if {$i == $curthread} {
+ fail "current thread stepped (didn't run)"
+ } else {
+ fail "other thread $i ran (didn't run) (1)"
+ }
+ } else {
+ if {$i == $curthread} {
+ if {[lindex $start_args $i] == [expr [lindex $cont_args $i] - 10]} {
+ pass "current thread stepped"
+ } else {
+ fail "current thread stepped (wrong amount)"
+ }
+ } else {
+ pass "other thread $i ran (1)"
+ }
+ }
+}
+
+# Test continue with scheduler locking
+gdb_test "set scheduler-locking on" ""
+
+my_continue "with lock"
+
+# Make sure we're still in the same thread.
+set newthread [get_current_thread "find current thread (3)"]
+if {$curthread == $newthread} {
+ pass "continue with lock does not change thread"
+} else {
+ fail "continue with lock does not change thread (switched to thread $newthread)"
+}
+
+set start_args $cont_args
+set cont_args [get_args]
+
+for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
+ if {[lindex $start_args $i] == [lindex $cont_args $i]} {
+ if {$i == $curthread} {
+ fail "current thread ran (didn't run)"
+ } else {
+ pass "other thread $i didn't run"
+ }
+ } else {
+ if {$i == $curthread} {
+ pass "current thread ran"
+ } else {
+ fail "other thread $i didn't run (ran)"
+ }
+ }
+}
+
+# Test stepping with scheduler locking
+step_ten_loops "locked"
+
+# Make sure we're still in the same thread.
+set newthread [get_current_thread "find current thread (2)"]
+if {$curthread == $newthread} {
+ pass "step with lock does not change thread"
+} else {
+ fail "step with lock does not change thread (switched to thread $newthread)"
+}
+
+set start_args $cont_args
+set cont_args [get_args]
+
+for {set i 0} {[expr $i < 6]} {set i [expr $i + 1]} {
+ if {[lindex $start_args $i] == [lindex $cont_args $i]} {
+ if {$i == $curthread} {
+ fail "current thread stepped locked (didn't run)"
+ } else {
+ pass "other thread $i didn't run (stepping)"
+ }
+ } else {
+ if {$i == $curthread} {
+ if {[lindex $start_args $i] == [expr [lindex $cont_args $i] - 10]} {
+ pass "current thread stepped locked"
+ } else {
+ fail "current thread stepped locked (wrong amount)"
+ }
+ } else {
+ fail "other thread $i didn't run (stepping) (ran)"
+ }
+ }
+}
+
+return 0
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d9285e86945..b4a0b8a0bd0 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -27,17 +27,17 @@
load_lib libgloss.exp
global GDB
-global CHILL_LIB
-global CHILL_RT0
-
-if ![info exists CHILL_LIB] {
- set CHILL_LIB [findfile $base_dir/../../gcc/ch/runtime/libchill.a "$base_dir/../../gcc/ch/runtime/libchill.a" [transform -lchill]]
-}
-verbose "using CHILL_LIB = $CHILL_LIB" 2
-if ![info exists CHILL_RT0] {
- set CHILL_RT0 [findfile $base_dir/../../gcc/ch/runtime/chillrt0.o "$base_dir/../../gcc/ch/runtime/chillrt0.o" ""]
-}
-verbose "using CHILL_RT0 = $CHILL_RT0" 2
+# 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,25 +920,25 @@ proc skip_cplus_tests {} {
return 0
}
-# * For crosses, the CHILL runtime doesn't build because it can't find
-# setjmp.h, stdio.h, etc.
-# * For AIX (as of 16 Mar 95), (a) there is no language code for
-# CHILL in output_epilog in gcc/config/rs6000/rs6000.c, (b) collect2
-# does not get along with AIX's too-clever linker.
-# * On Irix5, there is a bug whereby set of bool, etc., don't get
-# TYPE_LOW_BOUND for the bool right because force_to_range_type doesn't
-# work with stub types.
-# Lots of things seem to fail on the PA, and since it's not a supported
-# chill target at the moment, don't run the chill tests.
-
-proc skip_chill_tests {} {
- if ![info exists do_chill_tests] {
- return 1;
- }
- eval set skip_chill [expr ![isnative] || [istarget "*-*-aix*"] || [istarget "*-*-irix5*"] || [istarget "*-*-irix6*"] || [istarget "alpha-*-osf*"] || [istarget "hppa*-*-*"]]
- verbose "Skip chill tests is $skip_chill"
- return $skip_chill
-}
+# 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.
@@ -959,7 +959,7 @@ proc get_compiler_info {binfile args} {
global signed_keyword_not_used
global gcc_compiled
- if {![istarget "hppa*-*-hpux*"]} {
+ if {![istarget "hppa*-*-hpux*"] && ![istarget "mips*-*-irix*"]} {
if { [llength $args] > 0 } {
if {$args == "c++"} {
if { [gdb_compile "${srcdir}/lib/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
@@ -1265,6 +1265,7 @@ proc gdb_expect_list {test sentinel list} {
set ok 1
if { $suppress_flag } {
set ok 0
+ unresolved "${test}"
}
while { ${index} < [llength ${list}] } {
set pattern [lindex ${list} ${index}]
@@ -1273,41 +1274,42 @@ proc gdb_expect_list {test sentinel list} {
if { ${ok} } {
gdb_expect {
-re "${pattern}${sentinel}" {
- pass "${test}, pattern ${index} + sentinel"
+ # pass "${test}, pattern ${index} + sentinel"
}
-re "${sentinel}" {
- fail "${test}, pattern ${index} + sentinel"
+ fail "${test} (pattern ${index} + sentinel)"
set ok 0
}
timeout {
- fail "${test}, pattern ${index} + sentinel (timeout)"
+ fail "${test} (pattern ${index} + sentinel) (timeout)"
set ok 0
}
}
} else {
- unresolved "${test}, pattern ${index} + sentinel"
+ # unresolved "${test}, pattern ${index} + sentinel"
}
} else {
if { ${ok} } {
gdb_expect {
-re "${pattern}" {
- pass "${test}, pattern ${index}"
+ # pass "${test}, pattern ${index}"
}
-re "${sentinel}" {
- fail "${test}, pattern ${index}"
+ fail "${test} (pattern ${index})"
set ok 0
}
timeout {
- fail "${test}, pattern ${index} (timeout)"
+ fail "${test} (pattern ${index}) (timeout)"
set ok 0
}
}
} else {
- unresolved "${test}, pattern ${index}"
+ # unresolved "${test}, pattern ${index}"
}
}
}
if { ${ok} } {
+ pass "${test}"
return 0
} else {
return 1
@@ -1440,7 +1442,7 @@ proc get_debug_format { } {
set debug_format "unknown"
send_gdb "info source\n"
gdb_expect 10 {
- -re "Compiled with (.*) debugging format.\r\n$gdb_prompt $" {
+ -re "Compiled with (.*) debugging format.\r\n.*$gdb_prompt $" {
set debug_format $expect_out(1,string)
verbose "debug format is $debug_format"
return 1;
diff --git a/gdb/thread.c b/gdb/thread.c
index 45130bbb0ee..fa5eb27b15c 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -34,6 +34,7 @@
#include "gdbcmd.h"
#include "regcache.h"
#include "gdb.h"
+#include "gdb_string.h"
#include <ctype.h>
#include <sys/types.h>
diff --git a/gdb/top.c b/gdb/top.c
index b4026c1895b..a2cee530c20 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -63,7 +63,6 @@
#include <ctype.h>
#include "ui-out.h"
#include "cli-out.h"
-#include "interps.h"
/* Default command line prompt. This is overriden in some configs. */
@@ -387,7 +386,6 @@ catcher (catch_exceptions_ftype *func,
char *saved_error_pre_print;
char *saved_quit_pre_print;
struct ui_out *saved_uiout;
- struct gdb_interpreter *saved_interp;
/* Return value from SIGSETJMP(): enum return_reason if error or
quit caught, 0 otherwise. */
@@ -410,7 +408,6 @@ catcher (catch_exceptions_ftype *func,
/* Override the global ``struct ui_out'' builder. */
saved_uiout = uiout;
- saved_interp = gdb_current_interpreter ();
uiout = func_uiout;
/* Prevent error/quit during FUNC from calling cleanups established
@@ -441,24 +438,7 @@ catcher (catch_exceptions_ftype *func,
restore_cleanups (saved_cleanup_chain);
- /*
- cases:
- 1. interp1 calls using uiout1
- 2. interp1 calls using uiout1 calls using uiout2
- 3. interp1 calls using uiout1 calls interp2 using uiout2
- 4. more?
- is it enough to note that the interpreter has changed and
- reset saved_uiout
- */
- if (gdb_current_interpreter () == saved_interp)
- uiout = saved_uiout;
- else
- {
- /* We've changed interpreters under this call.
- Reset uiout to the current interpreter's uiout
- and hope for the best. */
- uiout = gdb_interpreter_ui_out (NULL);
- }
+ uiout = saved_uiout;
if (mask & RETURN_MASK_QUIT)
quit_pre_print = saved_quit_pre_print;
@@ -723,12 +703,12 @@ execute_command (char *p, int from_tty)
execute_user_command (c, arg);
else if (c->type == set_cmd || c->type == show_cmd)
do_setshow_command (arg, from_tty & caution, c);
- else if (c->func == NULL)
+ else if (!cmd_func_p (c))
error ("That is not a command, just a help topic.");
else if (call_command_hook)
call_command_hook (c, arg, from_tty & caution);
else
- (*c->func) (c, arg, from_tty & caution);
+ cmd_func (c, arg, from_tty & caution);
/* If this command has been post-hooked, run the hook last. */
execute_cmd_post_hook (c);
@@ -967,6 +947,29 @@ static int write_history_p;
static int history_size;
static char *history_filename;
+/* This is like readline(), but it has some gdb-specific behavior.
+ gdb can use readline in both the synchronous and async modes during
+ a single gdb invocation. At the ordinary top-level prompt we might
+ be using the async readline. That means we can't use
+ rl_pre_input_hook, since it doesn't work properly in async mode.
+ However, for a secondary prompt (" >", such as occurs during a
+ `define'), gdb just calls readline() directly, running it in
+ synchronous mode. So for operate-and-get-next to work in this
+ situation, we have to switch the hooks around. That is what
+ gdb_readline_wrapper is for. */
+char *
+gdb_readline_wrapper (char *prompt)
+{
+ /* Set the hook that works in this case. */
+ if (event_loop_p && after_char_processing_hook)
+ {
+ rl_pre_input_hook = (Function *) after_char_processing_hook;
+ after_char_processing_hook = NULL;
+ }
+
+ return readline (prompt);
+}
+
#ifdef STOP_SIGNAL
static void
@@ -1057,7 +1060,7 @@ static int operate_saved_history = -1;
/* This is put on the appropriate hook and helps operate-and-get-next
do its work. */
void
-gdb_rl_operate_and_get_next_completion ()
+gdb_rl_operate_and_get_next_completion (void)
{
int delta = where_history () - operate_saved_history;
/* The `key' argument to rl_get_previous_history is ignored. */
@@ -1079,6 +1082,8 @@ gdb_rl_operate_and_get_next_completion ()
static int
gdb_rl_operate_and_get_next (int count, int key)
{
+ int where;
+
if (event_loop_p)
{
/* Use the async hook. */
@@ -1091,8 +1096,20 @@ gdb_rl_operate_and_get_next (int count, int key)
rl_pre_input_hook = (Function *) gdb_rl_operate_and_get_next_completion;
}
- /* Add 1 because we eventually want the next line. */
- operate_saved_history = where_history () + 1;
+ /* Find the current line, and find the next line to use. */
+ where = where_history();
+
+ /* FIXME: kettenis/20020817: max_input_history is renamed into
+ history_max_entries in readline-4.2. When we do a new readline
+ import, we should probably change it here too, even though
+ readline maintains backwards compatibility for now by still
+ defining max_input_history. */
+ if ((history_is_stifled () && (history_length >= max_input_history)) ||
+ (where >= history_length - 1))
+ operate_saved_history = where;
+ else
+ operate_saved_history = where + 1;
+
return rl_newline (1, key);
}
@@ -1194,7 +1211,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
}
else if (command_editing_p && instream == stdin && ISATTY (instream))
{
- rl = readline (local_prompt);
+ rl = gdb_readline_wrapper (local_prompt);
}
else
{
@@ -2108,26 +2125,17 @@ gdb_init (char *argv0)
init_ui_hook (argv0);
/* Install the default UI */
- /* All the interpreters should have had a look at things by now.
- Initialize the selected interpreter. */
- {
- struct gdb_interpreter *interp;
- if (interpreter_p == NULL)
- interpreter_p = xstrdup (GDB_INTERPRETER_CONSOLE);
-
- interp = gdb_lookup_interpreter (interpreter_p);
+ if (!init_ui_hook)
+ {
+ uiout = cli_out_new (gdb_stdout);
- if (interp == NULL)
- {
- fprintf_unfiltered (gdb_stderr, "Interpreter `%s' unrecognized.\n",
- interpreter_p);
- exit (1);
- }
- if (!gdb_set_interpreter (interp))
- {
- fprintf_unfiltered (gdb_stderr, "Interpreter `%s' failed to initialize.\n",
- interpreter_p);
- exit (1);
- }
- }
+ /* All the interpreters should have had a look at things by now.
+ Initialize the selected interpreter. */
+ if (interpreter_p)
+ {
+ fprintf_unfiltered (gdb_stderr, "Interpreter `%s' unrecognized.\n",
+ interpreter_p);
+ exit (1);
+ }
+ }
}
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 19f290656e2..976f9259cdd 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -854,7 +854,7 @@ read_actions (struct tracepoint *t)
line = (*readline_hook) (prompt);
else if (instream == stdin && ISATTY (instream))
{
- line = readline (prompt);
+ line = gdb_readline_wrapper (prompt);
if (line && *line) /* add it to command history */
add_history (line);
}
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index d278c6a73a7..16d4835a435 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-18 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/655
+ * tui.c: Disable <termio.h> include.
+
2002-03-15 Andrew Cagney <ac131313@redhat.com>
* tui-out.c (XMALLOC): Delete macro. Update copyright.
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 7912efc8765..6b132b7332c 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -48,7 +48,9 @@
#endif
#include <signal.h>
#include <fcntl.h>
+#if 0
#include <termio.h>
+#endif
#include <setjmp.h>
#include "defs.h"
#include "gdbcmd.h"
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index b56610d3ac0..c4262d99016 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -20,7 +20,7 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "gdbtypes.h"
@@ -88,16 +88,16 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
type_print (type, "", stream, 0);
break;
#endif
-#ifdef _LANG_chill
- case language_chill:
- fprintf_filtered (stream, "SYNMODE ");
- if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
- !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
- fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
- else
- fprintf_filtered (stream, "<builtin> = ");
- type_print (type, "", stream, 0);
- break;
+#ifdef _LANG_chill /* OBSOLETE */
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE fprintf_filtered (stream, "SYNMODE "); */
+ /* OBSOLETE if (!TYPE_NAME (SYMBOL_TYPE (new)) || */
+ /* OBSOLETE !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new))) */
+ /* OBSOLETE fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new)); */
+ /* OBSOLETE else */
+ /* OBSOLETE fprintf_filtered (stream, "<builtin> = "); */
+ /* OBSOLETE type_print (type, "", stream, 0); */
+ /* OBSOLETE break; */
#endif
default:
error ("Language not supported.");
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 3dbcaab1326..3af6d2cc3b2 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -483,3 +483,97 @@ gdb_fopen (char *name, char *mode)
return NULL;
return stdio_file_new (f, 1);
}
+
+/* ``struct ui_file'' implementation that maps onto two ui-file objects. */
+
+static ui_file_write_ftype tee_file_write;
+static ui_file_fputs_ftype tee_file_fputs;
+static ui_file_isatty_ftype tee_file_isatty;
+static ui_file_delete_ftype tee_file_delete;
+static ui_file_flush_ftype tee_file_flush;
+
+static int tee_file_magic;
+
+struct tee_file
+ {
+ int *magic;
+ struct ui_file *one, *two;
+ int close_one, close_two;
+ };
+
+struct ui_file *
+tee_file_new (struct ui_file *one, int close_one,
+ struct ui_file *two, int close_two)
+{
+ struct ui_file *ui_file = ui_file_new ();
+ struct tee_file *tee = xmalloc (sizeof (struct tee_file));
+ tee->magic = &tee_file_magic;
+ tee->one = one;
+ tee->two = two;
+ tee->close_one = close_one;
+ tee->close_two = close_two;
+ set_ui_file_data (ui_file, tee, tee_file_delete);
+ set_ui_file_flush (ui_file, tee_file_flush);
+ set_ui_file_write (ui_file, tee_file_write);
+ set_ui_file_fputs (ui_file, tee_file_fputs);
+ set_ui_file_isatty (ui_file, tee_file_isatty);
+ return ui_file;
+}
+
+static void
+tee_file_delete (struct ui_file *file)
+{
+ struct tee_file *tee = ui_file_data (file);
+ if (tee->magic != &tee_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "tee_file_delete: bad magic number");
+ if (tee->close_one)
+ ui_file_delete (tee->one);
+ if (tee->close_two)
+ ui_file_delete (tee->two);
+
+ xfree (tee);
+}
+
+static void
+tee_file_flush (struct ui_file *file)
+{
+ struct tee_file *tee = ui_file_data (file);
+ if (tee->magic != &tee_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "tee_file_flush: bad magic number");
+ tee->one->to_flush (tee->one);
+ tee->two->to_flush (tee->two);
+}
+
+static void
+tee_file_write (struct ui_file *file, const char *buf, long length_buf)
+{
+ struct tee_file *tee = ui_file_data (file);
+ if (tee->magic != &tee_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "tee_file_write: bad magic number");
+ ui_file_write (tee->one, buf, length_buf);
+ ui_file_write (tee->two, buf, length_buf);
+}
+
+static void
+tee_file_fputs (const char *linebuffer, struct ui_file *file)
+{
+ struct tee_file *tee = ui_file_data (file);
+ if (tee->magic != &tee_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "tee_file_fputs: bad magic number");
+ tee->one->to_fputs (linebuffer, tee->one);
+ tee->two->to_fputs (linebuffer, tee->two);
+}
+
+static int
+tee_file_isatty (struct ui_file *file)
+{
+ struct tee_file *tee = ui_file_data (file);
+ if (tee->magic != &tee_file_magic)
+ internal_error (__FILE__, __LINE__,
+ "tee_file_isatty: bad magic number");
+ return (0);
+}
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index 3c351939797..989c343dfa0 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -90,4 +90,11 @@ extern struct ui_file *stdio_fileopen (FILE *file);
/* Open NAME returning an STDIO based UI_FILE. */
extern struct ui_file *gdb_fopen (char *name, char *mode);
+/* Create a file which writes to both ONE and TWO. CLOSE_ONE
+ and CLOSE_TWO indicate whether the original files should be
+ closed when the new file is closed. */
+struct ui_file *tee_file_new (struct ui_file *one,
+ int close_one,
+ struct ui_file *two,
+ int close_two);
#endif
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index c07d6952e6c..4a4a9228540 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -497,9 +497,9 @@ ui_out_field_core_addr (struct ui_out *uiout,
based on TARGET_ADDR_BIT. */
/* print_address_numeric (address, 1, local_stream); */
if (TARGET_ADDR_BIT <= 32)
- strcpy (addstr, local_hex_string_custom ((unsigned long) address, "08l"));
+ strcpy (addstr, local_hex_string_custom (address, "08l"));
else
- strcpy (addstr, local_hex_string_custom ((unsigned long) address, "016l"));
+ strcpy (addstr, local_hex_string_custom (address, "016l"));
ui_out_field_string (uiout, fldname, addstr);
}
diff --git a/gdb/utils.c b/gdb/utils.c
index 4baea624264..0c46f794e16 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1603,7 +1603,7 @@ prompt_for_continue (void)
/* Call readline, not gdb_readline, because GO32 readline handles control-C
whereas control-C to gdb_readline will cause the user to get dumped
out to DOS. */
- ignore = readline (cont_prompt);
+ ignore = gdb_readline_wrapper (cont_prompt);
if (annotation_level > 1)
printf_unfiltered ("\n\032\032post-prompt-for-continue\n");
@@ -2153,9 +2153,11 @@ fprintf_symbol_filtered (struct ui_file *stream, char *name, enum language lang,
case language_java:
demangled = cplus_demangle (name, arg_mode | DMGL_JAVA);
break;
- case language_chill:
- demangled = chill_demangle (name);
- break;
+#if 0
+ /* OBSOLETE case language_chill: */
+ /* OBSOLETE demangled = chill_demangle (name); */
+ /* OBSOLETE break; */
+#endif
default:
demangled = NULL;
break;
@@ -2462,9 +2464,7 @@ phex_nz (ULONGEST l, int sizeof_l)
CORE_ADDR
host_pointer_to_address (void *ptr)
{
- if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
- internal_error (__FILE__, __LINE__,
- "core_addr_to_void_ptr: bad cast");
+ gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr);
}
@@ -2472,9 +2472,8 @@ void *
address_to_host_pointer (CORE_ADDR addr)
{
void *ptr;
- if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
- internal_error (__FILE__, __LINE__,
- "core_addr_to_void_ptr: bad cast");
+
+ gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
return ptr;
}
diff --git a/gdb/uw-thread.c b/gdb/uw-thread.c
index 617cfbd9f81..cc6ed6daf4c 100644
--- a/gdb/uw-thread.c
+++ b/gdb/uw-thread.c
@@ -116,6 +116,14 @@
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
+/* Offset from SP to first arg on stack at first instruction of a
+ function. We provide a default here that's right for most, if not
+ all, targets that use this file. */
+
+#ifndef SP_ARG0
+#define SP_ARG0 (1 * 4)
+#endif
+
/* Whether to emit debugging output. */
#define DEBUG 0
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index e1869d04bab..3752dced66b 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -21,7 +21,6 @@
#include "defs.h"
#include "frame.h"
#include "inferior.h"
-#include "obstack.h"
#include "target.h"
#include "value.h"
#include "bfd.h"
@@ -123,6 +122,12 @@ enum
E_ALL_REGS_SIZE = (E_NUM_REGS) * v850_reg_size
};
+/* Size of return datatype which fits into all return registers. */
+enum
+{
+ E_MAX_RETTYPE_SIZE_IN_REGS = 2 * v850_reg_size
+};
+
static LONGEST call_dummy_nil[] = {0};
static char *v850_generic_reg_names[] =
@@ -199,7 +204,7 @@ static CORE_ADDR v850_scan_prologue (CORE_ADDR pc, struct prologue_info *fs);
/* Function: v850_register_name
Returns the name of the v850/v850e register N. */
-static char *
+static const char *
v850_register_name (int regnum)
{
if (regnum < 0 || regnum >= E_NUM_REGS)
@@ -266,11 +271,90 @@ v850_reg_virtual_type (int regnum)
return builtin_type_int32;
}
+static int
+v850_type_is_scalar (struct type *t)
+{
+ return (TYPE_CODE (t) != TYPE_CODE_STRUCT
+ && TYPE_CODE (t) != TYPE_CODE_UNION
+ && TYPE_CODE (t) != TYPE_CODE_ARRAY);
+}
+
/* Should call_function allocate stack space for a struct return? */
-int
+static int
v850_use_struct_convention (int gcc_p, struct type *type)
{
- return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 4);
+ /* According to ABI:
+ * return TYPE_LENGTH (type) > 8);
+ */
+
+ /* Current implementation in gcc: */
+
+ int i;
+ struct type *fld_type, *tgt_type;
+
+ /* 1. The value is greater than 8 bytes -> returned by copying */
+ if (TYPE_LENGTH (type) > 8)
+ return 1;
+
+ /* 2. The value is a single basic type -> returned in register */
+ if (v850_type_is_scalar (type))
+ return 0;
+
+ /* The value is a structure or union with a single element
+ * and that element is either a single basic type or an array of
+ * a single basic type whoes size is greater than or equal to 4
+ * -> returned in register */
+ if ((TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ && TYPE_NFIELDS (type) == 1)
+ {
+ fld_type = TYPE_FIELD_TYPE (type, 0);
+ if (v850_type_is_scalar (fld_type) && TYPE_LENGTH (fld_type) >= 4)
+ return 0;
+
+ if (TYPE_CODE (fld_type) == TYPE_CODE_ARRAY)
+ {
+ tgt_type = TYPE_TARGET_TYPE (fld_type);
+ if (v850_type_is_scalar (tgt_type) && TYPE_LENGTH (tgt_type) >= 4)
+ return 0;
+ }
+ }
+
+ /* The value is a structure whose first element is an integer or
+ * a float, and which contains no arrays of more than two elements
+ * -> returned in register */
+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+ && v850_type_is_scalar (TYPE_FIELD_TYPE (type, 0))
+ && TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)) == 4)
+ {
+ for (i = 1; i < TYPE_NFIELDS (type); ++i)
+ {
+ fld_type = TYPE_FIELD_TYPE (type, 0);
+ if (TYPE_CODE (fld_type) == TYPE_CODE_ARRAY)
+ {
+ tgt_type = TYPE_TARGET_TYPE (fld_type);
+ if (TYPE_LENGTH (fld_type) >= 0 && TYPE_LENGTH (tgt_type) >= 0
+ && TYPE_LENGTH (fld_type) / TYPE_LENGTH (tgt_type) > 2)
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+ /* The value is a union which contains at least one field which
+ * would be returned in registers according to these rules
+ * -> returned in register */
+ if (TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ for (i = 0; i < TYPE_NFIELDS (type); ++i)
+ {
+ fld_type = TYPE_FIELD_TYPE (type, 0);
+ if (!v850_use_struct_convention (0, fld_type))
+ return 0;
+ }
+ }
+
+ return 1;
}
@@ -844,22 +928,22 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* First, just for safety, make sure stack is aligned */
sp &= ~3;
+ /* The offset onto the stack at which we will start copying parameters
+ (after the registers are used up) begins at 16 rather than at zero.
+ I don't really know why, that's just the way it seems to work. */
+ stack_offset = 16;
+
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
len += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
- sp -= len; /* possibly over-allocating, but it works... */
+ sp -= len + stack_offset; /* possibly over-allocating, but it works... */
/* (you might think we could allocate 16 bytes */
/* less, but the ABI seems to use it all! ) */
- argreg = E_ARG0_REGNUM;
+ argreg = E_ARG0_REGNUM;
/* the struct_return pointer occupies the first parameter-passing reg */
if (struct_return)
- write_register (argreg++, struct_addr);
-
- stack_offset = 16;
- /* The offset onto the stack at which we will start copying parameters
- (after the registers are used up) begins at 16 rather than at zero.
- I don't really know why, that's just the way it seems to work. */
+ argreg++;
/* Now load as many as possible of the first arguments into
registers, and push the rest onto the stack. There are 16 bytes
@@ -870,8 +954,8 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
char *val;
char valbuf[v850_register_raw_size (E_ARG0_REGNUM)];
- if (TYPE_CODE (VALUE_TYPE (*args)) == TYPE_CODE_STRUCT
- && TYPE_LENGTH (VALUE_TYPE (*args)) > 8)
+ if (!v850_type_is_scalar (VALUE_TYPE (*args))
+ && TYPE_LENGTH (VALUE_TYPE (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS)
{
store_address (valbuf, 4, VALUE_ADDRESS (*args));
len = 4;
@@ -966,8 +1050,26 @@ v850_saved_pc_after_call (struct frame_info *ignore)
static void
v850_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
- memcpy (valbuf, regbuf + v850_register_byte (E_V0_REGNUM),
- TYPE_LENGTH (type));
+ CORE_ADDR return_buffer;
+
+ if (!v850_use_struct_convention (0, type))
+ {
+ /* Scalar return values of <= 8 bytes are returned in
+ E_V0_REGNUM to E_V1_REGNUM. */
+ memcpy (valbuf,
+ &regbuf[REGISTER_BYTE (E_V0_REGNUM)],
+ TYPE_LENGTH (type));
+ }
+ else
+ {
+ /* Aggregates and return values > 8 bytes are returned in memory,
+ pointed to by R6. */
+ return_buffer =
+ extract_address (regbuf + REGISTER_BYTE (E_V0_REGNUM),
+ REGISTER_RAW_SIZE (E_V0_REGNUM));
+
+ read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
+ }
}
const static unsigned char *
@@ -988,8 +1090,16 @@ v850_extract_struct_value_address (char *regbuf)
static void
v850_store_return_value (struct type *type, char *valbuf)
{
- write_register_bytes(v850_register_byte (E_V0_REGNUM), valbuf,
- TYPE_LENGTH (type));
+ CORE_ADDR return_buffer;
+
+ if (!v850_use_struct_convention (0, type))
+ write_register_bytes (REGISTER_BYTE (E_V0_REGNUM), valbuf,
+ TYPE_LENGTH (type));
+ else
+ {
+ return_buffer = read_register (E_V0_REGNUM);
+ write_memory (return_buffer, valbuf, TYPE_LENGTH (type));
+ }
}
static void
@@ -1057,8 +1167,9 @@ v850_init_extra_frame_info (int fromleaf, struct frame_info *fi)
}
static void
-v850_store_struct_return (CORE_ADDR a, CORE_ADDR b)
+v850_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
{
+ write_register (E_ARG0_REGNUM, addr);
}
static CORE_ADDR
@@ -1126,7 +1237,7 @@ 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_get_saved_register);
+ 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);
@@ -1158,12 +1269,12 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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_extract_return_value (gdbarch, v850_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value);
set_gdbarch_push_arguments (gdbarch, v850_push_arguments);
set_gdbarch_pop_frame (gdbarch, v850_pop_frame);
set_gdbarch_store_struct_return (gdbarch, v850_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, v850_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
+ 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);
diff --git a/gdb/valarith.c b/gdb/valarith.c
index cc067cb4b51..279528a15a7 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -859,7 +859,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
/* Integral operations here. */
/* FIXME: Also mixed integral/booleans, with result an integer. */
/* FIXME: This implements ANSI C rules (also correct for C++).
- What about FORTRAN and chill? */
+ What about FORTRAN and (OBSOLETE) chill ? */
{
unsigned int promoted_len1 = TYPE_LENGTH (type1);
unsigned int promoted_len2 = TYPE_LENGTH (type2);
@@ -946,12 +946,12 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
case BINOP_MOD:
/* Knuth 1.2.4, integer only. Note that unlike the C '%' op,
v1 mod 0 has a defined value, v1. */
- /* Chill specifies that v2 must be > 0, so check for that. */
- if (current_language->la_language == language_chill
- && value_as_long (arg2) <= 0)
- {
- error ("Second operand of MOD must be greater than zero.");
- }
+ /* OBSOLETE Chill specifies that v2 must be > 0, so check for that. */
+ /* OBSOLETE if (current_language->la_language == language_chill */
+ /* OBSOLETE && value_as_long (arg2) <= 0) */
+ /* OBSOLETE { */
+ /* OBSOLETE error ("Second operand of MOD must be greater than zero."); */
+ /* OBSOLETE } */
if (v2 == 0)
{
v = v1;
@@ -1070,12 +1070,12 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
case BINOP_MOD:
/* Knuth 1.2.4, integer only. Note that unlike the C '%' op,
X mod 0 has a defined value, X. */
- /* Chill specifies that v2 must be > 0, so check for that. */
- if (current_language->la_language == language_chill
- && v2 <= 0)
- {
- error ("Second operand of MOD must be greater than zero.");
- }
+ /* OBSOLETE Chill specifies that v2 must be > 0, so check for that. */
+ /* OBSOLETE if (current_language->la_language == language_chill */
+ /* OBSOLETE && v2 <= 0) */
+ /* OBSOLETE { */
+ /* OBSOLETE error ("Second operand of MOD must be greater than zero."); */
+ /* OBSOLETE } */
if (v2 == 0)
{
v = v1;
@@ -1338,8 +1338,8 @@ value_neg (struct value *arg1)
return value_from_double (result_type, -value_as_double (arg1));
else if (TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_BOOL)
{
- /* Perform integral promotion for ANSI C/C++.
- FIXME: What about FORTRAN and chill ? */
+ /* Perform integral promotion for ANSI C/C++. FIXME: What about
+ FORTRAN and (OBSOLETE) chill ? */
if (TYPE_LENGTH (type) < TYPE_LENGTH (builtin_type_int))
result_type = builtin_type_int;
diff --git a/gdb/valops.c b/gdb/valops.c
index 798e31fc646..1eeedd32cf7 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -45,7 +45,8 @@ extern int hp_som_som_object_present;
extern int overload_debug;
/* Local functions. */
-static int typecmp (int staticp, struct type *t1[], struct value *t2[]);
+static int typecmp (int staticp, int varargs, int nargs,
+ struct field t1[], struct value *t2[]);
static CORE_ADDR find_function_addr (struct value *, struct type **);
static struct value *value_arg_coerce (struct value *, struct type *, int);
@@ -360,18 +361,11 @@ value_cast (struct type *type, struct value *arg2)
value_zero (t1, not_lval), 0, t1, 1);
if (v)
{
- struct value *v2 = value_ind (arg2);
- VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v)
- + VALUE_OFFSET (v);
-
- /* JYG: adjust the new pointer value and
- embedded offset. */
- v2->aligner.contents[0] -= VALUE_EMBEDDED_OFFSET (v);
- VALUE_EMBEDDED_OFFSET (v2) = 0;
-
- v2 = value_addr (v2);
- VALUE_TYPE (v2) = type;
- return v2;
+ CORE_ADDR addr2 = value_as_address (arg2);
+ addr2 -= (VALUE_ADDRESS (v)
+ + VALUE_OFFSET (v)
+ + VALUE_EMBEDDED_OFFSET (v));
+ return value_from_pointer (type, addr2);
}
}
}
@@ -382,49 +376,49 @@ value_cast (struct type *type, struct value *arg2)
VALUE_POINTED_TO_OFFSET (arg2) = 0; /* pai: chk_val */
return arg2;
}
- else if (chill_varying_type (type))
- {
- struct type *range1, *range2, *eltype1, *eltype2;
- struct value *val;
- int count1, count2;
- LONGEST low_bound, high_bound;
- char *valaddr, *valaddr_data;
- /* For lint warning about eltype2 possibly uninitialized: */
- eltype2 = NULL;
- if (code2 == TYPE_CODE_BITSTRING)
- error ("not implemented: converting bitstring to varying type");
- if ((code2 != TYPE_CODE_ARRAY && code2 != TYPE_CODE_STRING)
- || (eltype1 = check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 1))),
- eltype2 = check_typedef (TYPE_TARGET_TYPE (type2)),
- (TYPE_LENGTH (eltype1) != TYPE_LENGTH (eltype2)
- /* || TYPE_CODE (eltype1) != TYPE_CODE (eltype2) */ )))
- error ("Invalid conversion to varying type");
- range1 = TYPE_FIELD_TYPE (TYPE_FIELD_TYPE (type, 1), 0);
- range2 = TYPE_FIELD_TYPE (type2, 0);
- if (get_discrete_bounds (range1, &low_bound, &high_bound) < 0)
- count1 = -1;
- else
- count1 = high_bound - low_bound + 1;
- if (get_discrete_bounds (range2, &low_bound, &high_bound) < 0)
- count1 = -1, count2 = 0; /* To force error before */
- else
- count2 = high_bound - low_bound + 1;
- if (count2 > count1)
- error ("target varying type is too small");
- val = allocate_value (type);
- valaddr = VALUE_CONTENTS_RAW (val);
- valaddr_data = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8;
- /* Set val's __var_length field to count2. */
- store_signed_integer (valaddr, TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)),
- count2);
- /* Set the __var_data field to count2 elements copied from arg2. */
- memcpy (valaddr_data, VALUE_CONTENTS (arg2),
- count2 * TYPE_LENGTH (eltype2));
- /* Zero the rest of the __var_data field of val. */
- memset (valaddr_data + count2 * TYPE_LENGTH (eltype2), '\0',
- (count1 - count2) * TYPE_LENGTH (eltype2));
- return val;
- }
+ /* OBSOLETE else if (chill_varying_type (type)) */
+ /* OBSOLETE { */
+ /* OBSOLETE struct type *range1, *range2, *eltype1, *eltype2; */
+ /* OBSOLETE struct value *val; */
+ /* OBSOLETE int count1, count2; */
+ /* OBSOLETE LONGEST low_bound, high_bound; */
+ /* OBSOLETE char *valaddr, *valaddr_data; */
+ /* OBSOLETE *//* For lint warning about eltype2 possibly uninitialized: */
+ /* OBSOLETE eltype2 = NULL; */
+ /* OBSOLETE if (code2 == TYPE_CODE_BITSTRING) */
+ /* OBSOLETE error ("not implemented: converting bitstring to varying type"); */
+ /* OBSOLETE if ((code2 != TYPE_CODE_ARRAY && code2 != TYPE_CODE_STRING) */
+ /* OBSOLETE || (eltype1 = check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 1))), */
+ /* OBSOLETE eltype2 = check_typedef (TYPE_TARGET_TYPE (type2)), */
+ /* OBSOLETE (TYPE_LENGTH (eltype1) != TYPE_LENGTH (eltype2) */
+ /* OBSOLETE *//*|| TYPE_CODE (eltype1) != TYPE_CODE (eltype2) *//* ))) */
+ /* OBSOLETE error ("Invalid conversion to varying type"); */
+ /* OBSOLETE range1 = TYPE_FIELD_TYPE (TYPE_FIELD_TYPE (type, 1), 0); */
+ /* OBSOLETE range2 = TYPE_FIELD_TYPE (type2, 0); */
+ /* OBSOLETE if (get_discrete_bounds (range1, &low_bound, &high_bound) < 0) */
+ /* OBSOLETE count1 = -1; */
+ /* OBSOLETE else */
+ /* OBSOLETE count1 = high_bound - low_bound + 1; */
+ /* OBSOLETE if (get_discrete_bounds (range2, &low_bound, &high_bound) < 0) */
+ /* OBSOLETE count1 = -1, count2 = 0; *//* To force error before */
+ /* OBSOLETE else */
+ /* OBSOLETE count2 = high_bound - low_bound + 1; */
+ /* OBSOLETE if (count2 > count1) */
+ /* OBSOLETE error ("target varying type is too small"); */
+ /* OBSOLETE val = allocate_value (type); */
+ /* OBSOLETE valaddr = VALUE_CONTENTS_RAW (val); */
+ /* OBSOLETE valaddr_data = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8; */
+ /* OBSOLETE *//* Set val's __var_length field to count2. */
+ /* OBSOLETE store_signed_integer (valaddr, TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)), */
+ /* OBSOLETE count2); */
+ /* OBSOLETE *//* Set the __var_data field to count2 elements copied from arg2. */
+ /* OBSOLETE memcpy (valaddr_data, VALUE_CONTENTS (arg2), */
+ /* OBSOLETE count2 * TYPE_LENGTH (eltype2)); */
+ /* OBSOLETE *//* Zero the rest of the __var_data field of val. */
+ /* OBSOLETE memset (valaddr_data + count2 * TYPE_LENGTH (eltype2), '\0', */
+ /* OBSOLETE (count1 - count2) * TYPE_LENGTH (eltype2)); */
+ /* OBSOLETE return val; */
+ /* OBSOLETE } */
else if (VALUE_LVAL (arg2) == lval_memory)
{
return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2),
@@ -632,6 +626,7 @@ value_assign (struct value *toval, struct value *fromval)
write_memory (changed_addr, dest_buffer, changed_len);
if (memory_changed_hook)
memory_changed_hook (changed_addr, changed_len);
+ target_changed_event ();
}
break;
@@ -677,6 +672,9 @@ value_assign (struct value *toval, struct value *fromval)
VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
#endif
}
+
+ target_changed_event ();
+
/* Assigning to the stack pointer, frame pointer, and other
(architecture and calling convention specific) registers may
cause the frame cache to be out of date. We just do this
@@ -764,6 +762,7 @@ value_assign (struct value *toval, struct value *fromval)
if (register_changed_hook)
register_changed_hook (-1);
+ target_changed_event ();
}
break;
@@ -960,9 +959,9 @@ value_ind (struct value *arg1)
to do. "long long" variables are rare enough that
BUILTIN_TYPE_LONGEST would seem to be a mistake. */
if (TYPE_CODE (base_type) == TYPE_CODE_INT)
- return value_at (builtin_type_int,
- (CORE_ADDR) value_as_long (arg1),
- VALUE_BFD_SECTION (arg1));
+ return value_at_lazy (builtin_type_int,
+ (CORE_ADDR) value_as_long (arg1),
+ VALUE_BFD_SECTION (arg1));
else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
{
struct type *enc_type;
@@ -1315,8 +1314,10 @@ hand_function_call (struct value *function, int nargs, struct value **args)
struct type *value_type;
unsigned char struct_return;
CORE_ADDR struct_addr = 0;
+ struct regcache *retbuf;
+ struct cleanup *retbuf_cleanup;
struct inferior_status *inf_status;
- struct cleanup *old_chain;
+ struct cleanup *inf_status_cleanup;
CORE_ADDR funaddr;
int using_gcc; /* Set to version of gcc in use, or zero if not gcc */
CORE_ADDR real_pc;
@@ -1332,8 +1333,18 @@ hand_function_call (struct value *function, int nargs, struct value **args)
if (!target_has_execution)
noprocess ();
+ /* Create a cleanup chain that contains the retbuf (buffer
+ containing the register values). This chain is create BEFORE the
+ inf_status chain so that the inferior status can cleaned up
+ (restored or discarded) without having the retbuf freed. */
+ retbuf = regcache_xmalloc (current_gdbarch);
+ retbuf_cleanup = make_cleanup_regcache_xfree (retbuf);
+
+ /* A cleanup for the inferior status. Create this AFTER the retbuf
+ so that this can be discarded or applied without interfering with
+ the regbuf. */
inf_status = save_inferior_status (1);
- old_chain = make_cleanup_restore_inferior_status (inf_status);
+ inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status);
/* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
(and POP_FRAME for restoring them). (At least on most machines)
@@ -1438,42 +1449,25 @@ hand_function_call (struct value *function, int nargs, struct value **args)
sp = old_sp; /* It really is used, for some ifdef's... */
#endif
- if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
- {
- i = 0;
- while (TYPE_CODE (TYPE_ARG_TYPES (ftype)[i]) != TYPE_CODE_VOID)
- i++;
- n_method_args = i;
- if (nargs < i)
- error ("too few arguments in method call");
- }
- else if (nargs < TYPE_NFIELDS (ftype))
+ if (nargs < TYPE_NFIELDS (ftype))
error ("too few arguments in function call");
for (i = nargs - 1; i >= 0; i--)
{
- /* Assume that methods are always prototyped, unless they are off the
- end (which we should only be allowing if there is a ``...'').
- FIXME. */
- if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
- {
- if (i < n_method_args)
- args[i] = value_arg_coerce (args[i], TYPE_ARG_TYPES (ftype)[i], 1);
- else
- args[i] = value_arg_coerce (args[i], NULL, 0);
- }
+ int prototyped;
- /* If we're off the end of the known arguments, do the standard
- promotions. FIXME: if we had a prototype, this should only
- be allowed if ... were present. */
- if (i >= TYPE_NFIELDS (ftype))
- args[i] = value_arg_coerce (args[i], NULL, 0);
+ /* FIXME drow/2002-05-31: Should just always mark methods as
+ prototyped. Can we respect TYPE_VARARGS? Probably not. */
+ if (TYPE_CODE (ftype) == TYPE_CODE_METHOD)
+ prototyped = 1;
+ else
+ prototyped = TYPE_PROTOTYPED (ftype);
+ if (i < TYPE_NFIELDS (ftype))
+ args[i] = value_arg_coerce (args[i], TYPE_FIELD_TYPE (ftype, i),
+ prototyped);
else
- {
- param_type = TYPE_FIELD_TYPE (ftype, i);
- args[i] = value_arg_coerce (args[i], param_type, TYPE_PROTOTYPED (ftype));
- }
+ args[i] = value_arg_coerce (args[i], NULL, 0);
/*elz: this code is to handle the case in which the function to be called
has a pointer to function as parameter and the corresponding actual argument
@@ -1485,7 +1479,7 @@ hand_function_call (struct value *function, int nargs, struct value **args)
In cc this is not a problem. */
if (using_gcc == 0)
- if (param_type)
+ if (param_type && TYPE_CODE (ftype) != TYPE_CODE_METHOD)
/* if this parameter is a pointer to function */
if (TYPE_CODE (param_type) == TYPE_CODE_PTR)
if (TYPE_CODE (TYPE_TARGET_TYPE (param_type)) == TYPE_CODE_FUNC)
@@ -1672,7 +1666,6 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
SAVE_DUMMY_FRAME_TOS (sp);
{
- char *retbuf = (char*) alloca (REGISTER_BYTES);
char *name;
struct symbol *symbol;
@@ -1731,11 +1724,12 @@ Evaluation of the expression containing the function (%s) will be abandoned.",
{
/* The user wants to stay in the frame where we stopped (default).*/
- /* If we did the cleanups, we would print a spurious error
- message (Unable to restore previously selected frame),
- would write the registers from the inf_status (which is
- wrong), and would do other wrong things. */
- discard_cleanups (old_chain);
+ /* If we restored the inferior status (via the cleanup),
+ we would print a spurious error message (Unable to
+ restore previously selected frame), would write the
+ registers from the inf_status (which is wrong), and
+ would do other wrong things. */
+ discard_cleanups (inf_status_cleanup);
discard_inferior_status (inf_status);
/* FIXME: Insert a bunch of wrap_here; name can be very long if it's
@@ -1753,11 +1747,12 @@ Evaluation of the expression containing the function (%s) will be abandoned.",
{
/* We hit a breakpoint inside the FUNCTION. */
- /* If we did the cleanups, we would print a spurious error
- message (Unable to restore previously selected frame),
- would write the registers from the inf_status (which is
- wrong), and would do other wrong things. */
- discard_cleanups (old_chain);
+ /* If we restored the inferior status (via the cleanup), we
+ would print a spurious error message (Unable to restore
+ previously selected frame), would write the registers from
+ the inf_status (which is wrong), and would do other wrong
+ things. */
+ discard_cleanups (inf_status_cleanup);
discard_inferior_status (inf_status);
/* The following error message used to say "The expression
@@ -1777,7 +1772,10 @@ the function call).", name);
}
/* If we get here the called FUNCTION run to completion. */
- do_cleanups (old_chain);
+
+ /* Restore the inferior status, via its cleanup. At this stage,
+ leave the RETBUF alone. */
+ do_cleanups (inf_status_cleanup);
/* Figure out the value returned by the function. */
/* elz: I defined this new macro for the hppa architecture only.
@@ -1790,10 +1788,17 @@ the function call).", name);
#ifdef VALUE_RETURNED_FROM_STACK
if (struct_return)
- return (struct value *) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
+ {
+ do_cleanups (retbuf_cleanup);
+ return VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
+ }
#endif
- return value_being_returned (value_type, retbuf, struct_return);
+ {
+ struct value *retval = value_being_returned (value_type, retbuf, struct_return);
+ do_cleanups (retbuf_cleanup);
+ return retval;
+ }
}
}
@@ -1938,13 +1943,14 @@ value_bitstring (char *ptr, int len)
}
/* See if we can pass arguments in T2 to a function which takes arguments
- of types T1. Both t1 and t2 are NULL-terminated vectors. If some
- arguments need coercion of some sort, then the coerced values are written
- into T2. Return value is 0 if the arguments could be matched, or the
- position at which they differ if not.
+ of types T1. T1 is a list of NARGS arguments, and T2 is a NULL-terminated
+ vector. If some arguments need coercion of some sort, then the coerced
+ values are written into T2. Return value is 0 if the arguments could be
+ matched, or the position at which they differ if not.
STATICP is nonzero if the T1 argument list came from a
- static member function.
+ static member function. T2 will still include the ``this'' pointer,
+ but it will be skipped.
For non-static member functions, we ignore the first argument,
which is the type of the instance variable. This is because we want
@@ -1953,30 +1959,30 @@ value_bitstring (char *ptr, int len)
requested operation is type secure, shouldn't we? FIXME. */
static int
-typecmp (int staticp, struct type *t1[], struct value *t2[])
+typecmp (int staticp, int varargs, int nargs,
+ struct field t1[], struct value *t2[])
{
int i;
if (t2 == 0)
- return 1;
- if (staticp && t1 == 0)
- return t2[1] != 0;
- if (t1 == 0)
- return 1;
- if (t1[!staticp] == 0)
- return 0;
- if (TYPE_CODE (t1[0]) == TYPE_CODE_VOID)
- return 0;
+ internal_error (__FILE__, __LINE__, "typecmp: no argument list");
+
/* Skip ``this'' argument if applicable. T2 will always include THIS. */
if (staticp)
- t2++;
- for (i = !staticp; t1[i] && TYPE_CODE (t1[i]) != TYPE_CODE_VOID; i++)
+ t2 ++;
+
+ for (i = 0;
+ (i < nargs) && TYPE_CODE (t1[i].type) != TYPE_CODE_VOID;
+ i++)
{
struct type *tt1, *tt2;
+
if (!t2[i])
return i + 1;
- tt1 = check_typedef (t1[i]);
+
+ tt1 = check_typedef (t1[i].type);
tt2 = check_typedef (VALUE_TYPE (t2[i]));
+
if (TYPE_CODE (tt1) == TYPE_CODE_REF
/* We should be doing hairy argument matching, as below. */
&& (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (tt1))) == TYPE_CODE (tt2)))
@@ -2012,12 +2018,12 @@ typecmp (int staticp, struct type *t1[], struct value *t2[])
/* We should be doing much hairier argument matching (see section 13.2
of the ARM), but as a quick kludge, just check for the same type
code. */
- if (TYPE_CODE (t1[i]) != TYPE_CODE (VALUE_TYPE (t2[i])))
+ if (TYPE_CODE (t1[i].type) != TYPE_CODE (VALUE_TYPE (t2[i])))
return i + 1;
}
- if (!t1[i])
+ if (varargs || t2[i] == NULL)
return 0;
- return t2[i] ? i + 1 : 0;
+ return i + 1;
}
/* Helper function used by value_struct_elt to recurse through baseclasses.
@@ -2046,11 +2052,18 @@ search_struct_field (char *name, struct value *arg1, int offset,
{
struct value *v;
if (TYPE_FIELD_STATIC (type, i))
- v = value_static_field (type, i);
+ {
+ v = value_static_field (type, i);
+ if (v == 0)
+ error ("field %s is nonexistent or has been optimised out",
+ name);
+ }
else
- v = value_primitive_field (arg1, offset, i, type);
- if (v == 0)
- error ("there is no field named %s", name);
+ {
+ v = value_primitive_field (arg1, offset, i, type);
+ if (v == 0)
+ error ("there is no field named %s", name);
+ }
return v;
}
@@ -2066,20 +2079,22 @@ search_struct_field (char *name, struct value *arg1, int offset,
/* Look for a match through the fields of an anonymous union,
or anonymous struct. C++ provides anonymous unions.
- In the GNU Chill implementation of variant record types,
- each <alternative field> has an (anonymous) union type,
- each member of the union represents a <variant alternative>.
- Each <variant alternative> is represented as a struct,
- with a member for each <variant field>. */
+ In the GNU Chill (OBSOLETE) implementation of
+ variant record types, each <alternative field> has
+ an (anonymous) union type, each member of the union
+ represents a <variant alternative>. Each <variant
+ alternative> is represented as a struct, with a
+ member for each <variant field>. */
struct value *v;
int new_offset = offset;
- /* This is pretty gross. In G++, the offset in an anonymous
- union is relative to the beginning of the enclosing struct.
- In the GNU Chill implementation of variant records,
- the bitpos is zero in an anonymous union field, so we
- have to add the offset of the union here. */
+ /* This is pretty gross. In G++, the offset in an
+ anonymous union is relative to the beginning of the
+ enclosing struct. In the GNU Chill (OBSOLETE)
+ implementation of variant records, the bitpos is
+ zero in an anonymous union field, so we have to add
+ the offset of the union here. */
if (TYPE_CODE (field_type) == TYPE_CODE_STRUCT
|| (TYPE_NFIELDS (field_type) > 0
&& TYPE_FIELD_BITPOS (field_type, 0) == 0))
@@ -2303,6 +2318,8 @@ search_struct_method (char *name, struct value **arg1p,
if (TYPE_FN_FIELD_STUB (f, j))
check_stub_method (type, i, j);
if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
+ TYPE_VARARGS (TYPE_FN_FIELD_TYPE (f, j)),
+ TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (f, j)),
TYPE_FN_FIELD_ARGS (f, j), args))
{
if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
@@ -2515,7 +2532,6 @@ value_struct_elt (struct value **argp, struct value **args,
* ARGP is a pointer to a pointer to a value (the object)
* METHOD is a string containing the method name
* OFFSET is the offset within the value
- * STATIC_MEMFUNCP is set if the method is static
* TYPE is the assumed type of the object
* NUM_FNS is the number of overloaded instances
* BASETYPE is set to the actual type of the subobject where the method is found
@@ -2606,7 +2622,6 @@ find_method_list (struct value **argp, char *method, int offset,
* ARGP is a pointer to a pointer to a value (the object)
* METHOD is the method name
* OFFSET is the offset within the value contents
- * STATIC_MEMFUNCP is set if the method is static
* NUM_FNS is the number of overloaded instances
* BASETYPE is set to the type of the base subobject that defines the method
* BOFFSET is the offset of the base subobject which defines the method */
@@ -2697,6 +2712,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
register int jj;
register int ix;
int static_offset;
+ struct cleanup *cleanups = NULL;
char *obj_type_name = NULL;
char *func_name = NULL;
@@ -2738,6 +2754,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
}
oload_syms = make_symbol_overload_list (fsym);
+ cleanups = make_cleanup (xfree, oload_syms);
while (oload_syms[++i])
num_fns++;
if (!num_fns)
@@ -2754,13 +2771,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
{
if (TYPE_FN_FIELD_STATIC_P (fns_ptr, ix))
static_offset = 1;
- nparms=0;
-
- if (TYPE_FN_FIELD_ARGS(fns_ptr,ix))
- {
- while (TYPE_CODE(TYPE_FN_FIELD_ARGS(fns_ptr,ix)[nparms]) != TYPE_CODE_VOID)
- nparms++;
- }
+ nparms = TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (fns_ptr, ix));
}
else
{
@@ -2772,7 +2783,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
parm_types = (struct type **) xmalloc (nparms * (sizeof (struct type *)));
for (jj = 0; jj < nparms; jj++)
parm_types[jj] = (method
- ? (TYPE_FN_FIELD_ARGS (fns_ptr, ix)[jj])
+ ? (TYPE_FN_FIELD_ARGS (fns_ptr, ix)[jj].type)
: TYPE_FIELD_TYPE (SYMBOL_TYPE (oload_syms[ix]), jj));
/* Compare parameter types to supplied argument types. Skip THIS for
@@ -2900,6 +2911,9 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
}
*objp = temp;
}
+ if (cleanups != NULL)
+ do_cleanups (cleanups);
+
return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0);
}
@@ -3034,7 +3048,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
{
v = value_static_field (t, i);
if (v == NULL)
- error ("Internal error: could not find static variable %s",
+ error ("static field %s has been optimized out",
name);
return v;
}
@@ -3303,10 +3317,10 @@ value_slice (struct value *array, int lowbound, int length)
if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
error ("slice from bad array or bitstring");
if (lowbound < lowerbound || length < 0
- || lowbound + length - 1 > upperbound
- /* Chill allows zero-length strings but not arrays. */
- || (current_language->la_language == language_chill
- && length == 0 && TYPE_CODE (array_type) == TYPE_CODE_ARRAY))
+ || lowbound + length - 1 > upperbound)
+ /* OBSOLETE Chill allows zero-length strings but not arrays. */
+ /* OBSOLETE || (current_language->la_language == language_chill */
+ /* OBSOLETE && length == 0 && TYPE_CODE (array_type) == TYPE_CODE_ARRAY)) */
error ("slice out of range");
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
@@ -3362,8 +3376,8 @@ value_slice (struct value *array, int lowbound, int length)
return slice;
}
-/* Assuming chill_varying_type (VARRAY) is true, return an equivalent
- value as a fixed-length array. */
+/* Assuming OBSOLETE chill_varying_type (VARRAY) is true, return an
+ equivalent value as a fixed-length array. */
struct value *
varying_to_slice (struct value *varray)
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 36854ce8110..b1c47a123d4 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -29,7 +29,6 @@
#include "gdbcore.h"
#include "gdbcmd.h"
#include "target.h"
-#include "obstack.h"
#include "language.h"
#include "annotate.h"
#include "valprint.h"
@@ -333,7 +332,7 @@ print_longest (struct ui_file *stream, int format, int use_local,
fprintf_filtered (stream,
use_local ? local_decimal_format_custom ("ll")
: "%lld",
- val_long);
+ (long long) val_long);
break;
case 'u':
fprintf_filtered (stream, "%llu", (long long) val_long);
@@ -342,13 +341,13 @@ print_longest (struct ui_file *stream, int format, int use_local,
fprintf_filtered (stream,
use_local ? local_hex_format_custom ("ll")
: "%llx",
- val_long);
+ (unsigned long long) val_long);
break;
case 'o':
fprintf_filtered (stream,
use_local ? local_octal_format_custom ("ll")
: "%llo",
- val_long);
+ (unsigned long long) val_long);
break;
case 'b':
fprintf_filtered (stream, local_hex_format_custom ("02ll"), val_long);
diff --git a/gdb/value.h b/gdb/value.h
index a0eb99086ff..448c222df21 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -23,6 +23,8 @@
#if !defined (VALUE_H)
#define VALUE_H 1
+struct regcache;
+
#include "doublest.h"
/*
@@ -240,8 +242,8 @@ do { COERCE_REF(arg); \
do { COERCE_ARRAY(arg); COERCE_ENUM(arg); } while (0)
#define COERCE_VARYING_ARRAY(arg, real_arg_type) \
-{ if (chill_varying_type (real_arg_type)) \
- arg = varying_to_slice (arg), real_arg_type = VALUE_TYPE (arg); }
+/* OBSOLETE { if (chill_varying_type (real_arg_type)) */ \
+/* OBSOLETE arg = varying_to_slice (arg), real_arg_type = VALUE_TYPE (arg); } */
/* If ARG is an enum, convert it to an integer. */
@@ -406,7 +408,8 @@ extern struct value *value_repeat (struct value *arg1, int count);
extern struct value *value_subscript (struct value *array, struct value *idx);
extern struct value *value_being_returned (struct type *valtype,
- char *retbuf, int struct_return);
+ struct regcache *retbuf,
+ int struct_return);
extern struct value *value_in (struct value *element, struct value *set);
diff --git a/gdb/values.c b/gdb/values.c
index 225dd218bb5..a0c9794bced 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -34,6 +34,7 @@
#include "demangle.h"
#include "doublest.h"
#include "gdb_assert.h"
+#include "regcache.h"
/* Prototypes for exported functions. */
@@ -792,7 +793,9 @@ unpack_pointer (struct type *type, char *valaddr)
}
-/* Get the value of the FIELDN'th field (which must be static) of TYPE. */
+/* Get the value of the FIELDN'th field (which must be static) of
+ TYPE. Return NULL if the field doesn't exist or has been
+ optimized out. */
struct value *
value_static_field (struct type *type, int fieldno)
@@ -808,7 +811,14 @@ value_static_field (struct type *type, int fieldno)
{
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
struct symbol *sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
- if (sym == NULL)
+ /* In some cases (involving uninitalized, unreferenced static
+ const integral members), g++ -gdwarf-2 can emit debugging
+ information giving rise to symbols whose SYMBOL_CLASS is
+ LOC_UNRESOLVED. In that case, do a minimal symbol lookup.
+ If it returns a useful value, then the symbol was defined
+ elsewhere, so we use that information. Otherwise, return
+ NULL. */
+ if (sym == NULL || SYMBOL_CLASS (sym) == LOC_UNRESOLVED)
{
/* With some compilers, e.g. HP aCC, static data members are reported
as non-debuggable symbols */
@@ -1224,7 +1234,8 @@ value_from_double (struct type *type, DOUBLEST num)
/* ARGSUSED */
struct value *
-value_being_returned (struct type *valtype, char *retbuf, int struct_return)
+value_being_returned (struct type *valtype, struct regcache *retbuf,
+ int struct_return)
{
struct value *val;
CORE_ADDR addr;
@@ -1239,6 +1250,17 @@ value_being_returned (struct type *valtype, char *retbuf, int struct_return)
return value_at (valtype, addr, NULL);
}
+ /* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
+ if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
+ if (struct_return)
+ {
+ char *buf = deprecated_grub_regcache_for_registers (retbuf);
+ addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (buf);
+ if (!addr)
+ error ("Function return value unknown.");
+ return value_at (valtype, addr, NULL);
+ }
+
val = allocate_value (valtype);
CHECK_TYPEDEF (valtype);
EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
@@ -1314,7 +1336,7 @@ set_return_value (struct value *val)
|| code == TYPE_CODE_UNION) /* FIXME, implement struct return. */
error ("GDB does not support specifying a struct or union return value.");
- STORE_RETURN_VALUE (type, VALUE_CONTENTS (val));
+ STORE_RETURN_VALUE (type, current_regcache, VALUE_CONTENTS (val));
}
void
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 9ae145e2170..4ae046aad4e 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -23,6 +23,7 @@
#include "language.h"
#include "wrapper.h"
#include "gdbcmd.h"
+#include "gdb_string.h"
#include <math.h>
#include "varobj.h"
@@ -52,7 +53,7 @@ struct varobj_root
struct block *valid_block;
/* The frame for this expression */
- CORE_ADDR frame;
+ struct frame_id frame;
/* If 1, "update" always recomputes the frame & valid block
using the currently selected frame. */
@@ -456,7 +457,7 @@ varobj_create (char *objname,
Since select_frame is so benign, just call it for all cases. */
if (fi != NULL)
{
- var->root->frame = FRAME_FP (fi);
+ get_frame_id (fi, &var->root->frame);
old_fi = selected_frame;
select_frame (fi);
}
@@ -514,13 +515,13 @@ char *
varobj_gen_name (void)
{
static int id = 0;
- char obj_name[31];
+ char *obj_name;
/* generate a name for this object */
id++;
- sprintf (obj_name, "var%d", id);
+ xasprintf (&obj_name, "var%d", id);
- return xstrdup (obj_name);
+ return obj_name;
}
/* Given an "objname", returns the pointer to the corresponding varobj
@@ -850,7 +851,8 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
struct value *new;
struct vstack *stack = NULL;
struct vstack *result = NULL;
- struct frame_info *old_fi;
+ struct frame_id old_fid;
+ struct frame_info *fi;
/* sanity check: have we been passed a pointer? */
if (changelist == NULL)
@@ -863,7 +865,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. */
- old_fi = selected_frame;
+ get_frame_id (selected_frame, &old_fid);
/* Update the root variable. value_of_root can return NULL
if the variable is no longer around, i.e. we stepped out of
@@ -983,7 +985,9 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
}
/* Restore selected frame */
- select_frame (old_fi);
+ fi = frame_find_by_id (old_fid);
+ if (fi)
+ select_frame (fi);
if (type_changed)
return -2;
@@ -1210,14 +1214,11 @@ create_child (struct varobj *parent, int index, char *name)
child->name = name;
child->index = index;
child->value = value_of_child (parent, index);
- if ((!CPLUS_FAKE_CHILD(child) && child->value == NULL) || parent->error)
+ if ((!CPLUS_FAKE_CHILD (child) && child->value == NULL) || parent->error)
child->error = 1;
child->parent = parent;
child->root = parent->root;
- childs_name =
- (char *) xmalloc ((strlen (parent->obj_name) + strlen (name) + 2) *
- sizeof (char));
- sprintf (childs_name, "%s.%s", parent->obj_name, name);
+ xasprintf (&childs_name, "%s.%s", parent->obj_name, name);
child->obj_name = childs_name;
install_variable (child);
@@ -1306,7 +1307,8 @@ new_root_variable (void)
var->root->lang = NULL;
var->root->exp = NULL;
var->root->valid_block = NULL;
- var->root->frame = (CORE_ADDR) -1;
+ var->root->frame.base = 0;
+ var->root->frame.pc = 0;
var->root->use_selected_frame = 0;
var->root->rootvar = NULL;
@@ -1645,8 +1647,8 @@ value_of_child (struct varobj *parent, int index)
if (value != NULL && VALUE_LAZY (value))
{
/* If we fail to fetch the value of the child, return
- NULL so that callers notice that we're leaving an
- error message. */
+ NULL so that callers notice that we're leaving an
+ error message. */
if (!gdb_value_fetch_lazy (value))
value = NULL;
}
@@ -1794,14 +1796,7 @@ c_name_of_child (struct varobj *parent, int index)
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- {
- /* We never get here unless parent->num_children is greater than 0... */
- int len = 1;
- while ((int) pow ((double) 10, (double) len) < index)
- len++;
- name = (char *) xmalloc (1 + len * sizeof (char));
- sprintf (name, "%d", index);
- }
+ xasprintf (&name, "%d", index);
break;
case TYPE_CODE_STRUCT:
@@ -1820,9 +1815,7 @@ c_name_of_child (struct varobj *parent, int index)
break;
default:
- name =
- (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
- sprintf (name, "*%s", parent->name);
+ xasprintf (&name, "*%s", parent->name);
break;
}
break;
@@ -1855,10 +1848,7 @@ c_value_of_root (struct varobj **var_handle)
else
{
reinit_frame_cache ();
-
-
- fi = find_frame_addr_in_frame_chain (var->root->frame);
-
+ fi = frame_find_by_id (var->root->frame);
within_scope = fi != NULL;
/* FIXME: select_frame could fail */
if (within_scope)
@@ -1929,7 +1919,8 @@ c_value_of_child (struct varobj *parent, int index)
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "vstructure");
break;
case TYPE_CODE_PTR:
@@ -1937,7 +1928,8 @@ c_value_of_child (struct varobj *parent, int index)
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "vstructure");
break;
default:
@@ -2024,12 +2016,10 @@ c_variable_editable (struct varobj *var)
static char *
c_value_of_variable (struct varobj *var)
{
- struct type *type;
-
/* BOGUS: if val_print sees a struct/class, it will print out its
children instead of "{...}" */
- type = get_type (var);
- switch (TYPE_CODE (type))
+
+ switch (TYPE_CODE (get_type (var)))
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
@@ -2038,19 +2028,14 @@ c_value_of_variable (struct varobj *var)
case TYPE_CODE_ARRAY:
{
- char number[18];
- sprintf (number, "[%d]", var->num_children);
- return xstrdup (number);
+ char *number;
+ xasprintf (&number, "[%d]", var->num_children);
+ return (number);
}
/* break; */
default:
{
- long dummy;
- struct ui_file *stb = mem_fileopen ();
- struct cleanup *old_chain = make_cleanup_ui_file_delete (stb);
- char *thevalue;
-
if (var->value == NULL)
{
/* This can happen if we attempt to get the value of a struct
@@ -2060,18 +2045,22 @@ c_value_of_variable (struct varobj *var)
}
else
{
+ long dummy;
+ struct ui_file *stb = mem_fileopen ();
+ struct cleanup *old_chain = make_cleanup_ui_file_delete (stb);
+ char *thevalue;
+
if (VALUE_LAZY (var->value))
gdb_value_fetch_lazy (var->value);
- val_print (VALUE_TYPE (var->value), VALUE_CONTENTS_RAW (var->value), 0,
- VALUE_ADDRESS (var->value),
- stb, format_code[(int) var->format], 1, 0, 0);
+ val_print (VALUE_TYPE (var->value),
+ VALUE_CONTENTS_RAW (var->value), 0,
+ VALUE_ADDRESS (var->value), stb,
+ format_code[(int) var->format], 1, 0, 0);
thevalue = ui_file_xstrdup (stb, &dummy);
do_cleanups (old_chain);
- }
-
return thevalue;
}
- /* break; */
+ }
}
}
@@ -2200,7 +2189,8 @@ cplus_name_of_child (struct varobj *parent, int index)
/* FIXME: This assumes that type orders
inherited, public, private, protected */
i = index + TYPE_N_BASECLASSES (type);
- if (STREQ (parent->name, "private") || STREQ (parent->name, "protected"))
+ if (STREQ (parent->name, "private")
+ || STREQ (parent->name, "protected"))
i += children[v_public];
if (STREQ (parent->name, "protected"))
i += children[v_private];
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 0478227ee92..709ef383c83 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -45,12 +45,10 @@ static gdbarch_frame_saved_pc_ftype vax_frame_saved_pc;
static gdbarch_frame_args_address_ftype vax_frame_args_address;
static gdbarch_frame_locals_address_ftype vax_frame_locals_address;
static gdbarch_frame_init_saved_regs_ftype vax_frame_init_saved_regs;
-static gdbarch_get_saved_register_ftype vax_get_saved_register;
static gdbarch_store_struct_return_ftype vax_store_struct_return;
-static gdbarch_extract_return_value_ftype vax_extract_return_value;
-static gdbarch_store_return_value_ftype vax_store_return_value;
-static gdbarch_extract_struct_value_address_ftype
+static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
+static gdbarch_deprecated_extract_struct_value_address_ftype
vax_extract_struct_value_address;
static gdbarch_push_dummy_frame_ftype vax_push_dummy_frame;
@@ -83,7 +81,7 @@ static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
static unsigned char *print_insn_arg ();
-static char *
+static const char *
vax_register_name (int regno)
{
static char *register_names[] =
@@ -125,51 +123,6 @@ vax_register_virtual_type (int regno)
}
static void
-vax_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
- struct frame_info *frame, int regnum,
- enum lval_type *lval)
-{
- CORE_ADDR addr;
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
- addr = find_saved_register (frame, regnum);
- if (addr != 0)
- {
- if (lval != NULL)
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer != NULL)
- {
- /* Put it back in target format. */
- store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
- (LONGEST) addr);
- }
- if (addrp != NULL)
- *addrp = 0;
- return;
- }
- if (raw_buffer != NULL)
- target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
- }
- else
- {
- if (lval != NULL)
- *lval = lval_register;
- addr = REGISTER_BYTE (regnum);
- if (raw_buffer != NULL)
- read_register_gen (regnum, raw_buffer);
- }
- if (addrp != NULL)
- *addrp = addr;
-}
-
-static void
vax_frame_init_saved_regs (struct frame_info *frame)
{
int regnum, regmask;
@@ -186,7 +139,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
/* regmask's low bit is for register 0, which is the first one
what would be pushed. */
- for (regnum = 0; regnum < AP_REGNUM; regnum++)
+ for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
{
if (regmask & (1 << regnum))
frame->saved_regs[regnum] = next_addr += 4;
@@ -199,7 +152,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
frame->saved_regs[PC_REGNUM] = frame->frame + 16;
frame->saved_regs[FP_REGNUM] = frame->frame + 12;
- frame->saved_regs[AP_REGNUM] = frame->frame + 8;
+ frame->saved_regs[VAX_AP_REGNUM] = frame->frame + 8;
frame->saved_regs[PS_REGNUM] = frame->frame + 4;
}
@@ -239,7 +192,7 @@ vax_frame_args_address (struct frame_info *frame)
if (frame->next)
return (read_memory_integer (frame->next->frame + 8, 4));
- return (read_register (AP_REGNUM));
+ return (read_register (VAX_AP_REGNUM));
}
static CORE_ADDR
@@ -276,12 +229,12 @@ vax_push_dummy_frame (void)
sp = push_word (sp, read_register (regnum));
sp = push_word (sp, read_register (PC_REGNUM));
sp = push_word (sp, read_register (FP_REGNUM));
- sp = push_word (sp, read_register (AP_REGNUM));
+ sp = push_word (sp, read_register (VAX_AP_REGNUM));
sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
sp = push_word (sp, 0);
write_register (SP_REGNUM, sp);
write_register (FP_REGNUM, sp);
- write_register (AP_REGNUM, sp + (17 * 4));
+ write_register (VAX_AP_REGNUM, sp + (17 * 4));
}
static void
@@ -296,7 +249,7 @@ vax_pop_frame (void)
| (read_register (PS_REGNUM) & 0xffff0000));
write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
+ write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
fp += 16;
for (regnum = 0; regnum < 12; regnum++)
if (regmask & (0x10000 << regnum))
@@ -353,6 +306,15 @@ vax_extract_struct_value_address (char *regbuf)
return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
}
+static const unsigned char *
+vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static const unsigned char vax_breakpoint[] = { 3 };
+
+ *lenptr = sizeof(vax_breakpoint);
+ return (vax_breakpoint);
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
@@ -620,13 +582,30 @@ print_insn_arg (char *d, register char *p, CORE_ADDR addr,
static struct gdbarch *
vax_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 ABI of the object we are 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 ABI selection matches. */
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep && tdep->osabi == osabi)
+ return arches->gdbarch;
+ }
- /* Right now there is only one VAX architecture variant. */
- if (arches != NULL)
- return (arches->gdbarch);
+ tdep = xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
- gdbarch = gdbarch_alloc (&info, NULL);
+ tdep->osabi = osabi;
/* Register info */
set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
@@ -665,16 +644,13 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 4);
- set_gdbarch_get_saved_register (gdbarch, vax_get_saved_register);
-
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Return value info */
set_gdbarch_store_struct_return (gdbarch, vax_store_struct_return);
- set_gdbarch_extract_return_value (gdbarch, vax_extract_return_value);
- set_gdbarch_store_return_value (gdbarch, vax_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- vax_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address);
/* Call dummy info */
set_gdbarch_push_dummy_frame (gdbarch, vax_push_dummy_frame);
@@ -692,18 +668,35 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
/* Breakpoint info */
+ set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Misc info */
set_gdbarch_function_start_offset (gdbarch, 2);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch, osabi);
return (gdbarch);
}
+static void
+vax_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep == NULL)
+ return;
+
+ fprintf_unfiltered (file, "vax_dump_tdep: OS ABI = %s\n",
+ gdbarch_osabi_name (tdep->osabi));
+}
+
void
_initialize_vax_tdep (void)
{
- gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
+ gdbarch_register (bfd_arch_vax, vax_gdbarch_init, vax_dump_tdep);
tm_print_insn = vax_print_insn;
}
diff --git a/gdb/vax-tdep.h b/gdb/vax-tdep.h
index 95324bcc036..ccabdd53557 100644
--- a/gdb/vax-tdep.h
+++ b/gdb/vax-tdep.h
@@ -21,6 +21,8 @@
#ifndef VAX_TDEP_H
#define VAX_TDEP_H
+#include "osabi.h"
+
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
@@ -52,4 +54,10 @@
#define VAX_PC_REGNUM 15 /* Contains program counter */
#define VAX_PS_REGNUM 16 /* Contains processor status */
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ enum gdb_osabi osabi; /* OS/ABI of inferior. */
+};
+
#endif /* VAX_TDEP_H */
diff --git a/gdb/version.in b/gdb/version.in
index 728029ebfcf..5e8235777e9 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2002-05-28-cvs
+2002-08-24-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index d519f7b3122..e0377c5afe4 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -1334,7 +1334,7 @@ static BOOL WINAPI (*DebugSetProcessKillOnExit)(BOOL);
static BOOL WINAPI (*DebugActiveProcessStop)(DWORD);
static int
-has_detach_ability ()
+has_detach_ability (void)
{
static HMODULE kernel32 = NULL;
@@ -1815,7 +1815,7 @@ init_child_ops (void)
}
void
-_initialize_inftarg (void)
+_initialize_win32_nat (void)
{
struct cmd_list_element *c;
diff --git a/gdb/wince.c b/gdb/wince.c
index e37866c34a9..a640bea74b2 100644
--- a/gdb/wince.c
+++ b/gdb/wince.c
@@ -1965,7 +1965,7 @@ set_upload_type (char *ignore, int from_tty)
}
void
-_initialize_inftarg (void)
+_initialize_wince (void)
{
struct cmd_list_element *set;
init_child_ops ();
diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index 4d390088032..6c9c6d60cef 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -19,9 +19,8 @@
#include "defs.h"
#include "value.h"
#include "wrapper.h"
-#include "top.h" /* for execute_command */
-/* use this struct to pass arguments to wrapper routines. We assume
+/* Use this struct to pass arguments to wrapper routines. We assume
(arbitrarily) that no gdb function takes more than ten arguments. */
struct gdb_wrapper_arguments
{
@@ -52,12 +51,6 @@ struct captured_value_struct_elt_args
struct value **result_ptr;
};
-struct captured_execute_command_args
-{
- char *command;
- int from_tty;
-};
-
static int wrap_parse_exp_1 (char *);
static int wrap_evaluate_expression (char *);
@@ -338,20 +331,3 @@ do_captured_value_struct_elt (struct ui_out *uiout, void *data)
return GDB_RC_OK;
}
-static int
-do_captured_execute_command (struct ui_out *uiout, void *data)
-{
- struct captured_execute_command_args *args = data;
- execute_command (args->command, args->from_tty);
- return GDB_RC_OK;
-}
-
-enum gdb_rc
-gdb_execute_command (struct ui_out *uiout, char *command, int from_tty)
-{
- struct captured_execute_command_args args;
- args.command = command;
- args.from_tty = from_tty;
- return catch_exceptions (uiout, do_captured_execute_command, &args,
- NULL, RETURN_MASK_ALL);
-}
diff --git a/gdb/wrapper.h b/gdb/wrapper.h
index 85072743f90..977a77d04cd 100644
--- a/gdb/wrapper.h
+++ b/gdb/wrapper.h
@@ -21,10 +21,6 @@
#include "gdb.h"
struct value;
-struct block;
-struct expression;
-struct ui_out;
-struct type;
/* Use this struct to pass arguments to wrapper routines. */
struct gdb_wrapper_arguments;
@@ -50,6 +46,4 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
extern int gdb_parse_and_eval_type (char *, int, struct type **);
-extern enum gdb_rc gdb_execute_command (struct ui_out *uiout, char *command,
- int from_tty);
#endif /* WRAPPER_H */
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index f57a5f27675..7749b415114 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -25,7 +25,6 @@
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
-#include "i387-tdep.h"
#include "gdb_assert.h"
#include "x86-64-tdep.h"
@@ -195,23 +194,73 @@ store_regs (int tid, int regno)
/* Transfering floating-point registers between GDB, inferiors and cores. */
-/* Fill GDB's register array with the floating-point register values in
- *FPREGSETP. */
+static void *
+x86_64_fxsave_offset (elf_fpregset_t * fxsave, int regnum)
+{
+ const char *reg_name;
+ int reg_index;
+
+ gdb_assert (x86_64_num_gregs - 1 < regnum && regnum < x86_64_num_regs);
+
+ reg_name = x86_64_register_name (regnum);
+
+ if (reg_name[0] == 's' && reg_name[1] == 't')
+ {
+ reg_index = reg_name[2] - '0';
+ return &fxsave->st_space[reg_index * 2];
+ }
+
+ if (reg_name[0] == 'x' && reg_name[1] == 'm' && reg_name[2] == 'm')
+ {
+ reg_index = reg_name[3] - '0';
+ return &fxsave->xmm_space[reg_index * 4];
+ }
+
+ if (strcmp (reg_name, "mxcsr") == 0)
+ return &fxsave->mxcsr;
+
+ return NULL;
+}
+
+/* Fill GDB's register array with the floating-point and SSE register
+ values in *FXSAVE. This function masks off any of the reserved
+ bits in *FXSAVE. */
void
-supply_fpregset (elf_fpregset_t * fpregsetp)
+supply_fpregset (elf_fpregset_t * fxsave)
{
- i387_supply_fxsave ((char *) fpregsetp);
+ int i, reg_st0, reg_mxcsr;
+
+ reg_st0 = x86_64_register_number ("st0");
+ reg_mxcsr = x86_64_register_number ("mxcsr");
+
+ gdb_assert (reg_st0 > 0 && reg_mxcsr > reg_st0);
+
+ for (i = reg_st0; i <= reg_mxcsr; i++)
+ supply_register (i, x86_64_fxsave_offset (fxsave, i));
}
-/* Fill register REGNO (if it is a floating-point register) in
- *FPREGSETP with the value in GDB's register array. If REGNO is -1,
- do this for all registers. */
+/* Fill register REGNUM (if it is a floating-point or SSE register) in
+ *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ this for all registers. This function doesn't touch any of the
+ reserved bits in *FXSAVE. */
void
-fill_fpregset (elf_fpregset_t * fpregsetp, int regno)
+fill_fpregset (elf_fpregset_t * fxsave, int regnum)
{
- i387_fill_fxsave ((char *) fpregsetp, regno);
+ int i, last_regnum = MXCSR_REGNUM;
+ void *ptr;
+
+ if (gdbarch_tdep (current_gdbarch)->num_xmm_regs == 0)
+ last_regnum = FOP_REGNUM;
+
+ for (i = FP0_REGNUM; i <= last_regnum; i++)
+ if (regnum == -1 || regnum == i)
+ {
+ ptr = x86_64_fxsave_offset (fxsave, i);
+ if (ptr)
+ regcache_collect (i, ptr);
+ }
}
/* Fetch all floating-point registers from process/thread TID and store
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index a3f8bee1682..a47f5e7e5af 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -28,6 +28,7 @@
#include "arch-utils.h"
#include "regcache.h"
#include "symfile.h"
+#include "objfiles.h"
#include "x86-64-tdep.h"
#include "dwarf2cfi.h"
#include "gdb_assert.h"
@@ -376,14 +377,15 @@ classify_argument (struct type *type,
{
int num = classify_argument (TYPE_FIELDS (type)[j].type,
subclasses,
- (TYPE_FIELDS (type)[j].loc.bitpos
- + bit_offset) % 256);
+ (TYPE_FIELDS (type)[j].loc.
+ bitpos + bit_offset) % 256);
if (!num)
return 0;
for (i = 0; i < num; i++)
{
int pos =
- (TYPE_FIELDS (type)[j].loc.bitpos + bit_offset) / 8 / 8;
+ (TYPE_FIELDS (type)[j].loc.bitpos +
+ bit_offset) / 8 / 8;
classes[i + pos] =
merge_classes (subclasses[i], classes[i + pos]);
}
@@ -490,7 +492,7 @@ classify_argument (struct type *type,
}
case TYPE_CODE_VOID:
return 0;
- default: /* Avoid warning. */
+ default: /* Avoid warning. */
break;
}
internal_error (__FILE__, __LINE__,
@@ -797,13 +799,24 @@ x86_64_store_return_value (struct type *type, char *valbuf)
}
-static char *
+const char *
x86_64_register_name (int reg_nr)
{
if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS)
return NULL;
return x86_64_register_info_table[reg_nr].name;
}
+
+int
+x86_64_register_number (const char *name)
+{
+ int reg_nr;
+
+ for (reg_nr = 0; reg_nr < X86_64_NUM_REGS; reg_nr++)
+ if (strcmp (name, x86_64_register_info_table[reg_nr].name) == 0)
+ return reg_nr;
+ return -1;
+}
@@ -845,10 +858,10 @@ x86_64_frameless_function_invocation (struct frame_info *frame)
CORE_ADDR
x86_64_skip_prologue (CORE_ADDR pc)
{
- int i, firstline, currline;
+ int i;
struct symtab_and_line v_sal;
struct symbol *v_function;
- CORE_ADDR salendaddr = 0, endaddr = 0;
+ CORE_ADDR endaddr;
/* We will handle only functions beginning with:
55 pushq %rbp
@@ -862,7 +875,7 @@ x86_64_skip_prologue (CORE_ADDR pc)
/* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */
for (i = 0; i < PROLOG_BUFSIZE; i++)
if (prolog_expect[i] != prolog_buf[i])
- return pc; /* ... no, it doesn't. Nothing to skip. */
+ return pc; /* ... no, it doesn't. Nothing to skip. */
/* OK, we have found the prologue and want PC of the first
non-prologue instruction. */
@@ -876,18 +889,13 @@ x86_64_skip_prologue (CORE_ADDR pc)
if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab)
return pc;
- firstline = v_sal.line;
- currline = firstline;
- salendaddr = v_sal.end;
endaddr = v_function->ginfo.value.block->endaddr;
for (i = 0; i < v_sal.symtab->linetable->nitems; i++)
- if (v_sal.symtab->linetable->item[i].line > firstline
- && v_sal.symtab->linetable->item[i].pc >= salendaddr
+ if (v_sal.symtab->linetable->item[i].pc >= pc
&& v_sal.symtab->linetable->item[i].pc < endaddr)
{
pc = v_sal.symtab->linetable->item[i].pc;
- currline = v_sal.symtab->linetable->item[i].line;
break;
}
@@ -1069,7 +1077,7 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Return number of args passed to a frame, no way to tell. */
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
/* Don't use default structure extract routine */
- set_gdbarch_extract_struct_value_address (gdbarch, 0);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 0);
/* If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
and EXTRACT_RETURN_VALUE to store/fetch the functions return value. It is
@@ -1083,12 +1091,12 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
- set_gdbarch_extract_return_value (gdbarch, x86_64_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, x86_64_extract_return_value);
/* Write into the appropriate registers a function return value stored
in VALBUF of type TYPE, given in virtual format. */
- set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, x86_64_store_return_value);
/* Offset from address of function to start of its code. */
@@ -1104,6 +1112,7 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
(gdbarch_breakpoint_from_pc_ftype *)
x86_64_breakpoint_from_pc);
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
/* Amount PC must be decremented by after a breakpoint. This is often the
number of bytes in BREAKPOINT but not always. */
diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h
index d15b8e71e7f..711486077fb 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/x86-64-tdep.h
@@ -28,6 +28,10 @@
extern int x86_64_num_regs;
extern int x86_64_num_gregs;
+int x86_64_register_number (const char *name);
+const char *x86_64_register_name (int reg_nr);
+
+
gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index d8781119774..0e85125791d 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2277,6 +2277,7 @@ scan_xcoff_symtab (struct objfile *objfile)
break;
case XMC_RW:
+ case XMC_TD:
/* Data variables are recorded in the minimal symbol
table, except for section symbols. */
if (*namestring != '.')
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index f8c20b70f28..d3583139c63 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -97,7 +97,7 @@ enum
/* Function: xstormy16_register_name
Returns the name of the standard Xstormy16 register N. */
-static char *
+static const char *
xstormy16_register_name (int regnum)
{
static char *register_names[] = {
@@ -1086,13 +1086,12 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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_extract_return_value (gdbarch, xstormy16_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments);
set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame);
set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return);
- set_gdbarch_store_return_value (gdbarch, xstormy16_store_return_value);
- set_gdbarch_extract_struct_value_address (gdbarch,
- xstormy16_extract_struct_value_address);
+ set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
+ 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);
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index 572a878dc20..c7396e21ff7 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -27,7 +27,6 @@
#include "defs.h"
#include "frame.h"
-#include "obstack.h"
#include "symtab.h"
#include "gdbcmd.h"
#include "gdbtypes.h"
@@ -325,25 +324,26 @@ z8k_print_register_hook (int regno)
{
if ((regno & 1) == 0 && regno < 16)
{
- unsigned short l[2];
+ unsigned char l[4];
- frame_register_read (selected_frame, regno, (char *) (l + 0));
- frame_register_read (selected_frame, regno + 1, (char *) (l + 1));
+ frame_register_read (selected_frame, regno, l + 0);
+ frame_register_read (selected_frame, regno + 1, l + 2);
printf_unfiltered ("\t");
- printf_unfiltered ("%04x%04x", l[0], l[1]);
+ printf_unfiltered ("0x%02x%02x%02x%02x", l[0], l[1], l[2], l[3]);
}
if ((regno & 3) == 0 && regno < 16)
{
- unsigned short l[4];
+ unsigned char l[8];
- frame_register_read (selected_frame, regno, (char *) (l + 0));
- frame_register_read (selected_frame, regno + 1, (char *) (l + 1));
- frame_register_read (selected_frame, regno + 2, (char *) (l + 2));
- frame_register_read (selected_frame, regno + 3, (char *) (l + 3));
+ 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);
printf_unfiltered ("\t");
- printf_unfiltered ("%04x%04x%04x%04x", l[0], l[1], l[2], l[3]);
+ printf_unfiltered ("0x%02x%02x%02x%02x%02x%02x%02x%02x",
+ l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7]);
}
if (regno == 15)
{